Scroll through Twitter and you’ll find plenty of sarcastic comments—not to mention lots of cases where sarcasm apparently went straight over someone’s head.
Luckily, an algorithm MIT researchers developed to analyze tweets can now detect sarcasm, and emotional subtext in general, better than most people.
Detecting the sentiment of social-media posts is already useful for tracking attitudes toward brands and products, and for identifying signals that might indicate trends in the financial markets. But more accurately discerning the meaning of tweets and comments could help computers automatically spot and quash abuse and hate speech online. A deeper understanding of Twitter should also help academics understand how information and influence flows through the network. What’s more, as machines become smarter, the ability to sense emotion could become an important feature of human-to-machine communication.
The researchers originally aimed to develop a system capable of detecting racist posts on Twitter. But they soon realized that the meaning of many messages couldn’t be properly understood without some understanding of sarcasm.
The algorithm uses deep learning, a popular machine-learning technique that relies on training a very large simulated neural network to recognize subtle patterns using a large amount of data. The secret to training this algorithm was that many tweets already use something like a labeling system for emotional content: emoji. Having taken advantage of this to help the system read tweets for emotion in general, the researchers were then able to teach it to recognize sarcasm.