NLTK 3.2.3 has a bug

26 views
Skip to first unread message

Clark Scrandis

unread,
May 18, 2017, 10:36:31 AM5/18/17
to nltk-users
I just upgraded nltk from 3.2.2 to 3.2.3 yesterday...and I started to get the following error:

CRFClassifier invoked on Thu May 18 13:08:11 UTC 2017 with arguments:
   -loadClassifier /opt/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz -textFile /tmp/tmpyByxDz -outputFormat slashTags -tokenizerFactory edu.stanford.nlp.process.WhitespaceTokenizer -tokenizerOptions "tokenizeNLs=false" -encoding utf-8
tokenizerFactory=edu.stanford.nlp.process.WhitespaceTokenizer
tokenizerOptions="tokenizeNLs=false"
loadClassifier=/opt/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz
encoding=utf-8
textFile=/tmp/tmpyByxDz
outputFormat=slashTags
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at edu.stanford.nlp.io.IOUtils.<clinit>(IOUtils.java:42)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifier(AbstractSequenceClassifier.java:1484)
at edu.stanford.nlp.ie.AbstractSequenceClassifier.loadClassifierNoExceptions(AbstractSequenceClassifier.java:1497)
at edu.stanford.nlp.ie.crf.CRFClassifier.main(CRFClassifier.java:3015)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more

Java command failed : ['/usr/lib/jvm/default-java/bin/java', '-mx1000m', '-cp', '/opt/stanford-ner-2015-12-09/stanford-ner.jar', 'edu.stanford.nlp.ie.crf.CRFClassifier', '-loadClassifier', '/opt/stanford-ner-2015-12-09/classifiers/english.all.3class.distsim.crf.ser.gz', '-textFile', '/tmp/tmpyByxDz', '-outputFormat', 'slashTags', '-tokenizerFactory', 'edu.stanford.nlp.process.WhitespaceTokenizer', '-tokenizerOptions', '"tokenizeNLs=false"', '-encoding', 'utf-8']

I downgrade nltk back to 3.2.2 and everything works fine.

CLASSPATH is defined as: /opt/stanford-ner-2015-12-09/stanford-ner.jar

I tried extending the CLASSPATH to the following: /opt/stanford-ner-2015-12-09/stanford-ner.jar:/opt/stanford-ner-2015-12-09/lib/*.jar
but it didn't help anything. The only thing that worked was to switch back to nltk 3.2.2

Reply all
Reply to author
Forward
0 new messages