I'm trying to create annotations in a context of "work situations". I would like to automatically annotate actors of work situations using JAPE rules. I'm using basic rules because I have no knowledge in Java coding. Here is a sample of the rules that I created.
`Phase:ActeurIdentif
Input:Lookup Token
Options:Control=appelt
Rule:ActeurId
(
{Lookup.majorType == person_first, Token.orth == upperInitial}
|
{Token.string =~ "[Ff]riend"}
|
{Token.string =~ "[Cc]lient"}
|
{Token.string =~ "[Ss]upplier"}
|
{Token.string =~ "[Cc]ustomer"}
|
({Token.string =~ "[Tt]he"}
({Token})?
{Token.string =~ "[Aa]ctor"})
|
{Token.string =~ "[Tt]echnician"}
|
(((({Lookup.majorType == jobtitle, !Token.string =~ "chair"}
|
{Lookup.majorType == jobtitle, !Token.string =~ "[Mm]odel"})
|
{Lookup.majorType == jobtitle, Token.category != JJ})
|
{Lookup.majorType == jobtitle, Token.category != VB}))
)
:NomActeur
-->
:NomActeur.Acteur = {rule = "ActeurId"}`
The problem is that GATE does not consider the 4 negations I put in my rule. For example "Chair" and "Model" are still identified as actors. I tried to use macros but it did not work, I thought it was a problem related to the operator (OR |). Can anyone help me with this. Thank you !
I think that it is related to the OR operator for sure.
This OR phrase simply means:
{Lookup.majorType == jobtitle}where there is not any annotation{Token.string =~ "chair"}OR
{Lookup.majorType == jobtitle}where there is not any annotation{Token.string =~ "[Mm]odel"}So the word
chairis valid for the second clause of the OR phrase and similarly the wordmodelis valid for the first clause.I'm not completely sure if it is valid, but following code could do the trick: