Abstract
The social media platforms have been generating an enormous amount of data for every second. Twitter, in practice by the individuals is producing more than six hundred tweets in each second. While freely posting opinions and expressions by users, it is very difficult to confine the hate speech shared against any individual, religion or any ethnic group. Consequently, the persons targeted by such hateful content get frustrated. In this regard the different approaches have been solving this serious problem but, sometimes unable to achieve satisfactory results. Therefore, we propose different Machine Learning models to classify given data in two categories, offensive or non-offensive. The experiments were conducted on Twitter data generated by ourselves using Twitter API and Tweepy library by Python. The generated results were evaluated based upon various metrics such as accuracy, precision, recall, F1-measure and MCNEMAR test. Compared to the different machine learning algorithms, random forest ensemble classifier outperformed against other algorithms, the novelty and contribution of our research paper is: The development of Twitter dataset that consists of several tweets containing 11 object variables with four different class variables showing the different offensive levels, Machine Learning algorithms' application to detect the hate speech, Comparative analysis of different Machine Learning algorithms against different evaluating metrics including McNemar Test. The significance of proposed technique is well explained by the Twitter datasets generated through Twitter API and Tweepy library by Python.
Keywords
Hate speech detection, Machine Learning, Natural Language Processing, Social media, Text Classification
Subject Area
Computer Science
Article Type
Article
First Page
1393
Last Page
1408
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.
How to Cite this Article
Siddiqui, Jawaid Ahmed; Yuhaniz, Siti Sophiayati; and Memon, Zulfiqar Ali
(2025)
"Unmasking Online Hostility: Analysing and Mitigating Hate Speech in Social Media,"
Baghdad Science Journal: Vol. 22:
Iss.
4, Article 30.
DOI: https://doi.org/10.21123/bsj.2024.10743