Share

The OpenNLP Grok Library

The forum address has changed, you have been automatically redirected. Please update any bookmarks to use the new URL.

Subscribe

Problems using EnglishChunkerME

You are viewing a single message from this topic. View all messages.

  1. 2004-01-08 02:16:54 UTC
    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
< Previous | 1 | Next >

Add a Reply

This forum does not allow anonymous participation.

Log in to add a reply. Not registered? Create an account to participate and receive email updates when replies are posted to this topic.