uima-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marshall Schor <...@schor.com>
Subject Re: Dynamically bind resources to AnalysisEngine
Date Wed, 11 Apr 2018 20:39:30 GMT

I don't know about DKPro, so someone more familiar with its conventions could

UIMA supports a decoupling of resources, shared among annotators running in some
pipeline.  I'm guessing you're asking about this mechanism,  but before
proceeding, there's nothing preventing you from implementing an annotator (let's
call it the spelling corrector annotator) which could load a dictionary (let's
say, specified by a configuration parameter), and then have some mechanism to
"reload it", if it changes.

This link in the UIMA Reference manual describes Resources:

See also the Javadocs for SharedResourceObject

These have a "load" method which the user is supposed to implement to cause the
resource to be "loaded".  Typically, if the resource, for example, implemennts a
hashmap, the load might read some external file and initialize the hashmap from

The implementation of the load method is the responsibility of the resource
implementer. UIMA will instantiate the resource class, and call the load method,

One possibility would be to have your spelling annotator check "every so often"
to see if the on-disk version has changed, and if so, call the load method
again.  If you consider doing this, remember that your annotator might (in some
deployments) be "scaled up" in multiple Java threads, so you might need to do
this under a synchronization lock.

Does this help?  There may be more conventions / built-in ways that DKPro has
for this scenario.

Cheers. -Marshall

On 4/11/2018 9:54 AM, Hugues de Mazancourt wrote:
> Hello,
> Is there a way to dynamically bind/update resources for an AnalysisEngine ?
> My use-case is : I build a query parser that will be used to retrieve information in
an indexed text database.
> The parser performs spelling correction, but doesn't have to consider words in the index
as spelling mistakes. Thus, the (aggregate) engine is bound to the index vocabulary (ie a
word list).
> My point is : when the index gets updated, its vocabulary will also be updated. I can
re-build a new aggregate parser, with the updated resource, but this takes time, mainly for
loading resources that were already loaded (POS model, lexica, etc.). Is there a way to update
a given resource on my parser without having to rebuild it ?
> Thanks for your help,
> PS: I'm mostly building on top of DKPro components. I may miss some basic UIMA mechanisms
> Hugues de Mazancourt
> Mazancourt Conseil
> E: hugues@mazancourt.com (mailto:hugues@mazancourt.com)
> P: +33-6 72 78 70 33 (tel:+33-6%2072%2078%2070%2033)
> W: http://www.mazancourt.com

View raw message