You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Vinod <vk...@gmail.com> on 2011/09/02 19:12:54 UTC

Multiple views and Aggregate Analysis engine...

Hi,

I am having difficulty in accessing document text (set by a collection reader)
 in a down stream annotator, 
I would appreciate if you could point me in the right direction.

Here is what I have:

Collection Reader creates 3 views, V1, V2, and V3 and sets documentText 
for those views 
(so default view has not text set).

I have an AggregateAE (AAE1) that includes another 
AggregateAE (AAE2 - MedKAT).

In AAE1, I have defined V1, V2, and V3 as output SOFAS and included all 
downstream annotators 
including AAE2 in the sofa mapping.

The problem: Annotators in AAE2 cannot access document text from V1, V2 or V3

Isn't the fact that I have defined AAE2 under Outputs in Sofa Mappings as 
"Outputs->V1->AAE2" be 
enough to have all the annotators in AAE2 have access to the views V1?

Any help would be appreciated.
Vinod.


Re: Multiple views and Aggregate Analysis engine...

Posted by Burn Lewis <bu...@gmail.com>.
All annotators in a pipeline have the potential to access all views in a
CAS.  Currently the declarations of input and output sofas in descriptors
are not enforced, so an annotator can access view V1 even if it was not
declared as an input sofa.  Similarly an annotator can create a view even if
no output sofas are declared.  Currently the declarations only indicate if
an annotator is sofa-aware or not (see Chapter 6 in the Apache UIMA
Tutorial)

So the answer to Q1 is "it depends" ... if V1 is sofa-mapped to the initial
view and the annotator is sofa-unaware (single-view) then it will be passed
V1.  Otherwise use getView("V1")

For Q2, yes, collection readers can create views also.

~Burn.


On Fri, Sep 2, 2011 at 5:36 PM, Vinod <vk...@gmail.com> wrote:

> Burn Lewis <bu...@...> writes:
>
> >
> > Without sofa mapping you should be able to access these views directly,
> e.g.
> >
> > CAS view1 = cas.getView("V1");
> >
> > If your annotator is single-view / sofa-unaware (i.e. declares no input
> or
> > output sofas) then it will be passed the default view or whatever view is
> > mapped to that.  If your annotator is multi-view / sofa-aware (i.e.
> declares
> > at least one input or output sofa) then it will be given a base CAS with
> no
> > view so you MUST use getView to access any of your views.
> >
> > If you've sofa-mapped V1 to some other name then you'll have to pass
> getView
> > the mapped name.
> >
> > ~Burn
> >
> > On Fri, Sep 2, 2011 at 1:12 PM, Vinod <vk...@...> wrote:
> >
> > > Hi,
> > >
> > > I am having difficulty in accessing document text (set by a collection
> > > reader)
> > >  in a down stream annotator,
> > > I would appreciate if you could point me in the right direction.
> > >
> > > Here is what I have:
> > >
> > > Collection Reader creates 3 views, V1, V2, and V3 and sets documentText
> > > for those views
> > > (so default view has not text set).
> > >
> > > I have an AggregateAE (AAE1) that includes another
> > > AggregateAE (AAE2 - MedKAT).
> > >
> > > In AAE1, I have defined V1, V2, and V3 as output SOFAS and included all
> > > downstream annotators
> > > including AAE2 in the sofa mapping.
> > >
> > > The problem: Annotators in AAE2 cannot access document text from V1, V2
> or
> > > V3
> > >
> > > Isn't the fact that I have defined AAE2 under Outputs in Sofa Mappings
> as
> > > "Outputs->V1->AAE2" be
> > > enough to have all the annotators in AAE2 have access to the views V1?
> > >
> > > Any help would be appreciated.
> > > Vinod.
> > >
> > >
> >
>
>
> Thanks for your response Burn. Let me see if I understand.
>
> if I have the following annotators in the flow
>
> A1, A2, A3, A4
>
> which are all included in an Aggregate AAE1. AAE1 defines
> View V1 as output, A1 creates this view and adds doc-text
> to this view. So other annotators A2 through A4 will have access
> to this view - I know this works in one of our UIMA pipelines.
>
> Now, if I instead have A1, AAE2, A3, A4
>
> Will the annotators in AAE2 (aggregate analysis engine 2) have
> access to the view that A1 created?
>
> Q1) Are you saying that *ALL* annotators in AAE3's flow should
> explicitly access V1 using getView?
> Q2) What will happen if the Collection reader creates a view instead
> of the first annotator A1?
>
> Thanks.
>
>
>

Re: Multiple views and Aggregate Analysis engine...

Posted by Vinod <vk...@gmail.com>.
Burn Lewis <bu...@...> writes:

> 
> Without sofa mapping you should be able to access these views directly, e.g.
> 
> CAS view1 = cas.getView("V1");
> 
> If your annotator is single-view / sofa-unaware (i.e. declares no input or
> output sofas) then it will be passed the default view or whatever view is
> mapped to that.  If your annotator is multi-view / sofa-aware (i.e. declares
> at least one input or output sofa) then it will be given a base CAS with no
> view so you MUST use getView to access any of your views.
> 
> If you've sofa-mapped V1 to some other name then you'll have to pass getView
> the mapped name.
> 
> ~Burn
> 
> On Fri, Sep 2, 2011 at 1:12 PM, Vinod <vk...@...> wrote:
> 
> > Hi,
> >
> > I am having difficulty in accessing document text (set by a collection
> > reader)
> >  in a down stream annotator,
> > I would appreciate if you could point me in the right direction.
> >
> > Here is what I have:
> >
> > Collection Reader creates 3 views, V1, V2, and V3 and sets documentText
> > for those views
> > (so default view has not text set).
> >
> > I have an AggregateAE (AAE1) that includes another
> > AggregateAE (AAE2 - MedKAT).
> >
> > In AAE1, I have defined V1, V2, and V3 as output SOFAS and included all
> > downstream annotators
> > including AAE2 in the sofa mapping.
> >
> > The problem: Annotators in AAE2 cannot access document text from V1, V2 or
> > V3
> >
> > Isn't the fact that I have defined AAE2 under Outputs in Sofa Mappings as
> > "Outputs->V1->AAE2" be
> > enough to have all the annotators in AAE2 have access to the views V1?
> >
> > Any help would be appreciated.
> > Vinod.
> >
> >
> 


Thanks for your response Burn. Let me see if I understand.

if I have the following annotators in the flow

A1, A2, A3, A4

which are all included in an Aggregate AAE1. AAE1 defines
View V1 as output, A1 creates this view and adds doc-text
to this view. So other annotators A2 through A4 will have access
to this view - I know this works in one of our UIMA pipelines.

Now, if I instead have A1, AAE2, A3, A4

Will the annotators in AAE2 (aggregate analysis engine 2) have 
access to the view that A1 created?

Q1) Are you saying that *ALL* annotators in AAE3's flow should
explicitly access V1 using getView?
Q2) What will happen if the Collection reader creates a view instead 
of the first annotator A1?

Thanks. 



Re: Multiple views and Aggregate Analysis engine...

Posted by Burn Lewis <bu...@gmail.com>.
Without sofa mapping you should be able to access these views directly, e.g.

CAS view1 = cas.getView("V1");

If your annotator is single-view / sofa-unaware (i.e. declares no input or
output sofas) then it will be passed the default view or whatever view is
mapped to that.  If your annotator is multi-view / sofa-aware (i.e. declares
at least one input or output sofa) then it will be given a base CAS with no
view so you MUST use getView to access any of your views.

If you've sofa-mapped V1 to some other name then you'll have to pass getView
the mapped name.

~Burn

On Fri, Sep 2, 2011 at 1:12 PM, Vinod <vk...@gmail.com> wrote:

> Hi,
>
> I am having difficulty in accessing document text (set by a collection
> reader)
>  in a down stream annotator,
> I would appreciate if you could point me in the right direction.
>
> Here is what I have:
>
> Collection Reader creates 3 views, V1, V2, and V3 and sets documentText
> for those views
> (so default view has not text set).
>
> I have an AggregateAE (AAE1) that includes another
> AggregateAE (AAE2 - MedKAT).
>
> In AAE1, I have defined V1, V2, and V3 as output SOFAS and included all
> downstream annotators
> including AAE2 in the sofa mapping.
>
> The problem: Annotators in AAE2 cannot access document text from V1, V2 or
> V3
>
> Isn't the fact that I have defined AAE2 under Outputs in Sofa Mappings as
> "Outputs->V1->AAE2" be
> enough to have all the annotators in AAE2 have access to the views V1?
>
> Any help would be appreciated.
> Vinod.
>
>