Zero-shot Code-Mixed Offensive Span Identification through Rationale Extraction (2022)

Abstract: This paper investigates the effectiveness of sentence-level transformers for zero-shot offensive span identification on a code-mixed Tamil dataset. More specifically, we evaluate rationale extraction methods of Local Interpretable Model Agnostic Explanations (LIME) (CITATION) and Integrated Gradients (IG) (CITATION) for adapting transformer based offensive language classification models for zero-shot offensive span identification. To this end, we find that LIME and IG show baseline F_{1} of 26.35% and 44.83%, respectively. Besides, we study the effect of data set size and training process on the overall accuracy of span identification. As a result, we find both LIME and IG to show significant improvement with Masked Data Augmentation and Multilabel Training, with F_{1} of 50.23% and 47.38% respectively. Disclaimer : This paper contains examples that may be considered profane, vulgar, or offensive. The examples do not represent the views of the authors or their employers/graduate schools towards any person(s), group(s), practice(s), or entity/entities. Instead they are used to emphasize only the linguistic research challenges.

## introduction offensive language classification and offensive span identification from code-mixed tamil-english comments portray the same task at different granularities. in the former case, we classify if the code mixed sentence is offensive or not, while the latter concentrates on extracting the offensive parts of the comments. accordingly, one could do the former using models of the latter and vice versa. transformer-based architectures such as bert @xcite , roberta @xcite and xlm-roberta @xcite have achieved state-of-the-art results on both these tasks @xcite . however, often * corresponding author these tasks are treated as independent and model development is often separated. this paper studies the rationale extraction methods for inferring offensive spans from transformer models trained only on comment-level offensive language classification labels. such an idea is often vital in the case of code-mixed tamil-english comments for which span annotations are often costly to obtain, but comment-level labels are readily available. besides, such an approach will also help in decoding the models' logic behind the prediction of offensiveness. accordingly, we evaluate and compare two different methods, namely lime and ig, for adapting pre-trained transformer models into zero-shot offensive span labelers. our experiments show that using lime with pre-trained transformer models struggles to infer correct span level annotations in a zero-shot manner, achieving only 20% f 1 on offensive span identification for code-mixed tamil-english comments. to this end, we find that a combination of masked data augmentation and multilabel training of sentence transformers helps to better focus on individual necessary tokens and achieve a strong baseline on offensive span identification. besides, ig consistently surpasses lime even in cases where there are no data augmentation or multilabel training. overall the contributions of this paper are as follows. the rest of the paper is organized as follows. in section 2, we present lime and ig methods in brief. meanwhile section 3 and 4 focus on dataset and experimental setup. in section 5, we present detailed experiments and conclude in section 6 with our findings and possible implications on the future work. ## methods in this section, we present the two rationale extraction methods lime and ig used to turn sentencelevel transformer models into zero-shot offensive span labelers. ## datasets in this section, we present various datasets used in this study. details on how they are used across different experiments are presented in ## experimental setup in this section, we present our experimental setup in detail. all of our experiments follow the two steps as explained below. transformer training: we use three different transformer models, namely multilingual-bert, roberta, and xlm-roberta, made available by hugging face @xcite , as our transformer architecture due to their widespread usage in the context of code-mixed tamil-english offensive language identification. in line with the works of @xcite all the models were fine-tuned for 20 epochs, and the best performing checkpoint was selected. each transformer model takes 1 hour to train on a tesla-v100 gpu with a learning rate of 3x10 -5 . further, all of our experiments were run five times with different random seeds and the results so reported are an average of five runs. the relationship between the datasets used to train the transformers across various experiments is as shown in span extraction testing: after training the transformer models for offensive language identification, we use the test set from the offensive span identification dataset for testing purposes. for lime, we use individual transformer models' mask token to mask out individual words and allow lime to generate 5000 masked samples per sentence. the resulting explanation weights are then used as scores for each word, and tokens below the fixed decision threshold of τ = -0.01 are removed while the spans of the rest of the comments are used for offensive span identification. meanwhile, for the ig model, for each sentence in the test set, we perform 50 iterations to generate scores for each word and extract the spans in line with lime. ## experiments, results and analysis the consolidated results are presented in ## conclusion this work examines rationale extraction methods for inferring offensive spans from the transformer model trained for offensive sentence classification. experiments revealed that approaches such as lime do not perform as well when applied to transformers directly, attributing to potential issues with surrogate models and perturbation procedures. meanwhile, we can see ig as the clear front runner for identifying offensive spans in a zero-shot way. we think this is due to the inherent nature of the method, where it focuses on creating the input at the same time learning the reason for offensiveness. besides, we also analyzed lime and ig under large datasets and incorporated position information in the training process. to this end, we discovered that only augmenting does not improve the performance of lime. however, when this large data is coupled with labels incorporating position information, both lg and ig improve significantly. especially lime prefers this approach with large improvements on f 1 , despite ig outperforming lime. additionally, we also found xlm-roberta to be a clear winner among the transformer models owing to its intrinsic learning of relationships which potentially helps with comments that are longer size. however, many details were unexplored, including (i) the effect of random perturbations on overall results (ii) the approach to merge attributions of multilabel predictions, which we plan to explore in the immediate future.