所以我不得不推动SentimentPipeline的错误修复。
如果您从GitHub获取最新代码并使用该版本: https://github.com/stanfordnlp/CoreNLP
你可以发出这个命令:
java -Xmx8g edu.stanford.nlp.sentiment.SentimentPipeline -file example-sentences.txt -output PENNTREES
你会得到这样的输出:
I really liked the movie. (3 (2 I) (3 (2 really) (3 (3 (3 liked) (2 (2 the) (2 movie))) (2 .)))) I hated the movie. (1 (2 I) (1 (1 (1 hated) (2 (2 the) (2 movie))) (2 .)))