SentimentDictionaryWeighted | R Documentation |
This routine creates a new object of type SentimentDictionaryWeighted
that
contains a number of words, each linked to a continuous score (i.e. weight) for
specifying its polarity. The scores can later be interpreted as a linear model
SentimentDictionaryWeighted(
words,
scores,
idf = rep(1, length(words)),
intercept = 0
)
words |
is collection (vector) of different words as strings |
scores |
are the corresponding scores or weights denoting the word's polarity |
idf |
provide further details on the frequency of words in the corpus as an additional source for normalization |
intercept |
is an optional parameter for shifting the zero level (default: 0) |
Returns a new object of type SentimentDictionaryWordlist
The intercept is useful when the mean or median of a response variable is not exactly located at zero. For instance, stock market returns have slight positive bias.
Pr\"ollochs and Feuerriegel (2018). Statistical inferences for Polarity Identification in Natural Language, PloS One 13(12).
SentimentDictionary
# generate dictionary (based on linear model)
d <- SentimentDictionaryWeighted(c("increase", "decrease", "exit"),
c(+1, -1, -10),
rep(NA, 3))
summary(d)
# alternative call
d <- SentimentDictionaryWeighted(c("increase", "decrease", "exit"),
c(+1, -1, -10))
summary(d)
# alternative call
d <- SentimentDictionary(c("increase", "decrease", "exit"),
c(+1, -1, -10),
rep(NA, 3))
summary(d)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.