Detecting Sexism in Tweets: A Sentiment Analysis and Graph Neural Network Approach (2025)

Abstract: In the digital age, social media platforms like Twitter serve as an extensive repository of public discourse, including instances of sexism. It is important to identify such behavior since radicalized ideologies can lead to real-world violent acts. This project aims to develop a deep learning-based tool that leverages a combination of BERT (both English and multilingual versions) and GraphSAGE, a Graph Neural Network (GNN) model, alongside sentiment analysis and natural language processing (NLP) techniques. The tool is designed to analyze tweets for sexism detection and classify them into five categories.

## introduction in today's digital age, social media platforms such as twitter have become central to public discourse, providing users with a space to express their thoughts and opinions, while also serving as a powerful tool for activism @xcite . however, while social media can empower victims to share their experiences, it also enables the spread of harmful ideologies such as sexism and gender-based violence (gbv) @xcite . peter glick and susan fiske introduced a theory in 1996 that explains how power imbalances and mutual dependence between men and women give rise to two interconnected forms of sexist attitudes @xcite . the first, hostile sexism (hs), is marked by overtly attitudes, including aggression, resentment, objectification, sexual violence, and misogyny. in contrast, benevolent sexism (bs) praises women who conform to traditional roles, offering protection and admiration. however, this attitude is based on the belief that women are inherently weaker, reinforcing harmful stereotypes and gender inequality @xcite . this dynamic of sexism is not limited to interpersonal interactions but extends to digital platforms, where it takes on new forms and reaches broader audiences. twitter, with its 280-character limit, often amplifies the problem of hate speech, including gender-based violence and sexism, by encouraging more aggressive and sensational content compared to platforms like facebook @xcite . therefore, systems that accurately detect hate speech are crucial for proactive moderation @xcite . sentiment analysis techniques are commonly employed to extract insights about the public sentiment on a wide range of topics, including sexism @xcite . when it comes to this classification task, a variety of approaches have been explored, incorporating both machine learning @xcite and deep learning tools @xcite @xcite . a popular advancement in text representation involves the use of transformers, like bert, which capture deep, bidirectional contextual information, significantly enhancing the understanding of language complexities @xcite . however, despite its strengths, these techniques often struggle to capture the complex relationships and structures within texts, such as dependencies between words and tend to underperform when dealing with long-range dependencies. to address these limitations, graph neural networks (gnns) have been applied in text classification tasks, as they are capable of modeling relationships and dependencies between nodes by propagating information along edges @xcite @xcite . additionally, to further enhance performance, recent approaches have sought to combine bert embeddings with gnns @xcite . our approach builds on this by leveraging bert's capacity to understand complex language contexts alongside graphsage, a gnn model chosen for its ability to generate node representations by aggregating features from neighboring nodes @xcite . then the contributions of this research in addressing the sexism classification task are summarized as follows: the rest of the paper is structured with section 2 covering the dataset and methodology of the proposed model, section 3 presenting the results, and section 4 discussing the findings. ## results results of both tasks are presented in actual predicted sexist not sexist sexist true positive 840 false negative 318 not sexist false positive 340 true negative 710 the bert graph exhibited strong performance in distinguishing sexist tweets from non-sexist ones, achieving an accuracy of 0.702 and an f1 score of 0.731. in contrast, mbert produced lower results for both metrics, highlighting the superiority of bert over mbert on this task. for task 2, both embeddings showed lower performance overall; however, bert continued to demonstrate its advantage over mbert with an accuracy of 0.5308 and an f1 score of 0.3783. ## discussion and related work the application of gnns, such as graphsage, to text classification, remains relatively unexplored but holds considerable promise. our model demonstrated competitive performance on task 1. however, it requires improvements for task 2. the first-place team in the exist contest @xcite created a second version of both bert and mbert by translating some in-stances from spanish to english to enhance the training data. they also implemented ensemble strategies, combining predictions from individual models, which consistently outperformed the single mbert and bert models. therefore, integrating some data strategies and an ensemble of graph-sage networks could be a worthy experiment for future research. nonetheless, this entry was not the only using data augmentation strategies. butt et al. @xcite used a 'back translation' strategy, where they input the text in the source language, translate it to another second language, and finally back to the source language. furthermore, data augmentation strategies can also be utilized to mitigate the class imbalance problem of task 2. among the models reviewed by the contestants, mb-courage (wilkens and ognibene, 2021) was the model most closely aligned with our proposed approach, as it also utilizes gnn for identifying sexism. however, while mb-courage employs graph convolutional neural networks (gcn), we use graphsage, a distinct variation of gnn. in terms of performance, our model outperformed mb-courage's best proposal on f1-score for task 1. regarding task 2, our best proposal proved to be the least effective among the compared models showed in as a final point, exploring alternative text similarity metrics such as emotion detection, latent dirichlet allocation (lda) topic modeling, or con-ceptnet similarity, could provide valuable insights for defining the graph structure, leading to improved performance in second tasks. moreover, improved text preprocessing and experimenting with different embedding models could help preserve higher-quality information.