Main Content

Sentiment scores with ratio rule

Use `ratioSentimentScores`

to evaluate sentiment in tokenized
text with a ratio rule. The `ratioSentimentScores`

function, by default,
uses the VADER sentiment lexicon.

returns sentiment scores for tokenized documents based on the ratio of positive and negative
tokens. For each document where the ratio of the positive score to negative score is larger
than 1, the function returns 1. For each document where the ratio of the negative score to
positive score is larger than 1, the function returns -1. Otherwise, the function returns
0.`compoundScores`

= ratioSentimentScores(`documents`

)

`[`

also returns the sums of the positive and negative token scores of the documents
respectively.`compoundScores`

,`positiveScores`

,`negativeScores`

] = ratioSentimentScores(`documents`

)

`___ = ratioSentimentScores(___,`

specifies additional options using one or more name-value pairs.`Name,Value`

)