Coco at SemEval-2023 Task 10: Explainable Detection of Online Sexism
Year: 2023

Abstract:
Sexism is a growing concern on social media platforms because it affects the overall health of the internet and can have negative impacts on society. This paper describes the coco system that participated in SemEval-2023 Task 10, Explainable Detection of Online Sexism (EDOS), which aims at sexism detection in various settings of natural language understanding. We develop a novel neural framework for sexism detection and misogyny that can combine text representations obtained using pre-trained language model models such as Bidirectional Encoder Representations from Transformers and using BiLSTM architecture to obtain the local and global semantic information. Further, considering that the EDOS dataset is relatively small and extremely unbalanced, we conducted data augmentation and introduced two datasets in the field of sexism detection. Moreover, we introduced Focal Loss which is a loss function in order to improve the performance of processing imbalanced data classification. Our system achieved an F1 score of 78.95% on Task A binary sexism.

heading: 1 Introduction
text: Social media platforms offer unparalleled communication and information-sharing abilities while providing an anonymous space for people of varying genders, ethnicities, races, and cultures to interact online. (Fortuna et al., 2021; Pamungkas et al., 2021; Chiril et al., 2020; Williams et al., 2020). As a result, there has been a rise in incidents, hostile behavior, and instances of harassment on social media platforms, especially sexism (Kirk et al., 2023; Deluca et al., 2016). Sexism is connected to beliefs about the essential nature of women and men, as well as the roles they should assume in society. This hierarchical way of thinking can be deliberate and hostile, or it can be unintentional and take the form of unconscious bias.
∗: Corresponding author.
The SemEval task 10 supports the development of English-language models for sexism detection that fine-grained classifications for sexist content from Gab and Reddit, which consists of three subtasks (Kirk et al., 2023). As illustrated in Fig.1:
(1) Task A - Binary Sexism Detection: It is a binary classification task which models are required to predict whether a text contains gender bias or not;
(2) Task B - Category of Sexism: It is a four-class classification task on texts that exhibit gender bias which requires models to predict one of four categories: (1) threats, (2) derogation, (3) animosity, (4) prejudiced discussions;
(3) Task C - Fine-grained Vector of Sexism : It is an 11-class classification task for texts exhibiting gender bias which requires models to predict one of 11 fine-grained vectors.
Our method employed Bert (Devlin et al., 2018) as mono-lingual pre-trained language models, and various models including CNN, LSTM and BiLSTM for further feature extraction to obtain context semantic features. Our contributions are summarized below.
• Our system achieved the Macro F1 score of 78.95% on the Task A - binary sexism detection;
• we employ a suitable neural framework for sexism detection task that combines using a pre-trained language model Bert and BiLSTM architecture.
• we introduced the additional datasets including EXIST-2022 and TRAC-2020 for data augmentation and tried different loss functions in order to solve the label imbalance problem, to achieve better performance for the sexism detection task.
469

heading: 2 Background
text: In this section, we review the work on the classification of sexism or misogyny. We also pay attention to some work related to the identification of hate speech, because some of these works are applicable to sexism detection to some extent, and these methods treat sexism as a kind of hate (Davidson et al., 2017; Abburi et al., 2021).
Over the last few years, due to the exponential growth of user-generated content and the diverse range of behaviors towards women on social media, manually inspecting and moderating sexist content has become unfeasible (Jiang et al., 2022). Therefore, there has been a significant surge in academic research aimed at automatically detecting sexist behavior in both monolingual and multilingual scenarios in recent years (Jha and Mamidi, 2017; Rodríguez-Sánchez et al., 2020). To tackle this issue, the first attempt was made by Hewitt et al.(Hewitt et al., 2016), who studied the manual detection of sexist tweets. Anzovino et al. (Anzovino et al., 2018) conducted the first survey of automatic sexism detection in social media. In an effort to address the issue of unintended bias in machine learning models for sexism detection, a new method proposed by Nozza et al. (Nozza et al., 2019) try to measure and mitigate this bias. Agrawal et al. (Agrawal and Awekar, 2018) investigated the detection of cyberbullying on social media platforms using deep learning methods. Unlike previous studies on hate detection, they attempt
to identifying sexism and misogyny, which encompass hate speech targeted towards women but is not limited to hate (Abburi et al., 2021).
Recently, academic work research on the detection of sexism or misogyny has been conducted extensively, particularly in multilingual and crossdomain scenarios (Pamungkas et al., 2020; Parikh et al., 2021). The majority of studies focusing on the detection of sexism or misogyny against women utilize supervised approaches. In their research, Basile et al. (Basile and Rubagotti, 2018) used the support vector machine to perform sexism detection, with features based on word and character n-grams. Buscaldi et al.(Buscaldi, 2018) employed random decision forests which is an ensemble learning method by constructing a multitude of decision trees at training and utilized locally weighted character n-grams as features for the detection of sexism or misogyny. Deep learning approaches based on Pre-Trained Models(PTM) have become more popular, such as DeBERTa (He et al., 2020), Roberta (Liu et al., 2019), XLM-RoBERTa (Conneau et al., 2019), XLNet (Yang et al., 2019), and SpanBERT (Joshi et al., 2020), which have made state-of-the-art achievements in different languages (Chiril et al., 2020; Samory et al., 2021). Parikh et al.(Parikh et al., 2019) built a BERT-based neural architecture to perform sexism detection and showed the models perform better than classic supervised approaches.
There are many opensource multilingual datasets
in the field of detection of sexism or hate speech, such as EXIST-2022 (Rodríguez-Sánchez et al., 2022), TRAC-2020 (Bhattacharya et al., 2020), HatEval (Basile et al., 2019) and AMI@IberEval (Fersini et al., 2018). Our model introduced the additional datasets, EXIST-2022 and TRAC-2020, which help with the sexism detection task. Our approach focuses on Pre-Trained Models (PTM) architecture, combines using pre-trained language model Bert and BiLSTM network, which is inspired by Rodrıguez (Rodríguez-Sánchez et al., 2020) and Parikh (Parikh et al., 2019).

heading: 3 System overview
text: An overview of the architecture of our proposed model is depicted in Figure 2. The model we propose comprises the following components: Bert is used to extracting the embedding sequence of the word sequence. At the same time, the embedding sequence output by Bert is further feature extracted through BiLSTM to obtain context semantic information, and then sent to the output layer. The output layer is composed of a fully connected layer and a softmax layer, in which the dimension of the feature vector is adjusted in the fully connected layer and the softmax classifier is used to classify to achieve sexism detection.

heading: 3.1 Pre-trained Language Models
text: To better utilize the performance of large-scale pre-trained models, we employ the pretrain-then-
finetune paradigm. The fine-tuning process of BERT involves utilizing the parameters obtained from pre-training as the initial values of the model while transferring the manually labeled dataset specific according to the downstream tasks. By balancing the relationship between the data and the model, this process results in the acquisition of a downstream-ready model (Devlin et al., 2018; Li et al., 2022).
As illustrated in Figure 2. In the BERT model, C refers to the pooled output of the first classification token ([CLS]), which summarizes the entire input sequence and is appropriate for sentencelevel tasks like text classification and natural language inference. In contrast, T_i, which refers to the output representation of the i-th token in a sequence excluding the special token [CLS], is valuable for performing token-level tasks such as sequence labeling and question answering. Moreover, the "all_hidden_states" is a list that contains the hidden states of all layers of the model. Each hidden state is represented as a tensor with the shape (batch_size, sequence_length, hidden_size), where each state represents the hidden state for every token at each time step. Specifically, "all_hidden_states[0]" corresponds to the initial hidden states of the input sequence, while "all_hidden_states[10]" corresponds to the hidden states of the 11th layer. The inputs for the BiLSTM architecture were obtained using Bert, the "all_hidden_states [10]", which provides a more
detailed and contextualized view of the input sentence by capturing the interdependence between words and their surrounding context, and enhances our understanding of the input sentence without significantly increasing the model complexity.

heading: 3.2 BiLSTM Model
text: The BiLSTM(Cho et al., 2014) model stands for Bidirectional Long Short-Term Memory, which is a model composed of a forward LSTM and a backward LSTM, and the LSTM in this model is a variant of the recurrent neural network. BiLSTM processes the input sequence in both forward and backward directions, which allows it to capture both past and future contexts, and can capture longer-term dependencies in the input sequence by using a memory cell and multiple gating mechanisms, thereby enabling it to be more robust to input noise. The structure of BiLSTM is shown in Figure 3.
To address the issue of irregular feature patterns, we utilize the BiLSTM model to uncover more hidden features in the contextual and semantic dependencies (Li et al., 2022). Specifically, we train BiLSTM on top of the BERT layer output to improve feature fitting and generalization performance for detecting sexism datasets.

heading: 4 Experimental

heading: 4.1 Task Description
text: Task A is a binary classification task for text: given a text sample from Gab and Reddit, the model is required to predict whether it contains sexism or not. The following examples present comments or statements that are either sexist or not sexist, respectively.
(1) The world is filled with cunty women. Take solace in the fact that most of them will die bitter and alone with their 10 cats.....who will eat their faces off when they’re dead. (#sexist)
(2) This is why I always get suspicious when women comment about video games.

heading: I have a feeling most women think this
text: about games. (#not sexist)
Example 1 is a sexist text where this sentence expresses abuse and discrimination against women.

heading: 4.2 Evaluation Metrics
text: For all tasks (A, B and C), standard evaluation metrics that Macro F1 score is used to evaluate the participating system performance. Macro F1, a commonly used evaluation metric in machine learning, calculates an equal-weighted average of F1 scores for each class in a classification task and is widely adopted in the field of imbalanced classification tasks. (Han et al., 2022). calculated as follows:
accuracy = TP + TN
TP + FP + TN + FN (1)
precision = TP
TP + FP (2)
recall = TP
TP + FN (3)
F1 = 2 · precision · recall precision+ recall
(4)
where the variables TP , FP , TN , and FN denote true positives, false positives, true negatives, and false negatives, respectively.

heading: 4.3 Dataset
text: Table 1 provides a summary of the detailed statistics for the EDOS dataset 1. As shown in Table 1, the training data exhibits an imbalance, with 3398 positive samples and 10602 negative samples. Our pre-processing step only involves the removal of excess spaces, tabs, and line breaks.
1https://codalab.lisn.upsaclay.fr/ competitions/7124

heading: 4.4 Experiment Details
text: Due to the long-tail nature of training data by sexist discrimination, we adopted re-sampling and reweighting techniques to address the issue, which did not have a significant effect. Therefore, we introduced two additional datasets for data augmentation, EXIST 2022 2 and TRAC-2020 3, for the same task of sexism detection. As shown in Table 2, the detailed statistics of these two datasets are summarized.
The method used for task A on sexism detection involves two main steps, namely, the extraction of embedding features and the semantic feature extraction step. Before the two main steps, We merge the three datasets and unify the labels, then the text for each instance is preprocessed by removing extra spaces, tabs, line breaks and URLs. In the embedding feature extraction step, each text instance is transformed into a 768-dimensional embedding vector by using the pre-trained Bert embedding model (Devlin et al., 2018). In particular, we used the base uncased model of Bert, which consists of 12 layers alongside 768 units per layer. In the semantic feature extraction step, we tried multiple neural network models including CNN, LSTM, DPCNN and BiLSTM. After a lot of experimental comparisons, we choose BiLSTM for feature extraction to obtain context semantic features.
During training, We did not perform pre-training on the BERT model and only fine-tuned it on downstream tasks by incorporating dataset labels. We use the Adam optimizer (Kingma and Ba, 2014) and the learning rate is 5e-5. We also use dropout (Hinton et al., 2012) with a rate of 0.3 to prevent overfitting. In particular, we use Focal Loss (Lin et al., 2017) as the loss function, alpha is set to 0.25, and gamma is set to 1. We conduct all the experiments on a machine equipped with a CPU: Intel(R) Xeon(R) Gold 6139 CPU @ 2.30GHz, and 6 GPU: Nvidia GeForce RTX 3090 GPU.
2http://nlp.uned.es/exist2022/ 3https://sites.google.com/view/trac2/
Dataset Model Performance
EDOS 2023 Bert + BiLSTM 75.86%(∗)
EDOS 2023 EXIST 2022 TRAC-2020 Bert + LSTM 75.65% Bert + DPCNN 77.40% Bert + BiLSTM 78.95%(∗)
Table 3: The official test-set performance of Task A under different experimental settings. Scores marked with an asterisk denote the final submitted results.

heading: 4.5 Results
text: Table 3 shows a comparison of the final performance on task A official test set using the proposed model settings. Due to time constraints, we only used the monolingual pre-trained base uncased model of BERT to submit the fine-tuning results for Task A, achieving 78.95% F1 score. It is evident that BiLSTM outperforms other architectures at sexism detection task as it focuses on feature extraction, particularly in obtaining contextual semantic features. These tricks include introducing additional datasets and using different loss functions, which have helped to improve the model’s performance to a certain extent.
It is worth noting that additional datasets were included for training, and thousands of Spanish language corpora were inadvertently introduced due to oversights in dataset preprocessing and merging. The reason why the model’s performance has only marginally improved after data augmentation could be attributed to this factor. Specifically, the additional data set is mixed with about 20% of the Spanish language corpora. The performance of the model has been improved to a certain extent after removing it.

heading: 4.6 Further Analysis
text: The dataset is very unevenly distributed across sexist and non-sexist texts, which can cause the model to be highly biased towards non-sexist aspects. Therefore, we use the confusion matrix and segmentation metrics (including FP, TP, FN, TN) to show the difference of the model to the category. As shown in Fig. 4 and Table 4. Overall, our model performed relatively well on non-discriminatory text, with a precision of 89% and a recall of 92%, however, the model performed poorly on discriminatory text.

heading: 5 Conclusion
text: In this paper, we introduce the system developed and evaluated for SemEval 2023 Task 10 and employ a novel neural framework that combines text representations obtained using pre-trained language model Bert, and using BiLSTM architecture to obtain context semantic information for better sexism detection. In addition, in order to alleviate the problem of data imbalance, we introduced additional datasets and tried different loss functions, which improved the performance of the model. Exploring approaches for detecting sexism in multilingual settings shows promise as a potential direction for future research.

heading: Acknowledgement
text: We appreciate previous work (Abburi et al., 2021; Subies, 2021; Jiang et al., 2022; Parikh et al., 2021; Li et al., 2022) and open resources provided by Shao and Wu. Based on this, we conducted our work on EDOS task. We also appreciate the help from the EDOS team and program chairs. In addition to the traditional tools, we used Chatgpt to help polish the paper, just polish.

heading: Future Work
text: Exploring approaches for detecting sexism in multilingual settings shows promise as a potential direction for future research