Menu

NullPointerException with sentence detection

Help
2003-04-16
2003-09-18
  • J. McConnell

    J. McConnell - 2003-04-16

    I am trying to run the EnglishSentenceDetectorME and am always getting a NullPointerException.

    I am using the command line from the javadocs:

    java opennlp.grok.preprocess.sentdetect.EnglishSentenceDetectorME "First sentence. Second sentence? Here is another one. And so on and so forth - you get the idea."

    This always results in the following stack trace:

    Exception in thread "main" java.lang.NullPointerException
            at java.util.zip.InflaterInputStream.<init>(InflaterInputStream.java:66)
            at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:56)
            at java.util.zip.GZIPInputStream.<init>(GZIPInputStream.java:68)
            at opennlp.grok.preprocess.sentdetect.EnglishSentenceDetectorME.getModel(EnglishSentenceDetectorME.java:47)
            at opennlp.grok.preprocess.sentdetect.EnglishSentenceDetectorME.<init>(EnglishSentenceDetectorME.java:42)
            at opennlp.grok.preprocess.sentdetect.EnglishSentenceDetectorME.main(EnglishSentenceDetectorME.java:61)

    Does anyone know what could be wrong?  I would really appreciate some help and am excited to begin using this software.

    Thanks,

    J.

     
    • Jason Baldridge

      Jason Baldridge - 2003-09-18

      Looks like the maxent models aren't in your classpath. Make sure that you have ${GROK_HOME}/src/java in your classpath, and it should work out.

      Having said that, you should check out the code in opennlp.sentdetect, where this package is currently being maintained. See:

      http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/opennlp/opennlp/src/java/opennlp/sentdetect/

      Sorry to have taken so long to respond --- seem to have missed your message since I haven't been monitoring the forums closely lately.

      Jason

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.