You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@opennlp.apache.org by "RYAN C. CORNIA" <ry...@utah.edu> on 2010/12/09 18:35:29 UTC

Sentence Detector Issue

I'm new to OpenNLP, and am trying to use the Sentence Detector. I am stumped by the following error:

Caused by: java.lang.VerifyError: (class: opennlp/model/GenericModelReader, method: checkModelType signature: ()V) Bad type in putfield/putstatic
at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:35)
at opennlp.tools.util.model.GenericModelSerializer.create(GenericModelSerializer.java:31)
at opennlp.tools.util.model.BaseModel.<init>(BaseModel.java:135)
at opennlp.tools.sentdetect.SentenceModel.<init>(SentenceModel.java:77)

This occurs with the following code:

SentenceModel model = new SentenceModel(new FileInputStream(new File("/Users/ryancornia/Downloads/en-sent.bin")));
sentenceDetector = new SentenceDetectorME(model);

Clearly it is not liking the model, but if I run it from the command line with the same model file, it works fine. I AM running this inside Tomcat, and am wondering if being in a servlet container could be causing an issue? Anyone running inside an app server? Or any other ideas? It seems really odd it runs from the command line with the same model.

-Ryan