You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Richard Eckart de Castilho <re...@apache.org> on 2013/11/01 12:06:24 UTC

Re: uimaFIT: external resource bindings?

You're using a ConceptMapper class which contains @ExternalResource annotations, right?
Otherwise, I'd be surprised if this worked, because otherwise there should be no 
external resource dependencies defined in the sentimentMapper description.

-- Richard

On 29.10.2013, at 14:05, Jens Grivolla <j+...@grivolla.net> wrote:

> I got it to work with the following:
> 
>> 	ExternalResourceDescription myDict = createExternalResourceDescription(
>> 		CompiledDictionaryResource_impl.class,
>> 		"file:dictionary.dic");
>> 
>> 	AnalysisEngineDescription sentimentMapper = createEngineDescription(
>> 		ConceptMapperBM.class,
>> 		ConceptMapperBM.PARAM_DICT_FILE, myDict,
>> 		ConceptMapperBM.PARAM_ANNOTATION_NAME, Sentiment.class.getCanonicalName(),
>> 		<lots of other parameters because too many are mandatory>
>> 		);
> 
> Apparently no explicit binding is necessary...
> 
> Bye,
> Jens
> 
> On 10/24/2013 10:00 PM, Richard Eckart de Castilho wrote:
>> It largely depends on how you use the ConceptMapper. External resources require three things to work:
>> 
>> 1) an external resource description
>> 2) a declaration on the analysis engine that it accepts an external resource (a dependency)
>> 3) a binding binding between the two
>> 
>> Since the ConceptMapper is not an uimaFIT component, i.e. it is not using the @ExternalResource annotation, uimaFIT cannot create 1 automatically. So you can create it manually using createDependencyAndBind(), which performs steps 2 (using the createDependency() call) and 3 (using a bindResource() call). Of course, you can also manually call createDependency() and bindResource() separately - which I think you were asking for.
>> 
>> If just pass the external resource description to the createEngineDescription() call, it only does 3, but not 2 - this approach only works if the AE you create the descriptor for uses the @ExternalResource annotation to declare external resources.
>> 
>> -- Richard
>> 
>> On 24.10.2013, at 17:56, Jens Grivolla <j+...@grivolla.net> wrote:
>> 
>>> Ok, I guess I don't actually need to do that, ConceptMapper only looks for the "key" and doesn't seem to know about the indirect binding, right?
>>> 
>>> And in uimaFIT if I want to bind the same resource to several AEs I use createExternalResourceDescription() and then just pass it like any other parameter to createEngineDescription()?
>>> 
>>> Bye,
>>> Jens
>>> 
>>> On 10/24/2013 05:28 PM, Jens Grivolla wrote:
>>>> Hi, I'm trying to run ConceptMapper from uimaFIT, but
>>>> createDependencyAndBind doesn't seem to allow to separate declaring the
>>>> external resource (with a "name") and binding that "name" to a "key". I
>>>> looked through ExternalResourceFactory but didn't find any method that
>>>> seems to obviously do what I need. What should I do?
>>>> 
>>>> Btw, I updated ConceptMapper to be based on JCasAnnotator_ImplBase
>>>> instead of Annotator_ImplBase and TextAnnotator (both deprecated).
>>>> 
>>>> Bye,
>>>> Jens