NER CRF, Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory [duplicate]

蹲街弑〆低调 提交于 2019-12-25 04:44:05

问题


I have downloaded the latest version for NER from this link. Then after extracting it, I have run this command.

java -cp stanford-ner.jar edu.stanford.nlp.ie.crf.CRFClassifier -prop austen.prop

This is not working and getting following exception.

CRFClassifier invoked on Mon Jul 25 06:56:22 EDT 2016 with arguments:
   -prop austen.prop
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at edu.stanford.nlp.io.IOUtils.<clinit>(IOUtils.java:42)
    at edu.stanford.nlp.util.StringUtils.argsToProperties(StringUtils.java:942)
    at edu.stanford.nlp.util.StringUtils.argsToProperties(StringUtils.java:891)
    at edu.stanford.nlp.ie.crf.CRFClassifier.main(CRFClassifier.java:2994)
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:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 4 more

In the folder, stanford-ner-2015-12-09 there is another folder lib, it already contains slf4j libraries but still it is not executing above command. I just downloaded and then extracted files and run that command to make a model but this exception is coming. I will be thankful to you if you can help me.


回答1:


Can you try

UNIX:

java -cp stanford-ner.jar:lib/*:. edu.stanford.nlp.ie.crf.CRFClassifier -prop austen.prop

Windows:

java -cp stanford-ner.jar;lib/*;. edu.stanford.nlp.ie.crf.CRFClassifier -prop austen.prop


来源:https://stackoverflow.com/questions/38566041/ner-crf-exception-in-thread-main-java-lang-noclassdeffounderror-org-slf4j-lo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!