I want to use Stanford parser with python in nltk package, it works well on pos tagger and NER tagger, but when it comes to parser, it do not work. here is the codes:
import nltk
from nltk.parse import stanford
import os
from nltk.parse import stanford
os.environ['CLASSPATH'] = '/Users/caoyue/PycharmProjects/iepy_/jars'
os.environ['STANFORD_MODELS'] = '/Users/caoyue/PycharmProjects/iepy_/jars'
from nltk.tag.stanford import StanfordPOSTagger
st = StanfordPOSTagger('english-left3words-distsim.tagger')
a=st.tag('What is the airspeed of an unladen swallow ?'.split())
print(a)
from nltk.tag import StanfordNERTagger
st = StanfordNERTagger('english.all.3class.distsim.crf.ser.gz')
b=st.tag('Rami Eid is studying at Stony Brook University in NY'.split())
print(b)
from nltk.parse.stanford import StanfordDependencyParser
dep_parser=StanfordDependencyParser(model_path="/Users/caoyue/PycharmProjects/iepy_/jars/english.all.3class.distsim.crf.ser.gz ")
list(dep_parser.raw_parse("the quick brown fox jumps over the lazy dog"))
And the error is :
I think that the model_path is wrong,how do I set it to be correct?