You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by Andreas Niekler <an...@informatik.uni-leipzig.de> on 2012/08/14 13:33:43 UTC
UIMA CAS Consumer
Hello,
i'm working on a MongoDB Cas Cosumer which consumes the openNLP CAS
Documents. Right now i'm having problems to correctly initialize the
TypeSystem. The following does not work. I bet this is because i do not
rely on the Annotators anymore and just want to grab the annotations.
But how can i address the types in a CAS_Consumer the right way using
the uima openNLP tools?
String sentenceTypeName =
CasConsumerUtil.getRequiredStringParameter(getUimaContext(),
UimaUtil.SENTENCE_TYPE_PARAMETER);
String tokenTypeName =
CasConsumerUtil.getRequiredStringParameter(getUimaContext(),
UimaUtil.TOKEN_TYPE_PARAMETER);
mSentenceType = CasConsumerUtil.getType(typeSystem, sentenceTypeName);
mTokenType = CasConsumerUtil.getType(typeSystem, tokenTypeName);
--
Andreas Niekler, Dipl. Ing. (FH)
NLP Group | Department of Computer Science
University of Leipzig
Johannisgasse 26 | 04103 Leipzig
mail: aniekler@informatik.uni-leipzig.deg.de
multiple Sofa's in UIMA CAS
Posted by Andreas Niekler <an...@informatik.uni-leipzig.de>.
Hello,
i wonder if it is possible to define multiple sofa's in a UIMA
Collection Reader and pass those differnt contents to the sentence
annotator. Will there be a sentence annotation for each sofa or does
openNLP UIMA automatically choose the first sofa in the data?
Thank you
Andreas
Re: UIMA CAS Consumer
Posted by Jörn Kottmann <ko...@gmail.com>.
On 08/14/2012 02:11 PM, Andreas Niekler wrote:
> That helped a lot. Thank you. Is there a better documentation for such
> problems somewhere?
No we don't really have documentation for the UIMA integration, you are
welcome to contribute a chapter
about it to our manual.
Jörn
Re: UIMA CAS Consumer
Posted by Andreas Niekler <an...@informatik.uni-leipzig.de>.
That helped a lot. Thank you. Is there a better documentation for such
problems somewhere?
Am 14.08.2012 14:00, schrieb Jörn Kottmann:
> On 08/14/2012 01:49 PM, Andreas Niekler wrote:
>> Hello,
>>
>>> - You did not specify the type parameters in your xml descriptor
>> The descriptor for the consumer contains the reference to the type
>> system. Note that this i a CasConsumer_ImplBase Class not an annotator.
>
> The type parameters are not specified in your descriptor. Have a look at
> the OpenNLP sample descriptors,
> its done there in most of them (e.g. Person Name Finder).
>
> Jörn
>
--
Andreas Niekler, Dipl. Ing. (FH)
NLP Group | Department of Computer Science
University of Leipzig
Johannisgasse 26 | 04103 Leipzig
mail: aniekler@informatik.uni-leipzig.deg.de
Re: UIMA CAS Consumer
Posted by Jörn Kottmann <ko...@gmail.com>.
On 08/14/2012 01:49 PM, Andreas Niekler wrote:
> Hello,
>
>> - You did not specify the type parameters in your xml descriptor
> The descriptor for the consumer contains the reference to the type
> system. Note that this i a CasConsumer_ImplBase Class not an annotator.
The type parameters are not specified in your descriptor. Have a look at
the OpenNLP sample descriptors,
its done there in most of them (e.g. Person Name Finder).
Jörn
Re: UIMA CAS Consumer
Posted by Andreas Niekler <an...@informatik.uni-leipzig.de>.
Hello,
> - You did not specify the type parameters in your xml descriptor
The descriptor for the consumer contains the reference to the type
system. Note that this i a CasConsumer_ImplBase Class not an annotator.
> - Your type system does not contain the types you want to retrieve
I appended the xml descriptor for my consumer. I hope that this helps to
spot the problem.
Thank you
--
Andreas Niekler, Dipl. Ing. (FH)
NLP Group | Department of Computer Science
University of Leipzig
Johannisgasse 26 | 04103 Leipzig
mail: aniekler@informatik.uni-leipzig.deg.de
Re: UIMA CAS Consumer
Posted by Jörn Kottmann <ko...@gmail.com>.
Hello,
that should work. What is the error you get?
The usual suspects are these:
- You did not specify the type parameters in your xml descriptor
- Your type system does not contain the types you want to retrieve
Hope that helps,
Jörn
On 08/14/2012 01:33 PM, Andreas Niekler wrote:
> Hello,
>
> i'm working on a MongoDB Cas Cosumer which consumes the openNLP CAS
> Documents. Right now i'm having problems to correctly initialize the
> TypeSystem. The following does not work. I bet this is because i do
> not rely on the Annotators anymore and just want to grab the
> annotations. But how can i address the types in a CAS_Consumer the
> right way using the uima openNLP tools?
>
> String sentenceTypeName =
> CasConsumerUtil.getRequiredStringParameter(getUimaContext(),
> UimaUtil.SENTENCE_TYPE_PARAMETER);
>
> String tokenTypeName =
> CasConsumerUtil.getRequiredStringParameter(getUimaContext(),
> UimaUtil.TOKEN_TYPE_PARAMETER);
>
> mSentenceType = CasConsumerUtil.getType(typeSystem,
> sentenceTypeName);
>
> mTokenType = CasConsumerUtil.getType(typeSystem, tokenTypeName);