An ensemble approach for offensive and hate speech detection from Roman Urdu social media platforms
Online platforms increasingly host hate and offensive content, motivating reliable automatic detection for moderation and safety. This study evaluates classical machine learning (Naïve Bayes (NB), Random Forest (RF), Support Vector Machine (SVM), and Logistic Regression (LR)) and neural models (Long Short-Term Memory (LSTM) and Multi-Layer Perceptron (MLP)) on three Roman Urdu benchmarks: Roman Urdu Hate-speech and Offensive Language Detection (RUHSOLD), Violent Views Detection Dataset in Urdu (VVD-21), and Hate Speech Roman Urdu (HS-RU-20). Experiments were conducted at word and sentence levels, and performance was assessed using accuracy, precision, recall, and F1-score. On RUHSOLD, LSTM achieved the highest accuracy (90%) at both word- and sentence-levels. On VVD-21 and HS-RU-20, SVM attained the best sentence-level accuracy (83%), with strong hostile-class F1, but weak neutral-class recall. Overall, LSTM favored sequential inputs, whereas SVM performed effectively on structured representations. Neutral detection remained challenging, reflecting class imbalance and subtle contextual usage. The findings underscore the need for improved feature representations and context-aware models. Future work should incorporate transformer-based encoders and adversarial training to enhance robustness and reduce bias.
Authors
- Rashid Amin (ORCID: https://orcid.org/0000-0002-3143-689X)
- Mohammed A. El-Meligy (ORCID: https://orcid.org/0000-0003-3972-9934)
- Jaroslav Frnda (ORCID: https://orcid.org/0000-0001-6065-3087)
- Nazia Khalid (ORCID: https://orcid.org/0000-0001-7373-7327)
- Mohamed Abdel Fattah Sharaf (ORCID: https://orcid.org/0000-0001-6722-8366)
- Hira Akhtar Butt (ORCID: https://orcid.org/0009-0008-7793-1184)
- Zunaira Rashid (ORCID: https://orcid.org/0009-0002-1465-4649)
Institutions
- VSB - Technical University of Ostrava (CZ)
- University of Engineering and Technology Taxila (PK)
- University of Central Punjab (PK)
- Jadara University (JO)
- King Saud University (SA)
- University of Žilina (SK)
- University of Management and Technology (PK)
Publication Details
- Journal
- PeerJ Computer Science
- Published
- 2026-11-30
- DOI
- https://doi.org/10.7717/peerj-cs.4161
- Primary Topic
- Hate Speech and Cyberbullying Detection
- Type
- article
- Field-Weighted Citation Impact
- 0.00