An Efficient Transformer-Based Sentence Embedding Fusion Approach for Hate Speech Detection on Social Media
Journal of Visualized Experiments · 13.11.2026 · (237)
DOI: 10.3791/74395 ↗Kurz gefasst
Video/Audio in der Zeitschrift Journal of Visualized Experiments, online erschienen am 13.11.2026. Verfasst von Jahanzeb Munir und 7 weiteren Autor:innen. Beteiligte Einrichtung: Department of Information Technology, The Islamia University of Bahawalpur. Hauptthemen laut MEDLINE: Social Media, Hate, Speech.
Abstract (Originalsprache)
The rapid proliferation of offensive and hate speech on social media platforms poses a significant threat to individual wellbeing and the integrity of online discourse, highlighting the need for accurate, scalable, and computationally efficient automatic detection systems. This study proposes a supervised framework for hate speech detection that integrates transformer-based sentence embeddings with classical machine learning classifiers to balance performance and computational efficiency. Experiments are conducted on the Hate Speech and Offensive Language Dataset, which presents a substantial class imbalance challenge. The proposed approach systematically compares traditional feature representations, including TF-IDF and n-grams, with contextual embeddings derived from Sentence-BERT (SBERT) and DistilBERT. Multiple classifiers, including Logistic Regression (LR), Support Vector Machines (SVM), Random Forests (RF), and Convolutional Neural Networks (CNN) are evaluated. The results show that transformer-based embeddings generally improve F1-score compared with traditional features. Notably, the fusion of SBERT and DistilBERT embeddings with LR achieves superior performance, attaining an accuracy of 94%, precision of 93%, a recall of 92%, and an F1-score of 92%. This indicates improved robustness under imbalanced data conditions. To ensure reliability, the proposed framework is validated using stratified five-fold cross-validation, achieving an average accuracy of 93%. Moreover, in an independent within-dataset replication on a second curated hate speech dataset, the framework achieved 92.56% accuracy. An ablation study further evaluates the contribution of individual components to the framework. The results show that sentence-level transformer embeddings are effective in capturing semantic and contextual nuances that are crucial for identifying abusive language and highlight the potential of lightweight models for real-world deployment.
Schlagwörter
MeSH-Schlagwörter (MEDLINE)
Autor:innen und Institutionen
- Department of Information Technology, The Islamia University of Bahawalpur.
- Department of Information Technology, The Islamia University of Bahawalpur; musarat.karim@iub.edu.pk.
- Department of Information Technology, College of Computer and Information Sciences, Princess Nourah bint Abdulrahman University.
- Department of Computer Science and Information, Applied College, Taibah University.
- Department of Computer Science and Information Technology, The Islamia University of Bahawalpur.
- Department of Computer Science and Engineering, Soonchunhyang University.
Zitieren
APA
Munir, J., Karim, M., Hameed, M., Atteia, G., Aljohani, A., Umer, M., Nam, Y., & Kang, B. G. (2026). An Efficient Transformer-Based Sentence Embedding Fusion Approach for Hate Speech Detection on Social Media. Journal of Visualized Experiments. https://doi.org/10.3791/74395
Vancouver
Munir J, Karim M, Hameed M, Atteia G, Aljohani A, Umer M, et al. An Efficient Transformer-Based Sentence Embedding Fusion Approach for Hate Speech Detection on Social Media. Journal of Visualized Experiments. 2026. doi:10.3791/74395
BibTeX
@article{Munir2026,
author = {Munir, Jahanzeb and Karim, Musarat and Hameed, Mustafa and Atteia, Ghada and Aljohani, Abeer and Umer, Muhammad and Nam, Yunyoung and Kang, Byeong-Gwon},
title = {An Efficient Transformer-Based Sentence Embedding Fusion Approach for Hate Speech Detection on Social Media},
journal = {Journal of Visualized Experiments},
year = {2026},
number = {237},
doi = {10.3791/74395}
}
EUVIMED