Hume (indra_world.sources.hume)

Hume is a general purpose reading system developed by BBN.

Currently, INDRA can process JSON-LD files produced by Hume. When available, the API will be extended with access to the reader as a service.

API (indra_world.sources.hume.api)

indra_world.sources.hume.api.process_jsonld(jsonld, extract_filter=None, grounding_mode=None)[source]

Process a JSON-LD string in the new format to extract Statements.

Parameters:
  • jsonld (dict) – The JSON-LD object to be processed.

  • extract_filter (Optional[list]) – A list of relation types to extract. Valid values in the list are ‘influence’ and ‘event’. If not given, all relation types are extracted. This argument can be used if, for instance, only Influence statements are of interest. Default: None

  • grounding_mode (Optional[str]) – Selects whether ‘flat’ or ‘compositional’ groundings should be extracted. Default: ‘flat’.

Returns:

A HumeProcessor instance, which contains a list of INDRA Statements as its statements attribute.

Return type:

indra_world.sources.hume.HumeProcessor

indra_world.sources.hume.api.process_jsonld_file(fname, extract_filter=None, grounding_mode='compositional')[source]

Process a JSON-LD file in the new format to extract Statements.

Parameters:
  • fname (str) – The path to the JSON-LD file to be processed.

  • extract_filter (Optional[list]) – A list of relation types to extract. Valid values in the list are ‘influence’ and ‘event’. If not given, all relation types are extracted. This argument can be used if, for instance, only Influence statements are of interest. Default: None

  • grounding_mode (Optional[str]) – Selects whether ‘flat’ or ‘compositional’ groundings should be extracted. Default: ‘flat’.

Returns:

A HumeProcessor instance, which contains a list of INDRA Statements as its statements attribute.

Return type:

indra_world.sources.hume.HumeProcessor

Processor (indra_world.sources.hume.processor)

class indra_world.sources.hume.processor.HumeJsonLdProcessor(json_dict)[source]

This processor extracts INDRA Statements from Hume JSON-LD output.

Parameters:

json_dict (dict) – A JSON dictionary containing the Hume extractions in JSON-LD format.

tree

The objectpath Tree object representing the extractions.

Type:

objectpath.Tree

statements

A list of INDRA Statements that were extracted by the processor.

Type:

list[indra.statements.Statement]

class indra_world.sources.hume.processor.HumeJsonLdProcessorCompositional(json_dict)[source]