uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sumit Madan <sumit.ma...@scai.fraunhofer.de>
Subject Re: UIMA Ruta use of features in a block statement
Date Tue, 30 May 2017 17:35:02 GMT
Am 30.05.2017 um 17:53 schrieb Peter Kluegl:
> Hi,

Hi Peter,

(as Lisa already left for today, I'm answering on her behalf.)

> 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.

We were not able to access the annotation within the BLOCK.


// This is not working for us:
BLOCK(forEACH) Lemma{}{
     Lemma{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
     Lemma{a ->Test1};

// This is working:
BLOCK(forEACH) Lemma{}{
     W{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
     W{a ->Test2};

// This is also working:
BLOCK(forEACH) Lemma{}{
Document{->MATCHEDTEXT(s), ASSIGN(a,contains(s,"er"))};
Document{a ->Test3};

>> 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.

Alright, that makes sense.

>> 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};

We weren't aware that we can use contains() as a condition too. I think 
the documentation [1] doesn't describe that String functions with return 
value boolean can be used as conditions. I think one can assume if you 
see the source code (public class ContainsBooleanFunction extends 
BooleanFunctionExpression) under [2].

[1] https://uima.apache.org/d/ruta-current/tools.ruta.book.html

>> 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?

We integrated the AE in our pipeline as we have our own type system. The 
steps we took to integrate Ruta in our environment:
1. Read the BasicEngine.xml as AnalysisEngineDescription.
2. Modify it and add the merged typesystem (Ruta typesystem +ours)
3. Modify some  parameters (such as extensions, debugging, statistics)
4. Write the modified AnalysisEngineDescription as a temporary file
5. Create a new aggregate AE (AAED.xml) with a different view name 
(sofaName) and use the temporary file as the AnalysisEngine 
6. Produce AE, process CAS and destroy AE

All these steps are included in a apply() method, which is very similar 
to Ruta::apply(CAS cas, String script, Map<String, Object> parameters). 
We just call our apply() method in our UIMA analysis engines if we need 
to extract information with Ruta.

> 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

They are activated and the CAS contains the debugging information but 
still the views are all empty. Do we have to do something else to fill 
the views as we are not in the workbench?

Mit freundlichem Gruß / Best regards

Sumit Madan, M.Sc.

Wissenschaftlicher Mitarbeiter / Research fellow

Fraunhofer-Institute for Algorithms and Scientific Computing (SCAI)
Department of Bioinformatics
Schloss Birlinghoven
D-53754 Sankt Augustin

Room: C3-242
Tel.: +49 2241 14 2997
Email: sumit.madan@scai.fraunhofer.de
Internet: http://www.scai.fraunhofer.de/

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message