AI v/s Sarcasm

In a world dominated by social-media and posts filled with sarcasm, how can AI accurately detect sarcasm?

Sulabh Gupta
Published in
5 min readDec 20, 2020


Source: The Simpsons (TV Series)

AI has become the backbone of everything that we do today. From your personal emails to self-driving cars, AI is ingrained in every technology we use in our day to day life. Over the past few years, I think one of the biggest ways AI capabilities have been leveraged by businesses has been with chatbots and online customer service and this includes support not only on the businesses’ websites but also the social media platforms.

With more people than ever using the social media to interact with customer support, it is virtually impossible for businesses to scale to the demand without relying on the chatbots to assist and redirect the support request to the right queue of sales or support agents. However, cases like the below always made me wonder how AI would deal with sarcasm and the Chandler Bings of the world.

Source: roshansxc (Twitter)

As you can obviously notice above, the bot focused on the words “Thank you” and “Brilliant Service” and responded with a pre-set reply which was not reflective of how the customer felt.

Here is another example of a product review I found on Facebook:

“This is the best T-shirt I have ever bought. It is so good for the first couple of wash and worthy of being reused as a mop after that. Very happy with this multi-purpose T-shirt purchase”.

The sarcasm is pretty evident above but the words: Best, Good, Worthy, wrongly classifies this as a positive review. The problem with businesses is that it is reviews like these that are very popular and become viral on social media and can hurt future sales for a business.

In today’s digital age, more and more people use online channels everyday to interact with businesses and to review products. Detecting sarcasm in reviews, therefore, has become one of the most important use cases of Natural Language Processing.

How researchers are improving AI’s sarcasm detection?

If you want to understand people, especially your customers…then you have to be able to possess a strong capability to analyze text — Paul Hoffman (CTO, Space-Time Insight)

Researchers and scientists have been hard at work to improve the AI capabilities to detect sarcasm which is predominant in the online society today. A couple of years ago, scientists from MIT developed a new AI system that accurately detected sarcasm in tweets 82% of the time. In comparison human volunteers working on the same dataset were accurate 76% of the time.

Last month, researchers from China claimed that they have developed AI systems capable of detecting sarcasm accurately 86% of the time. This may not seem like a big percentage increase but trust me it is a big deal. With more content online than ever, improving the accuracy of these AI systems by even a small amount is very very difficult.

The key to detect sarcasm is to detect incongruity in the text. Here are some of the ways the AI systems are detecting sarcasm:

  1. Use of Contradiction between Image and Text

The sarcasm detecting AI’s focus on contradictions between images and corresponding text. For example, say there is a sarcastic comment including words like “good”, “best” and a corresponding picture of a torn bag. AI can detect such anomaly and guess that the user is being sarcastic.

Well this looks appetizing .. Ubereats (Source: Venturebeat)

2. Hashtags and Text

Hashtags are pretty common in social media posts, especially the ones that relate to a business or product feedback. Any online post that contains some positive comment followed by a hashtag that is negative is a strong sign that the user is being sarcastic with their comment. In the photo above with Indigo airline tweet the hastag #DieIndigo was an obvious indication that the user was being sarcastic.

3. Predictive Analysis of User’s History

If you use Social media, it is not rocket science for modern-day algorithms to detect a pattern of your online activity — what you post, frequency of posts, how you post, your comments on someone else’s post and AI can use all this data to create a pattern of your tendency to use sarcasm. A post from a user who uses sarcasm very frequently has a higher probability of having used sarcasm compared to someone who may not use sarcasm that often.

4. Word Intensity

To enrich its analysis even further, another factor that AI uses for its analysis is the word intensity. For example, there is a difference in the intensity of words like fair, good, great, tremendous, and excellent. Major differences in the spectrum of intensity of the words used is a good indication that sarcasm is being used.

Final Words

While researchers and scientists around the world have been hard at work at solving the AI vs Sarcasm puzzle but it is unrealistic to assume that any further significant improvement in the accuracy of sarcasm detection of these AI systems will happen anytime soon. There are still several use cases that are a coin-toss when it comes to detecting sarcasm. For example, a tweet, “It was lovely to get 5 hours of sleep”, can be interpreted as grateful for someone who doesn’t sleep much or sarcastic for someone who can’t function on less than 8 hours of sleep. The AI to accurately decipher the emotions will need to undersand how many hours of sleep is deemed good for a particular demographic and is normal with the general population.

Another similar example can be a tweet like, “Well that was fun, more cold, snow and ice, please”, can be interpreted as positive or negative depending on the context, and without the body language or facial emotions, it is impossible to predict whether comments like these are sarcastic or not.

Other challenges include language and cultural barriers. The general use of sarcasm in the United States may slightly vary compared to countries like China, Russia, etc.

There is no doubt that AI will continue to evolve and get better at detecting sarcasm in written texts but humans as the most advanced and interesting users of languages will continue to find ways to outwit these fancy modern-day algorithms.



Sulabh Gupta

Technology Enthusiast with a love for Business Strategy.