Hi,

if I may join the discussion *putting on my Averbis hat*


It's about configuring the annotator packaged as a PEAR. The problem is
that we cannot access the analysis engine description and change the
parameter values programmatically as it is hidden in the PearSpecifier.
The external setting are not a good solution for us as far as I
understand the override settings. I see two disadvantages for our use
case: you need to declare and set the ExternalOverrideName and the
external settings are somewhat global.

Let's assume we have a pipeline like PEAR1_v1(param1=a) ->
PEAR1_v1(param1=b) -> PEAR1_v2(param1=c,param2=d) -> PEAR2_v1(param2->e)

Then, let's assume that there is an arbitrary combination of these in
different aggregated annotators in one pipeline.

If I understood the implementation correctly, it could get really nasty
to solve this with external settings.

There are other solutions to get this functionality up and running like
overriding the uima factory, using different PEAR versions for different
parameter values, relinking the PEAR to multiple analysis engine
descriptions. However, none of these solutions are really "acceptable".


*putting on my UIMA hat*


Is it a problem for us to simply implement Matthias's solution: Make use
of the parameters in the PearSpecifier and just set them in the wrapped
analysis engine description if they are compatible?


(I imagine someone could provide a patch for this)


Best,


Peter



Am 12.12.2017 um 15:57 schrieb Marshall Schor:
> Hi,
>
> Good question...
>
> The use of the word "parameters" in UIMA is unfortunately overloaded with
> multiple meanings.
>
> There are in general 2 kinds:  the kind used in produceAnalysisEngine - the
> so-called "additional parameters".  The other kind are the "configuration
> parameters", also called configuration settings.  These latter have a 
> capability
> for specifying global external settings overrides.
>
> If the parameters you want to override are configuration params (which I think
> you mean, because you say they're already in the "xml"),take a look at
> https://uima.apache.org/d/uimaj-current/references.html#ugr.ref.xml.component_descriptor.aes.external_configuration_parameter_overrides
>
> Maybe that will be an easy way to address your use case:  the external 
> settings
> could be dynamically written into a temp file and that temp file specified in 
> an
> "additional parameters" key to produceAnalysisEngine. 
>
> -Marshall
>
>
> On 12/12/2017 2:39 AM, Matthias Koch wrote:
>> Hi,
>>
>> I want to configure a PEAR dynamically. (I install the pear and want to
>> produce the analysis engine with different parameters than in the xml).
>> Is this possible? Can I use the additionalParameters? I have seen that the
>> PearSpecifier has an instance variable for parameters, but no one is using
>> (calling) it.
>>
>> I want to produce the analysisEngine with:
>> UIMAFramework.produceAnalysisEngine(resourceSpecifer, resourceManager, 
>> params);
>>
>> In this specifier there should be one or more pearSpecifiers that should be
>> configured.
>>
>> I have overridden the PearAnalysisEngineWrapper and built a loop that
>> configures the following specifier over the configurationParameterSettings. 
>> It
>> takes the parameters from the pear specifiers.
>>
>> line 257-258
>> // Parse the resource specifier
>> ResourceSpecifier specifier =
>> UIMAFramework.getXMLParser().parseResourceSpecifier(in);
>>
>> ==> added code
>> AnalysisEngineDescription analysisEngineDescription =
>> (AnalysisEngineDescription) specifier;
>> AnalysisEngineMetaData analysisEngineMetaData =
>> analysisEngineDescription.getAnalysisEngineMetaData();
>> ConfigurationParameterSettings configurationParameterSettings =
>> analysisEngineMetaData.getConfigurationParameterSettings();
>> for (Parameter parameter : Arrays.asList(pearSpec.getParameters())) {
>>
>> configurationParameterSettings.setParameterValue(parameter.getName(),
>> parameter.getValue());
>> }
>>
>> Is it possible without overriding anything?
>>
>> UIMAJ Version: 2.10
>>
>> Sincerely
>> Matthias
>>

-- 
Peter Klügl
R&D Text Mining/Machine Learning

Averbis GmbH
Tennenbacher Str. 11
79106 Freiburg
Germany

Fon: +49 761 708 394 0
Fax: +49 761 708 394 10
Email: peter.klu...@averbis.com
Web: https://averbis.com

Headquarters: Freiburg im Breisgau
Register Court: Amtsgericht Freiburg im Breisgau, HRB 701080
Managing Directors: Dr. med. Philipp Daumke, Dr. Kornél Markó

Reply via email to