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 Thu, 21 Feb 2019 08:30:17 GMT
Hi Sarah,

Good that you found your solution.
Regarding the resourecs, I don't think it's a good idea to locally store
DKPro resources. If you use maven, the resources are dowloaded by maven; if
you don't, DKPro uses an Ivy cache to store the downloaded artifacts. In
any case, the resources will be downloaded only once.

Best,

Hugues

Le mer. 20 févr. 2019 à 16:02, Sarah <sarschu@gmail.com> a écrit :

> Hi Hugues,
>
> Actually, I found the main cause of my issue: I had some annotators
> wrapped inside of a process method.
> However, I got into the optimising business now. I was wondering about
> your last question. Thus far, I use the standard DKPro resource management.
> Is there a benefit to storing resources locally and binding them to the
> annotators in terms of processing time? You would probably save the time
> for downloading and unpacking the resource, right?
>
> All the best,
> Sarah
>
> > On 20. Feb 2019, at 15:49, Hugues de Mazancourt <hugues@mazancourt.com>
> wrote:
> >
> > 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,
> ...) ?
> >
> > Best,
> > Hugues de Mazancourt
> >
> > P: 06.72.78.70.33 (tel:06.72.78.70.33 <tel:06.72.78.70.33>)
> > W: http://www.mazancourt.com <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
> >>>
> >>
> >>
> >
> >
>
>

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