microth / PathLSTM

Neural SRL model
71 stars 14 forks source link

Exception in thread "main" java.lang.NoClassDefFoundError: edu/stanford/nlp/process/PTBTokenizer ,Linux ubuntu 16:04 #4

Closed krywykj closed 7 years ago

krywykj commented 7 years ago

Hey microth,

After fixing the previous bugs, I had a new issue.

My command : java -Xmx40g -cp "libs/anna-3.3.jar:target/classes" se.lth.cs.srl.CompletePipeline eng -lemma models/CoNLL2009-ST-English-ALL.anna-3.3.lemmatizer.model -tagger models/CoNLL2009-ST-English-ALL.anna-3.3.postagger.model -parser models/CoNLL2009-ST-English-ALL.anna-3.3.parser.model -srl models/srl-ACL2016-eng.model -tokenize -reranker -externalNNs -test models/text_to_parse.txt

The output :

9.40.461   is2.data.ParametersFloat 121:read ->        read parameters 134217727 not zero 296071
9.40.469   is2.data.Cluster 113:<init> ->              Read cluster with 0 words 
9.40.469   is2.lemmatizer.Lemmatizer 192:readModel ->  Loading data finished. 
9.40.469   is2.lemmatizer.Lemmatizer 194:readModel ->  number of params  134217727
9.40.469   is2.lemmatizer.Lemmatizer 195:readModel ->  number of classes 92
9.44.359   is2.data.ParametersFloat 121:read ->        read parameters 134217727 not zero 1613201
9.44.359   is2.data.Cluster 113:<init> ->              Read cluster with 0 words 
9.44.360   is2.tag.Lexicon 103:<init> ->               Read lexicon with 0 words 
9.44.360   is2.tag.Tagger 141:readModel ->             Loading data finished. 
9.44.462   is2.parser.Parser 188:readModel ->          Reading data started
9.44.518   is2.data.Cluster 113:<init> ->              Read cluster with 0 words 
9.49.103   is2.parser.ParametersFloat 101:read ->      read parameters 134217727 not zero 19957525
9.49.103   is2.parser.Parser 201:readModel ->          parsing -- li size 134217727
9.49.108   is2.parser.Parser 211:readModel ->          Stacking false
9.49.108   is2.parser.Extractor 56:initStat ->         mult  (d4) 
Used parser   class is2.parser.Parser
Creation date 2012.11.02 14:33:53
Training data CoNLL2009-ST-English-ALL.txt.crossannotated
Iterations    10 Used sentences 10000000
Cluster       null
9.49.110   is2.parser.Parser 240:readModel ->          Reading data finnished
9.49.110   is2.parser.Extractor 56:initStat ->         mult  (d4) 
Loading pipeline from models/srl-ACL2016-eng.model
Loading reranker from models/srl-ACL2016-eng.model
Writing corpus to out.txt...
Exception in thread "main" java.lang.NoClassDefFoundError: edu/stanford/nlp/process/PTBTokenizer
    at se.lth.cs.srl.preprocessor.tokenization.StanfordPTBTokenizer.tokenizeplus(StanfordPTBTokenizer.java:35)
    at se.lth.cs.srl.preprocessor.Preprocessor.tokenizeplus(Preprocessor.java:37)
    at se.lth.cs.srl.CompletePipeline.parse(CompletePipeline.java:73)
    at se.lth.cs.srl.CompletePipeline.parseNonSegmentedLineByLine(CompletePipeline.java:165)
    at se.lth.cs.srl.CompletePipeline.main(CompletePipeline.java:138)
Caused by: java.lang.ClassNotFoundException: edu.stanford.nlp.process.PTBTokenizer
    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)
    ... 5 more

Concerning the downloaded files, stanford-corenlp-full-2016-10-31 is unzipped into the libs/ sub-directory.

Best, Julien

microth commented 7 years ago

Don't forget to add the stanford libraries to your classpath (-cp).

Cheers, Michael