You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Fabio Mancinelli <fa...@gmail.com> on 2009/08/21 11:39:58 UTC

How to configure aggregate analysis engines in a programmatically created CPE?

Hi everybody,

I am building a CPE programmatically by using an aggregate analysis engine:

CpeDescription cpeDesc = CpeDescriptorFactory.produceDescriptor();

/* Setup the collection reader */
...

/* Setup analysis engine */
URL analysisEngineUrl =
ClassLoader.getSystemResource("AggregateAnalysisEngine.xml");
CpeCasProcessor analysisEngine =
CpeDescriptorFactory.produceCasProcessor("Aggregate");
analysisEngine.setDescriptor(analysisEngineUrl.toString());
cpeDesc.addCasProcessor(analysisEngine);

The problem I am facing is that I don't know how to configure the
analysis engines contained in the aggregate ones.

With simple analysis engines I could do:

CasProcessorConfigurationParameterSettings analysisEngineSettings =
CpeDescriptorFactory.produceCasProcessorConfigurationParameterSettings();
analysisEngineSettings.setParameterValue("param", "value");
analysisEngine.setConfigurationParameterSettings(analysisEngineSettings);

But I cannot find any way to configure analysis engine inside an
aggregate using this API.

Any hint?

Thanks,
Fabio

Re: How to configure aggregate analysis engines in a programmatically created CPE?

Posted by Marshall Schor <ms...@schor.com>.

Fabio Mancinelli wrote:
> Hi everybody,
>
> I am building a CPE programmatically by using an aggregate analysis engine:
>
> CpeDescription cpeDesc = CpeDescriptorFactory.produceDescriptor();
>
> /* Setup the collection reader */
> ...
>
> /* Setup analysis engine */
> URL analysisEngineUrl =
> ClassLoader.getSystemResource("AggregateAnalysisEngine.xml");
> CpeCasProcessor analysisEngine =
> CpeDescriptorFactory.produceCasProcessor("Aggregate");
> analysisEngine.setDescriptor(analysisEngineUrl.toString());
> cpeDesc.addCasProcessor(analysisEngine);
>
> The problem I am facing is that I don't know how to configure the
> analysis engines contained in the aggregate ones.
>
> With simple analysis engines I could do:
>
> CasProcessorConfigurationParameterSettings analysisEngineSettings =
> CpeDescriptorFactory.produceCasProcessorConfigurationParameterSettings();
> analysisEngineSettings.setParameterValue("param", "value");
> analysisEngine.setConfigurationParameterSettings(analysisEngineSettings);
>
> But I cannot find any way to configure analysis engine inside an
> aggregate using this API.
>   
The way these are normally configured is by using the containing
aggregate(s) to override their parameters, and setting parameter values
only on the outermost aggregate.  Will that work for your use case?

-Marshall
> Any hint?
>
> Thanks,
> Fabio
>
>
>