A Comprehensive Comparative Study of Toxic Language Detection in Roman Urdu Using Hybrid Machine Learning, Deep Learning, and LoRA-Optimized Transformer Models
DOI:
https://doi.org/10.61467/2007.1558.2026.v17i4.1528Keywords:
Toxic language detection, machine learning, deep learningAbstract
The rapid growth of social media has intensified the spread of toxic language, abusive comments, and harmful online discourse, creating serious challenges for digital safety and automated moderation. This study presents a comprehensive framework for toxic language detection in Roman Urdu using machine learning, deep learning, and transformer-based approaches. First, we do the preprocessing and normalization, then text features were extracted using TF-IDF and Count Vectorizer with unigram, bigram, trigram, and combined n-gram settings. The classification models included Naive Bayes, Logistic Regression, Random Forest, Support Vector Machine, Decision Tree, AdaBoost, XGBoost, Convolutional Neural Network, Bidirectional Long Short-Term Memory, and LLaMA 3 fine-tuned with Low-Rank Adaptation. Experimental findings show that transformer-based fine-tuning produced the strongest results, with LLaMA 3 + LoRA achieving the highest F1-score of 96.78%, outperforming all baseline machine learning and deep learning models. Among conventional methods, XGBoost and Support Vector Machine demonstrated strong and stable performance, while CNN emerged as the best-performing deep learning baseline. The results confirm that parameter-efficient transformer adaptation is highly effective for toxic language detection in Roman Urdu and provides a scalable solution for content moderation in low-resource multilingual settings.
Spanish-language metadata / Metadatos en español
Título en español:
Un estudio comparativo exhaustivo sobre la detección de lenguaje tóxico en urdu romanizado mediante modelos híbridos de aprendizaje automático, aprendizaje profundo y transformadores optimizados con LoRA.
Resumen:
El rápido crecimiento de las redes sociales ha intensificado la propagación del lenguaje tóxico, los comentarios abusivos y los discursos perjudiciales en línea, lo que plantea importantes desafíos para la seguridad digital y la moderación automatizada. Este estudio presenta un marco integral para la detección de lenguaje tóxico en urdu romanizado mediante enfoques de aprendizaje automático, aprendizaje profundo y modelos basados en transformadores. En primer lugar, se realizaron el preprocesamiento y la normalización del texto; posteriormente, se extrajeron sus características mediante TF-IDF y CountVectorizer, utilizando configuraciones de unigramas, bigramas, trigramas y combinaciones de n-gramas. Los modelos de clasificación incluyeron Naive Bayes, regresión logística, bosque aleatorio, máquina de vectores de soporte, árbol de decisión, AdaBoost, XGBoost, red neuronal convolucional, memoria larga de corto plazo bidireccional y LLaMA 3 ajustado mediante adaptación de bajo rango. Los resultados experimentales muestran que el ajuste fino basado en transformadores produjo el mejor desempeño, ya que LLaMA 3 + LoRA alcanzó la puntuación F1 más alta, con un 96.78 %, y superó a todos los modelos de referencia de aprendizaje automático y aprendizaje profundo. Entre los métodos convencionales, XGBoost y la máquina de vectores de soporte mostraron un rendimiento sólido y estable, mientras que la red neuronal convolucional fue el modelo de referencia de aprendizaje profundo con mejor desempeño. Los resultados confirman que la adaptación de transformadores eficiente en parámetros es altamente eficaz para detectar lenguaje tóxico en urdu romanizado y proporciona una solución escalable para la moderación de contenidos en entornos multilingües con recursos limitados.
Smart citations:
https://scite.ai/reports/10.61467/2007.1558.2026.v17i4.1528
Dimensions.
Open Alex.
References
Aklouche, B., Bazine, Y., & Ghalia-Bououchma, Z. (2024). Offensive language and hate speech detection using transformers and ensemble learning approaches. Computación y Sistemas, 28(3), 1031–1039. https://doi.org/10.13053/CyS-28-3-4724
Al-Harigy, L. M., Al-Nuaim, H. A., Moradpoor, N., & Tan, Z. (2025). Towards a cyberbullying detection approach: Fine-tuned contrastive self-supervised learning for data augmentation. International Journal of Data Science and Analytics, 19, 469–490. https://doi.org/10.1007/s41060-024-00607-9
Almaliki, M., Almars, A. M., Gad, I., & Atlam, E.-S. (2023). ABMM: Arabic BERT-mini model for hate-speech detection on social media. Electronics, 12(4), Article 1048. https://doi.org/10.3390/electronics12041048
Althobaiti, M. J. (2022). BERT-based approach to Arabic hate speech and offensive language detection in Twitter: Exploiting emojis and sentiment analysis. International Journal of Advanced Computer Science and Applications, 13(5), 972–980. https://doi.org/10.14569/IJACSA.2022.01305109
Altinel, A. B., Baydogmus, G. K., Sahin, S., & Gurbuz, M. Z. (2024). So-haTRed: A novel hybrid system for Turkish hate speech detection in social media with ensemble deep learning improved by BERT and clustered-graph networks. IEEE Access, 12, 86252–86270. https://doi.org/10.1109/ACCESS.2024.3415350
Ansari, G., Kaur, P., & Saxena, C. (2024). Data augmentation for improving explainability of hate speech detection. Arabian Journal for Science and Engineering, 49, 3609–3621. https://doi.org/10.1007/s13369-023-08100-4
Asif, M., Al-Razgan, M., Ali, Y. A., & Yunrong, L. (2024). Graph convolution networks for social media trolls detection use deep feature extraction. Journal of Cloud Computing, 13, Article 33. https://doi.org/10.1186/s13677-024-00600-4
Caselli, T., Basile, V., Mitrović, J., & Granitzer, M. (2020). HateBERT: Retraining BERT for abusive language detection in English [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2010.12472
Clarke, C., Hall, M., Mittal, G., Yu, Y., Sajeev, S., Mars, J., & Chen, M. (2023). Rule by example: Harnessing logical rules for explainable hate speech detection [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2307.12935
García-Díaz, J. A., Pan, R., & Valencia-García, R. (2023). Leveraging zero and few-shot learning for enhanced model generality in hate speech detection in Spanish and English. Mathematics, 11(24), Article 5004. https://doi.org/10.3390/math11245004
Hussain, N., Qasim, A., Liaquat, F., Mehak, G., Meque, A. G. M., Usman, M., Sidorov, G., & Gelbukh, A. (2026). Toward bias-aware and efficient offensive language detection using QLoRA-optimized LLaMA and GPT models. In L. Martínez-Villaseñor, R. A. Vázquez, & G. Ochoa-Ruiz (Eds.), Advances in soft computing: MICAI 2025 (Lecture Notes in Computer Science, Vol. 16221, pp. 206–217). Springer. https://doi.org/10.1007/978-3-032-09037-9_17
Hussain, N., Qasim, A., Mehak, G., Kolesnikova, O., Gelbukh, A., & Sidorov, G. (2025). ORUD-Detect: A comprehensive approach to offensive language detection in Roman Urdu using hybrid machine learning–deep learning models with embedding techniques. Information, 16(2), Article 139. https://doi.org/10.3390/info16020139
Hussain, N., Qasim, A., Mehak, G., Kolesnikova, O., Gelbukh, A., & Sidorov, G. (2025). Hybrid machine learning and deep learning approaches for insult detection in Roman Urdu text. AI, 6(2), Article 33. https://doi.org/10.3390/ai6020033
Hussain, N., Qasim, A., Mehak, G., Zain, M., Hafeez, M., & Sidorov, G. (2025). Fine-tuning large language models with QLoRA for offensive language detection in Roman Urdu-English code-mixed text [Preprint]. arXiv. https://doi.org/10.48550/arXiv.2510.03683
Hussain, N., Qasim, A., Mehak, G., Zain, M., Sidorov, G., Gelbukh, A., & Kolesnikova, O. (2025). Multi-level depression severity detection with deep transformers and enhanced machine learning techniques. AI, 6(7), Article 157. https://doi.org/10.3390/ai6070157
Hussain, N., Qasim, A., Zain, M., & Sidorov, G. (2025). Secure data provenance and semantic interoperability model for big data in IoT: A healthcare perspective. Environment-Behaviour Proceedings Journal, 10(SI42), 103–108. https://doi.org/10.21834/e-bpj.v10iSI42.7747
Naseeb, A., Zain, M., Hussain, N., Qasim, A., Ahmad, F., Sidorov, G., & Gelbukh, A. (2025). Machine learning- and deep learning-based multi-model system for hate speech detection on Facebook. Algorithms, 18(6), Article 331. https://doi.org/10.3390/a18060331
Qasim, A., Mehak, G., Hussain, N., Gelbukh, A., & Sidorov, G. (2025). Detection of depression severity in social media text using transformer-based models. Information, 16(2), Article 114. https://doi.org/10.3390/info16020114
Shaheen, M., Awan, S. M., Hussain, N., & Gondal, Z. A. (2019). Sentiment analysis on mobile phone reviews using supervised learning techniques. International Journal of Modern Education and Computer Science, 11(7), 32–43. https://doi.org/10.5815/ijmecs.2019.07.04
Zain, M., Hussain, N., Qasim, A., Mehak, G., Ahmad, F., Sidorov, G., & Gelbukh, A. (2025). RU-OLD: A comprehensive analysis of offensive language detection in Roman Urdu using hybrid machine learning, deep learning, and transformer models. Algorithms, 18(7), Article 396. https://doi.org/10.3390/a18070396
Downloads
Published
How to Cite
Issue
Section
License
Copyright (c) 2026 International Journal of Combinatorial Optimization Problems and Informatics

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.