I am trying to run openIE given by stanford nlp using the command specified on the official website: http://nlp.stanford.edu/software/openie.shtml
java -mx1g -cp stanford-openie.jar:stanford-openie-models.jar edu.stanford.nlp.naturalli.OpenIE mytextfile.txt
but I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at edu.stanford.nlp.pipeline.StanfordCoreNLP.<clinit>(StanfordCoreNLP.java:99) at edu.stanford.nlp.naturalli.OpenIE.main(OpenIE.java:679) 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) ... 2 more
Again, when I run java code:
package edu.stanford.nlp.naturalli; import edu.stanford.nlp.ie.util.RelationTriple; import edu.stanford.nlp.ling.CoreAnnotations; import edu.stanford.nlp.pipeline.Annotation; import edu.stanford.nlp.pipeline.StanfordCoreNLP; import edu.stanford.nlp.util.CoreMap; import java.util.Collection; import java.util.List; import java.util.Properties; public class OpenIEDemo { public static void main(String[] args) throws Exception {
I get the following error:
Adding annotator tokenize TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer. Adding annotator ssplit Adding annotator pos Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [0,7 sec]. Adding annotator depparse Loading depparse model file: edu/stanford/nlp/models/parser/nndep/english_UD.gz ... PreComputed 100000, Elapsed Time: 1.159 (s) Initializing dependency parser done [3,5 sec]. Adding annotator natlog Exception in thread "main" java.lang.IllegalArgumentException: annotator "natlog" requires annotator "parse" at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:297) at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:126) at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:122) at stnfrd.OpenIEDemo.main(OpenIEDemo.java:33) /home/ue/.cache/netbeans/8.1/executor-snippets/run.xml:53: Java returned: 1 BUILD FAILED (total time: 4 seconds)
Any help would be appreciated.
source share