Tweet Sarcasm Detection Using Deep Neural Network

Meishan Zhang, Yue Zhang, Guohong Fu

Abstract

Sarcasm detection in microblogs like Twitter is a complex task due to the inherent ambiguity of ironic language. This paper introduces a deep learning approach that avoids labor-intensive manual feature engineering by combining a bi-directional gated recurrent neural network (Bi-GRNN) with a contextual pooling network. By analyzing both the target tweet's content and the author's historical tweet patterns, the model achieves state-of-the-art results. Our findings demonstrate that automatic feature induction effectively captures subtle semantic nuances and that historical context is a vital component for accurate sarcasm classification.

Introduction

Sarcasm presents a unique challenge for sentiment analysis because it involves a discrepancy between literal and intended meaning. A simple positive statement like "I love being stuck in traffic!" is clearly negative to a human but often misclassified by basic algorithms. Traditional sarcasm detection has relied on manually designed feature templates—such as punctuation counts or sentiment shifts—which often struggle with feature sparsity and a lack of situational context.

This research addresses these issues by proposing a neural network architecture that automatically learns complex linguistic patterns and incorporates "contextual" features derived from an author's past behavior.

Methods

The authors propose a dual-component neural architecture designed to process both the immediate text and the broader authorial context:

  1. Local Component (Tweet Content): A Bi-directional Gated Recurrent Neural Network (Bi-GRNN) processes the target tweet from both directions to capture long-range dependencies and sentence flow. Dense word embeddings are used as input, and a gated pooling function automatically weights the most salient parts of the tweet for classification.
  2. Contextual Component (Author History): To model the "speaker," the system analyzes the author's last 80 tweets. It identifies key words using tf-idf and passes their embeddings through a gated pooling layer to create a stylistic "fingerprint" of the user.

The outputs from both components are concatenated and passed through a non-linear hidden layer for the final prediction.

Architecture of the discrete and neural models for sarcasm detection.

Results and Key Insights

The neural model consistently outperformed discrete baselines and previous state-of-the-art methods across various testing scenarios.

  • Performance Gains: On a balanced dataset, the neural model with context achieved 90.74% accuracy. In an imbalanced real-world simulation (1:4 ratio), it reached 94.10% accuracy.
  • The Importance of Context: A significant finding was that adding author history provided a massive performance boost for both discrete and neural models. Sarcasm is often a personality trait; understanding a user's typical writing style is essential for identifying deviations that signal irony.
  • Robustness: Unlike discrete models, which degrade as tweets get longer due to "noise," the neural model remained stable, effectively filtering irrelevant information through its GRNN structure.
Accuracy vs. number of history tweets, showing the benefit of contextual information.

Conclusion

This work demonstrates that deep neural networks, particularly Bi-GRNNs combined with contextual history, are superior to traditional manual feature engineering for sarcasm detection. While the model currently requires a significant tweet history (80+ tweets) for optimal performance, it sets a new benchmark for capturing the subtle semantic shifts inherent in sarcastic communication. Future research may look into incorporating audience-specific features or real-time environmental trends to further refine these models.

Summary updated

BibTeX
@inproceedings{zhang2016tweet,
  author = {Meishan Zhang and Yue Zhang and Guohong Fu},
  title = {{Tweet Sarcasm Detection Using Deep Neural Network}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2016},
}
Figure