Hello,

The point is that the MARK action simply creates an annotation without any 
features. Reading your code, it seems that you expect the matched value to be 
held in the « value » feature. This is not the case.
You can access to the text that is covered by an annotation through the 
pseudo-feature « .ct » (as coveredText).
Thus I guess the following rule should do what you want (not tested) :

Document{-> CREATE(INTENT, "value" = 
"Apply_for_Card")}<-{e:ENTITY{e.ct=="card"} # a:ACTIONS{a.ct=="application"};}* 
;}*

But I guess that you will want to capture variations, such as plurals 
(card/cards) or even derivation (apply/application).
Then you should have a look at MARKTABLE action, which will take as a resource 
a CSV file with the text to be matched in the input document and as many 
features as you want to be created on the annotation. Thus you could describe 
dictionary entries with your variations, all of them mapping to a normalized 
value.

Keep trying, Ruta is a little bit tricky at start, but it’s worth the effort.

Best regards, 


Hugues de Mazancourt
http://www.mazancourt.com
twitter: @mazancourt



> Le 23 févr. 2018 à 17:30, Anna Polychroniou <[email protected]> a 
> écrit :
> 
> Hello,
> I am trying to complete an exercise in NLU using UIMA Ruta.
> I have hit a wall for the last 3 days.
> I would be grateful if you could give a hint on my issue:
> 
> I want to create 2 annotations ENTITY and ACTIONS for a list of sentences.
> I define a list of words for each one.
> Then I want to create a third annotation (INTENT) based on the first 2.
> Different values of ENTITY and ACTIONS must combine the 10 different values
> of INTENT annotation.
> 
> I 've stuck on the final step where I have to create the combined
> annotation (with bold).
> Could you please help?
> I attach my work below.
> 
> 
> 
> PACKAGE uima.ruta.exercise;
> 
> 
> WORDLIST EntityList = "Entities.txt";
> WORDLIST ActionList = "Actions.txt";
> DECLARE Annotation ENTITY(STRING value);
> DECLARE Annotation ACTIONS(STRING value);
> 
> 
> Document{-> RETAINTYPE(BREAK)};
> DECLARE Sentence;
> BREAK #{->MARK (Sentence)} BREAK;
> 
> DECLARE Annotation INTENT(STRING value);
> BLOCK(ForEach) Sentence{} {
> Document{-> MARKFAST(ENTITY, EntityList)};
> Document{-> MARKFAST(ACTIONS, ActionList)};
> 
> *Document{-> CREATE(INTENT, "value" =
> "Apply_for_Card")}<-{e:ENTITY{e.value=="card"} #
> a:ACTIONS{a.value=="application"};}*
> *;}*
> 
> 
> 
> 
> Thank you,
> Anna

Reply via email to