This article explains how CX Index calculates the sentiment score for open ended comments (verbatims) collected from a survey or another data source. The calculation uses the VADER lexicon tool.
Process steps
- The verbatim (open ended comment) is collected from the survey or other data source.
- The verbatim is processed by the sentiment tool.
- The tool applies industry standard VADER sentiment analysis.
- The score falls on a scale from -5 to 5.
- A positive sentiment produces a score greater than 0.
- A negative sentiment produces a score less than 0.
Lexicon and rule based sentiment analysis
VADER (Valence Aware Dictionary and sEntiment Reasoner) is a lexicon and rule based sentiment analysis tool. It is tuned for social media and open text. It is fully open source and released under the MIT licence.
- Technical overview: https://github.com/cjhutto/vaderSentiment
- Theoretical overview of application: https://blog.quantinsti.com/vader-sentiment/
VADER considers two properties of each word:
- Polarity: whether the sentiment is positive or negative
- Intensity: how strongly positive or negative the sentiment is
Valence scoring
VADER assigns each word a valence score that reflects its intensity. The table below shows example valence scores for context free words (words taken out of their surrounding text).
| Word | Valence score |
|---|---|
| okay | 0.9 |
| good | 1.9 |
| great | 3.1 |
| horrible | -2.5 |
| :( | -2.2 |
| sucks, sux | -1.5 |
The positive, negative and neutral proportions reflect only the raw categorisation of each lexical item (such as words, initialisms, emoticons and emojis). They do not include VADER's rule based enhancements, which are:
- word order sensitivity for multi word phrases with sentiment
- degree modifiers
- word shape amplifiers
- punctuation amplifiers
- negation polarity switches
- contrastive conjunction sensitivity
How VADER calculates the valence score of an input sentence
VADER applies rules that account for how each part of a sentence affects the intensity of the overall sentiment. It uses five heuristics.
- Punctuation: Exclamation points increase intensity without changing orientation. For example, "The weather is hot!!!" is more intense than "The weather is hot."
- Capitalisation: Writing a sentiment relevant word in ALL CAPS, when other words are not capitalised, increases intensity without changing orientation. For example, "The weather is HOT." is more intense than "The weather is hot."
- Degree modifiers: Intensifiers, booster words or degree adverbs increase or decrease intensity. For example, "extremely hot" is more intense than "hot", while "slightly hot" is less intense.
- Polarity shift from conjunctions: The contrastive conjunction "but" shifts polarity, and the text after it dominates. For example, "The weather is hot, but it is bearable." has mixed sentiment, and the second half determines the overall rating.
- Catching polarity negation: Examining the three items immediately before a sentiment laden word catches nearly 90% of cases where negation flips polarity.
In short, details matter
- Punctuation: The number of exclamation marks, if any, affects the score.
- Emoticons and emojis: VADER recognises these, along with common slang such as "meh" and "bleh".
- Capitals: Words written in full capitals are scored differently.
Sentences that look nearly identical can receive different scores if their punctuation or emphasis differs.
Still stuck? Email support@cxindex.com and the team will help.
