Skip to content
Zheng Tang edited this page Aug 21, 2021 · 9 revisions

Expanders

In Eidos, we expand mentions that serve as the possible cause and effect of a causal relation, as well as stateful mentions. The reason for this it to capture the full meaning of a cause or effect. Consider for example the sentence: The debate over added sugar has caused many to seek information from additional sources. Rather than simply extracting debate -> CAUSE -> seek, it is far closer to the intended meaning to extract something like: debate over added sugar -> CAUSE -> seek information from other sources. Since we initially limit our concepts to noun and verb phrases (using syntactic chunks), to get the fuller spans we expand our mentions using expanders. These are based on specified syntactic dependencies and are configured in terms of how many dependencies can be traversed etc.

This is enabled through the eidos.conf, in actions.useExpansion.

Configuration

The actual configurations for the expansion are in two different config files:

Each of these config files is used to create an Expander. The former creates an ArgumentExpander, while the latter creates a TextboundExpander (selected through expansionType in the conf).

Both expanders expand mentions by traversing incoming and outgoing dependencies, licensed through the regex patterns listed in the config in each of validIncoming, validOutgoing, invalidIncoming, invalidOutgoing. The number of edges that can be traversed is configured in maxHops. The ArgumentExpander has two additional settings:

  • validLabels: specifies which relation mentions are eligible to have their arguments expanded
  • validArguments: specifies which arguments of those mentions are eligible for expansion.

Notes

  • Within Eidos, the TextboundExpander is actually wrapped in a ConceptExpander, which is included in the EidosComponents. However, the real meat of the expander and how to configure it is as above.
  • There is also a NestedArgumentExpander, whose responsibility is to dig in and get any Mentions that exist only as arguments, so that they get to be part of the state. In that sense it isn't a true expander and doesn't extend the Expander trait, but it's currently in the same package.
  • IMHO one of the darkest corners of the code is in the Attachment handling. One key place where Attachments get propagated from Mention to Mention is during expansion, and several of the methods is in the ExpansionUtils object.
  • the argument expansion (the primary expansion) happens within a global action. Actions are applied to specific extractions (specified in the rule itself). The global action is applied to all extractions after each epoch/iteration of rule-application within Odin, before the mentions are added to the State.