You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by "SAITO, Isao Isaac" <13...@1995.sfc.ne.jp> on 2008/01/15 02:17:51 UTC

question: how to get order of annotations created by previous annotators?

hi all,

I am trying to develop an aggregate analysis engine.
The annotator run at the end (called annotator-end) wants to get
all annotations created by the previous annotators(annotators-prev),
as same order in given document(data that can be acquired by
JCas#getDocumentText()).
Could anyone tell me how to do this?

For example of what I want,
 - 2 types of Annotation(PrefixAnnot, SuffixAnnot) are in use
 - by annotators-prev, more than 1 annotations are created using
Annotation above
 - annotator-end wants to get a SuffixAnnot everytime after any
PrefixAnnot comes

In <code a> shown below, annotation instances can be acquired only
with respect to the class and the order is not available as far as I
know.

Thanks,
 Isaac

<code a>
FSIndex prefixIndex = aJCas.getAnnotationIndex(PrefixAnnot.type);
Iterator prefixIter = prefixIndex.iterator();
while (prefixIter.hasNext()) {
  PrefixAnnot prefix = (PrefixAnnot)prefixIter.next();
}

FSIndex suffixIndex = aJCas.getAnnotationIndex(SuffixAnnot.type);
Iterator suffixIter = suffixIndex.iterator();
while (suffixIter.hasNext()) {
  SuffixAnnot suffix = (SuffixAnnot)suffixIter.next();
}
</code a>

Re: Where can I download an C++ UIMA framework?

Posted by Eddie Epstein <ea...@gmail.com>.
Hi Nicolas,

Sorry not to have responded to this earlier. I don't see any of the
problems you have reported. Without changes to the build components in
svn recently, the following steps worked with no problem:

  mkdir testcpp
  cd testcpp
  svn co http://svn.apache.org/repos/asf/incubator/uima/uimacpp/trunk
  mv trunk/ uimacpp-2.2.0-svn
  cd uimacpp-2.2.0-svn/src
  make -f Makefile.prebuild
  export APR_HOME=/home/uimacpp/apr-1.2.8/usr/local/apr
  export ICU_HOME=/home/uimacpp/icu
  export XERCES_HOME=/home/uimacpp/xml4c-src5_5_0/install
  export JAVA_HOME=/uimacpp-common/ibm-java2-i386-50
  export JAVA_INCLUDE=$JAVA_HOME/include
  make -f Makefile.unix install
  cd test
  ./fvt.sh
  cd ../../docs/
  ./builddocs.sh
  cd ..
  ./buildsdk.sh ~/testcpp

Our build makes assumptions about how APR, ICU and Xerces were built
that are probably different from what you have. I will add some
details on building these components to the readme in the next few
days.

Not that I don't see any problems with buildsdk.sh. Why you are having
problems with that is a puzzle to me.

Eddie

On Tue, Jan 22, 2008 at 11:08 AM, Nicolas Hernandez
<ni...@gmail.com> wrote:
> Hi,
>
>  I recently heard about the UIMA UIMA framework and I m currently
>  testing it to estimate whether it fits to heterogeneous needs of my
>  research team. So far, I have managed to install eclipse plugins, made
>  my first annotators, dealt with SOAP deployment...
>  My last tests have concerned the ability of UIMA to integrate
>  Annotators written with Perl API thanks the "C++ Enablement Layer".  I
>  failed with the IBM' 1.4 and then I found this post about the
>  Apache'one.
>
>  I got some problems to install the latter. Since I finally managed to
>  deal with, I let you know some hints to get the uimacpp works from the
>  checkout version (as far as I understood from the READMEs).
>
>  I installed everything in my personnal $APPLI dir.
>  "jdk1.6.0" is installed too.
>  And I run on Linux version 2.6.22-14-generic (buildd@terranova) (gcc
>  version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)).
>
>  1. checkout ; we call the trunk, $APPLI/apache-uimacpp-v2.2.0-svn
>
>  2. follow the README.4src guidelines "Setting up the build environment".
>
>  3. install APR, ICU, XERCES and declare variables in .bashrc
>  #------ JAVA
>  export JAVA_HOME=$APPLI/jdk
>  export JRE_HOME=$JAVA_HOME/jre
>  export JAVA_INCLUDE=$JAVA_HOME/include
>  export CPATH=$JAVA_HOME/include:$CPATH
>
>  #------ XERCES - http://xml.apache.org/xerces-c/
>  export XERCES_HOME=$APPLI/xerces-c
>  export PATH=$PATH:$XERCES_HOME/bin
>  export LD_LIBRARY_PATH=$XERCES_HOME/lib:$LD_LIBRARY_PATH
>
>  #------   ICU    - http://www.icu-project.org/
>  export ICU_HOME=$APPLI/icu4c-3_8_1-bin
>  export PATH=$PATH:$ICU_HOME/bin:$ICU_HOME/sbin
>  export LD_LIBRARY_PATH=$ICU_HOME/lib:$LD_LIBRARY_PATH
>  export CPATH=$ICU_HOME/include:$CPATH
>
>  #------   APR    - http://apr.apache.org/
>  export APR_HOME=$APPLI/apr
>  export PATH=$PATH:$APR_HOME/bin
>  export LD_LIBRARY_PATH=$APR_HOME/include:$APR_HOME/include/apr-1:$APR_HOME/lib:$LD_LIBRARY_PATH
>  export CPATH=$APR_HOME/include:$APR_HOME/include/apr-1:$APR_HOME/lib:$CPATH
>
>  4. make some apt-get install libtool automake autoconf doxygen graphviz
>
>  5. cd apache-uimacpp-svn/src
>  make -f Makefile.prebuild
>
>  6. ./configure --prefix=apache-uimacpp-v2.2.0-bin
>  --with-jdk=$APPLI/jdk/include/linux --with-apr=$APR_HOME
>  --with-icu=$ICU_HOME --with-xerces=$XERCES_HOME
>  Here is a bug, since "apache-uimacpp-v2.2.0-bin" will be created into
>  apache-uimacpp-svn. We will call this dir UIMA_INSTALLDIR
>
>  7. make -f Makefile.unix install
>
>  8.
>  cd ../../docs
>  ./builddocs.sh
>
>  9.
>  cd ..
>  export UIMA_INSTALLDIR=$APPLI/apache-uimacpp-v2.2.0-svn/apache-uimacpp-v2.2.0-bin
>
>  10. Since buildsdk.sh have some bugs (UIMA_INSTALL -> UIMA_INSTALLDIR,
>  and UIMA_INSTALLDIR/include/uima does not exist) do
>  mkdir $UIMA_INSTALLDIR/include/uima
>  cp  $UIMA_INSTALLDIR/include/* $UIMA_INSTALLDIR/include/uima
>
>  11.
>  rm -rf $APPLI/tmp
>  ./buildsdk.sh $APPLI/tmp
>  cd $APPLI/tmp
>  tar cvzf uimacpp-2.2.0-incubating-bin.tgz uimacpp
>
>  12. Add in .bashrc
>  #------ UIMACPP
>  export UIMACPP_HOME=$UIMA_HOME/uimacpp
>  export PATH=$UIMACPP_HOME/bin:$PATH
>  export LD_LIBRARY_PATH=$UIMACPP_HOME/lib:$LD_LIBRARY_PATH
>
>  you can copy uimacpp-2.2.0-incubating-bin.tgz into your UIMA_HOME, and
>  read its README.
>
>  The rest works with me easily...
>
>  Wish you having fun...
>
>  /Nicolas
>
>
>  On Jan 15, 2008 1:52 PM, LeHouillier, Frank D.
>
>
> <Fr...@gd-ais.com> wrote:
>  > The C++ framework from apache hasn't been released yet but it is
>  > available via subversion.  If you have subversion installed, the command
>  > is
>  >
>  > svn co http://svn.apache.org/repos/asf/incubator/uima/uimacpp/trunk
>  >
>  > There are readme's included about how to build the source included for
>  > the gcc on linux and for Visual 8 on windows.
>  >
>  > I think that this version is largely the same as the IBM UIMA Cpp
>  > version 1.4 but changes all the namespaces and hooks up to the current
>  > Java UIMA well.  The core UIMA team has mostly focused on the Java
>  > framework in terms of developing the API and getting the project out of
>  > incubation etc.  I expect that at some point some work will be done to
>  > bring the Cpp API more in line with the Java API and we might even get
>  > stuff like the JCas for c++, but this probably depends more on community
>  > support than anything else.
>  >
>  >
>  > -----Original Message-----
>  > From: Kinnemann, Henrik [mailto:Henrik.Kinnemann@siemens.com]
>  > Sent: Tuesday, January 15, 2008 7:38 AM
>  > To: uima-user@incubator.apache.org
>  > Subject: Where can I download an C++ UIMA framework?
>  >
>  > Hi all,
>  >
>  > where can I download an "C++ UIMA framework"? I only saw the "Java UIMA
>  > framework" for downloading from Apache's web-site.
>  >
>  > Best regards,
>  > Henrik
>  >
>
>
>
>  --
>  Nicolas.Hernandez@univ-nantes.fr
>  --
>  # Laboratoire LINA-TALN CNRS UMR 6241
>  tel. +33 (0)2 51 12 58 55
>  # Institut Universitaire de Technologie de Nantes - Département Informatique
>  tel. +33 (0)2 40 30 60 67
>

Re: Where can I download an C++ UIMA framework?

Posted by Nicolas Hernandez <ni...@gmail.com>.
Hi,

I recently heard about the UIMA UIMA framework and I m currently
testing it to estimate whether it fits to heterogeneous needs of my
research team. So far, I have managed to install eclipse plugins, made
my first annotators, dealt with SOAP deployment...
My last tests have concerned the ability of UIMA to integrate
Annotators written with Perl API thanks the "C++ Enablement Layer".  I
failed with the IBM' 1.4 and then I found this post about the
Apache'one.

I got some problems to install the latter. Since I finally managed to
deal with, I let you know some hints to get the uimacpp works from the
checkout version (as far as I understood from the READMEs).

I installed everything in my personnal $APPLI dir.
"jdk1.6.0" is installed too.
And I run on Linux version 2.6.22-14-generic (buildd@terranova) (gcc
version 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)).

1. checkout ; we call the trunk, $APPLI/apache-uimacpp-v2.2.0-svn

2. follow the README.4src guidelines "Setting up the build environment".

3. install APR, ICU, XERCES and declare variables in .bashrc
#------ JAVA
export JAVA_HOME=$APPLI/jdk
export JRE_HOME=$JAVA_HOME/jre
export JAVA_INCLUDE=$JAVA_HOME/include
export CPATH=$JAVA_HOME/include:$CPATH

#------ XERCES - http://xml.apache.org/xerces-c/
export XERCES_HOME=$APPLI/xerces-c
export PATH=$PATH:$XERCES_HOME/bin
export LD_LIBRARY_PATH=$XERCES_HOME/lib:$LD_LIBRARY_PATH

#------   ICU    - http://www.icu-project.org/
export ICU_HOME=$APPLI/icu4c-3_8_1-bin
export PATH=$PATH:$ICU_HOME/bin:$ICU_HOME/sbin
export LD_LIBRARY_PATH=$ICU_HOME/lib:$LD_LIBRARY_PATH
export CPATH=$ICU_HOME/include:$CPATH

#------   APR    - http://apr.apache.org/
export APR_HOME=$APPLI/apr
export PATH=$PATH:$APR_HOME/bin
export LD_LIBRARY_PATH=$APR_HOME/include:$APR_HOME/include/apr-1:$APR_HOME/lib:$LD_LIBRARY_PATH
export CPATH=$APR_HOME/include:$APR_HOME/include/apr-1:$APR_HOME/lib:$CPATH

4. make some apt-get install libtool automake autoconf doxygen graphviz

5. cd apache-uimacpp-svn/src
make -f Makefile.prebuild

6. ./configure --prefix=apache-uimacpp-v2.2.0-bin
--with-jdk=$APPLI/jdk/include/linux --with-apr=$APR_HOME
--with-icu=$ICU_HOME --with-xerces=$XERCES_HOME
Here is a bug, since "apache-uimacpp-v2.2.0-bin" will be created into
apache-uimacpp-svn. We will call this dir UIMA_INSTALLDIR

7. make -f Makefile.unix install

8.
cd ../../docs
./builddocs.sh

9.
cd ..
export UIMA_INSTALLDIR=$APPLI/apache-uimacpp-v2.2.0-svn/apache-uimacpp-v2.2.0-bin

10. Since buildsdk.sh have some bugs (UIMA_INSTALL -> UIMA_INSTALLDIR,
and UIMA_INSTALLDIR/include/uima does not exist) do
mkdir $UIMA_INSTALLDIR/include/uima
cp  $UIMA_INSTALLDIR/include/* $UIMA_INSTALLDIR/include/uima

11.
rm -rf $APPLI/tmp
./buildsdk.sh $APPLI/tmp
cd $APPLI/tmp
tar cvzf uimacpp-2.2.0-incubating-bin.tgz uimacpp

12. Add in .bashrc
#------ UIMACPP
export UIMACPP_HOME=$UIMA_HOME/uimacpp
export PATH=$UIMACPP_HOME/bin:$PATH
export LD_LIBRARY_PATH=$UIMACPP_HOME/lib:$LD_LIBRARY_PATH

you can copy uimacpp-2.2.0-incubating-bin.tgz into your UIMA_HOME, and
read its README.

The rest works with me easily...

Wish you having fun...

/Nicolas


On Jan 15, 2008 1:52 PM, LeHouillier, Frank D.
<Fr...@gd-ais.com> wrote:
> The C++ framework from apache hasn't been released yet but it is
> available via subversion.  If you have subversion installed, the command
> is
>
> svn co http://svn.apache.org/repos/asf/incubator/uima/uimacpp/trunk
>
> There are readme's included about how to build the source included for
> the gcc on linux and for Visual 8 on windows.
>
> I think that this version is largely the same as the IBM UIMA Cpp
> version 1.4 but changes all the namespaces and hooks up to the current
> Java UIMA well.  The core UIMA team has mostly focused on the Java
> framework in terms of developing the API and getting the project out of
> incubation etc.  I expect that at some point some work will be done to
> bring the Cpp API more in line with the Java API and we might even get
> stuff like the JCas for c++, but this probably depends more on community
> support than anything else.
>
>
> -----Original Message-----
> From: Kinnemann, Henrik [mailto:Henrik.Kinnemann@siemens.com]
> Sent: Tuesday, January 15, 2008 7:38 AM
> To: uima-user@incubator.apache.org
> Subject: Where can I download an C++ UIMA framework?
>
> Hi all,
>
> where can I download an "C++ UIMA framework"? I only saw the "Java UIMA
> framework" for downloading from Apache's web-site.
>
> Best regards,
> Henrik
>



-- 
Nicolas.Hernandez@univ-nantes.fr
--
# Laboratoire LINA-TALN CNRS UMR 6241
tel. +33 (0)2 51 12 58 55
# Institut Universitaire de Technologie de Nantes - Département Informatique
tel. +33 (0)2 40 30 60 67

RE: Where can I download an C++ UIMA framework?

Posted by "LeHouillier, Frank D." <Fr...@gd-ais.com>.
The C++ framework from apache hasn't been released yet but it is
available via subversion.  If you have subversion installed, the command
is 

svn co http://svn.apache.org/repos/asf/incubator/uima/uimacpp/trunk

There are readme's included about how to build the source included for
the gcc on linux and for Visual 8 on windows.

I think that this version is largely the same as the IBM UIMA Cpp
version 1.4 but changes all the namespaces and hooks up to the current
Java UIMA well.  The core UIMA team has mostly focused on the Java
framework in terms of developing the API and getting the project out of
incubation etc.  I expect that at some point some work will be done to
bring the Cpp API more in line with the Java API and we might even get
stuff like the JCas for c++, but this probably depends more on community
support than anything else.

-----Original Message-----
From: Kinnemann, Henrik [mailto:Henrik.Kinnemann@siemens.com] 
Sent: Tuesday, January 15, 2008 7:38 AM
To: uima-user@incubator.apache.org
Subject: Where can I download an C++ UIMA framework?

Hi all,

where can I download an "C++ UIMA framework"? I only saw the "Java UIMA
framework" for downloading from Apache's web-site.

Best regards,
Henrik

Where can I download an C++ UIMA framework?

Posted by "Kinnemann, Henrik" <He...@siemens.com>.
Hi all,

where can I download an "C++ UIMA framework"? I only saw the "Java UIMA
framework" for downloading from Apache's web-site.

Best regards,
Henrik

Re: question: how to get order of annotations created by previous annotators?

Posted by "SAITO, Isao Isaac" <13...@1995.sfc.ne.jp>.
Eddie,

Your code directly helped my annotator to be completed.
Thank you for enough information!

Isaac

On Jan 16, 2008 4:03 AM, Eddie Epstein <ea...@gmail.com> wrote:
> Hi SAITO,
>
> An iterator created from a UIMA index covers the index type and all derived
> subtypes. So, for example, the iterator created by the code:
>
> Iterator annotIter = aJCas.getAnnotationIndex().iterator();
>
> will return all FS derived from uima.tcas.Annotation. These FS are also
> known as annotionFS or just annotations. The order that FS are returned by
> the iterator will be based on the keys defined for this index: start
> position ascending, end position descending, type priority. In this case,
> the document annotation will always be first because its start position is
> the first character and its end position is the last character.
>
> For your scenario it would be useful to create a single parent type, say
> Fix.type, that PrefixAnnot and SuffixAnnot types derive from. Then an
> iterator for Fix.type would only return the two annotations of interest, in
> document order, with longer annotations returned first in the case of common
> start position.
>
> Regards,
> Eddie
>
>
> On Jan 14, 2008 8:17 PM, SAITO, Isao Isaac <13...@1995.sfc.ne.jp> wrote:
>
> > hi all,
> >
> > I am trying to develop an aggregate analysis engine.
> > The annotator run at the end (called annotator-end) wants to get
> > all annotations created by the previous annotators(annotators-prev),
> > as same order in given document(data that can be acquired by
> > JCas#getDocumentText()).
> > Could anyone tell me how to do this?
> >
> > For example of what I want,
> >  - 2 types of Annotation(PrefixAnnot, SuffixAnnot) are in use
> >  - by annotators-prev, more than 1 annotations are created using
> > Annotation above
> >  - annotator-end wants to get a SuffixAnnot everytime after any
> > PrefixAnnot comes
> >
> > In <code a> shown below, annotation instances can be acquired only
> > with respect to the class and the order is not available as far as I
> > know.
> >
> > Thanks,
> >  Isaac
> >
> > <code a>
> > FSIndex prefixIndex = aJCas.getAnnotationIndex(PrefixAnnot.type);
> > Iterator prefixIter = prefixIndex.iterator();
> > while (prefixIter.hasNext()) {
> >  PrefixAnnot prefix = (PrefixAnnot)prefixIter.next();
> > }
> >
> > FSIndex suffixIndex = aJCas.getAnnotationIndex(SuffixAnnot.type);
> > Iterator suffixIter = suffixIndex.iterator();
> > while (suffixIter.hasNext()) {
> >  SuffixAnnot suffix = (SuffixAnnot)suffixIter.next();
> > }
> > </code a>
> >
>

Re: using multiple PEAR components in dynamically built pipelines

Posted by Michael Baessler <mb...@michael-baessler.de>.
It is also possible to use a pear descriptor as a CasProcessor 
descriptor in a CPE.

-- Michael

Marshall Schor wrote:
> Hi Girish -
>
> As I recall, you can only use a pear descriptor as a delegate of a 
> containing aggregate.  The person who knows the most about this is 
> away this week, so probably the definitive answer will come next week :-)
>
> -Marshall
>
> Chavan, Girish wrote:
>> Hi All,
>>
>> I am trying to build a system where users will be able to build
>> pipelines using any of the installed PEAR components and then save them
>> for later use. From searching the mailing lists it has become apparent
>> that you can use a PEAR component as an analysis engine.
>> Now, Looking at the SimpleRunCPE.java, and SimpleRunCPM.java code I can
>> come up with two strategies to do this...
>>
>> Strategy 1: Create a CPE descriptor file based on the user selections of
>> the PEAR components to be used and then build a CPE using the CPE
>> descriptor similar to how it is done in SimpleRunCPE.
>> My question here is, can you specify a PEAR component descriptor file as
>> a CasProcessor in the CPE descriptor file?
>>
>> Strategy 2: Create an Aggregate Analysis Engine descriptor that has the
>> user selected PEAR components. Then specify that as the Analysis Engine,
>> similar to how it is done in the SimpleRunCPM..java code.
>>
>> Again, can I use the PEAR descriptor file in the same fashion as I would
>> use a TAE descriptor file in an Aggregate AE descriptor?
>>
>> Another alternative is to build the CPE programmatically, and add the
>> PEAR components as CasProcessors programmatically. Basically do what the
>> SImpleRunCPE might be doing behind the curtain
>> (UIMAFramework.produceCollectionProcessingEngine() is a good place to
>> look I presume)
>>
>> However the first two strategies are preferable as I would like the
>> ability for users to build these pipelines in one session and then load
>> and run them later in another session. For that I need to persist their
>> selections in some form, and Id rather use a standard CPE descriptor or
>> Aggregate AE descriptor file rather than introduce my own xml format.
>>
>> I hope I could put my point across clearly. Is anyone doing anything
>> similar? Has anyone used multiple PEAR components in the same pipeline?
>> Any help would be much appreciated.
>>
>> Kind Regards,
>>
>> Girish Chavan
>> Dept. of Biomedical Informatics,
>> University of Pittsburgh
>>
>>
>>
>>   
>


Re: using multiple PEAR components in dynamically built pipelines

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

As I recall, you can only use a pear descriptor as a delegate of a 
containing aggregate.  The person who knows the most about this is away 
this week, so probably the definitive answer will come next week :-)

-Marshall

Chavan, Girish wrote:
> Hi All,
>
> I am trying to build a system where users will be able to build
> pipelines using any of the installed PEAR components and then save them
> for later use. From searching the mailing lists it has become apparent
> that you can use a PEAR component as an analysis engine. 
>
> Now, Looking at the SimpleRunCPE.java, and SimpleRunCPM.java code I can
> come up with two strategies to do this...
>
> Strategy 1: Create a CPE descriptor file based on the user selections of
> the PEAR components to be used and then build a CPE using the CPE
> descriptor similar to how it is done in SimpleRunCPE. 
>
> My question here is, can you specify a PEAR component descriptor file as
> a CasProcessor in the CPE descriptor file?
>
> Strategy 2: Create an Aggregate Analysis Engine descriptor that has the
> user selected PEAR components. Then specify that as the Analysis Engine,
> similar to how it is done in the SimpleRunCPM..java code.
>
> Again, can I use the PEAR descriptor file in the same fashion as I would
> use a TAE descriptor file in an Aggregate AE descriptor?
>
> Another alternative is to build the CPE programmatically, and add the
> PEAR components as CasProcessors programmatically. Basically do what the
> SImpleRunCPE might be doing behind the curtain
> (UIMAFramework.produceCollectionProcessingEngine() is a good place to
> look I presume)
>
> However the first two strategies are preferable as I would like the
> ability for users to build these pipelines in one session and then load
> and run them later in another session. For that I need to persist their
> selections in some form, and Id rather use a standard CPE descriptor or
> Aggregate AE descriptor file rather than introduce my own xml format.
>
> I hope I could put my point across clearly. Is anyone doing anything
> similar? Has anyone used multiple PEAR components in the same pipeline? 
>
> Any help would be much appreciated.
>
> Kind Regards,
>
> Girish Chavan
> Dept. of Biomedical Informatics,
> University of Pittsburgh
>
>
>
>   


using multiple PEAR components in dynamically built pipelines

Posted by "Chavan, Girish" <ch...@upmc.edu>.
Hi All,

I am trying to build a system where users will be able to build
pipelines using any of the installed PEAR components and then save them
for later use. From searching the mailing lists it has become apparent
that you can use a PEAR component as an analysis engine. 

Now, Looking at the SimpleRunCPE.java, and SimpleRunCPM.java code I can
come up with two strategies to do this...

Strategy 1: Create a CPE descriptor file based on the user selections of
the PEAR components to be used and then build a CPE using the CPE
descriptor similar to how it is done in SimpleRunCPE. 

My question here is, can you specify a PEAR component descriptor file as
a CasProcessor in the CPE descriptor file?

Strategy 2: Create an Aggregate Analysis Engine descriptor that has the
user selected PEAR components. Then specify that as the Analysis Engine,
similar to how it is done in the SimpleRunCPM..java code.

Again, can I use the PEAR descriptor file in the same fashion as I would
use a TAE descriptor file in an Aggregate AE descriptor?

Another alternative is to build the CPE programmatically, and add the
PEAR components as CasProcessors programmatically. Basically do what the
SImpleRunCPE might be doing behind the curtain
(UIMAFramework.produceCollectionProcessingEngine() is a good place to
look I presume)

However the first two strategies are preferable as I would like the
ability for users to build these pipelines in one session and then load
and run them later in another session. For that I need to persist their
selections in some form, and Id rather use a standard CPE descriptor or
Aggregate AE descriptor file rather than introduce my own xml format.

I hope I could put my point across clearly. Is anyone doing anything
similar? Has anyone used multiple PEAR components in the same pipeline? 

Any help would be much appreciated.

Kind Regards,

Girish Chavan
Dept. of Biomedical Informatics,
University of Pittsburgh


Re: question: how to get order of annotations created by previous annotators?

Posted by Eddie Epstein <ea...@gmail.com>.
Hi SAITO,

An iterator created from a UIMA index covers the index type and all derived
subtypes. So, for example, the iterator created by the code:

Iterator annotIter = aJCas.getAnnotationIndex().iterator();

will return all FS derived from uima.tcas.Annotation. These FS are also
known as annotionFS or just annotations. The order that FS are returned by
the iterator will be based on the keys defined for this index: start
position ascending, end position descending, type priority. In this case,
the document annotation will always be first because its start position is
the first character and its end position is the last character.

For your scenario it would be useful to create a single parent type, say
Fix.type, that PrefixAnnot and SuffixAnnot types derive from. Then an
iterator for Fix.type would only return the two annotations of interest, in
document order, with longer annotations returned first in the case of common
start position.

Regards,
Eddie

On Jan 14, 2008 8:17 PM, SAITO, Isao Isaac <13...@1995.sfc.ne.jp> wrote:

> hi all,
>
> I am trying to develop an aggregate analysis engine.
> The annotator run at the end (called annotator-end) wants to get
> all annotations created by the previous annotators(annotators-prev),
> as same order in given document(data that can be acquired by
> JCas#getDocumentText()).
> Could anyone tell me how to do this?
>
> For example of what I want,
>  - 2 types of Annotation(PrefixAnnot, SuffixAnnot) are in use
>  - by annotators-prev, more than 1 annotations are created using
> Annotation above
>  - annotator-end wants to get a SuffixAnnot everytime after any
> PrefixAnnot comes
>
> In <code a> shown below, annotation instances can be acquired only
> with respect to the class and the order is not available as far as I
> know.
>
> Thanks,
>  Isaac
>
> <code a>
> FSIndex prefixIndex = aJCas.getAnnotationIndex(PrefixAnnot.type);
> Iterator prefixIter = prefixIndex.iterator();
> while (prefixIter.hasNext()) {
>  PrefixAnnot prefix = (PrefixAnnot)prefixIter.next();
> }
>
> FSIndex suffixIndex = aJCas.getAnnotationIndex(SuffixAnnot.type);
> Iterator suffixIter = suffixIndex.iterator();
> while (suffixIter.hasNext()) {
>  SuffixAnnot suffix = (SuffixAnnot)suffixIter.next();
> }
> </code a>
>