Hate Speech Detection In Social Media with Deep Learning And Language Models
Year 2025,
Volume: 14 Issue: 2, 1077 - 1095, 30.06.2025
Beste Akdik
,
Güncel Sarıman
Abstract
Nowadays, hate speech has started to spread rapidly with the increasing use of social media. Such abusive discourse can cause reputation damage and adversely affect psychological health. Large social media companies are trying to prevent this situation and increase their service quality with the increasing number of users every day. In this context, our study proposes a system that detects hate speech in texts and warns the user against hate speech. The project was implemented using machine learning, deep learning and language modeling techniques with a labeled hate speech dataset collected from various sources.
The results show that BERTweet and DistilBERT language models achieved 90% accuracy. On the other hand, although the success of the classical models was lower, they were more effective temporally.
Ethical Statement
The study is complied with research and publication ethics.
References
-
S. V. Balshetwar and A. Rs, "Fake news detection in social media based on sentiment analysis using classifier techniques," Multimedia Tools and Applications, vol. 82, no. 23, pp. 35781-35811, 2023. https://doi.org/10.1007/s11042-023-14883-3
-
N. Khanduja, N. Kumar, and A. Chauhan, "Telugu language hate speech detection using deep learning transformer models: Corpus generation and evaluation," Systems and Soft Computing, p. 200112, 2024. https://doi.org/10.1016/j.sasc.2024.200112.
-
C. D. Putra and H.-C. Wang, "Advanced BERT-CNN for hate speech detection," Procedia Computer Science, vol. 234, pp. 239–246, 2024. https://doi.org/10.1016/j.procs.2024.02.170.
-
S. MacAvaney, H.-R. Yao, E. Yang, K. Russell, N. Goharian, and O. Frieder, "Hate speech detection: Challenges and solutions," PLOS ONE, vol. 14, no. 8, Article e0221152, 2019. https://doi.org/10.1371/journal.pone.0221152.
-
Z. Waseem and D. Hovy, "Hateful symbols or hateful people? Predictive features for hate speech detection on Twitter," in Proceedings of the NAACL Student Research Workshop, Association for Computational Linguistics, 2016. https://doi.org/10.18653/v1/n16-2013.
-
J. F. Allen, "Natural language processing," in Encyclopedia of Computer Science, 2003, pp. 1218-1222.
-
M. A. Alonso, D. Vilares, C. Gómez-Rodríguez, and J. Vilares, "Sentiment analysis for fake news detection," Electronics, vol. 10, no. 11, p. 1348, 2021. https://doi.org/10.3390/electronics10111348
-
Y. M. Ibrahim, R. Essameldin, and S. M. Darwish, "An adaptive hate speech detection approach using neutrosophic neural networks for social media forensics," Computers, Materials & Continua, pp. 1-10, 2024. https://doi.org/10.32604/cmc.2024.047840.
-
D. Mody, Y. Huang, and T. E. A. de Oliveira, "A curated dataset for hate speech detection on social media text," Data in Brief, vol. 46, p. 108832, 2023.
-
I. Kwok and Y. Wang, "Locate the hate: Detecting tweets against blacks," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 27, no. 1, pp. 1621-1622, 2013. https://doi.org/10.1609/aaai.v27i1.8539.
-
S. Tulkens, L. Hilte, E. Lodewyckx, B. Verhoeven, and W. Daelemans, "A dictionary-based approach to racism detection in Dutch social media," arXiv preprint arXiv:1608.08738, 2016.
-
P. Mishra, M. Del Tredici, H. Yannakoudakis, and E. Shutova, Author Profiling for Hate Speech Detection. [Online]. Available: http://arxiv.org/abs/1902.06734.
-
T. Davidson, D. Warmsley, M. Macy, and I. Weber, "Hateful symbols or hateful people? Predictive features for hate speech detection on Twitter," arXiv preprint arXiv:1703.06707, 2017.
-
A. Rios, "FuzzE: Fuzzy fairness evaluation of offensive language classifiers on African-American English," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 01, pp. 881-889, 2020. https://doi.org/10.1609/aaai.v34i01.5434.
-
P. Kar and S. Debbarma, "Sentiment analysis & hate speech detection on English and German text collected from social media platforms using optimal feature extraction and hybrid diagonal gated recurrent neural network," Engineering Applications of Artificial Intelligence, vol. 126, p. 107143, 2023.
-
M. Subramanian, V. E. Sathiskumar, G. Deepalakshmi, J. Cho, and G. Manikandan, "A survey on hate speech detection and sentiment analysis using machine learning and deep learning models," Alexandria Engineering Journal, vol. 80, pp. 110-121, 2023.
-
B. R. Chakravarthi et al., "Detecting abusive comments at a fine-grained level in a low-resource language," Natural Language Processing Journal, vol. 3, p. 100006, 2023.
-
A. Mousa, I. Shahin, A. B. Nassif, and A. Elnagar, "Detection of Arabic offensive language in social media using machine learning models," Intelligent Systems with Applications, vol. 22, p. 200376, 2024.
-
W. Sharif, S. Abdullah, S. Iftikhar, D. Al-Madani, and S. Mumtaz, “Enhancing Hate Speech Detection in the Digital Age: A Novel Model Fusion Approach Leveraging a Comprehensive Dataset”, IEEE Access, vol. 12, pp. 27225–27236, 2024. Accessed: Mar. 30, 2025. [Online]. Available: https://doi.org/10.1109/access.2024.3367281
-
I. Riadi, A. Fadlil, and M. Murni, "Identifying hate speech in tweets with sentiment analysis on Indonesian Twitter utilizing support vector machine algorithm," Khazanah Informatika: Jurnal Ilmu Komputer dan Informatika, vol. 9, no. 2, pp. 179–191, Oct. 2023. [Online]. Available: https://doi.org/10.23917/khif.v9i2.22470.
-
A. Tabassum and R. R. Patil, "A survey on text pre-processing & feature extraction techniques in natural language processing," International Research Journal of Engineering and Technology (IRJET), vol. 7, no. 06, pp. 4864-4867, 2020.
-
M. Hoekstra, Analyzing Personality Trait Intercorrelations: A Comparison between Model-Generated of Questionnaire-Derived Correlations (Master's thesis), 2023.
-
J. Li, Y. Zhu, and K. Sun, “A novel iteration scheme with conjugate gradient for faster pruning on transformer models”, Complex & Intell. Syst., Aug. 2024. Accessed: Mar. 30, 2025. [Online]. Available: https://doi.org/10.1007/s40747-024-01595-w
-
M. Md Abdul Qudar and V. Mago, "TweetBERT: A Pretrained Language Representation Model for Twitter Text Analysis," 2020. [PDF]
-
M. V. Koroteev, "BERT: a review of applications in natural language processing and understanding," arXiv preprint arXiv:2103.11943, 2021. [PDF]
-
K. Sheng Tai, R. Socher, and C. D. Manning, "Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks," 2015. [PDF]
-
G. Van Houdt, C. Mosquera, and G. Nápoles, “A review on the long short-term memory model”, Artif. Intell. Rev., vol. 53, no. 8, pp. 5929–5955, May 2020. Accessed: Mar. 30, 2025. [Online]. Available: https://doi.org/10.1007/s10462-020-09838-1
-
P. Rakshit and A. Sarkar, "A supervised deep learning-based sentiment analysis by the implementation of Word2Vec and GloVe embedding techniques," Multimedia Tools and Applications, pp. 1-34, 2024.
Year 2025,
Volume: 14 Issue: 2, 1077 - 1095, 30.06.2025
Beste Akdik
,
Güncel Sarıman
References
-
S. V. Balshetwar and A. Rs, "Fake news detection in social media based on sentiment analysis using classifier techniques," Multimedia Tools and Applications, vol. 82, no. 23, pp. 35781-35811, 2023. https://doi.org/10.1007/s11042-023-14883-3
-
N. Khanduja, N. Kumar, and A. Chauhan, "Telugu language hate speech detection using deep learning transformer models: Corpus generation and evaluation," Systems and Soft Computing, p. 200112, 2024. https://doi.org/10.1016/j.sasc.2024.200112.
-
C. D. Putra and H.-C. Wang, "Advanced BERT-CNN for hate speech detection," Procedia Computer Science, vol. 234, pp. 239–246, 2024. https://doi.org/10.1016/j.procs.2024.02.170.
-
S. MacAvaney, H.-R. Yao, E. Yang, K. Russell, N. Goharian, and O. Frieder, "Hate speech detection: Challenges and solutions," PLOS ONE, vol. 14, no. 8, Article e0221152, 2019. https://doi.org/10.1371/journal.pone.0221152.
-
Z. Waseem and D. Hovy, "Hateful symbols or hateful people? Predictive features for hate speech detection on Twitter," in Proceedings of the NAACL Student Research Workshop, Association for Computational Linguistics, 2016. https://doi.org/10.18653/v1/n16-2013.
-
J. F. Allen, "Natural language processing," in Encyclopedia of Computer Science, 2003, pp. 1218-1222.
-
M. A. Alonso, D. Vilares, C. Gómez-Rodríguez, and J. Vilares, "Sentiment analysis for fake news detection," Electronics, vol. 10, no. 11, p. 1348, 2021. https://doi.org/10.3390/electronics10111348
-
Y. M. Ibrahim, R. Essameldin, and S. M. Darwish, "An adaptive hate speech detection approach using neutrosophic neural networks for social media forensics," Computers, Materials & Continua, pp. 1-10, 2024. https://doi.org/10.32604/cmc.2024.047840.
-
D. Mody, Y. Huang, and T. E. A. de Oliveira, "A curated dataset for hate speech detection on social media text," Data in Brief, vol. 46, p. 108832, 2023.
-
I. Kwok and Y. Wang, "Locate the hate: Detecting tweets against blacks," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 27, no. 1, pp. 1621-1622, 2013. https://doi.org/10.1609/aaai.v27i1.8539.
-
S. Tulkens, L. Hilte, E. Lodewyckx, B. Verhoeven, and W. Daelemans, "A dictionary-based approach to racism detection in Dutch social media," arXiv preprint arXiv:1608.08738, 2016.
-
P. Mishra, M. Del Tredici, H. Yannakoudakis, and E. Shutova, Author Profiling for Hate Speech Detection. [Online]. Available: http://arxiv.org/abs/1902.06734.
-
T. Davidson, D. Warmsley, M. Macy, and I. Weber, "Hateful symbols or hateful people? Predictive features for hate speech detection on Twitter," arXiv preprint arXiv:1703.06707, 2017.
-
A. Rios, "FuzzE: Fuzzy fairness evaluation of offensive language classifiers on African-American English," in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 01, pp. 881-889, 2020. https://doi.org/10.1609/aaai.v34i01.5434.
-
P. Kar and S. Debbarma, "Sentiment analysis & hate speech detection on English and German text collected from social media platforms using optimal feature extraction and hybrid diagonal gated recurrent neural network," Engineering Applications of Artificial Intelligence, vol. 126, p. 107143, 2023.
-
M. Subramanian, V. E. Sathiskumar, G. Deepalakshmi, J. Cho, and G. Manikandan, "A survey on hate speech detection and sentiment analysis using machine learning and deep learning models," Alexandria Engineering Journal, vol. 80, pp. 110-121, 2023.
-
B. R. Chakravarthi et al., "Detecting abusive comments at a fine-grained level in a low-resource language," Natural Language Processing Journal, vol. 3, p. 100006, 2023.
-
A. Mousa, I. Shahin, A. B. Nassif, and A. Elnagar, "Detection of Arabic offensive language in social media using machine learning models," Intelligent Systems with Applications, vol. 22, p. 200376, 2024.
-
W. Sharif, S. Abdullah, S. Iftikhar, D. Al-Madani, and S. Mumtaz, “Enhancing Hate Speech Detection in the Digital Age: A Novel Model Fusion Approach Leveraging a Comprehensive Dataset”, IEEE Access, vol. 12, pp. 27225–27236, 2024. Accessed: Mar. 30, 2025. [Online]. Available: https://doi.org/10.1109/access.2024.3367281
-
I. Riadi, A. Fadlil, and M. Murni, "Identifying hate speech in tweets with sentiment analysis on Indonesian Twitter utilizing support vector machine algorithm," Khazanah Informatika: Jurnal Ilmu Komputer dan Informatika, vol. 9, no. 2, pp. 179–191, Oct. 2023. [Online]. Available: https://doi.org/10.23917/khif.v9i2.22470.
-
A. Tabassum and R. R. Patil, "A survey on text pre-processing & feature extraction techniques in natural language processing," International Research Journal of Engineering and Technology (IRJET), vol. 7, no. 06, pp. 4864-4867, 2020.
-
M. Hoekstra, Analyzing Personality Trait Intercorrelations: A Comparison between Model-Generated of Questionnaire-Derived Correlations (Master's thesis), 2023.
-
J. Li, Y. Zhu, and K. Sun, “A novel iteration scheme with conjugate gradient for faster pruning on transformer models”, Complex & Intell. Syst., Aug. 2024. Accessed: Mar. 30, 2025. [Online]. Available: https://doi.org/10.1007/s40747-024-01595-w
-
M. Md Abdul Qudar and V. Mago, "TweetBERT: A Pretrained Language Representation Model for Twitter Text Analysis," 2020. [PDF]
-
M. V. Koroteev, "BERT: a review of applications in natural language processing and understanding," arXiv preprint arXiv:2103.11943, 2021. [PDF]
-
K. Sheng Tai, R. Socher, and C. D. Manning, "Improved Semantic Representations From Tree-Structured Long Short-Term Memory Networks," 2015. [PDF]
-
G. Van Houdt, C. Mosquera, and G. Nápoles, “A review on the long short-term memory model”, Artif. Intell. Rev., vol. 53, no. 8, pp. 5929–5955, May 2020. Accessed: Mar. 30, 2025. [Online]. Available: https://doi.org/10.1007/s10462-020-09838-1
-
P. Rakshit and A. Sarkar, "A supervised deep learning-based sentiment analysis by the implementation of Word2Vec and GloVe embedding techniques," Multimedia Tools and Applications, pp. 1-34, 2024.