machinalis / iepy

Information Extraction in Python
BSD 3-Clause "New" or "Revised" License
905 stars 186 forks source link

Class not found when trying to start the preprocessor? #146

Open Broham opened 6 years ago

Broham commented 6 years ago

I've been following along on the tutorial here: http://iepy.readthedocs.io/en/latest/tutorial.html

Everything seemed to be going fine, but when I tried to run the preprocessor:

python bin/preprocess.py

I got the error:

Loading StanfordCoreNLP...
Error running '/Users/abemiessler/Library/Application Support/iepy/stanford-corenlp-full-2015-04-20/corenlp.sh -outputFormat xml -threads 4 -annotators tokenize,ssplit,pos,lemma,ner,parse,dcoref'
Output was: 'b'usage: dirname path\n/usr/bin/java -mx3g -cp "/*" edu.stanford.nlp.pipeline.StanfordCoreNLP -outputFormat xml -threads 4 -annotators tokenize,ssplit,pos,lemma,ner,parse,dcoref\nError: Could not find or load main class edu.stanford.nlp.pipeline.StanfordCoreNLP\n''

I checked and made sure that my java path was set correctly and everything. I confirmed that the StanfordCore NLP is installed (it's at this path: ~/Library/Application Support/iepy/stanford-corenlp-full-2015-04-20 if that matters)

Why would it not be finding the class above?

nilutz commented 5 years ago

This is a hack that solves the problem.

The stanfordnlp library is called via JAVAHOME -mx3g -cp "$scriptdir/*" edu.stanford.nlp.pipeline.StanfordCoreNLP. At least on my mac with Mojave 10.14.3 this leads to the command:

path\n/usr/bin/java -mx3g -cp **"/*"** edu.stanford.nlp.pipeline.StanfordCoreNLP

The "/" part doesn't exists as a command. If you want to it get to work you can edit the source file. E.g.: Go into ~/Library/Application Support/iepy/stanford-corenlp-full-2015-04-20/corenlp.sh and switch: `"$scriptdir/"to"*"`.