Can AI Understand Sarcasm?

Can AI Understand Sarcasm?

Are comedians going to lose their jobs to AI? If so, how do computers know when we’re being sarcastic? Sarcasm was always a big problem for artificial intelligence both in fiction and in real life. A recent research paper published this year suggests a way that can detect sarcasm with a 90 percent accuracy.

Before we move on with the post Can you please sign up for our newsletter? It’s totally cool if you don’t want to but it helps me a lot! Thanks!

Isn’t this old news?

Sarcasm detection is a complex issue in machine learning. It has been done before by two methods. One way to make a sarcasm detector is to annotate your data and write an AI to correlate the annotation with the text. The other way is to deal with the problem with an LLM, which stands for Large Language Model (ChatGPT is a famous example of this.)

The problem with the first method is there simply is not enough annotated data to train a big enough language model, and the second approach is noisy and therefore, really hard to get accurate information out of. The research team in this study published in “AI Open”, came up with a novel way to overcome these problems.

How did they do it?

They took inspiration from another study in Which researchers used both content and context as inputs to determine whether or not some tweets were sarcastic. The team then tweaked the framework used in that study to fit the type of data they had (which we’ll talk about later.) This edition of the framework also was “taught” through a LSTM (Long Short-Term Memory) how to context to the input. The LSTM lets the neural network remember information for a longer amount of time.

To make sure the assigned context was correct, the scientists also assisted the model with some annotated data. Annotated data basically means the text is noted to be sarcastic for example. Speaking of data, the dataset used to train this neural network was gathered from sarcastic and non-sarcastic news headlines. They were kind enough to share what words were most common in this figure:

Take note of the big TRUMP in the middle. I wonder why that is

How is this different than the other methods?

Using this new method the researchers call “hybrid neural network” allows the AI to be more flexible and most importantly, less dependent on annotated data which is harder and more labor-intensive to create. Furthermore, this new model is independent of the author and uses current events and common sense to figure out if a statement is sarcastic or not. It can even detect what part of the sentence is sarcastic. We get an example of that in the article:

For example, in the sentence “majority of nations civic engagement centered around oppressing other people”, our attentive model can emphasize the occurrence of ‘civic engagement’ and ‘oppressing other people’ to classify this sentence as sarcastic.

Rishabh Misra, Prahal Arora

The bottom line

Yes, AI can “understand” sarcasm. That being said, we have to realize that this is just an algorithm to deconstruct and analyze text and nothing more, So it can’t “Understand” as we humans do. This model is still a very powerful and useful tool to try and rectify mis and disinformation which is a growing concern in online communities. The Researchers published the framework and the dataset for public use so if you’re interested you can find out more in the original paper.

Leave a comment