You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Radwen ANIBA <ar...@gmail.com> on 2010/01/28 18:16:24 UTC

AE parameters don't change

Hi

I'm trying to change a parameter in an AE and then to call the CPE that uses
this AE but the changes are not made despite the fact that I don't have
errors. Here is the part of code I'm using

ResourceSpecifier aeSpecifier;
        try {
            aeSpecifier =
UIMAFramework.getXMLParser().parseResourceSpecifier(new
XMLInputSource("desc/TestSeePredAED.xml"));
            AnalysisEngine ae =
UIMAFramework.produceAnalysisEngine(aeSpecifier);

            ConfigurationParameterSettings aesettings =
ae.getMetaData().getConfigurationParameterSettings();

             NameValuePair[] valuePairs2 =
aesettings.getParameterSettings();

             for (NameValuePair nvp2 : valuePairs2) {



if(nvp2.getName().matches("OUTPUTDIR"))nvp2.setValue("/home/radwen/Bureau/Fold");

                 System.out.format("name='%s'; value='%s'\n",

                         nvp2.getName(), nvp2.getValue());

             }

          ae.reconfigure();


But after calling my CPE programmaticaly just after this code, well the
changes seems to be not made.

Can you help me figuring this out ?

Thx

Radwen

Re: AE parameters don't change

Posted by Radwen ANIBA <ar...@gmail.com>.
Thank you Marshall,

The SimpleRunCPM example is good but did not answer my question since I
already have a coded CPE and do not need to use CPM.

Or does it mean that instead of calling the CPE descriptor I have to follow
CPM example to add manually all the AEs I have developped including the one
that I change programmatically in the main class ?

Radwen

2010/2/1 Marshall Schor <ms...@schor.com>

>
>
> Radwen ANIBA wrote:
> > Well I tried again but still have the same bug.
> >
> > After changing AE parameters programatically how to tell the CPE (before
> or
> > when calling it) to look if the AE changed or not ?
> >
>
> See the example code in the examples, under
> org.apache.uima.examples.cpe.SimpleRunCPM, for an example of setting up
> a CPM to run after individually instantiating some components.
>
> HTH. -Marshall
> > Radwen
> >
> > 2010/1/30 Radwen ANIBA <ar...@gmail.com>
> >
> >
> >> I simply used reconfigure for the AE, i thought CPE will see the latest
> >> modification in the descriptor
> >>
> >> Am I wrong ?
> >>
> >> 2010/1/29 Marshall Schor <ms...@schor.com>
> >>
> >>
> >>
> >>> Radwen ANIBA wrote:
> >>>
> >>>> Hi
> >>>>
> >>>> I'm trying to change a parameter in an AE and then to call the CPE
> that
> >>>>
> >>> uses
> >>>
> >>>> this AE but the changes are not made despite the fact that I don't
> have
> >>>> errors.
> >>>>
> >>> How did you indicate to the CPE (Collection Processing Engine) that it
> >>> should use this configured Analysis Engine?
> >>> -Marshall
> >>>
> >>>> Here is the part of code I'm using
> >>>>
> >>>> ResourceSpecifier aeSpecifier;
> >>>>         try {
> >>>>             aeSpecifier =
> >>>> UIMAFramework.getXMLParser().parseResourceSpecifier(new
> >>>> XMLInputSource("desc/TestSeePredAED.xml"));
> >>>>             AnalysisEngine ae =
> >>>> UIMAFramework.produceAnalysisEngine(aeSpecifier);
> >>>>
> >>>>             ConfigurationParameterSettings aesettings =
> >>>> ae.getMetaData().getConfigurationParameterSettings();
> >>>>
> >>>>              NameValuePair[] valuePairs2 =
> >>>> aesettings.getParameterSettings();
> >>>>
> >>>>              for (NameValuePair nvp2 : valuePairs2) {
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> if(nvp2.getName().matches("OUTPUTDIR"))nvp2.setValue("/home/radwen/Bureau/Fold");
> >>>
> >>>>                  System.out.format("name='%s'; value='%s'\n",
> >>>>
> >>>>                          nvp2.getName(), nvp2.getValue());
> >>>>
> >>>>              }
> >>>>
> >>>>           ae.reconfigure();
> >>>>
> >>>>
> >>>> But after calling my CPE programmaticaly just after this code, well
> the
> >>>> changes seems to be not made.
> >>>>
> >>>> Can you help me figuring this out ?
> >>>>
> >>>> Thx
> >>>>
> >>>> Radwen
> >>>>
> >>>>
> >>>>
> >>
> >
> >
>

Re: AE parameters don't change

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

Radwen ANIBA wrote:
> Well I tried again but still have the same bug.
>
> After changing AE parameters programatically how to tell the CPE (before or
> when calling it) to look if the AE changed or not ?
>   

See the example code in the examples, under
org.apache.uima.examples.cpe.SimpleRunCPM, for an example of setting up
a CPM to run after individually instantiating some components.

HTH. -Marshall
> Radwen
>
> 2010/1/30 Radwen ANIBA <ar...@gmail.com>
>
>   
>> I simply used reconfigure for the AE, i thought CPE will see the latest
>> modification in the descriptor
>>
>> Am I wrong ?
>>
>> 2010/1/29 Marshall Schor <ms...@schor.com>
>>
>>
>>     
>>> Radwen ANIBA wrote:
>>>       
>>>> Hi
>>>>
>>>> I'm trying to change a parameter in an AE and then to call the CPE that
>>>>         
>>> uses
>>>       
>>>> this AE but the changes are not made despite the fact that I don't have
>>>> errors.
>>>>         
>>> How did you indicate to the CPE (Collection Processing Engine) that it
>>> should use this configured Analysis Engine?
>>> -Marshall
>>>       
>>>> Here is the part of code I'm using
>>>>
>>>> ResourceSpecifier aeSpecifier;
>>>>         try {
>>>>             aeSpecifier =
>>>> UIMAFramework.getXMLParser().parseResourceSpecifier(new
>>>> XMLInputSource("desc/TestSeePredAED.xml"));
>>>>             AnalysisEngine ae =
>>>> UIMAFramework.produceAnalysisEngine(aeSpecifier);
>>>>
>>>>             ConfigurationParameterSettings aesettings =
>>>> ae.getMetaData().getConfigurationParameterSettings();
>>>>
>>>>              NameValuePair[] valuePairs2 =
>>>> aesettings.getParameterSettings();
>>>>
>>>>              for (NameValuePair nvp2 : valuePairs2) {
>>>>
>>>>
>>>>
>>>>
>>>>         
>>> if(nvp2.getName().matches("OUTPUTDIR"))nvp2.setValue("/home/radwen/Bureau/Fold");
>>>       
>>>>                  System.out.format("name='%s'; value='%s'\n",
>>>>
>>>>                          nvp2.getName(), nvp2.getValue());
>>>>
>>>>              }
>>>>
>>>>           ae.reconfigure();
>>>>
>>>>
>>>> But after calling my CPE programmaticaly just after this code, well the
>>>> changes seems to be not made.
>>>>
>>>> Can you help me figuring this out ?
>>>>
>>>> Thx
>>>>
>>>> Radwen
>>>>
>>>>
>>>>         
>>     
>
>   

Re: AE parameters don't change

Posted by Radwen ANIBA <ar...@gmail.com>.
Well I tried again but still have the same bug.

After changing AE parameters programatically how to tell the CPE (before or
when calling it) to look if the AE changed or not ?

Radwen

2010/1/30 Radwen ANIBA <ar...@gmail.com>

> I simply used reconfigure for the AE, i thought CPE will see the latest
> modification in the descriptor
>
> Am I wrong ?
>
> 2010/1/29 Marshall Schor <ms...@schor.com>
>
>
>>
>> Radwen ANIBA wrote:
>> > Hi
>> >
>> > I'm trying to change a parameter in an AE and then to call the CPE that
>> uses
>> > this AE but the changes are not made despite the fact that I don't have
>> > errors.
>>
>> How did you indicate to the CPE (Collection Processing Engine) that it
>> should use this configured Analysis Engine?
>> -Marshall
>> > Here is the part of code I'm using
>> >
>> > ResourceSpecifier aeSpecifier;
>> >         try {
>> >             aeSpecifier =
>> > UIMAFramework.getXMLParser().parseResourceSpecifier(new
>> > XMLInputSource("desc/TestSeePredAED.xml"));
>> >             AnalysisEngine ae =
>> > UIMAFramework.produceAnalysisEngine(aeSpecifier);
>> >
>> >             ConfigurationParameterSettings aesettings =
>> > ae.getMetaData().getConfigurationParameterSettings();
>> >
>> >              NameValuePair[] valuePairs2 =
>> > aesettings.getParameterSettings();
>> >
>> >              for (NameValuePair nvp2 : valuePairs2) {
>> >
>> >
>> >
>> >
>> if(nvp2.getName().matches("OUTPUTDIR"))nvp2.setValue("/home/radwen/Bureau/Fold");
>> >
>> >                  System.out.format("name='%s'; value='%s'\n",
>> >
>> >                          nvp2.getName(), nvp2.getValue());
>> >
>> >              }
>> >
>> >           ae.reconfigure();
>> >
>> >
>> > But after calling my CPE programmaticaly just after this code, well the
>> > changes seems to be not made.
>> >
>> > Can you help me figuring this out ?
>> >
>> > Thx
>> >
>> > Radwen
>> >
>> >
>>
>
>

Re: AE parameters don't change

Posted by Radwen ANIBA <ar...@gmail.com>.
I simply used reconfigure for the AE, i thought CPE will see the latest
modification in the descriptor

Am I wrong ?

2010/1/29 Marshall Schor <ms...@schor.com>

>
>
> Radwen ANIBA wrote:
> > Hi
> >
> > I'm trying to change a parameter in an AE and then to call the CPE that
> uses
> > this AE but the changes are not made despite the fact that I don't have
> > errors.
>
> How did you indicate to the CPE (Collection Processing Engine) that it
> should use this configured Analysis Engine?
> -Marshall
> > Here is the part of code I'm using
> >
> > ResourceSpecifier aeSpecifier;
> >         try {
> >             aeSpecifier =
> > UIMAFramework.getXMLParser().parseResourceSpecifier(new
> > XMLInputSource("desc/TestSeePredAED.xml"));
> >             AnalysisEngine ae =
> > UIMAFramework.produceAnalysisEngine(aeSpecifier);
> >
> >             ConfigurationParameterSettings aesettings =
> > ae.getMetaData().getConfigurationParameterSettings();
> >
> >              NameValuePair[] valuePairs2 =
> > aesettings.getParameterSettings();
> >
> >              for (NameValuePair nvp2 : valuePairs2) {
> >
> >
> >
> >
> if(nvp2.getName().matches("OUTPUTDIR"))nvp2.setValue("/home/radwen/Bureau/Fold");
> >
> >                  System.out.format("name='%s'; value='%s'\n",
> >
> >                          nvp2.getName(), nvp2.getValue());
> >
> >              }
> >
> >           ae.reconfigure();
> >
> >
> > But after calling my CPE programmaticaly just after this code, well the
> > changes seems to be not made.
> >
> > Can you help me figuring this out ?
> >
> > Thx
> >
> > Radwen
> >
> >
>

Re: AE parameters don't change

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

Radwen ANIBA wrote:
> Hi
>
> I'm trying to change a parameter in an AE and then to call the CPE that uses
> this AE but the changes are not made despite the fact that I don't have
> errors. 

How did you indicate to the CPE (Collection Processing Engine) that it
should use this configured Analysis Engine?
-Marshall
> Here is the part of code I'm using
>
> ResourceSpecifier aeSpecifier;
>         try {
>             aeSpecifier =
> UIMAFramework.getXMLParser().parseResourceSpecifier(new
> XMLInputSource("desc/TestSeePredAED.xml"));
>             AnalysisEngine ae =
> UIMAFramework.produceAnalysisEngine(aeSpecifier);
>
>             ConfigurationParameterSettings aesettings =
> ae.getMetaData().getConfigurationParameterSettings();
>
>              NameValuePair[] valuePairs2 =
> aesettings.getParameterSettings();
>
>              for (NameValuePair nvp2 : valuePairs2) {
>
>
>
> if(nvp2.getName().matches("OUTPUTDIR"))nvp2.setValue("/home/radwen/Bureau/Fold");
>
>                  System.out.format("name='%s'; value='%s'\n",
>
>                          nvp2.getName(), nvp2.getValue());
>
>              }
>
>           ae.reconfigure();
>
>
> But after calling my CPE programmaticaly just after this code, well the
> changes seems to be not made.
>
> Can you help me figuring this out ?
>
> Thx
>
> Radwen
>
>   

Re: AE parameters don't change

Posted by Radwen ANIBA <ar...@gmail.com>.
Any help ?

2010/1/28 Radwen ANIBA <ar...@gmail.com>

> Hi
>
> I'm trying to change a parameter in an AE and then to call the CPE that
> uses this AE but the changes are not made despite the fact that I don't have
> errors. Here is the part of code I'm using
>
> ResourceSpecifier aeSpecifier;
>         try {
>             aeSpecifier =
> UIMAFramework.getXMLParser().parseResourceSpecifier(new
> XMLInputSource("desc/TestSeePredAED.xml"));
>             AnalysisEngine ae =
> UIMAFramework.produceAnalysisEngine(aeSpecifier);
>
>             ConfigurationParameterSettings aesettings =
> ae.getMetaData().getConfigurationParameterSettings();
>
>              NameValuePair[] valuePairs2 =
> aesettings.getParameterSettings();
>
>              for (NameValuePair nvp2 : valuePairs2) {
>
>
>
> if(nvp2.getName().matches("OUTPUTDIR"))nvp2.setValue("/home/radwen/Bureau/Fold");
>
>                  System.out.format("name='%s'; value='%s'\n",
>
>                          nvp2.getName(), nvp2.getValue());
>
>              }
>
>           ae.reconfigure();
>
>
> But after calling my CPE programmaticaly just after this code, well the
> changes seems to be not made.
>
> Can you help me figuring this out ?
>
> Thx
>
> Radwen
>