斯坦福 NLP 情绪预测错误;不同于现场演示

Stanford NLP sentiment prediction bug; differs from live demo

我想为以下句子(推文)寻找情绪:

After today's turnaround by #Boeing , the $SPX is heading for the best weekly gain since November led by #tech stocks that are flying!

NLP 情绪预测的一些试验使我得到以下代码:

val pipeline = {
  val props = new Properties()
  props.setProperty("annotators", "tokenize, ssplit, pos, lemma, parse, sentiment")
  props.setProperty("outputFormat", "json")
  new StanfordCoreNLP(props)
}
val text = "After today's turnaround by #Boeing , the $SPX is heading for the best weekly gain since November led by #tech stocks that are flying!"
val annotation: Annotation = pipeline.process(text)
val sentences = annotation.get(classOf[CoreAnnotations.SentencesAnnotation])
pipeline.annotate(annotation)
println(JSONOutputter.jsonPrint(sentences.head.get(classOf[SentimentCoreAnnotations.SentimentAnnotatedTree]))

其中 returns 负面情绪与现场演示的直觉和结果相反 http://nlp.stanford.edu:8080/sentiment/rntnDemo.html(正面的概率为 40%)。

我在这里错过了什么?

Lemmatizer 在典型的 NLP 管道中通常是可选的。必须在管道中有和没有各种组件的情况下进行 extrinsic/intrinsic 评估。尝试删除 lemmatizer 并添加 NER