You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@uima.apache.org by Neal Lewis <im...@gmail.com> on 2012/03/01 19:42:40 UTC

Developing a PEAR Wrapper

Hello!

I would like to develop a generic PEAR Wrapper application that reads in a
CAS Xmi and populates it with Features from a  PEAR. So, this is what it
will do:

1.input a cas xmi generated by a separate (but static) CPE
2.input a PEAR xmi descriptor after it is installed (or even a whole
PEAR).  The PEAR will not always be the same.
3.run the PEAR's analytics on the cas xmi
4.output an updated cas xmi

I have been able to use the documentAnalyzer in the uima tools to run
PEARs, and that works fine for reading in raw text, the same for the
runAE.sh tool.  However, I run into typing issue when I try to run a cas
xmi, which I believe to be caused by not inputing the initial CPE type
descriptor

Below is I what I'm thinking I will need.  Could anyone comment if they see
some kind of glaring hole, or perhaps a more efficient approach?

1. Type Descriptor from initial CPE
2. The expanded PEAR's descriptor xml
3. A Collection Reader which performs CAS xmi deserialization
4. Something ( another AE ? ) which executes the PEARs analytics
5. Final AE to act as a XMI Writer.


Any input would be much appreciated! Thank you!

Neal

Re: Developing a PEAR Wrapper

Posted by Neal Lewis <im...@gmail.com>.
Okay,  I figured this out.  this implementation was WAY easier than I
though thanks to the awesome API and UIMA documentation.

Essentially, I used the PEAR PackageInstaller() and PackageBrower() to
install the PEAR and pull out it's main descriptor, as done in
    http://uima.apache.org/d/uimaj-2.4.0/references.html#ugr.ref.pear

Get a cas from the AE in the PEAR.

Then I used XmiCasDeserializer.deserialize()  to read into  the cas,
ignoring the type system for now (this is from
examples/src/XmiCollectionReader.java)

This I process the cas with the AE as in
http://uima.apache.org/d/uimaj-2.4.0/tutorials_and_users_guides.html#ugr.tug.application.instantiating_an_ae


This print it out using the XmiCasSerializer()


This works just fine for now, and needs to be modified to with a constantly
running CPE, but I think I'll be fine for now.

Thanks!

Neal

On Thu, Mar 1, 2012 at 10:42 AM, Neal Lewis <im...@gmail.com> wrote:

> Hello!
>
> I would like to develop a generic PEAR Wrapper application that reads in a
> CAS Xmi and populates it with Features from a  PEAR. So, this is what it
> will do:
>
> 1.input a cas xmi generated by a separate (but static) CPE
> 2.input a PEAR xmi descriptor after it is installed (or even a whole
> PEAR).  The PEAR will not always be the same.
> 3.run the PEAR's analytics on the cas xmi
> 4.output an updated cas xmi
>
> I have been able to use the documentAnalyzer in the uima tools to run
> PEARs, and that works fine for reading in raw text, the same for the
> runAE.sh tool.  However, I run into typing issue when I try to run a cas
> xmi, which I believe to be caused by not inputing the initial CPE type
> descriptor
>
> Below is I what I'm thinking I will need.  Could anyone comment if they
> see some kind of glaring hole, or perhaps a more efficient approach?
>
> 1. Type Descriptor from initial CPE
> 2. The expanded PEAR's descriptor xml
> 3. A Collection Reader which performs CAS xmi deserialization
> 4. Something ( another AE ? ) which executes the PEARs analytics
> 5. Final AE to act as a XMI Writer.
>
>
> Any input would be much appreciated! Thank you!
>
> Neal
>
>