CWMS (indra.sources.cwms)

CWMS is a variant of the TRIPS system. It is a general purpose natural language understanding system with applications in world modeling. For more information, see: http://trips.ihmc.us/parser/cgi/cwmsreader

CWMS API (indra.sources.cwms.api)

indra.sources.cwms.api.process_ekb(ekb_str)[source]

Processes an EKB string produced by CWMS.

Parameters:ekb_str (str) – EKB string to process
Returns:cp – A CWMSProcessor, which contains a list of INDRA statements in its statements attribute.
Return type:indra.sources.cwms.CWMSProcessor
indra.sources.cwms.api.process_ekb_file(fname)[source]

Processes an EKB file produced by CWMS.

Parameters:fname (str) – Path to the EKB file to process.
Returns:cp – A CWMSProcessor, which contains a list of INDRA statements in its statements attribute.
Return type:indra.sources.cwms.CWMSProcessor
indra.sources.cwms.api.process_text(text, save_xml='cwms_output.xml')[source]

Processes text using the CWMS web service.

Parameters:text (str) – Text to process
Returns:cp – A CWMSProcessor, which contains a list of INDRA statements in its statements attribute.
Return type:indra.sources.cwms.CWMSProcessor

CWMS EKB Processor (indra.sources.cwms.processor)

exception indra.sources.cwms.processor.CWMSError[source]
class indra.sources.cwms.processor.CWMSProcessor(xml_string)[source]

The CWMSProcessor currently extracts causal relationships between terms (nouns) in EKB. In the future, this processor can be extended to extract other types of relations, or to extract relations involving events.

For more details on the TRIPS EKB XML format, see http://trips.ihmc.us/parser/cgi/drum

Parameters:xml_string (str) – A TRIPS extraction knowledge base (EKB) in XML format as a string.
tree

An ElementTree object representation of the TRIPS EKB XML.

Type:xml.etree.ElementTree.Element
doc_id

Document ID

Type:str
statements

A list of INDRA Statements that were extracted from the EKB.

Type:list[indra.statements.Statement]
sentences

The list of all sentences in the EKB with their IDs

Type:dict[str: str]
paragraphs

The list of all paragraphs in the EKB with their IDs

Type:dict[str: str]
par_to_sec

A map from paragraph IDs to their associated section types

Type:dict[str: str]
event_from_event(event_term)[source]

Return an Event from an EVENT element in the EKB.

extract_causal_relations()[source]

Extract Influence Statements from the EKB.

extract_events()[source]

Extract standalone Events from the EKB.

influence_from_event(event)[source]

Return an Influence from an EVENT element in the EKB.

influence_from_relation(relation)[source]

Return an Influence from a CC element in the EKB.

migration_from_event(event_term)[source]

Return a Migration event from an EVENT element in the EKB.