Attention at S em E val-2023 Task 10: Explainable Detection of Online Sexism ( EDOS ) (2023)

Abstract: In this paper, we have worked on explainability and understanding of the decisions made by models in the form of classification tasks. The task is divided into 3 subtasks. The first task consists of determining Binary Sexism Detection. The second task describes the Category of Sexism. The third task describes a more Fine-grained Category of Sexism. Our work explores solving these tasks as a classification problem by fine-tuning transformer-based architecture. We have performed several experiments with our architecture, including combining multiple transformers, using domain adaptive pretraining on the unlabelled dataset provided by Reddit and Gab, Joint learning, and taking different layers of transformers as input to a classification head. Our system (with the team name Attention’) was able to achieve a macro F1 score of 0.839 for task A, 0.5835 macro F1 score for task B and 0.3356 macro F1 score for task C at the Codalab SemEval Competition. Later we improved the accuracy of Task B to 0.6228 and Task C to 0.3693 in the test set.

## introduction online sexism is a growing problem in this era, considering the large scale of online texts. detecting online sexism is an important nlp task, and has a lot of social impacts related to it. sexism is defined as any abuse or negative sentiment that is directed towards women based on their gender or based on their gender combined with one or more other identity attributes (e.g. black women, trans women). there are some prior works regarding the detection of sexist text @xcite at semeval. flagging what is sexist content and also explaining why it is sexist is very important aspects. we tried to focus on interpretability, trust, and understanding of the decisions made by models. having an automated system that is capable of understanding, interpreting, and classifying sexist text will be a major step to make online sites safe. explainable detection of online sexism (edos) at semeval 2023 @xcite , tries to solve this problem by exploring different systems that can categorize the dataset created with texts from reddit and gab. the problem is divided into 3 subtasks. the first task is formulated as binary sexism detection, where the main idea is to detect whether a text is sexist or not. the second task describes the category of sexism. so, if the text is sexist, under which category it belongs? the categories are threats, derogation (treating someone as little worthy), animosity (a strong dislike or unfriendly feeling), and prejudiced discussions (an unfair feeling of dislike for a person or group because of race, sex, religion, etc). this makes this task a four-class classification problem given the text is sexist. the third task describes the fine-grained vector of sexist text. for posts that are sexist, systems were supposed to predict more fine-grained aspects of the category of sexism. which can help in interpretability and understanding why the post is sexist on a much deeper level. the sexist posts are classified into an 11-class classification problem, given the text is sexist. the 11 classes are descriptive attacks, aggressive and emotive attacks, casual use of gendered slurs, profanities, and insults, immutable gender differences and gender stereotypes, supporting systemic discrimination against women as a group, incitement, and encouragement of harm, dehumanising attacks & overt sexual objectification, supporting mistreatment of individual women, backhanded gendered compliments, threats of harm, condescending explanations or unwelcome advice. to solve this problem, we have fine-tuned transformer-based architecture. our final submission is made up of two transformers: roberta @xcite and deberta @xcite . the embedding is then passed to the mlp. at the last layer, we have the number of classes. we have also explored domain adaptive pre training using masked language modeling on both of these transformers and used their weights for the classification task. the models remain the same for all the tasks except the last layer changes based on the number of classes. our system ranked 35 th in sub-task 1, 50 th in sub-task 2, and 44 th in sub-task 3, out of 583 participants. the detailed comparison with the top team in the leaderboard is given below transformer-based models such as roberta and deberta has shown outstanding performance on wide domains of nlp, including text classification. these models can capture a sort of structure in the hateful speech as well @xcite . domain adaptive pre training is used in many domains of nlp, to make the model focus on the specific domain rather than a large variety of text it is trained on. don't stop pre training: adapt language models to domains and tasks @xcite talk about the increase in the performance of a model if it is pretrained on similar types of data. semeval-2021 task 7: hahackathon, detecting and rating humor and offense @xcite talks about the importance of pretraining and using ensembling methods to achieve high accuracy. it also described the importance of lexical features. this semeval task itself provided the dataset. the dataset contains text in english. the dataset contains 20,000 texts. half of the text was taken from gab and the other half from reddit. the entries are then manually annotated by three trained annotator women. for each text, we have (a) labelsexist, describing whether the label is sexist or not, (b) label-category: given the text is sexist what is the category of sexism, in the case of non-sexist text it is none. (c) label-vector: it is more fine-grained details about the category of sexism. the data is divided into 70% as training data, 10% as validation data, and 20% as test data. the distribution of labels for all three tasks is described in ## system overview mainly we have used transformers, but for a baseline, we have used lstm @xcite . we trained the embeddings from scratch using the pytorch embeddings layer. then lstm is followed by mlp at last, with a number of classes at the last layer. our main focus was on using transformer. we have used transformers with several variations. based on this variation we try to come up with the best model. • roberta: it is built on bert masked language strategy, but excludes bert's nextsentence pretraining objective, and training with much larger mini-batches and learning rates. roberta base model consists of 12 transformer layers, 12 self-attention heads per layer, and a hidden size of 768. with these two transformers, we have experimented with the architecture. the different architecture is as follows: we have taken the last layer of the roberta the base model followed by some linear layers and fine-tuned over the training data. the same setup has been used with deberta as well. all these models are used for all the tasks with a change in the last layer with the number of classes. ## experimental setup the dataset provided was already divided into train, dev, and test. we have experimented with some preprocessing of the text, which includes converting emoji to text, converting all the characters to lowercase, converting the link @xmath0, removing punctuations, removing words with numbers, removing stop words, and using wordnet lemmatizer. but after the cleaning step accuracy was low compared to the non-cleaned text. a probable reason is with the transformer tokenization mechanism is more useful than the naive tokenization mentioned. for the hyperparameter, we have taken the number of epochs on the training set as 20, the learning rate is 1e-5, the loss function used is cross entropy loss and the optimizer used in adamw @xcite . we have used the macro f1 score as a measure of evaluation for all three tasks. ## results results for different experiments are mentioned in with domain adaptive pretraining we have seen reduced perplexity scores of these language models, which measure the amount of randomness in our model or how confused the model is, so the less the better. the model has been tested across two datasets, exist2021 @xcite , automatic detection of sexist statements commonly used at the workplace @xcite . both datasets consist of sexist and non ## error analysis these error analyses are performed on experiment no 6. ## conclusion domain adaptive pre-training helps us get some extra accuracy numbers in all three sub-tasks. combining roberta and deberta makes the model big but also brings more variety of aspects to the model. although the macro f1 accuracy is quite good, the data instances where it is failing are very costly in the case of task a. in the case of binary classification of sexism, a false negative is high, i.e. a sexist text is sometimes treated as non-sexist. considering the case of online social media, taking a post down for some time even if it is not sexist is less harmful than keeping a sexist text on social platforms. in general, the model is failing to predict sexist texts. a manual inspection of the failed text of this type suggested that there is a large scope for improvement in the model. another weakness of the transformer model is to deploy it in real-world case scenarios where the data is real-time and the volume is high. the texts need to process at high speed. although transformers can parallelize the computation, the still amount of computation needed is high and we may need to devise some hybrid approach for that. despite that, the model shows very promising results, where the number of samples to train on is large. to further improve the accuracy we can use more annotated data from people. although this will be costly, it will be a one-time effort. the model that we submitted for task b was not able to generalize well. the macro f1 dropped from 67% to 58.35%. this can be due to overfitting or dissimilarity between the distribution of the test and train set. one of the ideas that we look forward to working with is to predict pseudo labels for unlabelled tasks. for example, if our best model is sure that the label belongs to a particular task with more than 99% probability then use that data instance as training data for the model. in this way, we can increase the data to train for our model. another idea that can be looked for is to generate text of a similar type @xcite using decoder-based transformers. for example, we can take text which is less in number and can train on causal language objectives over the labeled samples. this results in more data samples to train on.