Beyond words: a hybrid transformer-ensemble approach for detecting hate speech and offensive language on social media

Uložené v:
Podrobná bibliografia
Názov: Beyond words: a hybrid transformer-ensemble approach for detecting hate speech and offensive language on social media
Autori: Uzair Iftikhar, Syed Farooq Ali, Ghulam Mustafa, Nurhidayah Bahar, Kashif Ishaq
Zdroj: PeerJ Computer Science, Vol 11, p e3214 (2025)
Informácie o vydavateľovi: PeerJ Inc., 2025.
Rok vydania: 2025
Zbierka: LCC:Electronic computers. Computer science
Predmety: Hate speech, Offensive language, Sentiment analysis, Social media, Text classification, Electronic computers. Computer science, QA75.5-76.95
Popis: Over the past decade, there has been an increase in hateful content on social media platforms, specifically in tweets. Hence, it brings a challenge to identify and classify tweets containing racism, discrimination, offense, toxicity, or abuse. This article proposes a novel hybrid approach that combines the power of Transformer-based language modeling with ensemble learning to classify offensive, toxic, and hateful tweets. Specifically, the robustly optimized bidirectional encoder representations from Transformers pretraining approach (RoBERTa)-large model is employed for feature extraction, followed by a hyperparameter-tuned extreme gradient boosting (XGBoost) classifier for final classification. The approach was evaluated on three widely used datasets ToxicTweets, Davidson, and HateSpeechDetection and compared against state-of-the-art methods, including deep architectures such as convolutional neural network (CNN), bidirectional encoder representations from Transformers (BERT), and AngryBERT; transformer models including DistilBERT, RoBERTa, A Lite BERT (ALBERT), and efficiently learning an encoder that classifies token replacements accurately (ELECTRA); and logistic regression. The experimental results demonstrate that the proposed hybrid model significantly outperforms existing approaches in terms of accuracy, precision, recall, and F1-score, achieving the highest accuracy of 97% on the HateSpeechDetection dataset and 92.42% on the Davidson dataset. Furthermore, the approach was compared with other ensemble methods, including Adaptive Boosting (AdaBoost), random forest, support vector classifier (SVC), light gradient boosting machine (LightGBM), and bagging, to highlight its superior performance. This study suggests that integrating RoBERTa-large with XGBoost is an effective approach for hate speech detection and provides a robust solution to the increasing problem of online hate and toxicity.
Druh dokumentu: article
Popis súboru: electronic resource
Jazyk: English
ISSN: 2376-5992
Relation: https://peerj.com/articles/cs-3214.pdf; https://peerj.com/articles/cs-3214/; https://doaj.org/toc/2376-5992
DOI: 10.7717/peerj-cs.3214
Prístupová URL adresa: https://doaj.org/article/d16bfe0899e34dfda34b7e89a1dbbfd7
Prístupové číslo: edsdoj.16bfe0899e34dfda34b7e89a1dbbfd7
Databáza: Directory of Open Access Journals
Popis
Abstrakt:Over the past decade, there has been an increase in hateful content on social media platforms, specifically in tweets. Hence, it brings a challenge to identify and classify tweets containing racism, discrimination, offense, toxicity, or abuse. This article proposes a novel hybrid approach that combines the power of Transformer-based language modeling with ensemble learning to classify offensive, toxic, and hateful tweets. Specifically, the robustly optimized bidirectional encoder representations from Transformers pretraining approach (RoBERTa)-large model is employed for feature extraction, followed by a hyperparameter-tuned extreme gradient boosting (XGBoost) classifier for final classification. The approach was evaluated on three widely used datasets ToxicTweets, Davidson, and HateSpeechDetection and compared against state-of-the-art methods, including deep architectures such as convolutional neural network (CNN), bidirectional encoder representations from Transformers (BERT), and AngryBERT; transformer models including DistilBERT, RoBERTa, A Lite BERT (ALBERT), and efficiently learning an encoder that classifies token replacements accurately (ELECTRA); and logistic regression. The experimental results demonstrate that the proposed hybrid model significantly outperforms existing approaches in terms of accuracy, precision, recall, and F1-score, achieving the highest accuracy of 97% on the HateSpeechDetection dataset and 92.42% on the Davidson dataset. Furthermore, the approach was compared with other ensemble methods, including Adaptive Boosting (AdaBoost), random forest, support vector classifier (SVC), light gradient boosting machine (LightGBM), and bagging, to highlight its superior performance. This study suggests that integrating RoBERTa-large with XGBoost is an effective approach for hate speech detection and provides a robust solution to the increasing problem of online hate and toxicity.
ISSN:23765992
DOI:10.7717/peerj-cs.3214