uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sarah <sars...@gmail.com>
Subject Re: Uima and spring
Date Tue, 19 Feb 2019 14:25:05 GMT
Hi all,

Thanks for the advice!

I have created a JCasPool with - for now - only one JCas instance. I run my analysis engines
on it, use the results, reset the JCas and release it back into the pool. Then I start the
same process on the same JCas. 
However, the resources still get produced every single time I call “process” on my aggregate
engine. I assumed that the resource management would be taken care of during JCas creation.
But that is not the case.

Does anyone know where exactly the “initialize” method of JCasAnnotator is called?


> On 18. Feb 2019, at 17:04, Marshall Schor <msa@schor.com> wrote:
> Hi Sarah,
> I don't have knowledge of DKPro or Spring, but here's some general guidance,
> which may (or may not) be of use :-).
> External Resources are associated with a Resource Manager instance.
> Try figuring out how to have one Resource Manager instance be reused for
> multiple JCas instances.
> Also, try to not have multiple JCas instances, beyond what you need to keep all
> the cpu "cores" in your host busy. 
> Instead of one new JCas instance per piece of work, reusing existing instances,
> by calling myJCasInstance.reset() and then using it again.
> Hopefully others with specific knowledge may comment also.
> -Marshall
> On 2/18/2019 6:48 AM, Sarah wrote:
>> Hi,
>> I am using uimafit annotators in a spring component. These annotators use external
resources. These resources are currently produced for every JCas even though the Aggregate
Engine is created inside of the Spring component's init and merely the process method is called
on the individual JCas objects. This slows my system down.
>> How do I handle external resources appropriately in a spring component. I found the
SpringContextResourceManager but I don’t know how to use it. Can you point me to an example
where e.g. the DKPro CoreNLP Annotators are used in a spring context?
>> All the best,
>> Sarah

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message