with sentimentR
Suppose you are launching an exciting new meme…
meme ranked third best on Reddit
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” |
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 |
Now you do not need to read every comment to know how your meme is performing!
| “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 |
What does this mean for me?
Now, you can convert qualitative data to quantitative data!
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)\cdot valence(T_{i_{valence}}) \]
Very, Slightly, Absolutely, Not, NeverIt was not the case that I had an amazing time at the event bc it was teribl.
Sentiment: 0.1147079 (slightly positive)
Why is this useful?
You can use sentiment analysis to understand nearly any idea, not just positive or negative.
How is this useful?
sentimentr is very easy to use.
library(sentimentr)
texts <- c("I love this meme!", "This is okay.", "Not funny at all.")
sentiment(texts)
Don’t be fooled by simple implmentation – the algorithim behind this package is more sophisticated than several other packages.
Learn more about sentiment analysis at
https://cran.r-project.org/web/packages/sentimentr/sentimentr.pdf
Noah Christensen
noah_christensen1@baylor.edu