Hate speech detection by classic machine learning
Tharwat El-Sayed, Abdallah Mustafa, Ayman El‐Sayed, Mohamed A. El-Rashidy · 2023
It is becoming increasingly important for society to identify hate speech on social media. Differentiating hate speech from other instances involving offensive language is a significant difficulty for automatic hate speech tracking on social media. To distinguish between these categories, we train various classical machine learning models such as logistic regression, decision trees, random forest, naive Bayes, k-nearest neighbors, and support vector machines (SVM) - support vector classifier (SVC) on a dataset divided into three groups: those containing hate speech, those containing only offensive language, and those containing neither. From our practical trials, we found that the Logistic Regression algorithm and the SVM-SVC algorithm perform well in detecting hate speech and offensive language.