You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Matthias Koch <ma...@averbis.com> on 2017/12/12 07:39:10 UTC

Parameters for PEAR

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

-- 
Matthias Koch

Averbis GmbH
Tennenbacher Str. 11
79106 Freiburg
Germany

Fon: +49 761 708 394 0
Fax: +49 761 708 394 10
Email:matthias.koch@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ó


Re: Parameters for PEAR

Posted by Peter Klügl <pe...@averbis.com>.
ping?


Am 16.12.2017 um 13:48 schrieb Peter Klügl:
> Hi,
>
>
> Am 13.12.2017 um 14:33 schrieb Peter Klügl:
>> ...
>>
>>
>> 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?
>>
>
> Are there any opinions on this?
>
> If not, then I would open a ticket and implement the changes.
>
>
> Best,
>
> Peter
>

-- 
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.kluegl@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ó


Re: Parameters for PEAR

Posted by Richard Eckart de Castilho <re...@apache.org>.
On 10.01.2018, at 12:07, Peter Klügl <pe...@averbis.com> wrote:
> 
> I rather wanted to ask twice before I open an issue or implement
> something. Could always be that I missed something. Initially, I thought
> that the IBM guys (LanguageWare) made massive use of the PEAR concept
> and they surely had some possibility to configure their PEARs.

I might be a good idea to re-post the question to the developers list.

Cheers,

-- Richard

Re: Parameters for PEAR

Posted by Peter Klügl <pe...@averbis.com>.
Ok, I opened an issue for this.


Peter


Am 12.02.2018 um 17:46 schrieb Marshall Schor:
> nope. sorry. -Marshall
>
>
> On 2/9/2018 3:25 AM, Peter Klügl wrote:
>> Hi,
>>
>>
>> did you get an answer?
>>
>>
>> Best,
>>
>>
>> Peter
>>
>>
>> Am 10.01.2018 um 17:12 schrieb Marshall Schor:
>>> I'm pinging some people who might know something about LanguageWare's use of
>>> this feature. -Marshall
>>>
>>>
>>> On 1/10/2018 6:07 AM, Peter Klügl wrote:
>>>> Hi,
>>>>
>>>>
>>>> Am 10.01.2018 um 10:57 schrieb Richard Eckart de Castilho:
>>>>>> On 16.12.2017, at 13:48, Peter Klügl <pe...@averbis.com> wrote:
>>>>>>
>>>>>>> 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?
>>>>>>>
>>>>>> Are there any opinions on this?
>>>>> First, I was a bit confused and though the "PearSpecifier" would be
>>>>> this guy here [1]. The I realized it is this one [2].
>>>>>
>>>>> Looking at where the parameters of the PearSpecifier are used: apparently the
>>>>> setParameter and getParameter are only ever called directly in unit tests.
>>>>>
>>>>> Does it mean that the frameworks so far does not make any use of these parameter
>>>>> as all? Or maybe they are used via some inherited methods...?
>>>>>
>>>>> It sounds reasonable to me that these parameters are forwarded to the top-level
>>>>> component in the PEAR - the question I am asking myself is though: why doesn't
>>>>> this already happen and (maybe) what else where these PearSpecifier parameters
>>>>> intended to do then?
>>>> Yes, these are exactly the questions we had :-)
>>>>
>>>> I rather wanted to ask twice before I open an issue or implement
>>>> something. Could always be that I missed something. Initially, I thought
>>>> that the IBM guys (LanguageWare) made massive use of the PEAR concept
>>>> and they surely had some possibility to configure their PEARs.
>>>>
>>>> Best,
>>>>
>>>> Peter
>>>>
>>>>
>>>>> Cheers,
>>>>>
>>>>> -- Richard
>>>>>
>>>>> [1] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.installation_descriptor
>>>>> [2] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.specifier

-- 
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.kluegl@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ó


Re: Parameters for PEAR

Posted by Marshall Schor <ms...@schor.com>.
nope. sorry. -Marshall


On 2/9/2018 3:25 AM, Peter Klügl wrote:
> Hi,
>
>
> did you get an answer?
>
>
> Best,
>
>
> Peter
>
>
> Am 10.01.2018 um 17:12 schrieb Marshall Schor:
>> I'm pinging some people who might know something about LanguageWare's use of
>> this feature. -Marshall
>>
>>
>> On 1/10/2018 6:07 AM, Peter Klügl wrote:
>>> Hi,
>>>
>>>
>>> Am 10.01.2018 um 10:57 schrieb Richard Eckart de Castilho:
>>>>> On 16.12.2017, at 13:48, Peter Klügl <pe...@averbis.com> wrote:
>>>>>
>>>>>> 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?
>>>>>>
>>>>> Are there any opinions on this?
>>>> First, I was a bit confused and though the "PearSpecifier" would be
>>>> this guy here [1]. The I realized it is this one [2].
>>>>
>>>> Looking at where the parameters of the PearSpecifier are used: apparently the
>>>> setParameter and getParameter are only ever called directly in unit tests.
>>>>
>>>> Does it mean that the frameworks so far does not make any use of these parameter
>>>> as all? Or maybe they are used via some inherited methods...?
>>>>
>>>> It sounds reasonable to me that these parameters are forwarded to the top-level
>>>> component in the PEAR - the question I am asking myself is though: why doesn't
>>>> this already happen and (maybe) what else where these PearSpecifier parameters
>>>> intended to do then?
>>> Yes, these are exactly the questions we had :-)
>>>
>>> I rather wanted to ask twice before I open an issue or implement
>>> something. Could always be that I missed something. Initially, I thought
>>> that the IBM guys (LanguageWare) made massive use of the PEAR concept
>>> and they surely had some possibility to configure their PEARs.
>>>
>>> Best,
>>>
>>> Peter
>>>
>>>
>>>> Cheers,
>>>>
>>>> -- Richard
>>>>
>>>> [1] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.installation_descriptor
>>>> [2] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.specifier


Re: Parameters for PEAR

Posted by Peter Klügl <pe...@averbis.com>.
Hi,


did you get an answer?


Best,


Peter


Am 10.01.2018 um 17:12 schrieb Marshall Schor:
> I'm pinging some people who might know something about LanguageWare's use of
> this feature. -Marshall
>
>
> On 1/10/2018 6:07 AM, Peter Klügl wrote:
>> Hi,
>>
>>
>> Am 10.01.2018 um 10:57 schrieb Richard Eckart de Castilho:
>>>> On 16.12.2017, at 13:48, Peter Klügl <pe...@averbis.com> wrote:
>>>>
>>>>> 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?
>>>>>
>>>> Are there any opinions on this?
>>> First, I was a bit confused and though the "PearSpecifier" would be
>>> this guy here [1]. The I realized it is this one [2].
>>>
>>> Looking at where the parameters of the PearSpecifier are used: apparently the
>>> setParameter and getParameter are only ever called directly in unit tests.
>>>
>>> Does it mean that the frameworks so far does not make any use of these parameter
>>> as all? Or maybe they are used via some inherited methods...?
>>>
>>> It sounds reasonable to me that these parameters are forwarded to the top-level
>>> component in the PEAR - the question I am asking myself is though: why doesn't
>>> this already happen and (maybe) what else where these PearSpecifier parameters
>>> intended to do then?
>> Yes, these are exactly the questions we had :-)
>>
>> I rather wanted to ask twice before I open an issue or implement
>> something. Could always be that I missed something. Initially, I thought
>> that the IBM guys (LanguageWare) made massive use of the PEAR concept
>> and they surely had some possibility to configure their PEARs.
>>
>> Best,
>>
>> Peter
>>
>>
>>> Cheers,
>>>
>>> -- Richard
>>>
>>> [1] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.installation_descriptor
>>> [2] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.specifier

-- 
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.kluegl@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ó


Re: Parameters for PEAR

Posted by Marshall Schor <ms...@schor.com>.
I'm pinging some people who might know something about LanguageWare's use of
this feature. -Marshall


On 1/10/2018 6:07 AM, Peter Klügl wrote:
> Hi,
>
>
> Am 10.01.2018 um 10:57 schrieb Richard Eckart de Castilho:
>>> On 16.12.2017, at 13:48, Peter Klügl <pe...@averbis.com> wrote:
>>>
>>>> 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?
>>>>
>>> Are there any opinions on this?
>> First, I was a bit confused and though the "PearSpecifier" would be
>> this guy here [1]. The I realized it is this one [2].
>>
>> Looking at where the parameters of the PearSpecifier are used: apparently the
>> setParameter and getParameter are only ever called directly in unit tests.
>>
>> Does it mean that the frameworks so far does not make any use of these parameter
>> as all? Or maybe they are used via some inherited methods...?
>>
>> It sounds reasonable to me that these parameters are forwarded to the top-level
>> component in the PEAR - the question I am asking myself is though: why doesn't
>> this already happen and (maybe) what else where these PearSpecifier parameters
>> intended to do then?
> Yes, these are exactly the questions we had :-)
>
> I rather wanted to ask twice before I open an issue or implement
> something. Could always be that I missed something. Initially, I thought
> that the IBM guys (LanguageWare) made massive use of the PEAR concept
> and they surely had some possibility to configure their PEARs.
>
> Best,
>
> Peter
>
>
>> Cheers,
>>
>> -- Richard
>>
>> [1] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.installation_descriptor
>> [2] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.specifier


Re: Parameters for PEAR

Posted by Peter Klügl <pe...@averbis.com>.
Hi,


Am 10.01.2018 um 10:57 schrieb Richard Eckart de Castilho:
>> On 16.12.2017, at 13:48, Peter Klügl <pe...@averbis.com> wrote:
>>
>>> 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?
>>>
>> Are there any opinions on this?
> First, I was a bit confused and though the "PearSpecifier" would be
> this guy here [1]. The I realized it is this one [2].
>
> Looking at where the parameters of the PearSpecifier are used: apparently the
> setParameter and getParameter are only ever called directly in unit tests.
>
> Does it mean that the frameworks so far does not make any use of these parameter
> as all? Or maybe they are used via some inherited methods...?
>
> It sounds reasonable to me that these parameters are forwarded to the top-level
> component in the PEAR - the question I am asking myself is though: why doesn't
> this already happen and (maybe) what else where these PearSpecifier parameters
> intended to do then?

Yes, these are exactly the questions we had :-)

I rather wanted to ask twice before I open an issue or implement
something. Could always be that I missed something. Initially, I thought
that the IBM guys (LanguageWare) made massive use of the PEAR concept
and they surely had some possibility to configure their PEARs.

Best,

Peter


> Cheers,
>
> -- Richard
>
> [1] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.installation_descriptor
> [2] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.specifier

-- 
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.kluegl@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ó


Re: Parameters for PEAR

Posted by Richard Eckart de Castilho <re...@apache.org>.
> On 16.12.2017, at 13:48, Peter Klügl <pe...@averbis.com> wrote:
> 
>> 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?
>> 
> 
> Are there any opinions on this?

First, I was a bit confused and though the "PearSpecifier" would be
this guy here [1]. The I realized it is this one [2].

Looking at where the parameters of the PearSpecifier are used: apparently the
setParameter and getParameter are only ever called directly in unit tests.

Does it mean that the frameworks so far does not make any use of these parameter
as all? Or maybe they are used via some inherited methods...?

It sounds reasonable to me that these parameters are forwarded to the top-level
component in the PEAR - the question I am asking myself is though: why doesn't
this already happen and (maybe) what else where these PearSpecifier parameters
intended to do then?

Cheers,

-- Richard

[1] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.installation_descriptor
[2] http://uima.apache.org/d/uimaj-current/references.html#ugr.ref.pear.specifier

Re: Parameters for PEAR

Posted by Peter Klügl <pe...@averbis.com>.
Hi,


Am 13.12.2017 um 14:33 schrieb Peter Klügl:
> ...
>
>
> 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?
>

Are there any opinions on this?

If not, then I would open a ticket and implement the changes.


Best,

Peter


Re: Parameters for PEAR

Posted by Peter Klügl <pe...@averbis.com>.
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.kluegl@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ó


Re: Parameters for PEAR

Posted by Marshall Schor <ms...@schor.com>.
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
>


Re: Parameters for PEAR

Posted by Peter Klügl <pe...@averbis.com>.
Hi Jens,


Am 13.12.2017 um 09:53 schrieb Jens Grivolla:
> Is there a specific reason to use PEARs?

Yes. An example could be to add a previously unknown annotator with its
implementation in a running system, e.g. without restarting the
application server.
(I am not aware of any other functionality that would support that out
of the box for UIMA.)


>
> As far as I remember (but I could be wrong, it's been a few years), the
> main advantages of using them (automatic class path configuration, some
> degree of isolation between components) was lost when we wanted to change
> configuration parameters because then we would need to use the AE
> descriptor instead of the PEAR descriptor (at least with CPE).

Yes, that's the point. However, just because something does not work,
you do not have to accept it. You could fix the problem even if it is a
limited/special fix for the pear. The PearSpecifier theoretically
supports parameters, but these are just not used in the implementation
of UIMA. I'll comment on that more in an answer to Marshalls post.

>  If you're
> not going to use the PEAR descriptor then an installed PEAR is not much
> more than a bunch of JARs, and component descriptors with tons of
> hard-coded absolute file paths, so you should be able to just use and
> configure a component based on those descriptors (without anything
> PEAR-specific).
>
> We have since switched to doing everything with uimaFIT which gives you
> many many possibilities to adapt your workflow, configure engines
> programatically, etc. For us the change has been hugely positive, both for
> development (and debugging) and for deployment in a wide variety of ways
> and environments.

Yes, we (Averbis) also use uimaFIT everywhere, but PEARs have an
additional use case as I mention above. PEAR and uimaFIT do not need to
be mutually exclusive as you can or course also have a PEAR of a uimaFIT
annotator.


Best,

Peter


PS: nice to hear from you again :-)


> Best,
> Jens
>
> On Tue, Dec 12, 2017 at 8:39 AM, Matthias Koch <ma...@averbis.com>
> 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().p
>> arseResourceSpecifier(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
>>
>> --
>> Matthias Koch
>>
>> Averbis GmbH
>> Tennenbacher Str. 11
>> 79106 Freiburg
>> Germany
>>
>> Fon: +49 761 708 394 0
>> Fax: +49 761 708 394 10
>> Email:matthias.koch@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ó
>>
>>

-- 
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.kluegl@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ó


Re: Parameters for PEAR

Posted by Jens Grivolla <j+...@grivolla.net>.
Is there a specific reason to use PEARs?

As far as I remember (but I could be wrong, it's been a few years), the
main advantages of using them (automatic class path configuration, some
degree of isolation between components) was lost when we wanted to change
configuration parameters because then we would need to use the AE
descriptor instead of the PEAR descriptor (at least with CPE). If you're
not going to use the PEAR descriptor then an installed PEAR is not much
more than a bunch of JARs, and component descriptors with tons of
hard-coded absolute file paths, so you should be able to just use and
configure a component based on those descriptors (without anything
PEAR-specific).

We have since switched to doing everything with uimaFIT which gives you
many many possibilities to adapt your workflow, configure engines
programatically, etc. For us the change has been hugely positive, both for
development (and debugging) and for deployment in a wide variety of ways
and environments.

Best,
Jens

On Tue, Dec 12, 2017 at 8:39 AM, Matthias Koch <ma...@averbis.com>
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().p
> arseResourceSpecifier(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
>
> --
> Matthias Koch
>
> Averbis GmbH
> Tennenbacher Str. 11
> 79106 Freiburg
> Germany
>
> Fon: +49 761 708 394 0
> Fax: +49 761 708 394 10
> Email:matthias.koch@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ó
>
>