Open Access iconOpen Access

ARTICLE

crossmark

Using Hate Speech Detection Techniques to Prevent Violence and Foster Community Safety

Ayaz Hussain1, Asad Hayat2, Muhammad Hasnain1,*

1 Department of Information Technology, Lahore Leads University, Lahore, 42000, Pakistan
2 School of Electronics and Information Engineering, Taiyuan University of Science and Technology, Taiyuan, 030000, China

* Corresponding Author: Muhammad Hasnain. Email: email

Journal on Artificial Intelligence 2025, 7, 485-498. https://doi.org/10.32604/jai.2025.071933

Abstract

Violent hate speech and scapegoating people against one another have emerged as a rising worldwide issue. But identifying and combating such content is crucial to create safer and more inclusive societies. The current study conducted research using Machine Learning models to classify hate speech and overcome the limitations posed in the existing detection techniques. Logistic Regression (LR), Random Forest (RF), K-Nearest Neighbour (KNN) and Decision Tree were used on top of a publicly available hate speech dataset. The data was preprocessed by cleaning the text and tokenization and using normalization techniques to efficiently train the model. The experimental results indicate that LR and RF achieved good performance compared to other models, with LR achieving the highest testing accuracy of 93.66 and RF providing good general performance. These results demonstrate that the state-of-the-art applications of deep learning models are surpassed by optimized, and traditional machine learning models for hate speech detection. The research also highlights the need for constant re-adaptation to a linguistic shift and new forms of intolerance, emphasizing the interest of machine learning to support the actions against prejudice and social injustice in digital environments. This study benchmarks optimized machine learning algorithms for hate speech detection, demonstrating that traditional models can rival deep learning performance.

Keywords

Hate speech; logistic regression; machine learning; random forest; violence

Cite This Article

APA Style
Hussain, A., Hayat, A., Hasnain, M. (2025). Using Hate Speech Detection Techniques to Prevent Violence and Foster Community Safety. Journal on Artificial Intelligence, 7(1), 485–498. https://doi.org/10.32604/jai.2025.071933
Vancouver Style
Hussain A, Hayat A, Hasnain M. Using Hate Speech Detection Techniques to Prevent Violence and Foster Community Safety. J Artif Intell. 2025;7(1):485–498. https://doi.org/10.32604/jai.2025.071933
IEEE Style
A. Hussain, A. Hayat, and M. Hasnain, “Using Hate Speech Detection Techniques to Prevent Violence and Foster Community Safety,” J. Artif. Intell., vol. 7, no. 1, pp. 485–498, 2025. https://doi.org/10.32604/jai.2025.071933



cc Copyright © 2025 The Author(s). Published by Tech Science Press.
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
  • 261

    View

  • 98

    Download

  • 0

    Like

Share Link