le nltk.parse.stanford dans nltk3.2.5.NLTK n'a pas pu trouver stanford-parser .jar! Définissez la variable d'environnement CLASSPATH
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 ") fichier" /home/fonttian/anaconda3/lib/python3.6/site- paquets/NLTK/parse/stanford.py "ligne 52, dans à init key = lambda model_path: os.path.dirname (model_path) fichier" /home/fonttian/anaconda3/lib/python3.6/site- paquets /nltk/internals.py ", ligne 716, dans find_jar_iter raise 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>
===============================
S'il vous plaît voir https://stackoverflow.com/q/46734119/610569 – alvas