SENTIMENT ANALYSIS
Unit 2, Module 2.6
1
HOW DO COMPUTERS KNOW HOW PEOPLE FEEL?
2
2
NATURAL LANGUAGE PROCESSING
3
MODULE OBJECTIVES
Students should be able to:
4
ACTIVITY: GOOGLE TALK TO BOOKS
REFLECTION: What are some challenges you think search engines run into when trying to understand and answer user’s questions?
5
6
6
Sentiment Analysis With Machine Learning
© AI4ALL, 2019. May be reproduced with permission.
7
7
Sentiment: a view or opinion of something (Oxford)
Sentiment Analysis: a process that a computer performs to measure the positivity or negativity of a text
There are two aspects of sentiment analysis:
Sentiment
© AI4ALL, 2019. May be reproduced with permission.
8
8
Subjectivity
© AI4ALL, 2019. May be reproduced with permission.
9
9
Understanding Check
The subjectivity of each description of the puppy.
0 = Fact
0.5 = somewhat subjective
1 = Entirely Subjective
© AI4ALL, 2019. May be reproduced with permission.
10
10
Polarity
© AI4ALL, 2019. May be reproduced with permission.
11
11
Rate the polarity of each description of the puppy.
-1 = very negative opinion
0 = neutral
1 = very positive opinion
© AI4ALL, 2019. May be reproduced with permission.
Understanding Check
12
12
DISCUSSION
© AI4ALL, 2019. May be reproduced with permission.
13
13
Song Sentiment
© AI4ALL, 2019. May be reproduced with permission.
14
Key:
Sentiment score [-1...1]
Polarity - [positive, negative, neutral], [-1...1]
Magnitude - [0 - infinity]
Volume of sentiment conveyed
Subjectivity - subjective, objective, unknown
Twitter-like content == shorter, unformatted text, slang, missing punctuation
15
15
Try It #1 - Song Sentiment Analysis
Activity Overview
© AI4ALL, 2019. May be reproduced with permission.
STUDENT NAME
Song Title
Artist
16
| Predicted | Actual |
Overall Sentiment Score [-1 to 1] | | |
Polarity [-1 to 1]�Positive, Negative, Neutral | | |
Subjectivity�Subjective, Objective, Unknown | | |
Magnitude [0-infinity] | | |
Use Insert Video to add a quick thumbnail to the song
Make a copy of this slide and complete!
STUDENT NAME
Song Title
Artist
17
| Predicted | Actual |
Overall Sentiment Score [-1 to 1] | Negative [-.25] | |
Polarity [-1 to 1]�Positive, Negative, Neutral | Negative [-.25] | |
Subjectivity�Subjective, Objective, Unknown | Subjective | |
Magnitude intensity [0-infinity] | 1 | |
18
18
DISCUSSION
© AI4ALL, 2019. May be reproduced with permission.
TRY IT #2 - COMPARISON OF SENTIMENT ANALYSIS TOOLS
Try out these three online demos and compare the outputs.
19
Not sure you agreed with the sentiment ratings of the other tool.
Let’s try out some other tools …
Goal: Explore
Ratings of song lyrics
Representations of Sentiment
20
21
STUDENT NAME
Song Title
Artist
22
| | Text2data.com�Free Sentiment Analysis Demo | Watson Tone Analyzer | Monekeylearn.com�Sentiment Analyzer |
| Predicted | Actual | Actual | Actual |
Overall Sentiment Score [-1 to 1] | | | | |
Polarity [-1 to 1]�Positive, Negative, Neutral | | | | |
Subjectivity�Subjective, Objective, Unknown | | | | |
Other representations of sentiment & ratings | | | | |
Agreement with Rating | | | | |
Use Insert Video to add a quick thumbnail to the song
23
23
DISCUSSION
© AI4ALL, 2019. May be reproduced with permission.
24
24
Takeaways
© AI4ALL, 2019. May be reproduced with permission.
APPLICATION ACTIVITY
25
25
CONNECTING TO STUDENTS LIVES
Possible Applications of Sentiment Analysis
26
27
WHAT IS CYBER BULLYING?
DETECTING CYBER BULLYING
28