uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Kluegl <pklu...@gmail.com>
Subject Re: UIMA Ruta use of features in a block statement
Date Tue, 30 May 2017 15:53:32 GMT
Hi,


Am 30.05.2017 um 16:37 schrieb Lisa Langnickel:
> Hi, 
>
> thank you for your quick reply. 
> The feature wordLemma is a String. 
>
> The alternatives you wrote work out. Thanks.  
>
> Nevertheless, will there be the possibility to work on features in a block statement
in the future? (For other use cases) 

Well, you can work on features in a BLOCK when you access them using the
annotation. Besides that, that are no plans to support blocks on string
expression or similar things.

> Or is the block statement not needed at all?

Yes, they are not need at all, also not in similar use cases. If you
have several conditions with separate actions, you can increase the
speed using the FOREACH block.

>  
> I used it because I found it in the user guideline in relation to NER-task:
>
> STRING s;
> BOOLEAN a ;
> BLOCK(forEACH) W{}{
>     W{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
>     W{a ->Test};
> }
> So, what's the advantage of the block statement here? 

There is no advantage. I assume that it was necessary when the string
function have been introduced. However, the language evolved quite a bit
since then. This example should just illustrate some usage of the
function. Now, you can also use the function as an implicit condition.
Thus, you do not need a separate rule after the assign action. Thus, you
do not need the block to restrict the window in order to restrict the
usage of the global variable (which is also not required). It's now a
really bad example...

Now I would write it as:

W{contains(W.ct, "er") -> Test};


>
> And one other question: 
> We implemented Ruta into the UIMA pipeline, but in the debug mode, the ruta views "matched
rules", "applied rules", "failed rules" etc. are all empty. 
> How can we fix this? 

Can you give me more information? Did you directly launch the ruta
script in a ruta debug launch configuration or did you include the AE in
a pipeline and launch that in a java debug launch config? In general,
you need to set the two debug config parameters of the RutaEngine to
true in order to add debug information to the CAS: DEBUG and
DEBUG_WITH_MATCHES


Best,

Peter


> Best regards, 
> Lisa 
>
>
>
>
>
>  
>
>
> ----- Original Message -----
> From: "Peter Kl├╝gl" <peter.kluegl@averbis.com>
> To: "user" <user@uima.apache.org>
> Sent: Tuesday, May 30, 2017 3:55:41 PM
> Subject: Re: UIMA Ruta use of features in a block statement
>
> Hi,
>
>
> yes, this should throw an error when the script is parsed. I have to
> take closer look, could be that the feature is interpreted as literal
> string matching condition because of a string expression representing
> the feature.
>
>
> What is the range of the feature wordLemma? Support in ruta for
> StringArray and StringList is still not really given.
>
>
> If you want to iterate, you need to iterate over annotations currently.
> The rules also operate always on types or annotations, something that is
> a reference to some text position. However, this should not be a problem
> as you can simply use the existing Lemma annotation.
>
>
> You could try something like:
>
>
> FOREACH(lemma) Lemma{}{
>     lemma{REGEXP(lemma.wordLemma, ".*vergess.*") -> Value2};
> }
>
>
> or even
>
>
>
> l:Lemma{REGEXP(l.wordLemma, ".*vergess.*") -> Value2};
>
>
> with the boolean string function, it could work like this:
>
>
> l:Lemma{contains(l.wordLemma, "vergess") -> Value2};
>
>
> (I did not test the rules and I was assuming several things like feature
> ranges)
>
>
> Best,
>
>
> Peter
>
>
> Am 30.05.2017 um 15:35 schrieb Lisa Langnickel:
>> Hi, 
>>
>> I would like to use a BLOCK statement to iterate over the values of a feature.
>> In more detail, I applied a lemmatizer before and would like to work on the "lemmas"
itself.
>>
>> I tried something like this (where Lemma.wordLemma describes the feature of Lemma):
>>
>> BLOCK(forEACH) Lemma.wordLemma{}{
>>     Document{-> MATCHEDTEXT(s), ASSIGN(a,contains(s,"vergess"))};
>>     Document{a -> Value2};
>> }
>>
>> There is no error message, but nothing happens. Instead, when only working on the
type "Lemma", it works. 
>>
>> Is there any possibility to work on the feature within the block statement? 
>>
>> Thanks in advance, 
>> Lisa


Mime
View raw message