uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From james.d.ba...@gmail.com
Subject Re: Passing additional parameters through to CPE components
Date Thu, 24 Jul 2014 15:31:20 GMT
I think you’ve misunderstood my question - I’m not asking whether I can override defined
parameters, I’m asking if I can provide additional configuration parameters that aren’t
defined in a descriptor file. Let me give an example:

MyCollectionReader.xml defines the following properties:
	folder [String] - The folder to process files from
	classname [String] - The qualified class name of a class implementing my ContentExtractor
interface

MyCpe.xml uses MyCollectionReader.xml and provides the following properties, including some
that MyContentExtractor uses but aren’t defined above:
	folder - /opt/test
	classname - test.MyContentExtractor
	baseUrl - http://www.example.com

The parameter baseUrl, although it is specified in the MyCpe.xml file, isn’t defined in
MyCollectionReader.xml because it is specific to the MyContentExtractor class and not necessarily
known at design time. However, UIMA isn’t passing it through to UimaContext presumably because
it isn’t defined in the MyCollectionReader.xml.

Hope that helps clear it up.


On 24 Jul 2014, at 14:51, Eddie Epstein <eaepstein@gmail.com> wrote:

> A CPE descriptor can override configuration parameters defined in any
> integrated components.
> Documentation a little bit below
> http://uima.apache.org/d/uimaj-2.6.0/references.html#ugr.ref.xml.cpe_descriptor.descriptor.cas_processors.individual
> 3.6.1.2. <configurationParameterSettings> Element
> 
> This element provides a way to override the contained Analysis Engine's
> parameters settings. Any entry specified here must already be defined;
> values specified replace the corresponding values for each parameter. For
> Cas Processors, this mechanism is only available when they are deployed in “
> integrated” mode. For Collection Readers and Initializers, it always is
> available.
> 
> 
> 
> On Thu, Jul 24, 2014 at 8:19 AM, James Baker <james.d.baker@gmail.com>
> wrote:
> 
>> Is it possible to provide additional configuration parameters in a CPE
>> descriptor XML file that aren't specified in the annotator/collection
>> reader descriptor XML file?
>> 
>> I have a collection reader that accepts the classname of a class to use to
>> do the content extraction as a parameter. This works fine, but I'd like to
>> be able to pass additional parameters to the content extractor via the XML.
>> The parameters will be dependant on the content extractor though, so I
>> can't specify them in the collection reader descriptor. For example,
>> ContentExtractor1 might need a parameter 'encoding', and ContentExtractor2
>> might need a parameter 'baseUrl'.
>> 
>> I have been able to achieve this with UimaFIT by creating the collection
>> reader without the XML and injecting the parameters, but when I try and do
>> it from the XML file the parameters don't make it through to my content
>> extractor (I pass the UimaContext object through to the content extractor).
>> I suspect they might be being ignored by UIMA because they aren't in the
>> descriptor. How can I work around this?
>> 
>> Thanks,
>> James
>> 


Mime
View raw message