CNLP - NITS at S em E val-2023 Task 10: Online sexism prediction, PREDHATE ! (2023)

Abstract: Online sexism is a rising issue that threatens women’s safety, fosters hostile situations, and upholds social inequities. We describe a task SemEval-2023 Task 10 for creating English-language models that can precisely identify and categorize sexist content on internet forums and social platforms like Gab and Reddit as well to provide an explainability in order to address this problem. The problem is divided into three hierarchically organized subtasks: binary sexism detection, sexism by category, and sexism by fine-grained vector. The dataset consists of 20,000 labelled entries. For Task A, pertained models like Convolutional Neural Network (CNN) and Bidirectional Long Short-Term Memory (BiLSTM), which is called CNN-BiLSTM and Generative Pretrained Transformer 2 (GPT-2) models were used, as well as the GPT-2 model for Task B and C, and have provided experimental configurations. According to our findings, the GPT-2 model performs better than the CNN-BiLSTM model for Task A, while GPT-2 is highly accurate for Tasks B and C on the training, validation and testing splits of the training data provided in the task. Our proposed models allow researchers to create more precise and understandable models for identifying and categorizing sexist content in online forums, thereby empowering users and moderators.

## introduction sexism is a pervasive issue in society that shows up in a variety of linguistic contexts, including online discourse @xcite . the topic of automatically recognising sexist language in text has several real-world applications, including bias detection in computer-generated material and social media platform moderation @xcite . sexism is a major issue in society today, and it has been shown to have negative effects on both men and women. the prevalence of sexism in online communication makes it difficult for people to identify and address it @xcite . automatically detecting sexist language in text is an important problem that has many practical applications. for example, social media platforms can use automated systems to detect sexist language and take appropriate actions against users who post offensive content @xcite , this could help reduce the amount of sexism present on these platforms and create a more inclusive environment for all users. the shared task semeval-2023 task 10 (kirk et al., 2023) was about identifying sexism and proving it by identifing sexist content and explaining why it is sexist enhances the generalization ability, trust, and comprehension of the choices made by automated systems, giving users and moderators more control. this will bring more confidence on the automated system which detects sexist content by providing an explainability for that content. the shared task incorporated with three hierarchical subtasks that each builds on the previous one makes up our main task. the first subtask, task a, requires systems to anticipate whether or not a post is sexist and it is a binary classification task. in the second subtask, task b, systems must predict the category of sexism for posts that are labeled as sexist in task a. task b is a four-class classification task. 'threats', 'derogation', 'animosity', and 'prejudiced discussions' based on prejudice are the categories. the third and final subtask, task c, requires systems to predict one of 11 fine-grained vectors for postings that are rated as sexist in task a and categorized in task b. task c is an 11-class classification task. in this shared task semeval-2023 task 10, the problem of detecting sexist language and explainability was addressed using two models, one is convolutional neural network (cnn) @xcite and bidirectional long short-term memory (bilstm) @xcite which is interchangeably called throughout the paper cnn-bilstm @xcite and the other is generative pretrained transformer 2 (gpt-2) @xcite . a common type of neural network used in image analysis is the cnn. but, by treating each word as a "channel" in the input, they can also be employed in tasks involving natural language processing. in order to capture particular features, such as n-grams and word embeddings, that are important for the classification task, the cnn layer can then learn various sorts of filters. on the other hand, bilstm models are a kind of recurrent neural network @xcite created specifically to handle sequential data, like text. they can recognise long-range relationships in the text because they can keep track of the words that came before them in a phrase. gpt-2 is a transformer-based language model developed by openai @xcite that has shown remarkable performance in various natural language processing tasks, such as language generation @xcite , machine translation @xcite , and question answering @xcite . to deploy our models a web application called 'pred-hate!' has been created that enables users to input any text they desire. the application employs our model's forecast to indicate whether the text contains sexist content or not. the paper has been arranged as follows, section 2 will be the background work and relative work done in the field, section 3 will be about the data sampling and training, development and test data splits. section 4 the system overview of the models and were demonstrated. section 5 gives the experimental setup of our models for the tasks a,b & c. section 6 will provide the results how our models performed on these tasks. ## background in recent years, there has been growing interest in the task of detecting sexism and misogyny @xcite in natural language text. this is exemplified by research efforts such as semeval task 10, which provides a dataset @xcite for training and evaluating machine learning models for this task @xcite . one approach to tackling this challenge is to use classic machine learning techniques, such as ngrams, as demonstrated inn @xcite . this study presents a dataset for identifying and classifying misogynistic language on twitter in both spanish and english. meanwhile, @xcite applies a similar approach to detect online hate speech against women by combining two datasets. likewise, we are combining the semeval task 10 dataset with other similar ones, which we will be explaining in detail in the section 3. however, more recent studies have explored the use of advanced deep learning techniques to achieve state-of-the-art results in sexism detection. for instance, @xcite uses glove embeddings @xcite and modified lstms with attention mechanisms @xcite to detect sexist statements commonly used in the workplace automatically. these studies demonstrate the potential of using deep learning techniques to address the challenge of detecting sexism and misogyny in natural language text. gpt-2 @xcite has been used in several related natural language processing (nlp) tasks, including text classification (anaby-tavor et al., 2020), sentiment analysis @xcite , and language modeling @xcite . for example, in a recent study by @xcite , the authors used a pre-trained gpt-2 model to perform binary classification on a dataset of news articles to predict whether the article is sexist or not sexist. the results showed that the gpt-2 model outperformed several other machine learning models in terms of accuracy. another study @xcite ) used a pre-trained gpt-2 model to perform sentiment analysis on a dataset of customer reviews. the authors found that the gpt-2 model was able to achieve state-of-the-art performance in sentiment analysis tasks. while these studies did not focus specifically on sexism classification, they demonstrate the potential of pre-trained language models like gpt-2 for natural language processing tasks. similar approaches using gpt-2 could be effective for the sexism classification task (vaca-serrano, 2022) as they have done a decent job, for classification of sexism in english and spanish languages, they have mostly used encoder-decoder models for their approach. ## system overview for task a, we use a binary classification approach where we classify whether a post is sexist or not sexist. for this, we use the cnn-bilstm model and the gpt-2 model. the cnn-bilstm model uses a combination of convolutional and recurrent layers for feature extraction and sequence modeling, respectively. the input to the model is a sequence of words, which are first embedded into a dense vector representation. the embedded words are then passed through multiple convolutional layers to extract local features, which are then fed to a bidirectional lstm layer for sequence modeling. the output of the lstm layer is then passed through a dense layer for binary classification. on the other hand, the gpt-2 model is a transformer-based language model that uses many layers to extract contextual information from a given sequence. the input to the gpt-2 model is also a sequence of words, which are embedded into dense vector representations. the embedded words are then passed through multiple transformer layers to extract contextual information. the output of the last transformer layer is then passed through a dense layer for binary classification. for task b, we classify the posts that are labeled as sexist by task a into one of four categories: (1) threats, (2) derogation, (3) animosity, (4) prejudiced discussions. for task c, we classify the posts labeled as sexist by task a into one of eleven fine-grained vectors. we use the gpt-2 models as in task a for this classification task for both task b & c. the only difference is that the output layer is modified to predict one of the four categories instead of binary classification for task b and again modified to predict one of the eleven fine-grained vectors for task c. towards gui: we have designed a web app, where users can type any text they want. based on our model's prediction it will show whether the text is sexist or not. figure 1 shows an overview of our website 'predhate!' which also provided a few features like checking the history and can classify multiple texts at a time. code is openly available at: https://github.com/human71/predhate . ## experimental setup the semeval task 10 has been divided into 3 subtasks, for each subtask we have created individual models with respect to their respective classifications. now the experimental setup has been divided into 2 parts as follows. ## experimental results in this part, we present gpt2 model's performance throughout training and testing compared to our other approach. we also compare the result with the other existing system submitted on semeval-2023 task 10. ## conclusion as a conclusion, the identification and categorization of sexism in online content is a significant issue in modern culture, where social interactions take place more and more in online settings. making online places more welcoming and secure for everyone can be achieved with the use of automated techniques for sexism detection and classification especially for women. in this study, we provided an overview of the 20,000 sexism-labeled entries from the gab and reddit dataset as well as a hierarchy of three sexism detection and classification tasks, namely task a (binary sexism detection), task b (category of sexism), and task c (fine-grained vector of sexism). the cnn-bilstm and gpt-2 models for task a as well as the gpt-2 model for tasks b and c were also given, along with their respective experimental settings. our findings demonstrated that the gpt-2 model performed better on task a than the cnn-bilstm model, achieving greater accuracy and f1 scores. also, the use of gpt-2 for tasks b and c enabled the creation of more thorough and educational classifications, offering greater insights on the kind and degree of the sexism found in online content. in the future, we hope that our work will stimulate additional investigation into the automated identification and categorization of sexism and that researchers in this field will find our dataset and experimental setups to be a helpful resource. we also hope that the knowledge we learn from this effort will contribute to the development of more welcoming and secure online environments for everyone.