尝试导入NLTK模块时出现导入错误

时间:2019-11-24 15:09:49

标签: python nltk

我正在尝试从以下网站实现选区解析器。
https://bbengfort.github.io/snippets/2018/06/22/corenlp-nltk-parses.html

from nltk.parse.corenlpnltk.pa import CoreNLPParser

当我尝试上述步骤时,出现此错误。

Traceback (most recent call last): File "3main.py", line 2, in <module> from nltk.parse.corenlpnltk.pa import CoreNLPParser ImportError: No module named corenlpnltk.pa

1 个答案:

答案 0 :(得分:0)

导入错误。

使用此功能:

from nltk.parse.corenlp import CoreNLPParser

参考:https://www.nltk.org/_modules/nltk/parse/corenlp.html