Analyzing the Feasibility of Bert Model for Toxicity Analysis of Text
摘要
Online comments can often be toxic, offensive, and harmful to individuals and communities. In recent years, there has been a growing need to automatically identify and mitigate these toxic comments. For this problem, NLP models are often used to identify such toxicity and harshness but each model has its own efficiency and performance limitations. In this paper, we propose the use of the bidirectional encoder representations from transformers (BERT) algorithm for toxicity classification of online comments. BERT is a state-of-the-art natural language processing model developed by Google in 2018 that has shown strong results on a variety of tasks. In this paper, we used the BERT algorithm for toxicity classification and evaluated its performance on a real world dataset and performed comparative analysis with conventional NLP models, logistic regression (TF-IDF) over which BERT showed an improvement of 6.9% in accuracy, 26.1% in f1-score, 21.5% in ROC score; logistic regression (BOW) over which BERT showed an improvement of 9.1% in accuracy, 70.6% in f1-score, 39.8% in ROC score; multinomialNB (BOW) over which BERT showed an improvement of 9.2% in accuracy, 25.9% in f1-score, 10.6% in ROC score.