You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Jens Grivolla <j+...@grivolla.net> on 2018/07/05 12:52:43 UTC

run existing AE instance on different view

Hi,

I'm trying to run an already instantiated AE on a view other than
_InitialView. Unfortunately, I can't just call process() on the desired
view, as there is a call to Util.getStartingView(...)
in PrimitiveAnalysisEngine_impl that forces it back to _InitialView.

The view mapping methods I found (e.g. using and AggregateBuilder) work on
AE descriptions, so I would need to create additional instances (with the
corresponding memory overhead). Is there a way to remap/rename the views in
a JCas before calling process() so that the desired view is seen as the
_InitialView? It looks like CasCopier.copyCasView(..) could maybe be used
for this, but it doesn't feel quite right.

Best,
Jens

Re: run existing AE instance on different view

Posted by Jens Grivolla <j+...@grivolla.net>.
Hi Marshall,

as far as I can tell all the mapping methods described there need to be
applied *before* instantiating an AE. The problem is that while I can use
CAS.getView(...) or JCas.getView(...) to access the desired view I find no
way to call the process() method of an existing AE instance on it.

One application we have right now is having a pretty memory-heavy pipeline
loaded into memory that we need to apply to texts from different sources
(typically as a web service). Depending on the source we may need to first
apply translation, cleanup, etc., all of which create new views on which to
operate. We are not using CPE or any other "standard" execution engine but
rather create the initial JCas from the incoming text and then apply
aggregate engines (using their process() method) to that JCas as needed.

Best,
Jens

On Mon, Jul 9, 2018 at 10:46 PM, Marshall Schor <ms...@schor.com> wrote:

> Hi,
>
> Is anything in
> https://uima.apache.org/d/uimaj-2.10.2/tutorials_and_
> users_guides.html#ugr.tug.mvs.name_mapping_application
> helpful?
>
> If not, could you add some details that says why not?
>
> -Marshall
>
>
> On 7/5/2018 8:52 AM, Jens Grivolla wrote:
> > Hi,
> >
> > I'm trying to run an already instantiated AE on a view other than
> > _InitialView. Unfortunately, I can't just call process() on the desired
> > view, as there is a call to Util.getStartingView(...)
> > in PrimitiveAnalysisEngine_impl that forces it back to _InitialView.
> >
> > The view mapping methods I found (e.g. using and AggregateBuilder) work
> on
> > AE descriptions, so I would need to create additional instances (with the
> > corresponding memory overhead). Is there a way to remap/rename the views
> in
> > a JCas before calling process() so that the desired view is seen as the
> > _InitialView? It looks like CasCopier.copyCasView(..) could maybe be used
> > for this, but it doesn't feel quite right.
> >
> > Best,
> > Jens
> >
>
>

Re: run existing AE instance on different view

Posted by Marshall Schor <ms...@schor.com>.
Hi,

Is anything in
https://uima.apache.org/d/uimaj-2.10.2/tutorials_and_users_guides.html#ugr.tug.mvs.name_mapping_application
helpful?

If not, could you add some details that says why not?

-Marshall


On 7/5/2018 8:52 AM, Jens Grivolla wrote:
> Hi,
>
> I'm trying to run an already instantiated AE on a view other than
> _InitialView. Unfortunately, I can't just call process() on the desired
> view, as there is a call to Util.getStartingView(...)
> in PrimitiveAnalysisEngine_impl that forces it back to _InitialView.
>
> The view mapping methods I found (e.g. using and AggregateBuilder) work on
> AE descriptions, so I would need to create additional instances (with the
> corresponding memory overhead). Is there a way to remap/rename the views in
> a JCas before calling process() so that the desired view is seen as the
> _InitialView? It looks like CasCopier.copyCasView(..) could maybe be used
> for this, but it doesn't feel quite right.
>
> Best,
> Jens
>


Re: run existing AE instance on different view

Posted by Jens Grivolla <j+...@grivolla.net>.
Hi Eddie,

unfortunately for the most part we can't (easily) change the AEs to make
them SofA-aware (many of them come from DKPro).

If no better solutions come up, I guess we will go with copying the view to
be processed so it is always accessible the same way (either as
_InitialView or with a different name that we always statically map to
_InitialView).

Thanks,
Jens

On Tue, Jul 10, 2018 at 3:58 PM, Eddie Epstein <ea...@gmail.com> wrote:

> I think the UIMA code uses the annotator context to map the _InitialView
> and the context remains static for the life of the annotator. Replicating
> annotators to handle different views has been used here too, but agree it
> is ugly.
>
> If the annotator code can be changed, then one approach would be to put
> some information in a fixed _IntialView that specifies which named view(s)
> should be analyzed and have all down stream annotators use that to select
> the view(s) to operate on.
>
> Also sounds possible to have a single new component use the cascopier to
> create a new view that is always the one processed.
>
> Regards,
> Eddie
>
> On Thu, Jul 5, 2018 at 8:52 AM, Jens Grivolla <j+...@grivolla.net> wrote:
>
> > Hi,
> >
> > I'm trying to run an already instantiated AE on a view other than
> > _InitialView. Unfortunately, I can't just call process() on the desired
> > view, as there is a call to Util.getStartingView(...)
> > in PrimitiveAnalysisEngine_impl that forces it back to _InitialView.
> >
> > The view mapping methods I found (e.g. using and AggregateBuilder) work
> on
> > AE descriptions, so I would need to create additional instances (with the
> > corresponding memory overhead). Is there a way to remap/rename the views
> in
> > a JCas before calling process() so that the desired view is seen as the
> > _InitialView? It looks like CasCopier.copyCasView(..) could maybe be used
> > for this, but it doesn't feel quite right.
> >
> > Best,
> > Jens
> >
>

Re: run existing AE instance on different view

Posted by Eddie Epstein <ea...@gmail.com>.
I think the UIMA code uses the annotator context to map the _InitialView
and the context remains static for the life of the annotator. Replicating
annotators to handle different views has been used here too, but agree it
is ugly.

If the annotator code can be changed, then one approach would be to put
some information in a fixed _IntialView that specifies which named view(s)
should be analyzed and have all down stream annotators use that to select
the view(s) to operate on.

Also sounds possible to have a single new component use the cascopier to
create a new view that is always the one processed.

Regards,
Eddie

On Thu, Jul 5, 2018 at 8:52 AM, Jens Grivolla <j+...@grivolla.net> wrote:

> Hi,
>
> I'm trying to run an already instantiated AE on a view other than
> _InitialView. Unfortunately, I can't just call process() on the desired
> view, as there is a call to Util.getStartingView(...)
> in PrimitiveAnalysisEngine_impl that forces it back to _InitialView.
>
> The view mapping methods I found (e.g. using and AggregateBuilder) work on
> AE descriptions, so I would need to create additional instances (with the
> corresponding memory overhead). Is there a way to remap/rename the views in
> a JCas before calling process() so that the desired view is seen as the
> _InitialView? It looks like CasCopier.copyCasView(..) could maybe be used
> for this, but it doesn't feel quite right.
>
> Best,
> Jens
>