Dear Stackoverlow crowd
I managed to use the qdap polarity function to calculate the polarity of some blog entries, loading my own dictionary, based on sentiWS. Now I do have a new sentiment dictionary (SePL) which not only contains single words, but as well phrases. For example "simply good", where "simply" is neither a negator nor an amplifier, but makes it more precise. So i was wondering, wether I could search for ngrams using the polarity function of qdap.
As an example:
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))
gives:
all wc polarity pos.words neg.words text.var
1 all 5 0.179 simply, best - This is simply the best
However, I would like to get an output like:
all wc polarity pos.words neg.words text.var
1 all 5 0.76 simply the best - This is simply the best
Anyone an Idea how to get that working like that?
All the best, Ben