BanglaHateCorpus: A large-scale bangla benchmark for hate speech classification and a transformer-based deep learning method
Anika Tasnim Rodela, Mahbub E Sobhani, Sakif Naieb Raiyan, Mohammad Nurul Huda, Dewan Md. FaridHate speech on social media refers to content that threatens, attacks, or dehumanizes people or groups based on specified characteristics, thereby eroding trust, worsening societal divisions, and causing psychological harm to the targeted communities. In digitally connected South Asian societies, strong in-group bonds and online inter-group hatred can rapidly lead to real-world violence, a risk intensified by the proliferation of Bangla texts, highlighting the urgent need for robust detection in this low-resource language. Previous studies have mostly focused on building their datasets by scraping various sources, without emphasizing standardized quality annotation or ensuring classification accuracy. To address these gaps, we introduce BanglaHateCorpus, a unified corpus of 168K examples consolidated from eight public sources, rigorously de-duplicated and annotated through a two-stage, human and LLM-assisted pipeline. Building on this benchmark, we propose BanHateFormer, a novel deep-learning model that embodies state-of-the-art transformer components, and replaces the conventional feed-forward blocks with a Mixture-of-Experts layer followed by a binary classification head. BanHateFormer achieves state-of-the-art classification results, as assessed by accuracy, precision, recall, and macro F1-score with approximately 94.74 times fewer parameters than comparable models, achieving a 91.33% macro F1-score on the BanglaHateCorpus dataset and 78.96% on the transliterated BanTH benchmark. BanHateFormer outperforms BanglaBERT and XLM-RoBERTa by up to 2.57% with three times fewer parameters, and improves macro F1-score by 3.38% on transliterated text, demonstrating strong performance on romanized inputs. BanHateFormer significantly surpasses existing transformer-based models in balancing memory efficiency and high-fidelity outputs, marking a breakthrough in hate speech classification with optimal space utilization.