R 3.4.3, using qdap::polarity()
, I'm wondering if there is a way to have an amplifier apply to a negated word instead of the actual word itself. In the example below, "love" is the positive word, "didn't" is the negation word, and "definitely" is the amplification word. I want to have phrase "a" have a more negative polarity score, but it appears "definitely" is amplifying "love" and not "didn't love".
library(qdap)
text <- c("definitely didn't love", "didn't love", "love")
phrase <- c("a", "b", "c")
df <- data.frame(phrase, text)
polarity(df$text, df$phrase)
phrase total.sentences total.words ave.polarity sd.polarity stan.mean.polarity
1 a 1 3 -0.115 NA NA
2 b 1 2 -0.707 NA NA
3 c 1 1 1.000 NA NA
Thanks in advance, -jt
This is not the way qdqp::polarity
works. The valence words can amplify, deamplify, or negate/reverse the tagged polarized word only. For example, the phrase "definitely didn't love" from the question above contains <amplifier> <negator> <polarized word>
.
The negator "didn't", reverses the positively polarized word "love".
The amplifier "definitely" amplifies the positive polarized word "love". It does not amplify the negated "didn't love".