Technical gazette, Vol. 33 No. 6, 2026.
Original scientific paper
https://doi.org/10.17559/TV-20251105003111
Transformer Based Approach for Hate Speech Detection and Real Time Moderation on Social Media
Bala Sundara Ganapathy N.
; Sathyabama Institute of Science and Technology, Chennai, Tamil Nadu 600119, India
Albert Mayan J.
; Department of Computer Science and Engineering, Sathyabama Institute of Science and Technology, Chennai, Tamil Nadu 600119, India
*
* Corresponding author.
Abstract
The real-time detection of hate speech on social media platforms, particularly Twitter, remains a significant challenge in Natural Language Processing (NLP). Traditional approaches, such as Long Short-Term Memory (LSTM) networks, Support Vector Machines (SVM), and n-gram-based methods, often struggle to capture contextual nuances and long-range dependencies. This study proposes a transformer-based approach for hate speech detection, leveraging Bidirectional Encoder Representations from Transformers (BERT) to enhance contextual understanding and classification accuracy. The proposed methodology involves data collection, preprocessing, and feature extraction using pre-trained transformer models, followed by fine-tuning on labeled hate speech datasets. Unlike conventional methods, transformer-based models capture bidirectional context, semantic relationships, and subtle linguistic cues, leading to improved detection of implicit and explicit hate speech. The model is trained using transfer learning and evaluated against all machine learning techniques including SVM, Logistic regression, and Random Forest. Performance is assessed using precision, recall, and F1-score metrics. To enhance model reliability and generalizability, explainability techniques, multilingual support, and data augmentation strategies are incorporated. Experimental results demonstrate that transformer-based models achieve state-of-the-art performance, significantly surpassing traditional techniques in terms of accuracy, robustness, and real-time applicability. The findings indicate that the proposed model is well-suited for deployment in real-world applications, enabling automated hate speech detection to promote safer and more inclusive online communities. Future research will explore model scalability, real-time adaptability, and integration with content moderation systems for broader implementation across social media platforms.
Keywords
bidirectional encoder representations from transformers (BERT); hate speech detection; natural language processing (NLP); real-time text classification; transformer models
Hrčak ID:
353080
URI
Publication date:
7.11.2026.
Visits: 0 *