Search code examples
eclipsemachine-learningnlpuimaruta

Name Entity Relationship in UIMA


I am a newbie in UIMA, Currently I am stuck on below situation.

How to classify and relate different set of tokens that are obtained from an annotator in UIMA? Like for person entity token set names like {John,Smith} and for assets entity set like {car,home}. I want to write rules to classify like the following xml.

<person>
  <name>john</name>
  <asset>car</asset> 
</person>
and
<person>
  <name>Smith</name>
  <asset>home</asset> 
</person>

Thanks for help in advance..


Solution

  • You maybe want to take a look at UIMA Ruta for a rule-based approach.

    There are various ways to solve this in UIMA Ruta dependent on the preconditions and requirements.

    Here's a simple example that processes a document like "john buys a car. Smith is home."

    DECLARE Name, Asset, Sentence;
    DECLARE Annotation Person (Name name, Asset asset);
    
    // just to get some annotations
    "john" -> Name;
    "Smith" -> Name;
    "car" -> Asset;
    "home" -> Asset;
    
    // span of relation
    (# PERIOD){-> Sentence};
    PERIOD (# PERIOD){-> Sentence};
    
    // create relation
    Sentence{-> CREATE(Person, "name" =  Name, "asset" = Asset)};
    

    (I am a developer of UIMA Ruta)