uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew DeAngelis <roni...@gmail.com>
Subject Re: Wrong CAS being passed on in AAE
Date Wed, 26 Aug 2015 19:33:18 GMT
I'll bet that Richard will be more helpful than I am, but I found the below
in the documentation for CAS Multipliers (7.5.2). It does not sound exactly
like your issue, but it might be related.



Regards,
Matt

7.5.2. Using a CAS Multiplier with other Analysis Engines

In your application you can take the output CASes from a CAS Multiplier and
pass them to the process method of other Analysis Engines. However there
are some special considerations regarding the Type System of these CASes.

By default, the output CASes of a CAS Multiplier will have a Type System
that contains all of the types and features declared by any component in
the outermost Aggregate Analysis Engine or Collection Processing Engine
that contains the CAS Multiplier. If in your application you create a CAS
Multiplier and another Analysis Engine, where these are not enclosed in an
aggregate, then the output CASes from the CAS Multiplier will not support
any types or features that are declared in the latter Analysis Engine but
not in the CAS Multiplier.

This can be remedied by forcing the CAS Multiplier and Analysis Engine to
share a single UimaContext when they are created, as follows:

//create a "root" UIMA context for your whole application

UimaContextAdmin rootContext =
   UIMAFramework.newUimaContext(UIMAFramework.getLogger(),
      UIMAFramework.newDefaultResourceManager(),
      UIMAFramework.newConfigurationManager());

XMLInputSource input = new XMLInputSource("MyCasMultiplier.xml");
AnalysisEngineDescription desc = UIMAFramework.getXMLParser().
        parseAnalysisEngineDescription(input);

//create a UIMA Context for the new AE we are about to create

//first argument is unique key among all AEs used in the application
UimaContextAdmin childContext = rootContext.createChild(
        "myCasMultiplier", Collections.EMPTY_MAP);

//instantiate CAS Multiplier AE, passing the UIMA Context through the
//additional parameters map

Map additionalParams = new HashMap();
additionalParams.put(Resource.PARAM_UIMA_CONTEXT, childContext);

AnalysisEngine casMultiplierAE = UIMAFramework.produceAnalysisEngine(
        desc,additionalParams);

//repeat for another AE
XMLInputSource input2 = new XMLInputSource("MyAE.xml");
AnalysisEngineDescription desc2 = UIMAFramework.getXMLParser().
        parseAnalysisEngineDescription(input2);

UimaContextAdmin childContext2 = rootContext.createChild(
        "myAE", Collections.EMPTY_MAP);

Map additionalParams2 = new HashMap();
additionalParams2.put(Resource.PARAM_UIMA_CONTEXT, childContext2);

AnalysisEngine myAE = UIMAFramework.produceAnalysisEngine(
        desc2, additionalParams2);


On Wed, Aug 26, 2015 at 3:07 PM, Martin Wunderlich <martin_wu@gmx.net>
wrote:

> Hi all,
>
> I am running a SimplePipeline which consists of a Reader and two Aggregate
> Analysis Engines. The output CAS of the first AAE is meant to feed into the
> second AAE. However, I find that even though the output of the first AAE is
> correct, it is different from the input to the second AAE. I have verified
> this by writing to XMI as the last step of AAE 1 and the first step of AAE
> 2. In AAE 1 I have a CAS merger as the final step and a flow controller
> which is set to drop the input CAS to the merger. This is working fine:
> Only the merged CAS remains after the merge step. And yet, the input CAS to
> AAE 2 is missing the annotations which were added by annotator steps in AAE
> 1 before the merge.
>
> If I combine both AAEs into one super-AAE and add this one to the
> SimplePipeline instead, it works fine. So, there is a work-around. I am
> just curious why the AAEs might behave this way when I have the separate.
> Thanks a lot.
>
> Cheers,
>
> Martin
>
>
>

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