all projects

2024

Dialect-Robust Sentiment & Sarcasm Detection

Sentiment and sarcasm classification evaluated across English varieties, with class-imbalance-aware metrics that surface what accuracy alone hides.

  • NLP
  • Transformers
  • Sarcasm Detection
  • Dialect Robustness
View source

Problem

Sarcasm inverts sentiment, and sentiment models trained on one English variety misread dialectal and ironic text — exactly the text people most want analysed, and exactly where standard classifiers are weakest.

Approach

A TF-IDF + logistic regression baseline establishes a floor before moving to a fine-tuned transformer, evaluated with class-imbalance-aware metrics (macro F1 alongside accuracy) since sarcastic examples are a small minority of the data.

Results

The baseline reaches 76.3% accuracy but only 42.2% F1 on the minority sarcastic class (103 sarcastic vs. 647 non-sarcastic examples) — a concrete illustration of exactly the problem the project targets: a headline accuracy number that hides poor performance on the class that actually matters.

What I learned

On an imbalanced, dialect-shifted task, accuracy is close to meaningless on its own — macro F1 on the minority class is the number that tells you whether the model is actually doing its job.