Sarcasm Suite: A Browser-Based Engine for Sarcasm Detection and Generation

Aditya Joshi, Diptesh Kanojia, Pushpak Bhattacharyya, Mark James Carman

Introduction

Standard Sentiment Analysis (SA) systems often struggle with sarcasm because the literal meaning of a sarcastic sentence typically contradicts its intended sentiment. While various computational approaches have been developed to detect or generate sarcasm, they are rarely accessible for interactive testing by the broader research community.

This paper introduces "Sarcasm Suite," a browser-based demonstration engine that consolidates five distinct approaches to computational sarcasm—four for detection and one for generation—into a single accessible tool. By allowing users to interactively test these models, the suite aims to expose the limitations of current techniques and inspire future research in computational sarcasm.

System Architecture and Methods

The Sarcasm Suite is a web application built with PHP, Bootstrap, and jQuery that interfaces with backend Python and Java modules. It integrates five distinct approaches from the authors' prior work, categorized into detection and generation modules.

Overview of the Sarcasm Suite architecture, detailing the four detection methods and the generation module.

Sarcasm Detection Modules

  1. Sentiment Incongruity: Detects sarcasm by identifying explicit sentiment flips (e.g., positive words followed immediately by negative ones) or implicit sentiment phrases within a text.
  2. Semantic Incongruity: Utilizes word embeddings (Word2Vec) and distance-weighted features to identify semantic clashes between words in a sentence.
  3. Historical Context Incongruity: A rule-based approach that retrieves an author's past tweets to compare the surface sentiment of a new tweet against their historical sentiment towards similar phrases.
  4. Conversational Context Incongruity: Treats sarcasm detection in dialogue as a sequence labeling problem, utilizing SVM-HMM to analyze the flow of conversation between multiple speakers.

Sarcasm Generation Module

The suite includes a chatbot module featuring eight distinct rule-based generators. Each is designed to produce a specific flavor of sarcastic response based on user input.

Data Sources and Implementation

As a demonstration-focused project, the suite utilizes specific data sources to establish context for its models:

  • 'Friends' TV Show Transcripts: Used to train the conversational context sequence labeling model.
  • Live Twitter Data: The historical context module dynamically downloads up to 2,000 recent tweets from a provided Twitter ID to establish a user's baseline sentiment.

The backend relies on robust machine learning tools, specifically SVM-perf, SVM-HMM, and SVM-Light. To ensure the web engine runs at interactive speeds, the authors optimized the semantic incongruity module by using a reduced subset of Word2Vec embeddings.

Interactive Interface and Results

The primary contribution of this work is the successful deployment of the Sarcasm Suite as a functional, multi-module web engine. It integrates complex backend machine learning tools into a unified, visually appealing user interface.

The Sarcasm Suite web interface, allowing users to input text and receive a sarcasm prediction.

By putting these models into a public, browser-based interface, the authors intentionally invite users to "break" the systems. Observing where these models fail in the wild is positioned as a primary method for mapping out the next frontier in computational sarcasm.

Discussion and Future Directions

The Sarcasm Suite highlights that sarcasm is not monolithic; it manifests in multiple ways, requiring different detection strategies. A model looking for semantic clashes might miss sarcasm that relies heavily on conversational flow or an author's historical behavior. This reinforces the idea that context is essential—two of the four detection modules rely heavily on external context (past tweets or surrounding dialogue) rather than just the isolated sentence.

While the system will inevitably make errors, the authors anticipate that the edge cases and failures generated by live user interactions will directly inform and inspire future research directions in computational sarcasm.

Summary updated

BibTeX
@inproceedings{joshi2017sarcasm,
  author = {Aditya Joshi and Diptesh Kanojia and Pushpak Bhattacharyya and Mark James Carman},
  title = {{Sarcasm Suite: A Browser-Based Engine for Sarcasm Detection and Generation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2017},
  doi = {10.1609/aaai.v31i1.10532},
}
Figure