亲爱的 Stackoverlow 人群
我设法使用 qdap 极性函数来计算一些博客条目的极性,加载我自己的字典,基于 sentiWS。现在我确实有一个新的情感词典(SePL),它不仅包含单个单词,还包含短语。例如“simply good”,其中“simply”既不是否定词也不是放大器,而是使其更精确。所以我想知道,我是否可以使用 qdap 的极性函数搜索 ngram。
举个例子:
library(qdap)
phrase <- "This is simply the best"
key <- sentiment_frame(c("simply", "best", "simply the best"), "", c(0.1,0.3,0.8))
counts(polarity(phrase, polarity.frame=key))
给出:
all wc polarity pos.words neg.words text.var
1 all 5 0.179 simply, best - This is simply the best
但是,我想得到如下输出:
all wc polarity pos.words neg.words text.var
1 all 5 0.76 simply the best - This is simply the best
任何人都知道如何让它像那样工作?
一切顺利,本