Impact of Politically Biased Data on Hate Speech Classification (2020)

Abstract: One challenge that social media platforms are facing nowadays is hate speech. Hence, automatic hate speech detection has been increasingly researched in recent years - in particular with the rise of deep learning. A problem of these models is their vulnerability to undesirable bias in training data. We investigate the impact of political bias on hate speech classification by constructing three politically-biased data sets (left-wing, right-wing, politically neutral) and compare the performance of classifiers trained on them. We show that (1) political bias negatively impairs the performance of hate speech classifiers and (2) an explainable machine learning model can help to visualize such bias within the training data. The results show that political bias in training data has an impact on hate speech classification and can become a serious issue.

## introduction social media platforms, such as twitter and facebook, have gained more and more popularity in recent years. one reason is their promise of free speech, which also obviously has its drawbacks. with the rise of social media, hate speech has spread on these platforms as well @xcite . but hate speech is not a pure online problem because online hate speech can be accompanied by offline crime @xcite . due to the enormous amounts of posts and comments produced by the billions of users every day, it is impossible to monitor these platforms manually. advances in machine learning (ml), however, show that this technology can help to detect hate speech -currently with limited accuracy @xcite . there are many challenges that must be addressed when building a hate speech classifier. first of all, an undesirable bias in training data can cause models to produce unfair or incorrect results, such as racial discrimination @xcite . this phenomenon is already addressed by the research community. researchers have examined methods to identify and mitigate different forms of bias, such as racial bias or annotator bias @xcite @xcite . but it has not been solved yet; on the contrary, more research is needed @xcite . secondly, most of the classifiers miss a certain degree of transparency or explainability to appear trustworthy and credible. especially in the context of hate speech detection, there is a demand for such a feature @xcite ; @xcite . the reason is the value-based nature of hate speech classification, meaning that perceiving something as hate depends on individual and social values and social values are non-uniform across groups and societies. therefore, it should be transparent to the users what the underlying values of a classifier are. the demand for transparency and explainability is also closely connected to bias because it can help to uncover the bias. in the paper, we deal with both problems. we investigate a particular form of bias -political bias -and use an explainable ai method to visualize this bias. to our best knowledge, political bias has not been addressed in hate speech detection, yet. but it could be a severe issue. as an example, a moderator of a social media platform uses a system that prioritizes comments based on their hatefulness to efficiently process them. if this system had a political bias, i.e. it favors a political orientation, it would impair the political debate on the platform. that is why we want to examine this phenomenon by addressing the following two research questions: rq1 what is the effect of politically biased data sets on the performance of hate speech classi-fiers? rq2 can explainable hate speech classification models be used to visualize a potential undesirable bias within a model? we contribute to answering these two questions by conducting an experiment in which we construct politically biased data sets, train classifiers with them, compare their performance, and use interpretable ml techniques to visualize the differences. in the paper, we use hate speech as an overarching term and define it as "any communication that disparages a person or a group on the basis of some characteristic such as race, color, ethnicity, gender, sexual orientation, nationality, religion, or other characteristic" (nockleby (2000, p.1277), as cited in @xcite ). ## methodology our approach for the experiment is to train hate speech classifiers with three different politically bi-ased data sets and then to compare the performance of these classifiers, as depicted in figure 1 . to do so, we use an existing twitter hate speech corpus with binary labels (offensive, non-offensive), extract the offensive records, and combine them with three data sets each (politically left-wing, politically right-wing, politically neutral) implicitly labeled as non-offensive. subsequently, classifiers are trained with these data sets and their f1 scores are compared. additionally, we apply shap to explain predictions of all three models and to compare the explanations. our code is available on github foot_0 . ## discussion the experiment shows that the politically biased classifiers (left-and right-wing) perform worse than the politically neutral one, and consequently that political bias in training data can lead to an impairment of hate speech detection (rq1). in this context, it is relevant to consider only the gaps between the f1 classifiers' scores at 100% replace-ment rate. the gaps reflect the performance decrease of the politically biased classifiers. the rise of the f1 scores with an increasing replacement rate is caused by the fact that the new non-offensive tweets are less similar to the offensive ones of the original data set. the results also indicate that a right-wing bias impairs the performance more strongly than a leftwing bias. this hypothesis, however, cannot be confirmed with the experiment because we do not have enough details about the composition of the offensive tweets. it could be that right-wing hate speech is overrepresented in the offensive part. the effect would be that the right-wing classifier has more difficulties to distinguish between offensive and non-offensive than the left-wing one even if both data sets are equally hateful. the reason is that the vocabulary of the right-wing data set is more coherent. therefore, this hypothesis can neither be confirmed nor rejected by our experiment. concerning rq2, we show that explainable ml models can help to identify and to visualize a political bias in training data. the two analyzed tweets provide interesting insights. the downside of the approach is that these frameworks (in our case shap) can only provide local explanations, meaning only single inputs are explained, not the entire model. it is, however, conceivable that the local explanations are applied to the entire data set, and the results are aggregated and processed in a way to identify and visualize bias. summing up, this part of the experiment can be seen rather as a proof-of-concept and lays the foundation for future research. regarding the overall approach of the experiment, one may criticize that we only simulate a political bias by constructing politically biased data sets and that this does not reflect the reality. we agree that we simulate political bias within data due to the lack of such data sets. nevertheless, we claim the relevance and validity of our results due to the following reasons: firstly, the offensive data part is the same for all classifiers. consequently, the varying performances are caused by non-offensive tweets with political bias. therefore, the fact that the offensive tweets were annotated by annotators and the non-offensive tweets were indirectly labeled is less relevant. furthermore, any issues with the offensive tweets' annotation quality do not play a role because all classifiers are trained and tested on the same offensive tweets. secondly, we con- ## conclusion we showed that political bias in training data can impair hate speech classification. furthermore, we found an indication that the degree of impairment might depend on the political orientation of bias. but we were not able to confirm this. additionally, we provide a proof-of-concept of visualizing such a bias with explainable ml models. the results can help to build unbiased data sets or to debias them. researchers that collect hate speech to construct new data sets, for example, should be aware of this form of bias and take our findings into account in order not to favor or impair a political orientation (e.g., politically balanced set of sources). our approach can be applied to identify bias with xai in existing data sets or during data collection. with these insights, researchers can debias a data set by, for example, adjusting the distribution of data. another idea that is fundamentally different from debiasing is to use these findings to build politically branded hate speech filters that are marked as those. users of a social media platform, for example, could choose between such filters depending on their preferences. of course, obvious hate speech would be filtered by all classifiers. but the classifiers would treat comments in the gray area of hate speech depending on the group's norms and values. a limitation of this research is that we simulate the political bias and construct synthetic data sets with offensive tweets annotated by humans and nonoffensive tweets that are only implicitly labeled. it would be better to have a data set annotated by different political orientations to investigate the impact of political bias. but such an annotating process is very challenging. another limitation is that the germeval data and our gathered data are from different periods. we, however, compensate this through our topic modeling-based data creation. nevertheless, political bias in hate speech data is a phenomenon that researchers should be aware of and that should be investigated further. all in all, we hope that this paper contributes helpful insights to the hate speech research and the fight against hate speech.