Focal-Loss-Enhanced LSTM for Colloquial Text Normalization and Multi-Label Toxic Comment Moderation under Severe Class Imbalance
Journal of Intelligent Decision Making and Information Science · 15.09.2026 · 3 (19s) · 369-387
DOI: 10.17762/jidmis.v3.6171 ↗Kurz gefasst
Fachartikel in der Zeitschrift Journal of Intelligent Decision Making and Information Science, online erschienen am 15.09.2026. Verfasst von Balaji Mudadla. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).
Abstract (Originalsprache)
Toxic language has become an increasingly prevalent issue in online communities and social media. There is a need to detect such language automatically for the usability of these online platforms, but doing so is quite difficult as toxic comments are very few, multi-labeled, and are not always grammatically correct. Under severe class imbalance, a model trained with binary cross-entropy can post near-perfect overall accuracy while almost never catching the rarest and most damaging categories, such as threats and identity-based hatred. This study sets out an imbalance-aware way to evaluate multi-label toxic-comment detection and measures what a focal-loss objective contributes. We use the public Jigsaw/Conversation AI corpus (159,571 English comments, six toxicity labels) and compare a feed-forward baseline, three recurrent baselines and a small LSTM-50-Dense-25 model trained with binary focal loss. A controlled ablation changes only the training objective. Every model is scored per class and with macro and micro precision, recall and F1, plus the area under the precision-recall curve, averaged over three random seeds. Accuracy proves to be almost useless: a model which classifies all comments as non-toxic already achieves 96.3% accuracy in terms of labeling, while all trained models have very similar macro-F1 score of 0.51. The difference is seen classwise. For example, on the same architecture switching from cross-entropy loss to focal loss increases recall for the least common class (Threat) from 0.14 to 0.42 and recall for Severe-Toxic from 0.69 to 0.82, while macro-F1 stays almost the same; small sacrifice in terms of precision is made for a considerable increase in recall for minority classes. The compact model also trains 38% faster than the most complex recurrent baseline. As online comments often contain informal words, we introduce a light Colloquial text normalization stage, during which slang tokens like gonna, wanna and u are replaced with their formal counterparts in accordance with a special dictionary before classification and removal of comments. For the typical comments, it correctly generates their normalizations and spends 9.8 microseconds per comment, which means that it does not influence the time of real-time use of the model.
Zitieren
APA
Mudadla, B. (2026). Focal-Loss-Enhanced LSTM for Colloquial Text Normalization and Multi-Label Toxic Comment Moderation under Severe Class Imbalance. Journal of Intelligent Decision Making and Information Science, 3(19s), 369-387. https://doi.org/10.17762/jidmis.v3.6171
Vancouver
Mudadla B. Focal-Loss-Enhanced LSTM for Colloquial Text Normalization and Multi-Label Toxic Comment Moderation under Severe Class Imbalance. Journal of Intelligent Decision Making and Information Science. 2026;3(19s):369-387. doi:10.17762/jidmis.v3.6171
BibTeX
@article{Mudadla2026,
author = {Mudadla, Balaji},
title = {Focal-Loss-Enhanced LSTM for Colloquial Text Normalization and Multi-Label Toxic Comment Moderation under Severe Class Imbalance},
journal = {Journal of Intelligent Decision Making and Information Science},
year = {2026},
volume = {3},
number = {19s},
pages = {369--387},
doi = {10.17762/jidmis.v3.6171}
}
EUVIMED