Skip to content
All projects
NLP/2026

Dialect-Robust Sentiment & Sarcasm Detection

Text classification that holds up across English varieties — where sarcasm inverts the label.

Role
Solo — data pipeline, modelling, evaluation
Timeline
2026

At a glance

Transformer-based sentiment and sarcasm detection designed to stay robust across regional varieties of English, where the hardest case is text that says one thing and means the opposite. Baselines with classical models establish what the transformer actually adds.

  • Sarcasm inverts sentiment — a model trained only on literal labels confidently misreads exactly the text people most want analysed.
  • A joint model predicts sentiment and sarcasm together, using the sarcasm signal to correct sentiment on ironic inputs.
  • Evaluation is stratified by English variety, so dialect robustness is measured rather than assumed.
  • Classical baselines make the transformer's contribution explicit instead of taking it on faith.

Key numbers

2 heads

Task

Sentiment and sarcasm, jointly predicted

English varieties

Robustness axis

Performance measured across dialects, not just overall

Classical + transformer

Baselines

To isolate what the transformer adds

Tech stack

Modelling
Fine-tuned transformerJoint sentiment + sarcasm headsClassical baselines
Focus
Cross-dialect robustnessEnglish varietiesIrony / sarcasm handling
Tooling
Pythonscikit-learnHugging Face Transformers

The problem

Sentiment models are usually evaluated on one distribution of English and reported as a single number. That hides two failures: they degrade on dialects underrepresented in training, and they break on sarcasm, where the surface sentiment is the opposite of the intended one.

Approach

A fine-tuned transformer jointly predicts sentiment and sarcasm. The sarcasm head acts as a correction signal for the sentiment head on ironic inputs. Classical models (TF-IDF with linear classifiers) provide baselines so the transformer's added value is measurable, and evaluation is broken out by English variety rather than pooled.

What I took from it

A multi-task head is a cheap way to inject a linguistic prior, and stratified evaluation is the only way to notice that an aggregate score is hiding a dialect gap.

Want the details?

The full source, READMEs, evaluation harnesses, and results are on GitHub.

github.com/dariyaDeepanshu/Dialect-Robust-NLP-for-Sentiment-Sarcasm-Detection-across-English-varieties