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

Import Error when trying to import NLTK module

我正在尝试从以下网站实施选区解析器。
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

导入错误。

使用这个:

from nltk.parse.corenlp import CoreNLPParser

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