nltk Stanford Segmenter:NoClassDefFoundError:org / slf4j / LoggerFactory(Windows)

时间:2016-01-19 16:52:25

标签: nltk stanford-nlp

我对此比较陌生。试图让Stanford Segmenter与nltk一起玩得很好并继续遇到这个错误,我还没有能够重新开始。

这是错误:

CRFClassifier invoked on Tue Jan 19 17:39:25 CET 2016 with arguments:
   -sighanCorporaDict C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data -textFile C:\Users\NGBENE\AppData\Local\Temp\tmpmti8l2nb -sighanPostProcessing true -keepAllWhitespaces false -loadClassifier C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/pku.gz -serDictionary C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/dict-chris6.ser.gz -inputEncoding UTF-8
serDictionary=C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/dict-chris6.ser.gz
loadClassifier=C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data/pku.gz
sighanCorporaDict=C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/data
inputEncoding=UTF-8
textFile=C:\Users\AppData\Local\Temp\tmpmti8l2nb
sighanPostProcessing=true
keepAllWhitespaces=false
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

我有python3.4

我重新安装了nltk(当前版本3.1)

我已经添加了slf4j-api.jar的类路径(我需要添加的任何其他.jar?)

import os
javapath = "C:/Users/Documents/DaimText/stanford-segmenter-2015-12-09/slf4j-api.jar"
os.environ['CLASSPATH'] = javapath

仍然无法运作。有什么想法吗?

非常感谢!

更新

卸载:stanford-segmenter-2015-12-09

已安装:stanford-segmenter-2014-08-27

点击此处的测试代码:

http://textminingonline.com/dive-into-nltk-part-vi-add-stanford-word-segmenter-interface-for-python-nltk

作品!

似乎它可能是新版本的问题。

0 个答案:

没有答案