You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Asher Stern <as...@gmail.com> on 2016/09/29 13:36:51 UTC

Dynamically configure Sofa to be processed

Hi all.

I wanted to ask a question.

Using UimaFit, how to tell an analysis engine, which is unaware of Sofas,
to process a specific Sofa, without changing its code, after that engine
has been created?

I mean:
I have an analysis engine that operates over the CAS. It uses
JCas#getDocumentText() to take the data. It is unaware of Sofas.
I want that engine to process a specific Sofa (a specific view).

I know that when the engine is being created (using
AnalysisEngineFactory#createEngine) I can provide a parameter with the
default view, which makes the engine process that view (instead of
_InitialView).
However, I want *the same engine* to process several Sofas (separately),
and I don't want to create an instance of the engine again and again for
each Sofa. I need some way to tell the engine that in the next call to
process() it shall process a specific Sofa.

When I just call process() with either the CAS or a specific view as
parameter, it processes the default view (_InitialView). Question is, how
to guide it to process another view.

Many thanks in advance,
Asher

Re: Dynamically configure Sofa to be processed

Posted by Burn Lewis <bu...@gmail.com>.
Although you have a sofa-unaware component, your requirements appear to be
perfect for a sofa-aware annotator.  The name of the sofa to process could
be put in the CAS itself, in a Java object, or even in a file.  Could you
make it sofa-aware?

~Burn

On Thu, Sep 29, 2016 at 12:01 PM, Richard Eckart de Castilho <rec@apache.org
> wrote:

> Hi Asher,
>
> I don't think UIMA provides a straightforward way for dynamically
> changing sofa mappings while a workflow/pipeline is being processed.
>
> It is assumed that either components are sofa-aware and can
> choose themselves which views they process - or if they are
> not sofa-aware, then they process whatever is mapped to the
> "_InitialView".
>
> Even a sofa-aware component with some parameter that would allow
> to configure the view to process would at least need to be "reconfigured"
> to change that parameter to a different view.
>
> It might be possible to reinitialize a component to work on a different
> view by calling initialize() and passing a UimaContext parameter there
> in the additional parameters map in which you set up a mapping from
> some view to the "_InitialView".
>
> Cheers,
>
> -- Richard
>
> > On 29.09.2016, at 15:36, Asher Stern <as...@gmail.com> wrote:
> >
> > Hi all.
> >
> > I wanted to ask a question.
> >
> > Using UimaFit, how to tell an analysis engine, which is unaware of Sofas,
> > to process a specific Sofa, without changing its code, after that engine
> > has been created?
> >
> > I mean:
> > I have an analysis engine that operates over the CAS. It uses
> > JCas#getDocumentText() to take the data. It is unaware of Sofas.
> > I want that engine to process a specific Sofa (a specific view).
> >
> > I know that when the engine is being created (using
> > AnalysisEngineFactory#createEngine) I can provide a parameter with the
> > default view, which makes the engine process that view (instead of
> > _InitialView).
> > However, I want *the same engine* to process several Sofas (separately),
> > and I don't want to create an instance of the engine again and again for
> > each Sofa. I need some way to tell the engine that in the next call to
> > process() it shall process a specific Sofa.
> >
> > When I just call process() with either the CAS or a specific view as
> > parameter, it processes the default view (_InitialView). Question is, how
> > to guide it to process another view.
> >
> > Many thanks in advance,
> > Asher
>
>

Re: Dynamically configure Sofa to be processed

Posted by Richard Eckart de Castilho <re...@apache.org>.
Hi Asher,

I don't think UIMA provides a straightforward way for dynamically
changing sofa mappings while a workflow/pipeline is being processed.

It is assumed that either components are sofa-aware and can
choose themselves which views they process - or if they are
not sofa-aware, then they process whatever is mapped to the
"_InitialView".

Even a sofa-aware component with some parameter that would allow 
to configure the view to process would at least need to be "reconfigured"
to change that parameter to a different view.

It might be possible to reinitialize a component to work on a different
view by calling initialize() and passing a UimaContext parameter there
in the additional parameters map in which you set up a mapping from
some view to the "_InitialView".

Cheers,

-- Richard

> On 29.09.2016, at 15:36, Asher Stern <as...@gmail.com> wrote:
> 
> Hi all.
> 
> I wanted to ask a question.
> 
> Using UimaFit, how to tell an analysis engine, which is unaware of Sofas,
> to process a specific Sofa, without changing its code, after that engine
> has been created?
> 
> I mean:
> I have an analysis engine that operates over the CAS. It uses
> JCas#getDocumentText() to take the data. It is unaware of Sofas.
> I want that engine to process a specific Sofa (a specific view).
> 
> I know that when the engine is being created (using
> AnalysisEngineFactory#createEngine) I can provide a parameter with the
> default view, which makes the engine process that view (instead of
> _InitialView).
> However, I want *the same engine* to process several Sofas (separately),
> and I don't want to create an instance of the engine again and again for
> each Sofa. I need some way to tell the engine that in the next call to
> process() it shall process a specific Sofa.
> 
> When I just call process() with either the CAS or a specific view as
> parameter, it processes the default view (_InitialView). Question is, how
> to guide it to process another view.
> 
> Many thanks in advance,
> Asher