This works relatively well. However, I would also like to use the English Chunker, and I would expect to be able to add "opennlp.grok.preprocess.chunk.EnglishChunkerME" to mPipeline and get chunked output.
However when I add the chunker, I get the following exception when calling my process method:
java.lang.NullPointerException
at opennlp.common.xml.XmlUtils.replace(XmlUtils.java:90)
at opennlp.grok.preprocess.chunk.ChunkerME.process(ChunkerME.java:124)
at opennlp.common.Pipeline.run(Pipeline.java:110)
Any idea why?
Thanks,
Dan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to use a simple Grok pipeline to do parts of speech tagging of English. To do this I use the following code:
public NLPSingleton()
{
try
{
mPipeline = new Pipeline(new String[] {"opennlp.grok.preprocess.sentdetect.EnglishSentenceDetectorME", "opennlp.grok.preprocess.tokenize.EnglishTokenizerME", "opennlp.grok.preprocess.postag.EnglishPOSTaggerME"});
}
catch (opennlp.common.PipelineException e)
{
System.out.println("Pipeline exception: " +e);
return;
}
}
public NLPDocument process(String input)
{
try
{
return mPipeline.run(input);
}
catch (opennlp.common.PipelineException e)
{
return null;
}
}
This works relatively well. However, I would also like to use the English Chunker, and I would expect to be able to add "opennlp.grok.preprocess.chunk.EnglishChunkerME" to mPipeline and get chunked output.
However when I add the chunker, I get the following exception when calling my process method:
java.lang.NullPointerException
at opennlp.common.xml.XmlUtils.replace(XmlUtils.java:90)
at opennlp.grok.preprocess.chunk.ChunkerME.process(ChunkerME.java:124)
at opennlp.common.Pipeline.run(Pipeline.java:110)
Any idea why?
Thanks,
Dan