Measuring Emotions by Sentiment Analysis
by Shelly Rathee
DIFFERENT FORMS OF MEASUREMENT
Questionnaires asking
Likes/Dislikes
Facial
Expressions
Sentiment Analysis of
Online WOM
Self Assessment
Mannequin (SAM)
Physiological Customer
Responses Service
Feedback
KEY ISSUES WITH TRADITIONAL METHODS
1. May not work in today’s more rapidly changing world when it
is important for businesses to respond quickly.
2. Do not have the ability to capture people’s true feeling
because you are asking consumers to convert feelings and thoughts
into numeric estimates. E.g. Am I satisfied about 6 or 6.2 with the
product?
3. Traditional surveys might have the issue of non-truthful
responses.
MEASURING CONSUMER EMOTIONS
USING SENTIMENT ANALYSIS
SENTIMENT ANALYSIS
Imagine you introduced a
new KITKAT - Green Tea
Matcha. And you want to
understand whether
customers are happy with
this new product?
Customer sentiment analysis
answers exactly what your
customers think about the
new product.
CUSTOMER REVIEWS
SENTIMENT ANALYSIS: STEPS
1. Through online word of mouth (WOM), you can collect
your brand mentions in the reviews to assess your brand
health in the social space.
2. Preprocess the text data by removing stop words that are
uninformative.
3. Convert the text to an array (quantitative
information).
STEP 1: COLLECTING BRAND MENTIONS IN REVIEWS
I liked KITKAT - Matcha! It is different.
I was disappointed with KITKAT - Matcha, as it tasted very
sweet.
I don’t know why I love KITKAT - Matcha so much. It is
different and new!
…
…
I was displeased to notice how sweet KITKAT - Matcha
was. I was expecting something better.
STEP 2: PRE-PROCESSING
✴The basic unit in any text is an individual word.
✴But not all words are equally informative to the analysis. For
instance, words such as “a” or “the” occur in large numbers in
text data. Removing such words helps remove unhelpful
information.
✴Therefore, we first preprocess text data i.e., common words such
as “the” or “a”, conjunctions such as “and”, “or,” and proper
names.
✴We also remove numbers, punctuations, and white space.
After preprocessing, we are left with unique words such as KITKAT -
Matcha, liked, different, disappointed, taste, love, new, displeased, sweet,
expecting, something, don’t, know, better.
STEP 3: CONVERTING TEXT TO AN ARRAY
UNDERSTANDING TERMINOLOGY
Term - Each unit of word is called term.
Document - Each document is a separate entity or
record. For instance, each review is one document.
Corpus - A corpus is a collection of documents such as
news articles, emails, blogs, tweets on a certain topic,
customer reviews, or books.
STEP 3: CONVERTING TEXT TO AN ARRAY
✴The most common information that can be retrieved from text is to count
the number of times a word appears in a document (review) i.e. its frequency.
This is also called the term frequency (tf).
✴We can then create a table in which the rows can represent each of the
documents and the columns can represent individual words.
KITKAT
DOC - liked disappointed taste different new love something displeased sweet expecting better don’t know
Matcha
1 1 1 0 0 1 0 0 0 0 0 0 0 0 0
2 1 0 1 1 0 0 0 0 0 1 0 0 0 0
3 1 0 0 0 1 1 1 0 0 0 0 0 1 1
… … … … … … … … … … … … … … …
100 1 0 0 0 0 0 0 1 1 1 1 1 0 0
TOTAL 4 1 1 1 2 1 1 1 1 2 1 1 1 1
VISUALIZATION: SENTIMENT ANALYSIS WITH WORD CLOUD
The simplest visualization tool for sentiment analysis is a word cloud.
It is the first step to get an idea of which words appear most frequently and
hence, are most representative of the sentiment in the documents.
ALTERNATIVE TO CLASSIC SENTIMENT ANALYSIS:
DICTIONARY METHOD
DICTIONARY METHOD:
WORDS RELATED TO A SPECIFIC SENTIMENT
✴Use pre-existing lexicon or create dictionary of words.
To create a lexicon, you can come up with words that capture a
specific sentiment e.g. 10 word that capture happiness and 10
words that capture sadness.
✴Convert the text to an array. Count the number of words
related to happiness and the number of words related to sadness
in a review.
STEP 1: LEXICON OR DICTIONARY OF SENTIMENTS
✴First, there are a variety of dictionaries that exist for evaluating the opinion or
emotion.
✴For Instance, In R, tidytext package contains several sentiment lexicons. Three general-
purpose lexicons are
• AFINN from Finn Årup Nielsen,
• bing from Bing Liu and collaborators, and
• nrc from Saif Mohammad and Peter Turney
✴ Second, we can create lexicons to come up with words that capture satisfaction and
dissatisfaction.
HAPPINESS SADNESS
Happy Sad
Satisfied Dissatisfied
Love Hate
Satiated Insatiate
Fulfilled Unfulfilled
Like Dislike
Gratified Disappointed
Pleased Displeased
STEP 2: CONVERTING TEXT TO AN ARRAY
Say, we have 100 reviews and 20 lexicon words then we will end up with a
100 rows and 20 columns document term matrix.
HAPPY SADNESS
I liked KITKAT - Matcha. It is
1 0
different.
I was disappointed with KITKAT -
0 1
Matcha, as it tasted very sweet.
I don’t know why I love KITKAT -
Matcha so much. It is different and 1 0
new!
… … …
I was displeased to notice how
sweet KITKAT - Matcha was. I was 0 1
expecting something better.
TOTAL 60 30
VISUALIZATION: OVERALL SENTIMENT
100%
25%
75%
50% Happiness Sadness
75%
25%
0%
KITKAT - MATCHA
VISUALIZATION: WORD CLOUD
RECAP
➤ What traditional methods are used to measure
consumer emotions?
➤ What are some of the disadvantages of using
traditional methods to measure consumer
emotions?
➤ What tool can be used to measure consumer
emotions, when there is huge data available in the
form of unstructured online text data?
➤ How does Sentiment Analysis work?
“
Any Questions?