Sarcasm Detection with Deep Learning

Built a deep learning model for detecting sarcasm in text headlines using a public dataset — workflow and modeling inspired by the Scalar master class

Portfolio Image
Portfolio Image
Portfolio Image
Gallery Image
Gallery Image
Gallery Image
Gallery Image
AI & ML Deep Learning Keras TensorFlow NLP Interactive UI
AI ML
March 2025
Scaler

Sarcasm Detection Headlines Classifier

Trained a deep learning model to classify news headlines as sarcastic or not. The workflow, modeling steps, and interpretation functions are based on Scalar master class tutorials, but the actual data is a public JSON file of labeled headlines.

The project loads news headline data labeled for sarcasm, preprocesses text using Keras Tokenizer and padding, and trains a Sequential model. Main layers: Embedding, GlobalAveragePooling1D, Dense.

Sarcasm detection is inherently difficult due to context and linguistic subtleties. Achieving robust model accuracy with simple architecture is tough for nuanced text like humor or sarcasm.

Used a Keras Sequential model (Embedding, pooling, dense). Accuracy: ~97% train, ~83% test. Original Scalar master class code structure enhanced for interpretability; handles custom predictions and output transformation.

Key Features

  • Headline-based sarcasm detection
  • Tokenization & Padding
  • Embedding & Pooling layers
  • Scalar master class code reference
  • Custom output interpretation
  • Keras/TensorFlow workflow