uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexandre Patry <alexandre.pa...@keatext.com>
Subject Re: Multi-view CAS and sofa-unaware AE
Date Wed, 03 Apr 2013 16:15:18 GMT
On 13-04-03 11:10 AM, Peter Klügl wrote:
> Yes, but imagine you have a CAS with 10 views and you want to apply a
> primitive sofa-unaware AE on each view.
>
> The easiest solution I found was to write a template AAE descriptor,
> replaced the AE descriptor and sofa name (and mapping), instantiate the
> AAE, call process(), and then repeat that for the next view.
>
> This can get quite ugly, if you have to override parameters and you do
> not know the primitive AE and its parameters.
If you are willing to use uimafit, you could do it in a simple for loop. 
It would look like this :

    // build an aggregate that will run the same analysis engine on many
    sofas
    final AggregateBuilder builder = new AggregateBuilder();
    for (String sofa : sofas) {
         final AnalysisEngineDescription annotator =
    AnalysisEngineFactory.createPrimitiveDescription(YourEngine.class,
    paramName1, paramValue1, paramName2, paramValue2, ...);
         builder.add(annotator, "_InitialView", sofa);
    }

    final AnalysisEngine engine = builder.createAggregate();
    // you can then user your engine


The documentation on the web site ( https://code.google.com/p/uimafit/) 
is quite good if you want more information.

Regards,

Alexandre

>
> Best,
>
> Peter
>
>
> On 03.04.2013 14:38, Jörn Kottmann wrote:
>> Yes, you can use the sofa mapping, to map some view to the _InitialView.
>>
>> Have a look here:
>> http://uima.apache.org/d/uimaj-2.4.0/tutorials_and_users_guides.html#ugr.tug.mvs.sofa_name_mapping
>>
>>
>> Jörn
>>
>> On 04/03/2013 02:19 PM, Peter Klügl wrote:
>>> Hi,
>>>
>>> sorry for this beginner question:
>>>
>>> It there a shortcut to apply a sofa-unaware AE on CAS view that is not
>>> the _InitialView?
>>>
>>> It seems quite cumbersome to programmatically generate an aggregate
>>> analysis engine description to wrap to sofa-unaware engine.
>>>
>>> Best,
>>>
>>> Peter
>>


-- 
Alexandre Patry, Ph.D
Chercheur / Researcher
http://KeaText.com

>> Transformez vos documents en outils de décision
<< Turn your documents into decision tools


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