Detecting Sarcasm With AI

Detecting Sarcasm with Artificial Intelligence

January 7, 2022

They said sarcasm is simple. Yeah, right. Despite being widespread and present in multiple languages and communication styles, cognitively speaking, sarcasm is perhaps one of the most complex forms of human expression – and one of the hardest to teach to the AI model. Yet, researchers have been actively studying the nuances of communication – and how sarcasm could be used in a playful manner or sometimes to pass out mean or aggressive comments. Detecting sarcasm with Artificial Intelligence requires the algorithms to spot irony and deliberate falsehoods by looking for hidden relationships between words. In fact, both creating and comprehending sarcasm can get quite intricate as it involves understanding the difference between the literal and intended meaning of a statement. Furthermore, it often involves the introduction of novelty and humor, as well as incredibly intricate thought processes. But that’s not it, a sarcastic remark depends not only on what is said but also on the tone of the voice, gestures, and the expression of the person who makes the remark. However, as written communication is increasing across a pandemic-hit world, people are expressing their sarcasm in text such as through social media posts. This can be hard for humans, and even harder for machines to interpret. 


However, despite the hurdles, Computer Science researchers from the University of Central Florida have developed a model that can detect sarcasm in social media posts. 

Detecting Sarcasm in Social Media Posts

In today’s world, social media has become an essential platform for marketing and selling products and services. Understanding customer feedback on Twitter, Facebook, and other social media platforms are extremely important for a company’s success, but it is also time-consuming. However, sentiment analysis can be used to determine whether a piece of the text indicates positive, negative, or neutral sentiments. 

But why does it matter? Studies have shown that sarcasm is more engaging and more influential than other negative responses on social media platforms. Therefore, this is an area where companies who are committed to the customer experience should pay close attention to. Many businesses leverage sentiment analysis to monitor their customers’ feedback and understand their needs from textual data. This helps businesses gauge brand reputation and improve their products and/or services.   

The researchers at UCF developed a model capable of detecting sarcasm in social media posts. The findings of the study were recently published in the journal Entropy. The team taught the AI model how to pick out patterns that indicate sarcasm and identify cues that appear in sequences similar to sarcasm. The model was fed with large amounts of data to recognize the prominent patterns. Ivan Garibay, Associate Professor of Engineering at University of Central Florida, stated:

“The presence of sarcasm in the text is the main hindrance in the performance of sentiment analysis. Sarcasm isn’t always easy to identify in conversation, so you can imagine it’s pretty challenging for a computer program to do it and do it well. We developed an interpretable deep learning model using multi-head self-attention and gated recurrent units. The multi-head self-attention module aids in identifying crucial sarcastic cue-words from the input, and the recurrent units learn long-range dependencies between these cue-words to better classify the input text.”

Garibay and his colleague Ramya Akula examined Twitter posts, Reddit discussions, and headlines from The Onion to map out how certain keywords relate to others. They said:

“For instance, words such as ‘just’, ‘again’, ‘totally’, ‘!’, have darker edges connecting them with every other word in a sentence. These are the words in the sentence that hint at sarcasm and, as expected, these receive higher attention than others.”

Using the concept of self-attention architecture, researchers trained complex artificial neural networks to give extra weight to certain words which are often used in sarcastic speech. 

The model achieved a nearly “perfect sarcasm detection score” on the Twitter dataset. The press release also noted that the model is easy to interpret, meaning outputs are more easily explained. 

There has been a long history of researchers attempting to detect sarcasm in short pieces of text, such as social media posts, using machine learning or artificial intelligence. This method, however, improves on previous efforts that relied on training algorithms that looked for too many very specific cues handpicked by the researchers, like words that suggested specific emotions or emojis. This made the algorithm miss many sarcastic instances that didn’t fit the criteria.

Garibay stated that while the other methods leveraged neural networks to find hidden relationships, it was almost impossible to understand the reason behind which the neural networks reached the conclusion in the first place. As Garibay pointed out, while the new method performs well in detecting sarcasm, there is the option to retrace these results as well, which intelligence officials have asserted is a critical element of the use of artificial intelligence in national security.

An Effort to Understand Humans Better

Researchers have found that digital communication may decrease our ability to empathize with others. In fact, as digital communication proliferates during a pandemic-struck world, expressing empathy will become crucial within these communications. Companies are trying to differentiate themselves from their competitors based on the customer experience provided by them. In fact, there is a shift of focus from customer satisfaction to building an emotional connection with the customers which helps in long-term retention goals.

Although the definition of emotion is not scientifically established, many experts agree that emotions play a role in thinking, decision-making, actions, social interactions, as well as well-being. By understanding emotions better, AI technology can create more empathetic customer experiences, improve healthcare, and design better products that fit our needs.

As AI continues to evolve, experts argue that it will continue to amplify human effectiveness. Humans are naturally intuitive and have a high level of social intelligence. This base-level intelligence, which we inherit and learn, governs our behavior in many situations. There is a dedicated branch of AI to process, understand and replicate human emotions. Essentially, the research seeks to enhance natural communication between man and machine by creating an AI that communicates in a more authentic manner. After all, if AI can gain some emotional intelligence, it is likely that it can also replicate the same.


Leave a Comment

Your email address will not be published.