ruleSentimentPolarity {SentimentAnalysis}R Documentation

Sentiment polarity score

Description

Sentiment score defined as the difference between positive and negative word counts divided by the sum of positive and negative words.

Usage

ruleSentimentPolarity(dtm, d)

Arguments

dtm

Document-term matrix

d

Dictionary of type SentimentDictionaryBinary

Details

Given the number of positive words PP and the number of negative words NN. Then, the sentiment ratio is defined as

PNP+N\frac{P-N}{P+N}

. Here, it uses the entries negativeWords and positiveWords of the SentimentDictionaryBinary.

Value

Sentiment score in the range of -1 to 1.


[Package SentimentAnalysis version 1.3-5 Index]