IUST _ NLP at S em E val-2023 Task 10: Explainable Detecting Sexism with Transformers and Task-adaptive Pretraining (2023)

Abstract: This paper describes our system on SemEval-2023 Task 10: Explainable Detection of Online Sexism (EDOS). This work aims to design an automatic system for detecting and classifying sexist content in online spaces. We propose a set of transformer-based pre-trained models with task-adaptive pretraining and ensemble learning. The main contributions of our system include analyzing the performance of different transformer-based pre-trained models and combining these models, as well as providing an efficient method using large amounts of unlabeled data for model adaptive pretraining. We have also explored several other strategies. On the test dataset, our system achieves F1-scores of 83%, 64%, and 47% on subtasks A, B, and C, respectively.

## introduction discriminatory views against women in online environments can be extremely harmful so in recent years it has become a serious problem in social networks. identifying online sexism involves many challenges because sexist discrimination and misogyny have different types and appear in different forms. therefore, the aim of the edos shared task @xcite is to develop englishlanguage models for detecting sexism. these models should be more accurate and explainable and include detailed classifications for sexist content from gab and reddit. this task covers a wide range of sexist content and aims to distinguish different types of sexist content. there are three hierarchical subtasks within the task: when dealing with sexist posts, a fine-grained classification approach is utilized, where predictive systems are required to assign one of 11 specific vectors to each post. in this paper, we describe our system for three subtasks. first, we used some models based on transformers. these models are fine-tuned for classification and in addition, they are used by adding classification components in the upper layer. we have also created a model by combining several transformer-based models and adding a classification layer and using it in all three subtasks as ensemble learning. we then built a task-adaptive model to adapt it to our specific domain. we trained this model on a large unlabeled dataset and fine-tuned it on labeled data for all subtasks. for all three subtasks, we used cross-entropy loss for multi-class classification. our best system was able to achieve an f1-score of 83% (subtask a), 64% (subtask b), and 47% (subtask c) on the test dataset. ## background detecting and addressing sexist content in online spaces has emerged as a significant issue. in this work, we leverage a dataset obtained from two online networks, reddit and gab, comprising of user-generated text content. while 20,000 of the dataset are labeled, a substantial portion of it (two million) remains unlabeled. our system employs both datasets to perform the subtasks. figure 1 displays a sample input and output for each subtask. state-of-the-art results in natural language processing (nlp) tasks have been achieved by pretrained models such as bert, roberta, ernie, xlm-roberta, and deberta @xcite @xcite @xcite . these models, which are trained on large datasets with numerous parameters, have demonstrated the potential to improve system performance and generalization in recent studies. therefore, we used several pretrained models such as bert @xcite , roberta @xcite , xlm-roberta (conneau et al., 2019), competitive pre-trained models such as deberta @xcite , and largescale pre-trained models such as ernie @xcite . while pre-trained models have demonstrated excellent performance in sentence-level or paragraph-level tasks and binary classification subtask a, our preliminary tests revealed that they did not perform well in subtasks b and c, which involve classifying into four and eleven classes, respectively. the limited amount of training data available, differences in the scope of our work, and pre-trained models' training can explain these results. however, training these models in our specific domain can potentially enhance the results. in recent years, there has been significant research into detecting sexism on social media platforms. several approaches have been proposed, ranging from rule-based models to machine learning algorithms. binary classification of shared content in online networks as sexist and not-sexist has been considered in many recent works and some of the best methods used in sexism detection include deep learning, ensemble methods, and hybrid approaches. in this work @xcite , a new work is proposed that aims to understand and analyze how sexism is expressed, from overt hate or violence to subtle expressions, in online conversations. the authors first collected a dataset of 10,000 tweets on various topics including politics, sports, culture, etc. then, using this dataset, they trained different models for sexism detection using deep learning methods. for example, they used convolutional neural networks, recurrent neural networks, and hybrid neural networks. the performance of each model was then evaluated using accuracy, precision, and recall metrics. finally, the authors concluded that convolutional and hybrid neural networks are more accurate and precise in detecting sexism on twitter. in @xcite binary and multi-class classification, two multilingual transformer models are used, one based on multilingual bert and the other based on xlm-r. this paper's approach uses two different strategies to adapt transformers to detect sexist content. first, unsupervised pre-training with additional data, and second, supervised fine-tuning with additional and augmented data. the authors compare their model's performance with several state-of-the-art methods, including traditional machine learning models and deep learning models like convolutional neural networks and long shortterm memory networks. the evaluation results show that the proposed multilingual transformer model outperforms all other methods, achieving state-of-the-art performance in detecting sexism across multiple languages. the structure of our paper is as follows: section 3 describes our methodological approach and describes the models used. our experimental setup and employed datasets will be described in section 4 of this paper, followed by a documentation of the results (section 5) and a final discussion and conclusion (section 6). ## system overview this section describes the methods we have used in our system. the main challenge in this work is the rather small number of training datasets for all three subtasks (subtask a includes 14,000 training instances, and subtasks b and c include 3,398 training instances). this rather small size makes it difficult to effectively pre-training complex nlp methods such as transformers. for this reason, we use different transfer learning methods. as a basis for textual content modeling, we apply several pre-trained transformer-based models: bert, deberta, and roberta. to adapt these generalpurpose models to the task of recognition (subtask a) and sexism classification (subtask b and c), we use a large unlabeled dataset that has the same content as the training set. also, in another approach, we combine several pre-trained models and train them by adding a classification layer for each subtask. in section 3.1 our system that uses transformerbased models is described for three subtasks. then, we describe our task-adaptive system on the domain of this particular task (see section 3.2). also, the ensemble model system is described in section 3.3. finally, we describe the optimization algorithm and loss function in section 3.4. ## experimental setup to fine-tune the pre-trained transformer-based models used in our systems, we employed the adamw optimizer (kingma and ba, 2014) with default hyperparameters. additionally, we explored the impact of additional hyperparameters, as detailed in ## results in this section, we examine the results of the systems that we explained in the previous section. our best system was able to macro-f1 score 83%, 64%, and 47% on the test sets and 84%, 68%, and 49% on dev sets in subtasks a, b, and c, respectively. using the bert model, we obtained the official result submitted for subtask a on the test dataset. our official submission system was based on the bert model, in which we utilized class-weight in the loss function. we then improved it using other models such as deberta and ensemble models. also, the official results for subtasks b and c have been using deberta's model, which in this paper we have improved by adding class weights to the cross-entropy loss function. these weights are calculated based on the ratio of the number of samples in each class to the total number of samples. they are then normalized and used as the weight of each class in the loss function. the official scores that we have submitted are as follows: 77% in subtask a, 64% in subtask b, and 42% in subtask c, which can be seen in using the deberta base , task-adaptive, and ensemble models, we were able to achieve promising results in subtask a, with the best performance belonging to model deberta base on the test set. for subtasks b and c, we obtained the best results on the test sets using the deberta base model with class-weight. the classification layer of the pre-trained deberta base for sequence classification model was utilized in the deberta base model. however, in the ensemble model, pretrained transformer-based models are only used for feature extraction. then, several dense layers are added to combine the extracted features, and finally, an output layer is added for classification, which is trained on the data. due to the small number of data samples and their insufficient amount for fine-tuning the model, the ensemble a confusion matrix of the deberta model predictions on subtask a, is shown in figure 5 . because the classes are unbalanced, the false negative error is more than the false positive error. ## conclusion in this work, we described our system for se-meval2023 task 10. the purpose of this task was to identify and classify sexist content in online spaces. to do this, we used different types of transformer-based models as well as their combinations. we also presented a task-adaptive system in the domain of this particular task. in the above sections, we examined the essential components for ensuring the repeatability of our systems and evaluated the performance of the architectures. our best system was able to achieve an f1-score of 83% in subtask a, 64% in subtask b, and 47% in subtask c on test sets. in future work, larger pre-trained models such as deberta-v3 can be used for classification or task-adaptative pretraining, and it is also promising to use other unsupervised methods or use more data to train the task-adaptive model.