Sentiment Analysis

with natural language processing

Noah Christensen

The Problem

Suppose you are launching an exciting new meme…

meme ranked third best on Reddit

The Problem

  • Your only source of feedback is thousands of comments.

  • How do you turn this into workable data?

“This is hilarious!”
“Made me laugh out loud”
“Not bad”
“Meh”
“I don’t get it”
“Could be better”

The Solution

Sentiment Analysis

Natural language processing enables the vectorization of arbitrary text.

“This is hilarious!” Good
“Made me laugh out loud” Good
“Not bad” Neutral
“Meh” Bad
“I don’t get it” Bad
“Could be better” Neutral

The Solution

Outcome

  • Objective
  • Systemic
  • Automated

Now you do not need to read every comment to know how your meme is performing!

Sentiment Analysis

Vectorization

  • Computers do not process in good, neutral, and bad.
  • Sentiment Analysis assigns a decimal to each statement.
“This is hilarious!” Good 0.90
“Made me laugh out loud” Good 0.50
“Not bad” Neutral 0.21
“Meh” Bad -0.65
“I don’t get it” Bad -0.55
“Could be better” Neutral -0.17

Sentiment Analysis

Vectorization

What does this mean for me?

Now, you can convert qualitative data to quantitative data!

  • Objective data based on established standards
  • Consistency throughout implementation
  • Little room for researcher bias

Sentiment Analysis

Expanding beyond sentiment

At its core, sentiment analysis uses large dictionaries of words and their weights.

“excellent” 1.0
“awful” -1.0

\[ Sentiment(T) = \sum_{i=1}^{T_{length}}weight(T_i) \]

Sentiment Analysis

Expanding beyond sentiment


Why is this useful?

You can use sentiment analysis to understand nearly any idea, not just positive or negative.

Applications

How is this useful?

  • Many companies use sentiment analysis to process customer feedback.
    • Customer surveys
    • Product reviews
    • Etc.
  • Political campaigns
  • Finance and stocks (This library has built-in bindings for finance)

Applications

Getting started with code


SentimentAnalysis is very easy to use.


library(SentimentAnalysis)
texts <- c("I love this meme!", "This is okay.", "Not funny at all.")
analyzeSentiment(texts)


This code produces a sentiment value for all three statements.

Sentiment Analysis

Learn more about sentiment analysis at

https://cran.r-project.org/web/packages/SentimentAnalysis/



Presenter

Noah Christensen

noah_christensen1@baylor.edu