die nltk.parse.stanford in nltk3.2.5.NLTK konnte den Stanford-Parser .jar nicht finden! Setzen Sie die CLASSPATH-Umgebungsvariable
from nltk.parse.stanford import *
# CoreNLPServer = CoreNLPServer(path_to_jar="/home/fonttian/NLP/stanford/")
# dep_parser=StanfordDependencyParser(model_path="/home/fonttian/NLP/stanford/stanford-chinese-corenlp-2017-06-09-models/edu/stanford/nlp/models/lexparser/chinesePCFG.ser.gz")
====>
dep_parser=StanfordDependencyParser(model_path="edu/stanford/nlp/models
/lexparser/chinesePCFG.ser.gz ") File" /home/fonttian/anaconda3/lib/python3.6/site- packages/nltk/parse/stanford.py "Zeile 52, in Schlüssel init = Lambda model_path: os.path.dirname (model_path) File" /home/fonttian/anaconda3/lib/python3.6/site- Pakete /nltk/internals.py ", Zeile 716, in find_jar_iter erhöhe Looku pError ('\ n \ n% s \ n% s \ n% s' % (div, msg, div)) LookupError:
============================
NLTK was unable to find stanford-parser\.jar! Set the CLASSPATH
environment variable.
For more information, on stanford-parser\.jar, see:
<https://nlp.stanford.edu/software/lex-parser.shtml>
===============================
Bitte sehen https://stackoverflow.com/q/46734119/610569 – alvas