Quick Primer: Machine Learning and Sentiment Analysis
By: Jim Jacisin
Tags: Sentiment Analysis, Machine Learning, Data Science, Data Ethics

Whenever someone takes the time to write out their opinion on a topic, it’s usually pretty easy for a reader to extrapolate the author’s feeling on a matter. Take for instance the following restaurant reviews:

“Terrible. I went here during an astral projection and all I can say was it was the absolute worst. The pizza was NOT good. Employees looked at me as if I were some sort of slime monster that was going to hurt them. Wow. Cannot say that I would recommend going here. 1. Pizza = totes ew 2. Employees =totes rude. So TWO bad tastes in my mouth!!! Talk about hitting two birds with one stone!!!!” “I have driven up at 2 in the morning, and walked in the door at 10 AM and still paid $10 for a 10-piece chicken fingers and a load of fries (I have only been able to finish eating a whole order one time in my life, and that was under extenuating circumstances). Each time, I walk away satisfied body, mind and soul.”

It’s fairly straightforward to conclude that the first review was a generally negative experience, whereas the second experience was a positive one. This kind of observation is a form of sentiment analysis, which aims to determine the attitude regarding some topic (or the overall contextual polarity) of a document.

From a machine learning perspective, we can derive free text sentiment analysis by utilizing NLP and create models to quantify unstructured data, analyze consumer preferences, communicate effectively with a customer base.

Historically Speaking

Dating back to Homer’s Iliad, Agamemnon needed to assess the fighting spirit of his men to see if they were fit for battle. We could consider this “opinion mining” in an ancient context. Around the fifth century BC, Athens assessed public opinion, which is the birth of voting and democracy.

Plutchik’s Wheel of Emotion. Source: Unknown

Fast forward to South Florida in the 1980s, Robert Plutchik and he create a digestible psychoanalytical classification of human emotions otherwise known as Plutchik’s wheel of emotion. He argues for the primacy of these emotions by showing each to be the trigger of behavior with high survival value, such as the way fear inspires the fight-or-flight response. Machine learning researchers have used this wheel as base or target sentiments when performing their analysis.

Machines Learning Sentiment

All of the machine learning algorithms used today have their roots in academia, including Natural Language Processing (or “NLP”).

Example of a Parse Tree. Source: Wikipedia

Before the 1960s, most language analysis used Chomsky’s notion of a universal grammar. In a modern context, academics (and their algorithmic counterparts) have moved forward into more probabilistic modeling of language, sound, images, and the sentiments that can be gained from their interaction.

Visual Sentiment Analysis

According to researchers, 99% of all academic papers about sentiment analysis have been written since 2004. While the academic theories about mass sentiment were known for some time, the ability to test and experiment on those concepts were limited. However, with the advent of the internet, cheaper data storage, and processing power, sentiment analysis has been an academic frontier. Over the recent years, leading edge of the frontier has focused on combining imagine/video data with text and audio known as visual sentiment analysis (or “VSA”).

The challenges for VSA get to the heart of many challenges in the machine learning field today. 1) There is a huge amount of data to analyze. For instance, 300 hours of video are uploaded to YouTube every minute and 95 million photos and videos are shared on Instagram per day, all with a varying supple text and audio to accompany it, if any, which leads to the second point. 2) Classification Scarcity is the idea that despite having so much raw data, being able to classify it into a specific buckets may be difficult if not impossible. Messages or comments that accompany an image or video tend to be short or non-existent (i.e. social media commenting), and when there is a discernible sentiment, the way to interpret the sentiment is constantly changing (i.e. memes).

Another interesting challenge for VSA is the dichotomy between the emotion that an author intends to impart on the viewer versus the viewer’s actual emotion. Consider this: A publisher tags a video or image of a food as “yummy,” viewers are likely to comment “delicious” or “hungry. Studies have shown that given a certain amount of examples of these publisher and viewer reactions to food images, a model will be able better able to predict how a viewer will react to a given image and publisher description.

“A picture is worth a thousand words” - Every visual sentiment analysis paper ever

The logical conclusion for this type of analysis is that we’ll have access to models that will be able to predict a given reaction to any imagine or video with a given publisher description.

VSA Model Example. Source: http://www.ee.columbia.edu/ln/dvmm/publications/14/ICMR-VAC.pdf

However, getting to that conclusion has its challenges. One example is analyzing reaction complexity. Take for instance negative ad hominem political meme or attacks. A creator associated with Group 1 creates a meme that meant to illicit an emotional “gotcha” reaction for its base. This will generally two very distinct and polar opposite reactions:

Agreement from members of Group 1 by “getting one over on Group 2.” Negative reaction by Group 2 who feel unduly attacked by the post

Then the next step is a sort of “meta” reaction that Group 1 can accuse Group 2 of being too sensitive or politically correct.

A specific example of this circumstance is likely very familiar to the reader and won’t be useful to call out here. However, think about specific examples that have happened recently, then imagine a world where a single person or group could create a model that specifically churns out this kind of negative chaos.

This wound up being one of my heavier blog posts, but it’s an interesting topic that has real implications for how we consume media in any modern context, and will require more sophisticated consumer to understand.

Let me know what you think! What about machine learning sentiment analysis interests you? Is there a general ethical framework that this type have analysis can fit into?

** Shout out to my partners Rob Boscacci and Zach Noble who helped put together the Flatiron School Presents presentation that was the basis for this blog.**

**Most of the academic information referenced in this blog were obtained from these two papers: