Skip to end of metadata
Go to start of metadata

The IE pipeline creates annotations. The gazetteer creates Lookup annotations, but there are also other temporary annotations which only role is to help other processing resources and rules to create meaningful annotations at the end. KIM has a white-list with all these meaningful annotation types in the property IE_ANN_TYPES in KIM/config/nerc.properties. At the end of the processing of a document, all annotations not in this list are removed.

Now the task is to transform all Lookups from the Person annotation set into Person annotations in the default annotation set. The easiest way is with a jape rule. The Jape rule looks like this:

Phase:  dbpedia_person
Input:  Person
Options: control = all


Rule:dbpedia_person
(\{Lookup\}):match
-->
:match.Person = \{ class = :match.Lookup.class , inst = :match.Lookup.inst, rule=dbpedia_person \}

The rule does not transform the existing Lookup annotations. It creates new Person annotations over the same phrases as the lookups.

Put this grammar in a file called dbpedia_person.jape and store it in
KIM/context/default/resources/grammar/dbpedia. Then create a Jape transducer processing resource for this grammar in the GATE UI and place it after the new gazetteer in the pipeline. The important thing here is to set the inputASName parameter to the new annotation set (Person) and leave the outputASName parameter empty. This will make the rule match annotations from the Person annotation set and create annotations in the default annotation set.


The Jape transducer processing resource in the GATE UI

Run the pipeline over your test document and see how it will create new annotations of type Person in the default annotation set.

Store the changes you made in GATE, so that KIM will be able to use them later. You can do this by right clicking on the pipeline and choosing "Save Application State". Then save it over the application descriptor file KIM uses, which in this case is KIM/context/default/resources/IE.gapp. The exact path is set in the IE_APP property in KIM/config/nerc.properties.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.