本文介绍了NER CRF,线程"main"中的异常java.lang.NoClassDefFoundError:org/slf4j/LoggerFactory的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从链接.然后解压缩后,我运行了此命令.

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

在文件夹 stanford-ner-2015-12-09 中,还有另一个文件夹 lib 它已经包含slf4j库,但仍未执行.我刚刚下载了文件,然后解压缩文件并运行该命令以建立模型,但是这种异常即将到来.如果您能帮助我,我会很感激.

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.

推荐答案

可以尝试

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

这篇关于NER CRF,线程"main"中的异常java.lang.NoClassDefFoundError:org/slf4j/LoggerFactory的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 13:55