uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthias Mühlhausen <Matthias.Muehlhau...@uni-jena.de>
Subject Re: setting of an Object as a configuration parameter
Date Fri, 18 Jul 2008 13:15:48 GMT
Thank you Thilo,

the example is really useful for understanding the concept. But what can 
I do if I don't want to use a file where the serialized object is stored 
(in he HMMTagger example: file:english/BrownModel.dat) but instead just 
keep the object in memory without writing it to a file?
I saw that the method 'load' that has to be implemented, uses a 
DataResource object to get an InputStream to deserialize the object. So 
I guess the ResourceManager or the UIMAFramework somehow manages it to 
get the filename from the descriptor...

regards
Matthias

Thilo Goetz schrieb:
> Matthias,
>
> that's what external resources are for.  You declare them
> in a descriptor, and they get loaded once by the framework.
> See 
> http://incubator.apache.org/uima/downloads/releaseDocs/2.2.2-incubating/docs/html/tutorials_and_users_guides/tutorials_and_users_guides.html#ugr.tug.aae.accessing_external_resource_files

>
>
> A real life example of such an external resource is the
> HMM model file of the sandbox Tagger.  Check the HmmTagger.xml
> descriptor, IModelResource.java and ModelResource.java.
>
> --Thilo
>
> Matthias Mühlhausen wrote:
>> Hello,
>>
>> I have a question concerning the setting of an Object as a 
>> configuration parameter for an AnalysisEngine:
>>
>> We are processing a corpus with several threads of the same UIMA 
>> pipeline. There is a very large Java object or "resource" that is 
>> used by an AnalysisEngine of this pipeline. it's a Dictionary object 
>> that needs between 4 and 12GB memory. We would like to create only 
>> one object and use this in all pipelines, because of the memory 
>> footprint. I thought it could be possible to create it once and then 
>> set it as a configuration parameter for all the components. This does 
>> not work, because an AnalysisEngine does not accept to set an Object 
>> as a configuration parameter.
>> So I thought about two solutions yet:
>>
>> 1. we use this component not as a AnalysisEngine but as a POJO and 
>> set the Object by a simple setter.
>>
>> 2. using JNDI and resolve the object by a name - but I have no 
>> experience with JNDI, so I would like to have somebody's opinion 
>> about this approach.
>>
>>
>> regards
>> Matthias
>>


-- 
Matthias Mühlhausen
Jena University Language and Information Engineering (JULIE) Lab
Phone: +49-3641-944305
Fax:   +49-3641-944321
email: matthias.muehlhausen@uni-jena.de
URL:   http://www.julielab.de 


Mime
View raw message