S tanford ML ab at S em E val-2023 Task 10: Exploring G lo V e- and Transformer-Based Methods for the Explainable Detection of Online Sexism (2023)

Abstract: In this paper, we discuss the methods we applied at SemEval-2023 Task 10: Towards the Explainable Detection of Online Sexism. Given an input text, we perform three classification tasks to predict whether the text is sexist and classify the sexist text into subcategories in order to provide an additional explanation as to why the text is sexist. We explored many different types of models, including GloVe embeddings as the baseline approach, transformer-based deep learning models like BERT, RoBERTa, and DeBERTa, ensemble models, and model blending. We explored various data cleaning and augmentation methods to improve model performance. Pre-training transformer models yielded significant improvements in performance, and ensembles and blending slightly improved robustness in the F1 score.

## introduction online sexism has the potential to inflict significant harm on women @xcite , and it is a serious issue that must be addressed. with the increasing prevalence of social media, it has become easy for groups of people to spread sexist ideas and threaten the safety of others, with online social networks becoming increasingly inundated by sexist comments @xcite . there have been numerous previous works on the detection of online sexism as a whole @xcite @xcite , including even applying these models to non-english datasets @xcite @xcite . however, almost all of these models do not focus on precisely classifying why a certain text conveys sexist sentiments, and instead provide a binary classification for whether the text is sexist. however, this is the task which is most likely to make these models useful for content moderation, since they provide both the moderator and the platform's users with a consistent explanation for why something was classified as sexist or not. in many cases, the difficulty of using machine classification when doing content moderation is the perception of it being decided by an arbitrary black box. while the models may empirically have a high accuracy, due to the high social sensitivity of this task, human intervention is almost always required. with laws such as the general data protection regulation (gdpr) established in europe, which establishes a "right to explanation" @xcite , there is thus a huge need for model explainability on top of existing performance optimization @xcite . with more detailed feedback about the categories of sexism, moderators can efficiently mitigate sexist sentiment online in a robust and rules-based manner, and therefore reduce gender-based violence. as such, given the increasing importance of explainable detection in machine learning models, we propose and compare several natural language processing methods for doing so. we used gloveand transformer-based models, as well as various data cleaning and augmentation techniques, applying them on reddit and gab textual data to detect sexist messages and classify them into various categories of sexism. ## background and task setup the data for this task was provided by semeval task @xcite . this labeled data set consisted of 10,000 entries extracted from gab along with 10,000 entries from reddit. the dataset is labeled according to the specifications of the required classifier for subtask a, subtask b, and subtask c. in addition to this labeled dataset, there were two unlabeled data sets which each contain 1 million entries from gab and reddit that were provided, which we used to improve our system's performance. subtask a requires a binary classifier to categorize posts into being sexist or non-sexist. subtask b requires a four-class classification system which categorizes a sexist post according to one of the following categories: (1) threats, (2) derogation, (3) animosity, and (4) prejudiced discussions. finally, for subtask c, of the posts which are sexist, an 11-class classification system categorizes the posts according to a more specific label of sexism. subtasks b and c ensure that text which is labeled as sexist is given a specific label for why it is sexist, providing a degree of explainability for those using the model. ## experimental setup to train and evaluate our models, we used an 80-20 split on the provided training dataset to create training and validation datasets for our models. we used a fixed train-val split so we could directly compare the performance of our models. during training, we monitored the macro f1 score on the validation set, and our program saved the model with the best score. we trained our models with a maximum of 200 epochs, and we used early-stopping to stop training if the training loss did not decrease over 30 epochs. we trained all of our transformerbased models using the adam optimizer and crossentropy loss. for our final submission, we trained our model on all the training data provided. ## conclusion the three subtasks and classification models for online sexism were able to provide explanations for the model predictions by showing intermediate results of the classification. although this does not provide a look inside a black box, it is nonetheless a useful explanation for the end user of the model, explaining the specific reason why a text might be sexist. from our experiments, we saw that transformerbased models like bert and roberta worked the best to classify sexism in texts, as seen in subtask a. data cleaning was essential in improving our results. furthermore, pre-training transformers models like roberta on domain-specific text substantially improved the performance, rivaling the multi-transformer models in subtask b. the models involving concatenating transformer embeddings produced slightly (subtask b) to significantly better (subtask c) results, illustrating how combining information from different transformer models produces better representations. blending model outputs led to slight performance improvements, but these improvements were small in comparison to the improvements seen from pretraining and concatenation.