Skip to content

Sentiment analysis

Anne Schumacher edited this page Jul 11, 2018 · 1 revision

How the sentiment analysis works

The sentimentclass is derived from the polarity label in the (checked/corrected) sensaldo-base model. If you hover over the class labels in the result table you get the polarity score. If a token has several senses Sparv calculates a weighted mean value from the different polarity scores and the sense probabilities (which we get from Richard's word sense disambiguation tool, Sparv wsd).

For a token x with i different senses the polarity score is calculated as follows:

polarityscore(x) = big_sum( polarityscore_i * p(sense_i))

If the different meanings occur with different sentiment labels then the calculated score is rounded to the closest integer and the label is derived from it (-1: "negative", 0: "neutral", 1: "positive").

If you use Sparv's API rather than the interface you will get the sentiment score and the label in different annotations (e.g. sentiment="0.019892" sentimentclass="neutral"). You can even choose to show the score in the interface (instead of the label) by deselecting the attribute "sentimentclass" in the advanced settings before hitting the run-button.

Clone this wiki locally