# SarcasmBot: A 2015 Java Module That Turns Chat Input Into Sarcastic Replies

> SarcasmBot is a GPL-3.0 Java library that generates sarcastic responses to user input using a sentiment lexicon and a part-of-speech tagger. It is a research artifact from 2015, not a production-ready chatbot component, and its approach is best understood as a rule-based template system.

**adityajo/sarcasmbot** — SarcasmBot: An open-source sarcasm-generation module for chatbots

- Repository: https://github.com/adityajo/sarcasmbot
- Website: http://www.cse.iitb.ac.in/~adityaj/sarcasmbot-wisdom15-kdd.pdf
- Stars: 50 · Forks: 8
- Language: Java
- License: GPL-3.0
- Published: 2026-08-17 · Updated: 2026-08-18 · Language: en
- Canonical page: https://hysenlabs.com/projects/adityajo-sarcasmbot

## The Problem: Chatbots That Never Push Back

Most chatbots are built to be agreeable. They answer, confirm, and move on. SarcasmBot targets the opposite: it takes a user's statement or question and returns a sarcastic reply. The intended user is a researcher or a developer who wants to add a layer of verbal irony to a bot. The paper behind it, presented at WISDOM at KDD 2015, frames sarcasm generation as a distinct task from sarcasm detection. The code is a proof of that task, not a polished library. The README gives a single sample call: new sarcasticChatter(postagger, sentiwordlist) and then sc.chat("Do you love chocolates?"). That is the entire public interface. If you need a chatbot that can hold a conversation, this module is a side effect generator, not a dialogue engine.

## How It Works: Sentiment Flip and Template Fill

The mechanism is visible from the two required inputs. The module takes a Stanford POS tagger and a sentiment wordlist. The tagger identifies word roles in the user's input. The sentiment wordlist, downloaded from an opinion-lexicon archive, provides polarity scores. The README does not expose the internal algorithm, but the dependencies suggest a two-step process. First, the input is tagged to find adjectives or sentiment-bearing words. Second, the module flips the polarity or inserts a sarcastic template around the tagged phrase. The sample output for "Do you love chocolates?" is not shown, but a typical rule would be to respond with something like "Oh, I absolutely adore them." where the adverb is swapped for its opposite. The version number, 0.2, and the revision log from August 2015 indicate a research prototype. The code likely uses a small set of hand-crafted patterns, not machine learning.

## Getting It Running: Manual Setup with Two External Dependencies

The README lists six steps. Download a sentiment lexicon from a specific URL. Set up an Eclipse project and import the code from the SarcasmTalker directory. Download the Stanford POS tagger and uncompress it. Include the tagger jars in the project. Find the model file path, for example the english-left3words-distsim.tagger. Then call Main.sarcasticChatter with the model file path as argument 1 and the sentiment wordlist path as argument 2. The code is a plain Java project, so you can also compile it from the command line, but the README only documents Eclipse. There is no build tool like Maven or Gradle mentioned. You must handle the classpath manually. The sample snippet creates a sarcasticChatter object and calls chat, which returns a String. The setup is straightforward for a Java developer, but it is not turnkey. You need to fetch the lexicon from a .rar archive, which adds a step.

## Limitations: A Narrow Trigger Set and No Context

The most obvious limitation is that the module only works with inputs that the sentiment wordlist and the tagger can process. If a user says something with no sentiment-bearing words, the module likely returns a generic or fallback reply, or possibly nothing useful. The README gives no examples of failure modes. The paper, referenced in the homepage, might describe evaluation, but the README does not. Another limitation is that sarcasm depends on context, tone, and shared knowledge. This module has none of that. It flips polarity on a word-by-word basis. A phrase like "That's a great idea" might become "That's a terrible idea," which is sarcastic in a simple way, but it will not handle irony that requires understanding the speaker's intent. The module is also tied to the Stanford tagger version from 2014. Newer tagger models may change the output format, and the code may break.

## Wrong Tool Cases: When Not to Use SarcasmBot

If you are building a customer service bot, do not use this. Sarcastic replies to frustrated users will escalate problems. If you need sarcasm that adapts to the user's history or personality, this module cannot do that. It has no memory and no state. If you want a bot that produces varied sarcastic replies, the template approach will quickly become repetitive. The README shows a single constructor and a single method, so there is no configuration for tone, intensity, or topic. The code is a research artifact, so it is not designed for high-throughput or concurrent use. Any production use would require wrapping it in a service and handling exceptions, which the README does not address. For a serious chatbot project, you would be better off using a modern language model with prompt engineering, but that is a different approach entirely.

## Alternative: Rule-Based Sarcasm vs. Neural Generation

A real alternative is to use a large language model (LLM) with a system prompt that instructs it to respond sarcastically. The difference is fundamental. SarcasmBot uses a fixed rule set: it identifies sentiment and flips it. An LLM generates text based on probabilistic patterns learned from millions of examples. The LLM can handle context, produce varied phrasing, and adapt to the user's input in ways that a template cannot. However, an LLM requires a GPU or an API call, which adds cost and latency. SarcasmBot runs locally on a single JVM with no network calls after setup. For a research project on sarcasm generation, SarcasmBot is a transparent baseline. For a production bot, the LLM is more flexible but less predictable. The choice depends on whether you need explainability or quality.

## Maintenance and License: A Static 2015 Snapshot

The repository has no recent releases and no archived status, but the last push date is unknown. The revision log shows only one entry: 10th August 2015, the first version uploaded. That means the code has not been updated in nearly a decade. The license is GPL-3.0, which is strong copyleft. If you use the code in a distributed application, you must release your source code under the same license. That is a significant implication for proprietary chatbot projects. The README asks that you cite the paper if you use the software, which is a scholarly courtesy, not a legal requirement. The dependency on the Stanford tagger is another maintenance burden. You must find a compatible version of the tagger and its model files. The sentiment lexicon from the given URL may change or disappear over time. You would need to archive it yourself. Upgrading the tagger to a newer version could break the module, and there is no test suite mentioned to catch that.

## Who Should Adopt It and What to Verify

Adopt SarcasmBot if you are a researcher reproducing the WISDOM 2015 paper or a hobbyist building a joke bot that does not need reliability. Do not adopt it if you need a maintainable, production-grade component. Before you start, verify three things. First, download the sentiment lexicon and confirm it loads correctly with the code. Second, check that the Stanford tagger model file you have matches the expected format. Third, read the source in the SarcasmTalker directory to understand the exact template rules, because the README does not document them. The code is small enough to audit, but you must do that yourself. The GPL-3.0 license means you can modify it, but you must share your changes if you distribute the result. The paper, linked on the homepage, is the best source for the algorithm's details. Start there if you want to extend the module.

## Conclusion

SarcasmBot is for researchers studying sarcasm generation or for developers building a toy chatbot that needs a simple, rule-based sarcastic reply. It is not for production chatbots that need nuanced, context-aware sarcasm or that must handle a wide range of inputs without heavy setup. Before adopting, verify that the Stanford POS tagger version you supply is compatible with the code, download the sentiment lexicon from the provided URL, and check that the GPL-3.0 license fits your project's distribution model. The code is a 2015 research prototype with no releases and no ongoing maintenance, so expect to read the source and adapt it yourself.

## FAQ

### How do I use the Sarcasmbot Java code?

Download the sentiwordlist, import the code from the SarcasmTalker package into an Eclipse or similar project, add the Stanford postagger jars, then call Main.sarcasticChatter with the tagger modelfile path as argument 1 and the sentiwordlist path as argument 2.

### Where do I download the sentiwordlist for sarcasmbot?

From the University of Illinois at Chicago page linked in the README, which serves an English opinion lexicon as a .rar archive. It is not bundled with the repository, so you fetch and unpack it yourself before constructing the module.

### What does the sarcasmbot sample Java snippet look like?

Two lines: construct a sarcasticChatter with the postagger and the sentiwordlist, then call chat with a line of input and print the result, as in sc.chat("Do you love chocolates?"). There is no conversation state or history parameter.

### Which paper should I cite if I use sarcasmbot?

SarcasmBot: An open-source sarcasm-generation module for chatbots, by Aditya Joshi, Anoop Kunchukuttan, Pushpak Bhattacharyya and Mark J Carman, at WISDOM at KDD 2015 in Sydney, August 2015. The repository homepage points at that paper as a PDF.

## Sources

- [Official documentation](http://www.cse.iitb.ac.in/~adityaj/sarcasmbot-wisdom15-kdd.pdf)
- [Official README](https://github.com/adityajo/sarcasmbot#readme)
- [Project repository](https://github.com/adityajo/sarcasmbot)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/adityajo-sarcasmbot
