Anaphora#

Anaphora is the use of a word referring to or replacing a word used earlier in a sentence, like using ‘he’ to refer to ‘Donald Trump’. This is a very common phenomenon in text, that's why a good text analytics engine should be able to handle it.

You can use anaphora to solve to what a pronoun (like ‘she’, ‘he’ or ‘him’) refers to, but also other common nouns like: this drug, or the 21-year-old or the Taiwanese company.

Example:

namespace anaphora
{
    rule:
    {
        'he'
    } = wow::anaphora@( concept="Person",scope="-3:0", inherit="true",relevancy="gender:male:7.0" );
}

A bit of explaining:

  • first you enclose your anaphora rules within the anaphora namespace:

namespace anaphora
{
}
  • Then you have to use a special annotation wow::anaphora where you can set a series of attributes to define your matching:
    • concept: This is obligatory, this is the name of the annotation you want to match.

    • scope: Also an obligatory attribute, you have to say what is the range of sentences to consider for the matching, in the given example from 3 sentences in front (-3) to the current sentence (0)

    • inherit: This is an optional attribute. It tells the engine whether it needs to inherit attributes from the matching concept. For instance, we may have the attribute country=”USA” for Apple. If we match “the company”, that attribute will be inherited as well.

    • relevancy: It’s a subjective quantification of how important a referent attribute is to make a match. In the example above we say that if the Person match candidate has an attribute male, it has 7.0 more probabilities to match than if it does not have this attribute. This is optional as well.

    • required: Only use candidates that have the required attribute value pair. ex: required=”country:USA”