Evaluation of Different ML and Text Processing Techniques for Hate Speech Detection

Nabil Shawkat, Jesse R. Simpson, Jamil M. Saquer · 2022

Social media has become a domain that involves a lot of cyberbullying and hate speech. Some users feel entitled to engage in abusive conversations by sending abusive messages, tweets, or photos to other users. It is critical to detect hate speech and prevent innocent users from becoming victims of cyberbullying. In this paper, we investigate the applicability and performance of a variety of machine learning techniques with the help of text processing techniques in the pursuit of a reliable system for identifying hate speech. We evaluate Naïve Bayes, Support Vector Machines, Decision Trees, Random Forests, Logistic Regression, and K Nearest Neighbors on three different datasets. We used Term Frequency-Inverse Document Frequency (TF-IDF), unigram, bigram, trigram, combination of unigram and bigram, and combination of unigram, bigram, and trigram for the text corpus read by the machine learning techniques to see which approach gives better results. Additionally, since the datasets are unbalanced, we under-sampled and over-sampled the data and investigated the results. Our results show that on all three datasets over-sampling the minority class and using a combination of unigram, bigram, and trigram gave the best results with Random Forests achieving the highest F1-score of at least 0.96 on the three datasets. This was followed by SVM and Logistic Regression, which achieved F1-scores of at least 0.939.

Read the paper · More papers on PaperTik