# Social Media Hate Speech Detection Using Explainable Artificial Intelligence (XAI)
## 4 Conclusions
### Conclusion of the Study on the HateXplain Dataset  
The HateXplain dataset comprises posts from Twitter and Gab and is annotated by human annotators. Several state-of-the-art models were tested on this dataset to perform evaluation on several aspects of the hate speech detection. These models contained explainability imbibed in various ways. LIME was used with interpretable models such as decision trees, random forest, logistic regression, and naive Bayes to extract weights of words that contributed significantly to the model's decision making. Furthermore, variants of BERT were created to achieve the best performance. The best performance was observed for the BERT variants, BERT + ANN and BERT + MLP, as compared to the other models. BERT + ANN had a slightly better overall performance than BERT + MLP. For appropriate comparisons, the evaluation metrics were divided into three subsets, namely, performance metrics (accuracy, precision, recall, negative predicted value, specificity, and macro F1-score), bias-based metrics, and explainability metrics (plausibility and faithfulness) as in [PERSON] et al. (2020). LIME was used to demonstrate the textual explanations on some data of the black-box models. We used explanation metrics based on the ERASER benchmark by [PERSON] et al. for the human-annotated dataset HateXplain. These metrics \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Technique** & **Subgroup AUC** & **BPSN AUC** & **BSNP AUC** \\ \hline BERT + ANN & **0.7977** & **0.7188** & **0.7391** \\ BERT + MLP & **0.8229** & **0.7752** & **0.8077** \\ DT-LIME & 0.6926 & 0.6578 & 0.6617 \\ RF-LIME & 0.7627 & 0.6977 & 0.5978 \\ LR-LIME & 0.5266 & 0.4522 & 0.4991 \\ NB-LIME & 0.6136 & 0.4812 & 0.5049 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Explainability Metrics. suggested how faithful the results of these models were in identifying hateful comments as compared to other existing models. LIME is a surrogate model which is used to highlight contributing words or tokens that can play major part in a comment being hateful or not hateful. The accuracy scores of BERT + MLP and BERT + ANN were 93.67% and 93.55%, respectively, outperforming the simple BERT implementations by [PERSON] et al. (2020) with an accuracy score 69.8%. The prime reason behind this difference was the combination of BERT with neural network models such as MLP and ANN. Furthermore, our models are trained on 50 epochs, which took around 11.5 and 8.3 h, on Google Colab Pro. The precision scores of BERT + ANN and BERT + MLP were 95.2% and 95%, while recall scores were 93.1% and 93%, respectively. The results of the macro F1-score were calculated to be 94.14% and 93.99%, respectively. In terms of bias-based metrics, the BERT variant models performed better in reducing the unintended model bias for all the bias metrics. We observed that the presence of community terms within the rationales was effective in reducing the unintended bias. The BERT + MLP model handled this bias much better than other models in terms of subgroup, BPSN (background positive, subgroup negative), and BNSP (background negative, subgroup positive) AUC with values of 0.8229, 0.7752, and 0.8077, respectively, representing an improvement over simple BERT implementation (0.807, 0.745, and 0.763, respectively) by [PERSON] et al. (2020). Future research on hate speech should consider the impact of the model performance on individual communities to have a clear understanding. Considering the explainability metrics using the ERASER benchmark by [PERSON] et al. (2019), two main factors were evaluated: plausibility (defined by IOU F1, token F1, and AUPRC) and faithfulness (defined by comprehensiveness and sufficiency). The best-performing models, BERT + ANN and BERT + MLP, had plausibility (IOU F1, token F1, and AUPRC) values of 0.188, 0.507, and 0.8384, and 0.29, 0.529, and 0.8589, respectively, compared to the base BERT model (0.222, 0.506, and 0.841, respectively) in the paper by [PERSON] et al. (2020). BERT + MLP performed better than the simple BERT implementation.