The Naughtyformer: A Transformer Understands and Moderates Adult Humor (Student Abstract)

Leonard Tang, Alexander Cai, Jason WangAAAI 2023 · OpenReview

TL;DR

This paper introduces "The Naughtyformer," a finetuned Transformer model for classifying adult humor subtypes (wholesome, dark, dirty) and detecting offensiveness. They also release a new, large-scale dataset of 92,153 jokes scraped from Reddit, which is crucial for training and evaluating such nuanced humor models.

What Problem Does This Paper Address?

While detecting humor in text has seen progress, classifying subtypes of humor, particularly adult-oriented ones, remains an underexplored area. This is a nuanced challenge because adult humor can range from mildly suggestive to overtly offensive, and distinguishing these categories is important for applications like content moderation and understanding social discourse. Existing humor detection models often lack the granularity to differentiate these subtypes, and there's a lack of specialized datasets for this task.

Methods

The core of the paper is the "Naughtyformer," which is a finetuned Transformer-based language model. They experimented with several pre-trained Transformer architectures, including BERT, RoBERTa, and DeBERTa, and also evaluated Longformer to handle longer text inputs. The models were finetuned on their newly created dataset for both the humor subtype classification task and a binary offensiveness detection task. For the latter, they simplified the problem by classifying jokes as either offensive (Dark/Dirty) or inoffensive (Wholesome/News).

Datasets

The authors introduce a novel dataset of 92,153 jokes scraped from Reddit, categorized into three subtypes:

  • Wholesome Jokes: Inoffensive humor.
  • Dark Jokes: Humor that is morbid, cruel, offensive to some, or graphic.
  • Dirty Jokes: Obscene, indecent, vulgar, sexist, racist, or discriminatory content.

They also included news articles from Thomson Reuters as a non-joke, inoffensive baseline. The data was collected from specific subreddits: r/cleanjokes, r/darkjokes, and r/DirtyJokes.

Key Insights and Ideas

  • Subreddit as a Natural Classifier: The authors leverage the community-driven nature of Reddit subreddits (like r/cleanjokes, r/darkjokes, r/DirtyJokes) as a proxy for distinct humor categories, assuming subreddit rules and moderation enforce content separation.
  • Transformer Dominance: Finetuned Transformer models, particularly DeBERTa, show strong performance on both humor subtype classification and offensiveness detection, outperforming simpler models.
  • Context Length Nuance: Surprisingly, the Longformer, designed for longer contexts, performed worse than models with shorter context limits (like BERT, RoBERTa, DeBERTa). This suggests that for this specific dataset, most jokes fall within the 512-token limit, and the extended context might introduce noise or distraction.
  • Offensiveness Detection is Tractable: Reducing the problem to a binary offensiveness detection task (offensive vs. inoffensive) proved highly effective, with their finetuned DeBERTa model significantly outperforming existing state-of-the-art offensiveness detection models.

Key Results

  • Multiclass Humor Classification: The DeBERTa-base model achieved the highest accuracy (87.69%) and F1 score (85.22%) among the tested Transformer models for classifying the three humor subtypes.
  • Offensiveness Detection: Their finetuned DeBERTa model achieved 92.88% accuracy and a 92.47% micro-averaged F1 score on the binary offensiveness detection task. This is a substantial improvement of 17.04% in accuracy compared to the state-of-the-art TweetEval offensiveness detection model.

Limitations and Future Work

Limitations: * The paper acknowledges that the Longformer's performance was suboptimal, possibly due to the nature of the joke data not requiring extremely long contexts. * The reliance on subreddits for data collection might introduce biases inherent to those specific communities.

Future Work: * The authors hope their dataset and models will spur further research at the intersection of NLP and Computational Social Science. * They suggest their models could be used to mitigate overly offensive humor in appropriate settings, implying a need for further development and deployment strategies.

Summary updated

Abstract

Jokes are intentionally written to be funny, but not all jokes are created the same. While recent work has shown impressive results on humor detection in text, we instead investigate the more nuanced task of detecting humor subtypes, especially of the more adult variety. To that end, we introduce a novel jokes dataset filtered from Reddit and solve the subtype classification task using a finetuned Transformer dubbed the Naughtyformer. Moreover, we show that our model is significantly better at detecting offensiveness in jokes compared to state-of-the-art methods.
BibTeX
@inproceedings{tang2023naughtyformer,
  author = {Leonard Tang and Alexander Cai and Jason Wang},
  title = {{The Naughtyformer: A Transformer Understands and Moderates Adult Humor (Student Abstract)}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2023},
  url = {https://openreview.net/forum?id=Zly61UMEUK},
}
Figure