uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugues de Mazancourt <hug...@mazancourt.com>
Subject Re: Uima and spring
Date Wed, 20 Feb 2019 14:49:40 GMT
Hi Sarah,

Sorry it didn't solve your issue.
Do all resources get reloaded or just specific ones ?
DKPro's components usually perform a check on the JCas typesystem and reload the resource
if the TS changed. This happen as a prolog in every call to process().
Thus if the components "feels" that the typesystem has changed for some reason, this will
trigger a reload of the corresponding resource.
Do you use standard DKPro resource management (through language/variant) or use an explicit
location for your resource (PARAM_RESOURCE_LOCATION, ...) ?

Hugues de Mazancourt

P: (tel:
W: http://www.mazancourt.com

On févr. 19 2019, at 3:25 pm, Sarah <sarschu@gmail.com> wrote:
> 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?
> Sarah
> > 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