0

I am trying to run this program on Eclipse and it is giving following error:

Loading classifier from E:\corenlp\stanford-ner-2015-01-29\stanford-ner-2015-01-30\classifiers\english.all.3class.distsim.crf.ser.gz ... done [6.8 sec].
Exception in thread "main" java.lang.NoSuchFieldError: wordFunction
    at edu.stanford.nlp.sequences.ObjectBankWrapper.doBasicStuff(ObjectBankWrapper.java:136)
    at edu.stanford.nlp.sequences.ObjectBankWrapper.processDocument(ObjectBankWrapper.java:93)
    at edu.stanford.nlp.sequences.ObjectBankWrapper$WrappedIterator.next(ObjectBankWrapper.java:86)
    at edu.stanford.nlp.sequences.ObjectBankWrapper$WrappedIterator.next(ObjectBankWrapper.java:50)
    at edu.stanford.nlp.ie.AbstractSequenceClassifier.classifyToString(AbstractSequenceClassifier.java:542)
    at edu.stanford.nlp.ie.AbstractSequenceClassifier.classifyToString(AbstractSequenceClassifier.java:588)
    at NERDemo.main(NERDemo.java:87)

For clarity, line 87 is:

    System.out.println(classifier.classifyToString(str));

I am using latest versions of all NLP tools and have included all jar files in Build Path option in Eclipse. What should I do?

Darshil Babel
  • 145
  • 2
  • 13
  • There's likely an issue with your classpath—the demo works fine on a fresh download on my local machine. Can you provide more details about your run environment? What exactly is on your classpath? – Jon Gauthier Feb 04 '15 at 21:31

1 Answers1

0

I was getting same error to execute ParserDemo.java code available in stanford-parser. In order to resolve it, I downloaded the latest parser from here. Extracted zip file into some folder. Then I imported that project into eclipse by following steps:

File -> New -> Project -> Java -> Java project from existing Ant File -> Specify the folder containing build.xml file

I specified stanford-parser-3.4.1-sources.jar and stanford-parser-3.4.1-models.jar using 'Build Path'.

I hope these steps may give some clue about the problem.

kravi
  • 747
  • 1
  • 8
  • 13