Multi-Label Toxic Comment Detection Using BERT-Based NLP and Machine Learning - Adhikari, Binita; Sapkota, Pratistha; Shakya, Rajad (International Journal on Engineering Technology and Infrastructure Development, 2026)
The rapid growth of online communication platforms has significantly increased the prevalence of toxic and abusive language, creating major challenges for content moderation and online safety. Traditional keyword-based and machine learning approaches often fail to capture contextual and semantic nuances present in toxic comments. This study proposes a BERT-based toxic comment detection system using Natural Language Processing (NLP) and deep learning techniques for multi-label classification of online comments. The proposed model classifies comments into six toxicity categories: toxic, severe toxic, obscene, threat, insult, and identity hate using the Jigsaw Toxic Comment Classification Challenge dataset. The methodology includes data preprocessing, tokenization using the BERT tokenizer, and fine-tuning of the pre-trained BERT-base-uncased model. Experimental evaluation demonstrates that the proposed model achieved a micro-average F1-score of 0.7354, outperforming traditional machine learning approaches such as Logistic Regression, Random Forest, Naive Bayes, and Support Vector Machine (SVM). The results indicate that transformer-based architectures effectively capture contextual relationships and implicit toxic expressions compared to conventional methods. However, performance on minority classes such as threat and identity hate remained limited because of severe dataset imbalance. The findings demonstrate the effectiveness of BERT for context-aware toxic comment classification and highlight its potential application in automated moderation systems for safer online communication platforms.