我正在尝试按照此处的示例通过 NLTK 使用斯坦福解析器。
我遵循示例的前两行(带有必要的导入)
from nltk.parse.corenlp import CoreNLPDependencyParser
dep_parser = CoreNLPDependencyParser(url='http://localhost:9000')
parse, = dep_parser.raw_parse('The quick brown fox jumps over the lazy dog.')
Run Code Online (Sandbox Code Playgroud)
但我收到一条错误消息:
[...] Failed to establish a new connection: [Errno 61] Connection refused"
Run Code Online (Sandbox Code Playgroud)
我意识到尝试连接到作为构造函数输入给出的 url 一定是一个问题。
dep_parser = CoreNLPDependencyParser(url='http://localhost:9000')
Run Code Online (Sandbox Code Playgroud)
如果不是这个,我应该连接到哪个网址?如果这是正确的,问题是什么?