Explainable Detection of Sarcasm in Social Media

Ramya Akula, Ivan GaribayWASSA@EACL 2021

TL;DR

This paper introduces an interpretable deep learning model for detecting sarcasm in social media text. By combining multi-head self-attention with Gated Recurrent Units (GRUs), the model not only achieves state-of-the-art performance across diverse datasets but also provides insights into why it makes its predictions, highlighting crucial words that signal sarcasm.

What Problem Does This Paper Address?

Sarcasm is a tricky linguistic phenomenon where people say the opposite of what they mean, often with a critical or humorous intent. While humans can often pick up on sarcasm through tone of voice, facial expressions, and context, detecting it in text is a significant challenge. This ambiguity makes it difficult for automated systems to accurately identify sarcasm, which is crucial for applications like sentiment analysis, opinion mining, and understanding online discourse. Previous deep learning approaches have achieved good performance but often lack transparency, making it hard to understand their decision-making process.

Methods

The authors propose a novel deep learning architecture for sarcasm detection that emphasizes both performance and interpretability. The core components are:

  • Data Pre-processing: Input text is converted into word embeddings using the pre-trained BERT model. This captures rich contextual information.
  • Multi-Head Self-Attention: This mechanism is key to the model's interpretability. It allows the model to weigh the importance of different words in a sentence for detecting sarcasm. By using multiple "heads," the model can learn various types of relationships between words.
  • Gated Recurrent Units (GRUs): After self-attention highlights important words, GRUs are used to learn long-distance dependencies among these words, helping to capture the overall context of the sentence.
  • Classification: A final fully-connected layer with sigmoid activation outputs a probability score for sarcasm.
  • Model Interpretability: The self-attention mechanism inherently allows for visualization of attention weights. This means the model can highlight which words it found most indicative of sarcasm, providing a window into its reasoning.

Datasets

The model was evaluated on several publicly available datasets:

  • Twitter, 2013: Sourced from Twitter.
  • Dialogues, 2016 (Sarcasm Corpus V2 Dialogues): Collected from online discussion forums.
  • Reddit, 2018 (SARC 2.0): A large dataset from Reddit, further divided into "Main" and "Political" subsets.

These datasets represent varied online communication styles and contexts, making them suitable for robust evaluation.

Key Insights and Ideas

  • Interpretability through Attention: The paper champions self-attention not just for its performance benefits but for its inherent interpretability. By visualizing attention maps, the model can explicitly show which words it "focused on" to classify a sentence as sarcastic.
  • Identifying Sarcastic Cues: The attention analysis reveals that words like "just," "again," "totally," and punctuation like "!" often receive higher attention weights, aligning with human intuition about sarcastic language.
  • Context is King: Using BERT embeddings emphasizes the importance of global context for sarcasm detection, as sarcasm often relies on subtle contextual cues.
  • GRU for Long-Range Dependencies: GRUs effectively complement self-attention by capturing relationships between potentially distant words that might be crucial for understanding sarcasm.

Key Results

The proposed model achieved state-of-the-art results on the evaluated datasets, outperforming previous methods. For instance:

  • On the Twitter dataset, the model achieved a precision of 99.6%, recall of 98.7%, and F1-score of 99.6%, showing significant improvements over existing models.
  • On the SARC 2.0 Political dataset, the model achieved an accuracy of 81.0% and F1-score of 81.0%, also demonstrating superior performance.
  • Ablation studies showed that increasing the number of self-attention layers and heads generally improved performance, up to a point of saturation. The model with a single GRU layer without self-attention performed significantly worse, highlighting the contribution of the attention mechanism.

Limitations and Future Work

  • Limitations: While the model achieves high performance, the paper acknowledges that the interpretability analysis is primarily focused on identifying cue words. Further work could explore more nuanced explanations. The reliance on pre-trained BERT embeddings means the model inherits any biases present in BERT.
  • Future Work: The authors suggest exploring the use of personality features, as hinted at in their ablation studies, to further enhance sarcasm detection. Investigating more sophisticated attention mechanisms or combining them with other interpretability techniques could also be fruitful avenues. The potential for applying this interpretable approach to other forms of figurative language is also an interesting direction.

Summary updated

BibTeX
@inproceedings{akula2021explainable,
  author = {Ramya Akula and Ivan Garibay},
  title = {{Explainable Detection of Sarcasm in Social Media}},
  booktitle = {WASSA@EACL},
  year = {2021},
  url = {https://openreview.net/forum?id=qihZCnMXbd},
}
Figure