WLV - RIT at S em E val-2021 Task 5: A Neural Transformer Framework for Detecting Toxic Spans (2021)

Abstract: In recent years, the widespread use of social media has led to an increase in the generation of toxic and offensive content on online platforms. In response, social media platforms have worked on developing automatic detection methods and employing human moderators to cope with this deluge of offensive content. While various state-of-the-art statistical models have been applied to detect toxic posts, there are only a few studies that focus on detecting the words or expressions that make a post offensive. This motivates the organization of the SemEval-2021 Task 5: Toxic Spans Detection competition, which has provided participants with a dataset containing toxic spans annotation in English posts. In this paper, we present the WLV-RIT entry for the SemEval-2021 Task 5. Our best performing neural transformer model achieves an 0.68 F1-Score. Furthermore, we develop an open-source framework for multilingual detection of offensive spans, i.e., MUDES, based on neural transformers that detect toxic spans in texts.

## introduction the widespread adoption and use of social media has led to a drastic increase in the generation of abusive and profane content on the web. to counter this deluge of negative content, social media companies and government institutions have turned to developing and applying computational models that can identify the various forms of offensive content online such as aggression @xcite , cyber-bullying @xcite , and hate speech @xcite . prior work has either designed methods for identifying conversations that are likely to go awry @xcite this paper contains text excerpts and words that are offensive in nature. @xcite or detecting offensive content and labelling posts at the instances level -this has been the focus in the recent shared tasks like hasoc at fire 2019 @xcite and fire 2020 @xcite , ger-meval 2019 task 2 @xcite , trac @xcite , hateval @xcite , offenseval at semeval-2019 @xcite and semeval-2020 @xcite . with respect to identifying offensive language in conversations, comments, and posts, noticeable progress has been made with a variety of large, annotated datasets made available in recent years @xcite . the identification of the particular text spans that make a post offensive, however, has been mostly neglected @xcite as current state-ofthe-art offensive language identification models flag the entire post or comment but do not actually highlight the offensive parts. the pressing need for toxic span detection models to assist human content moderation, processing and flagging content in a more interpretable fashion, has motivated the organization of the semeval-2021 task 5: toxic spans detection @xcite . in this paper, we present the wlv-rit submission to the semeval-2021 task 5. we explore several statistical learning models and report the performance of the best model, which is based on a neural transformer. next, we generalise our approach to an open-source framework called mudes: multilingual detection of offensive spans @xcite . alongside the framework, we also release the pretrained models as well as a user-friendly web-based user interface (ui) based on docker, which provides the functionality of automatically identifying the offensive spans in a given input text. apart from the dataset released for semeval-2021 task 5, hatexplain @xcite is, to the best of our knowledge, the only dataset that we could find that has been annotated at the word level. the dataset consists of 20, 000 posts from gab and twitter. each data sample is annotated with one of the hate/offensive/normal labels, communities being targeted, and words of the text are marked by the annotators who support the label. ## task and dataset in the semeval-2021 task 5 dataset, the sequence of words that makes a particular post or comment toxic is defined as a toxic span. the dataset for this task is extracted from posts in the civil comments dataset that have been found to be toxic. the practice dataset has 690 instances out of which 43 instances do not contain any toxic spans. the training dataset has a total of 7, 939 instances and ## evaluation and results for evaluation, we followed the same procedure that the task organisers have used to evaluate the systems. let system a i return a set s t a i of character offsets for parts of a text post that have been found to be toxic. let g t be the character offsets of the ground truth annotations of t. we compute the f1 score of system a i with respect to the ground truth g for post t as mentioned in equation 1 where | •| denotes set cardinality. p t and r t measure the precision and recall, respectively. observe in ## conclusion and future work in this paper, we presented the wlv-rit approach for tackling the semeval-2021 task 5: toxic spans detection. semeval-2021 task 5 provided participants with the opportunity of testing computational models to identify token spans in toxic posts as opposed to previous related semeval tasks such as hateval and offenseval that provided participants with datasets annotated at the instance level. we believe that word-level predictions are an important step towards explainable offensive language identification. we experimented with several methods including a lexicon-based word match, lstms, and neural transformers. our results demonstrated that transformer models offered the best generalization results and, given the success observed, we developed mudes, an open-source software framework based on neural transformers focused on detecting toxic spans in texts. with mudes. we release two english models that performed best for this task @xcite . a large model; en-large based on roberta-large which is more accurate, but has a low efficiency regarding space and time. the base model based on xlnetbase-cased; en-base is efficient, but has a comparatively low accuracy than the en-large model. all pre-trained models are available on hugging face model hub @xcite foot_2 . we also make mudes available as a python package foot_3 and set up as an open-source project foot_4 . in addition, a prototype user interface (ui) of mudes has been made accessible to the general public foot_5 based on docker 7 . in terms of future work, we would like to experiment with multi-task (neural) architectures that can be used for offensive language identification capable of carrying out predictions at both the wordlevel and post-level jointly. furthermore, we would like to evaluate multi-task architectures on multidomain and multilingual settings as well as broaden our experimental comparison to other types of recurrent network models, such as the delta-rnn @xcite .