Fine-tuning for multi-domain and multi-label uncivil language detection (2020)

Abstract: Incivility is a problem on social media, and it comes in many forms (name-calling, vulgarity, threats, etc.) and domains (microblog posts, online news comments, Wikipedia edits, etc.). Training machine learning models to detect such incivility must handle the multi-label and multi-domain nature of the problem. We present a BERT-based model for incivility detection and propose several approaches for training it for multi-label and multi-domain datasets. We find that individual binary classifiers outperform a joint multi-label classifier, and that simply combining multiple domains of training data outperforms other recently-proposed fine tuning strategies. We also establish new state-of-the-art performance on several incivility detection datasets.

## introduction in 2019, 93% of americans identify incivility as a problem, with 68% classifying it as a "major" problem, and those who experienced incivility faced on average 10.2 uncivil interactions each week @xcite . of those who expect civility to get worse, "social media/the internet" tops the list of what they blame, above "the white house", "politicians in general", "the news media", etc. especially on social media and the internet, this incivility often takes the form of uncivil language, features of discussion that convey an unnecessarily disrespectful tone toward the discussion forum, its participants, or its topics @xcite . uncivil language can range from name-calling (e.g., mark, you're some kind of special stupid) to vulgarity (e.g., just build the damn mine already!) to threats (e.g., fine. i will destroy you.) and beyond. different types of incivilities often appear in the same utterance (e.g., name-calling, vulgarity, and threats are all included in shut up, you fat poop, or i will kick your ass!!!). uncivil language appears in many places online, from microblogs like twitter, to comments on online newspapers, to edit histories of resources like wikipedia. uncivil language detection is thus a multi-label and multi-domain language processing problem. while there has been much research in natural language processing methods for identifying such incivility, especially in the subarea of abusive language @xcite @xcite @xcite , the multi-label and multi-domain nature of incivility detection is understudied. we thus consider incivility detection on several datasets that (1) require the classification of incivility into several not-mutually-exclusive fine-grained categories, and (2) cover multiple genres of online interactions. our contributions are: we frame uncivil language detection as a multilabel text classification problem, where the input is a piece of text, and the outputs are the types of incivilities (name-calling, vulgarity, etc.) that are present. formally, we aim to learn a function h such that for each piece of text x: where repr(x) is a tensor representing that text (e.g., a series of word vectors), and y is a binary vector where y i is 1 if x contains the i th form of incivility and 0 otherwise. we frame learning such h functions a multidomain classifier training problem, where training and testing data are drawn from multiple domains (news comments, politician tweets, etc.). formally, given a domain d i , we aim to learn a function h d i that maximizes performance on test data d itest by training on examples (x, y) drawn from training data d 1 train d 2 train . . . d n train . ## data we consider the following datasets for evaluating multi-label and multi-domain incivility detection. local news comments in this multi-label dataset, the following labels are defined and used to annotate online comments on local news articles by @xcite : local politics tweets coe and colleagues also annotated a collection of microblog posts from the twitter accounts of their local politicians, but only for name-calling incivility. russian troll tweets coe and colleagues also annotated a small subset of the 3 million english tweets written by russian trolls and collected by linvill and warren (2018) foot_0 , again for just name-calling incivility. wikipedia comments in this multi-label dataset, also known as the kaggle toxic comment classification challenge, jigsaw/google's conversation ai team annotated comments from wikipedia's talk page edits (conversation ai, 2018) for the presence of the following types of abusive language, defined by perspective ai (2020). the three datasets annotated by coe and colleagues can be used in multi-domain experiments, as they share the same annotation scheme. they share only the label name-calling, so our multi-domain experiments consider only binary classification. the local news comments and wikipedia comments datasets can be used in multi-label experiments, as they have been annotated for multiple forms of incivility. they do not share annotation schemes, so our multi-label experiments consider each multi-label dataset separately. ## prior work there is much recent work on detecting incivility (also referred to as toxicity, abusive language, offensive language, etc.) in social media. @xcite presents an overview of such efforts and shows that many datasets constructed for this purpose have unintended bias because of how they have been sampled. we focus on the @xcite and conversation ai (2018) datasets because they do not have the problems with topicbiased sampling that some other datasets do, where topic words are better predictors of incivility than uncivil words. there have also been several recent shared tasks that consider incivility. both the offenseval shared task @xcite and the hateval (basile et al., 2019) shared task ran as part of semeval-2019 and considered detection of various forms of offensive and hate speech. neither of these tasks focused on a multi-label or multi-domain problem. a few models have been designed for and evaluated on the multi-label, multi-domain corpora we consider. @xcite considered the local news comments corpus, training recurrent neural network models, and focusing on only the top two most frequent labels for this dataset. they achieved 0.48 f 1 for name-calling and 0.53 f 1 for vulgarity. van aken et al. (2018) presented multiple approaches to the wikipedia comments dataset. they developed an ensemble of logistic regression, recurrent neural networks, and convolutional neural networks, achieving an auc score of 0.983. there are a few recent works in cross-domain abusive language detection. @xcite ; @xcite ; pamungkas and patti (2019) all explore training models on one abusive language dataset and testing on another. they focus on binary predictions and bag-of-words support vector machine classifiers (though pamungkas and patti (2019) also explores a recurrent neural network). they do not consider multi-label problems, or modern pre-trained neural networks like bert, which were more successful in recent shared tasks on abusive language @xcite . they also evaluate on several datasets that have been identified as problematic by @xcite due to their use of topic-biased sampling. ## experiments we use bert @xcite as the starting point for all experiments. bert is a pre-trained transformer-based neural network that has shown impressive performance on a wide variety of nlp tasks. we follow the standard approach for finetuning bert for text classification, placing a fully connected layer over bert's [cls] output. we use n sigmoids on this layer rather than a softmax activation, since we are performing multi-label classification. bert is then fine-tuned as usual, with hyperparameters like learning rate, maximum sequence length, number of epochs, training batch size tuned on the development set. we explored each hyperparameter within the following ranges: learning rate: 8e-6, 2e-5, 4e-5, 8e-5 maximum sequence length: 128, 256, 512 number of epochs: 2, 3, 4, 5, 6, 8 training batch size: 16, 32, 64, 128 ## limitations we focused on a bert-based model due to its top-ranking performance in related shared tasks @xcite , but recent advances over bert, e.g., roberta @xcite might yield additional gains. we also focused on the limited number of datasets that could support multilabel and/or multi-domain experiments, but our results could be strengthened by creating new multilabel, multi-domain datasets. finally, class imbalance only partly explains why a joint multi-label classifier failed to outperform independent binary classifiers, indicating that further investigation is needed into multi-label classification approaches for uncivil language. ## conclusion we applied bert on multi-label and multi-domain incivility detection tasks and achieved a new stateof-the-art on several different datasets. in exploring different training procedures, we found that it was better to directly combine data from multiple domains than other more complex procedures, and that it was better to train individual binary classifiers than to train a joint multi-label classifier.