Explainability in Emotion Detection in Social Media Text Using Distilled Transformer Models

This research presents an explainable, low-latency framework for emotion detection in social media text using distilled transformer models DistilBERT, BERT, and RoBERTa combined with token-level interpretability via SHAP. Using the GoEmotions dataset filtered to six core emotions (joy, sadness, anger, fear, surprise, and disgust), the models were fine-tuned through Optuna-based hyperparameter optimization with stratified 80/10/10 data splits. The results demonstrate competitive macro-F1 performance (DistilBERT = 0.816, BERT = 0.806, RoBERTa = 0.825) while maintaining low overall processing latency for batch inference. Beyond classification, this study contributes an analysis of cross-model consistency and explainability: certain emotions such as joy were recognized consistently (100% agreement across models), whereas sadness and fear exhibited variation, reflecting linguistic and contextual differences in emotional expression. The SHAP-based explainability highlighted overlapping and divergent token contributions across models, exposing where algorithmic architecture and training data led to different interpretive outcomes. This work concludes that DistilBERT offers an optimal trade-off between accuracy, interpretability, and runtime cost, and that explainability disagreement among models can illuminate deeper semantic and cultural complexities in emotional language.

Institutions

Publication Details

Journal
University of Birmingham Research Portal (University of Birmingham)
Published
2026-02-16
Primary Topic
Sentiment Analysis and Opinion Mining
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Explainability in Emotion Detection in Social Media Text Using Distilled Transformer Models

University of Birmingham Research Portal (University of Birmingham)
Sentiment Analysis and Opinion Mining
article

Explainability in Emotion Detection in Social Media Text Using Distilled Transformer Models

article en

Abstract

This research presents an explainable, low-latency framework for emotion detection in social media text using distilled transformer models DistilBERT, BERT, and RoBERTa combined with token-level interpretability via SHAP. Using the GoEmotions dataset filtered to six core emotions (joy, sadness, anger, fear, surprise, and disgust), the models were fine-tuned through Optuna-based hyperparameter optimization with stratified 80/10/10 data splits. The results demonstrate competitive macro-F1 performance (DistilBERT = 0.816, BERT = 0.806, RoBERTa = 0.825) while maintaining low overall processing latency for batch inference. Beyond classification, this study contributes an analysis of cross-model consistency and explainability: certain emotions such as joy were recognized consistently (100% agreement across models), whereas sadness and fear exhibited variation, reflecting linguistic and contextual differences in emotional expression. The SHAP-based explainability highlighted overlapping and divergent token contributions across models, exposing where algorithmic architecture and training data led to different interpretive outcomes. This work concludes that DistilBERT offers an optimal trade-off between accuracy, interpretability, and runtime cost, and that explainability disagreement among models can illuminate deeper semantic and cultural complexities in emotional language.

University of Birmingham Research Portal (University of Birmingham)
University of Dubai (AE), University of Birmingham (GB)
Openalex Percentile: Top 98%
Sentiment Analysis and Opinion Mining
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.