我想找到以下句子的情绪(推文):
在#Boeing今天的转变之后,$ SPX正在迎来11月以来最好的每周涨幅,这是由正在飞行的#tech股票引领的!
一些试验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]))
返回负面情绪与现实演示http://nlp.stanford.edu:8080/sentiment/rntnDemo.html的直觉和结果相反(正面有40%的概率)。
我在这里错过了什么?
Lemmatizer在典型的NLP管道中通常是可选的。人们必须在管道中使用和不使用各种组件进行外在/内在评估。尝试删除lemmatizer并添加NER