Sarcasm Analysis Using Conversation Context

Debanjan Ghosh, Alexander R. Fabbri, Smaranda Muresan · DOI

Abstract: Detecting sarcasm in social media is a complex task that often requires more than just the text of a single post. This paper explores the use of conversation context—specifically the turns preceding a post—to improve sarcasm detection. By employing specialized LSTM architectures and attention mechanisms, the researchers demonstrate that modeling the "clash" between context and reply significantly enhances performance and helps identify the specific conversational triggers of sarcasm.

Introduction

Sarcasm is inherently interactional. It relies on a discrepancy between what is said and what is expected based on the surrounding environment. In isolation, a sentence like "I love waiting at the doctor's office for hours" might seem sincere to a machine. However, within the context of a shared understanding that waiting is unpleasant, its sarcastic intent becomes clear. This research addresses whether machines can leverage this conversational context to "get" the joke, moving beyond treating utterances as isolated islands of text.

Datasets and Contextual Examples

To ensure robust findings, the study utilized three distinct types of social media data, each with different labeling conventions:

  • Twitter: Self-labeled by authors using hashtags like #sarcasm.
  • Reddit: Sourced from the Self-Annotated Reddit Corpus (SARC), where users mark sarcasm with the "/s" tag.
  • Internet Argument Corpus (IACv2): A dataset of forum debates where labels come from crowdsourced readers. This captures human perception of sarcasm rather than just the author's intent.
Examples of prior turns (P_TURN) and sarcastic replies (C_TURN) across different social media platforms.

As shown in the examples above, the "Prior Turn" (P_TURN) provides the necessary setup for the "Current Turn" (C_TURN) to be interpreted as sarcastic. For instance, on Twitter, the factual statement about plane safety triggers a sarcastic response about the "great" feeling of flying.

Modeling Incongruity

The researchers implemented neural architectures designed to capture the relationship between different parts of a conversation:

  • Multiple and Conditional LSTMs: Instead of concatenating context and reply, the models used separate Long Short-Term Memory (LSTM) networks. In the "Conditional" setup, the model reads the reply with a "memory" initialized by the prior context, effectively processing the response in the mindset of the preceding conversation.
  • Attention Mechanisms: Word-level and sentence-level attention allowed the models to "weigh" specific parts of the context more heavily, effectively pinpointing the "trigger" for the sarcasm.

Key Findings: The Importance of Temporal Context

The study revealed that the direction of context matters immensely. While the prior turn was incredibly helpful—boosting F1 scores by 6–11%—the succeeding turn (the reply to the sarcastic post) provided almost no benefit. Sarcasm is triggered by what came before, not validated by what comes after.

A multi-turn discussion including the succeeding turn (S_TURN) used to test the impact of future context.

In the IACv2+ dataset (illustrated above), researchers included the succeeding turn (S_TURN) to see if future context helped. The results confirmed that the "trigger" is rooted in the past. Furthermore, the models successfully learned to identify "valence reversal," such as focusing on a negative context word like "mediocre" when the response used a positive word like "gutsy."

Results and Limitations

The LSTM-conditional model achieved a 73.32% F1 score on the IACv2 dataset, a significant improvement over models looking only at the current turn. Additionally, the model's attention weights matched human-identified triggers 41% of the time.

Despite these gains, challenges remain. The models still struggle with:

  • World Knowledge: Sarcasm relying on external facts or niche events not mentioned in the text remains difficult to detect.
  • Long-Form Text: In long forum posts, the sarcastic cue can be buried; 75% of false negatives occurred in posts with five or more sentences.
  • Informal Language: Slang and profane "snark" common on platforms like Reddit continue to pose difficulties for sequence-based models.

Conclusion

This research highlights that for both humans and machines, context is king in sarcasm detection. By modeling the interaction between conversational turns, AI can better navigate the nuances of human communication, though incorporating broader world knowledge remains the next major frontier.

Summary updated

BibTeX
@article{ghosh2018sarcasm,
  author = {Debanjan Ghosh and Alexander R. Fabbri and Smaranda Muresan},
  title = {{Sarcasm Analysis Using Conversation Context}},
  journal = {Comput. Linguistics},
  year = {2018},
  doi = {10.1162/coli\_a\_00336},
}
Figure