原代码
sentence = "Ten of them are yellow, and there are 80% more of those in purple."
output = nlp.parse(sentence)
print(output)
报错
JSONDecodeError: Expecting value: line 1 column 1 (char 0)
参考官方文档(CoreNLP Server - CoreNLP (stanfordnlp.github.io))
CoreNLP command line, except formatted as a JSON object. The POST
data should be percent-encoded (otherwise known as URL encoded). In particular, you shoud esapce a % sign as %25
. (Interfaces calling CoreNLP via the web service should do this escaping for their users.)
代码改为
sentence = "Ten of them are yellow, and there are 80%2