我想为下面这句话(推特)找到一种感情:
在波音公司今天的扭亏为盈之后,$SPX正朝着自去年11月以来最好的每周上涨的方向前进,这是在飞着的#科技股的引领下!
一些对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%的概率)。
我在这里错过了什么?
发布于 2019-03-21 13:57:52
在典型的NLP管道中,Lemmatizer通常是可选的。一个人必须做外在的/内在的评估,有和没有不同的组成部分在管道中。试着滴柠檬汁和添加纳。
https://stackoverflow.com/questions/55263332
复制相似问题