Entity at S em E val-2021 Task 5: Weakly Supervised Token Labelling for Toxic Spans Detection (2021)

Abstract: Detection of toxic spans - detecting toxicity of contents in the granularity of tokens - is crucial for effective moderation of online discussions. The baseline approach for this problem using the transformer model is to add a token classification head to the language model and fine-tune the layers with the token labeled dataset. One of the limitations of such a baseline approach is the scarcity of labeled data. To improve the results, We studied leveraging existing public datasets for a related but different task of entire comment/sentence classification. We propose two approaches: the first approach fine-tunes transformer models that are pre-trained on sentence classification samples. In the second approach, we perform weak supervision with soft attention to learn token level labels from sentence labels. Our experiments show improvements in the F1 score over the baseline approach. The implementation has been released publicly.

## introduction the growth of social media platforms has led to an increase in hate speech and abusive language in online communities, primarily due to the anonymity provided on such platforms @xcite . since manual moderation is not feasible for the gigantic amount of textual data, automated toxicity detection has received significant attention with numerous datasets being released in recent years @xcite . however, most of the existing work on toxicity detection labels the entire comment as toxic or non-toxic and does not provide information about which specific part of the comment is toxic. in practice, human moderators (e.g., news portals moderators) can benefit from information on which character indices of the part of the comment that is toxic instead of just a system-generated unexplained toxicity score per post. designing models that can accurately locate toxic spans within a text is thus a crucial step towards successful semi-automated moderation. this is challenging because of the scarcity of datasets that are labeled on a segment or token level. this paper explains our approaches for the semeval-2021 task 5 which requires us to identify the character offsets for the toxic spans within a comment @xcite . we explore possible techniques for improving the results of the vanilla transformer model by leveraging several available public datasets. weakly supervised learning @xcite defined inexact supervision as a type of weakly super-vised learning in which coarse-grained labels are used to train for a more specific problem. @xcite used this approach for inferring token-level labels by training a sentence classification model. they used a bidirectional lstm to get a contextual representation @xmath0, and pass it through a fully-connected layer with hyperbolic tangent activation to obtain h @xmath1: ## methodology and experimental setup in this section, we will present our two solutions. both of our approaches are using bert pre-trained language model. in the first approach, we first finetune the bert model with additional labeled data explained in subsection 3.1 and then perform another round of fine-tuning using token classification head with task training data. in the second approach, we apply weak supervision to learn token labels for the additional dataset. we then use the augmented labeled token dataset to fine-tune the token classifier head and use it to predict labels for the task test data set. ## conclusion and future work in this paper, we proposed two solutions to improve the baseline transformer model fine-tuning for the span toxicity detection task. in the first approach, we performed sequential fine-tuning with an additional fine-tuning of the sentence classifier with supplemental public data. in the second approach, we augmented the labeled token dataset with weak supervision and then performed the fine-tuning token classification on the augmented dataset. our experimental results show that the first approach improves the baseline fine-tuning results by a 0.0572 f1 score and the second approach improves the baseline results by a 0.051 f1 score. an interesting future direction is to improve the weak supervision technique -possibly using other objective functions for relating token labels and sentence labels -and multi-task learning.