Context-Aware Harmful Language Identification on Social Media Using Machine Learning and Explainable AI
DOI:
https://doi.org/10.62647/Keywords:
Harmful Language Detection, NLP, Machine Learning, Explainable AI, Transformer ModelsAbstract
The proliferation of social media platforms has transformed digital communication, enabling real-time interaction and large-scale content sharing. However, this growth has simultaneously increased the prevalence of harmful language, including abusive, offensive, and toxic expressions that negatively affect individuals and online communities. Manual moderation and rule-based systems are insufficient due to scalability limitations and poor contextual understanding. This paper proposes a comprehensive and interpretable framework for context-aware harmful language identification using classical machine learning techniques, extended with transformer-based modeling and explainable artificial intelligence (XAI). The framework incorporates a complete natural language processing pipeline, including data preprocessing, feature extraction, model training, and extensive evaluation. Multiple classifiers are systematically compared using accuracy, precision, recall, F1-score, AUC–ROC, confusion matrices, and Precision–Recall curves. Experimental results demonstrate that ensemble-based models provide strong baseline performance, while transformer-based approaches improve contextual discrimination. The integration of explainable AI techniques enhances transparency, accountability, and trust, making the system suitable for responsible real-world content moderation.
Downloads
Downloads
Published
Issue
Section
License
Copyright (c) 2025 Ahmed Qudsi Ghouse Ali Khan, Sadia Kausar (Author)

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











