A Transparent Pipeline for Identifying Sexism in Social Media: Combining Explainability with Model Prediction
Abstract
:Featured Application
Abstract
1. Introduction
2. Related Work
3. Materials and Methods
3.1. Data
3.2. Data Preparation and Augmentation
3.3. Methodology
3.4. CustomBERT—Ensemble Model Design
Algorithm 1 CustomBERT model for sexism detection. |
|
3.5. Explainability Analysis
- Model Prediction on Test Dataset: For each sentence i in the test dataset, use the trained model to generate predictions .
- Sexism Score Calculation for Test Dataset: Calculate the Sexism Score for each sentence i in the test dataset using the SHAP scores from the training dataset. This is achieved as follows:
- Binning Based on Sexism Scores: Divide the test dataset into bins based on the calculated Sexism Scores . Define bins such that:
- Performance Comparison: For each bin , evaluate the model’s performance by calculating metrics such as accuracy, precision, recall, and F1 score. Compare these metrics across different bins to assess the model’s performance in handling varying levels of detected sexism.
4. Results
4.1. Exploratory Data Analysis (EDA)
4.2. Model Training and Optimization
4.3. Explainability Results
4.4. Increasing Model Efficiency
4.5. Usability for Decision Makers
5. Discussion and Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
AI | Artificial Intelligence |
BERT | Bidirectional Encoder Representations from Transformers |
CNN | Convolutional Neural Network |
LLM | Large Language Model |
NLP | Natural Language Processing |
SHAP | Shapley Additive Explanations |
XAI | Explainable Artificial Intelligence |
XNLP | Explainable Natural Language Processing |
Appendix A. System Configuration
- Operating System: Ubuntu 20.04 server
- Instance Type: GPU 24 Core—220 GB RAM—1x A100 (Standard_NC24ads_A100_v4)
Appendix B. Effective Tokens
Token | SHAP Importance | Importance Ratio | Cumulative Importance |
---|---|---|---|
pussy | 1.52 × 1020 | 1.16 × 10−2 | 1.16 × 10−2 |
yeah | 1.50 × 1020 | 1.14 × 10−2 | 2.30 × 10−2 |
shut | 1.39 × 1020 | 1.06 × 10−2 | 3.36 × 10−2 |
baby | 1.36 × 1020 | 1.04 × 10−2 | 4.39 × 10−2 |
think | 1.32 × 1020 | 1.01 × 10−2 | 5.40 × 10−2 |
theyre | 1.31 × 1020 | 9.97 × 10−3 | 6.40 × 10−2 |
fight | 1.31 × 1020 | 9.95 × 10−3 | 7.39 × 10−2 |
company | 1.31 × 1020 | 9.94 × 10−3 | 8.39 × 10−2 |
slut | 1.30 × 1020 | 9.87 × 10−3 | 9.37 × 10−2 |
post | 1.29 × 1020 | 9.82 × 10−3 | 1.04 × 10−1 |
whore | 1.28 × 1020 | 9.77 × 10−3 | 1.13 × 10−1 |
ive | 1.25 × 1020 | 9.51 × 10−3 | 1.23 × 10−1 |
day | 1.24 × 1020 | 9.46 × 10−3 | 1.32 × 10−1 |
hell | 1.23 × 1020 | 9.39 × 10−3 | 1.42 × 10−1 |
ugly | 1.23 × 1020 | 9.37 × 10−3 | 1.51 × 10−1 |
vagina | 1.20 × 1020 | 9.12 × 10−3 | 1.60 × 10−1 |
just | 1.16 × 1020 | 8.81 × 10−3 | 1.69 × 10−1 |
yes | 1.16 × 1020 | 8.80 × 10−3 | 1.78 × 10−1 |
avoid | 1.14 × 1020 | 8.71 × 10−3 | 1.86 × 10−1 |
try | 1.11 × 1020 | 8.45 × 10−3 | 1.95 × 10−1 |
credit | 1.10 × 1020 | 8.39 × 10−3 | 2.03 × 10−1 |
talk | 1.08 × 1020 | 8.20 × 10−3 | 2.12 × 10−1 |
lady | 1.07 × 1020 | 8.17 × 10−3 | 2.20 × 10−1 |
turn | 1.06 × 1020 | 8.05 × 10−3 | 2.28 × 10−1 |
sidebar | 1.05 × 1020 | 7.96 × 10−3 | 2.36 × 10−1 |
wine | 1.04 × 1020 | 7.95 × 10−3 | 2.44 × 10−1 |
fucking | 1.04 × 1020 | 7.93 × 10−3 | 2.52 × 10−1 |
work | 1.03 × 1020 | 7.83 × 10−3 | 2.59 × 10−1 |
crap | 1.02 × 1020 | 7.77 × 10−3 | 2.67 × 10−1 |
rape | 1.02 × 1020 | 7.75 × 10−3 | 2.75 × 10−1 |
equality | 1.01 × 1020 | 7.71 × 10−3 | 2.83 × 10−1 |
feminism | 9.91 × 1019 | 7.55 × 10−3 | 2.90 × 10−1 |
raped | 9.90 × 1019 | 7.54 × 10−3 | 2.98 × 10−1 |
youre | 9.71 × 1019 | 7.40 × 10−3 | 3.05 × 10−1 |
far | 9.70 × 1019 | 7.38 × 10−3 | 3.13 × 10−1 |
making | 9.63 × 1019 | 7.34 × 10−3 | 3.20 × 10−1 |
little | 9.35 × 1019 | 7.13 × 10−3 | 3.27 × 10−1 |
sex | 9.28 × 1019 | 7.07 × 10−3 | 3.34 × 10−1 |
personality | 9.26 × 1019 | 7.05 × 10−3 | 3.41 × 10−1 |
commie | 9.23 × 1019 | 7.03 × 10−3 | 3.48 × 10−1 |
muslim | 9.15 × 1019 | 6.97 × 10−3 | 3.55 × 10−1 |
face | 9.08 × 1019 | 6.91 × 10−3 | 3.62 × 10−1 |
cunt | 9.01 × 1019 | 6.86 × 10−3 | 3.69 × 10−1 |
maybe | 8.93 × 1019 | 6.80 × 10−3 | 3.76 × 10−1 |
girl | 8.88 × 1019 | 6.77 × 10−3 | 3.82 × 10−1 |
bitch | 8.84 × 1019 | 6.73 × 10−3 | 3.89 × 10−1 |
liberty | 8.83 × 1019 | 6.72 × 10−3 | 3.96 × 10−1 |
kino | 8.61 × 1019 | 6.56 × 10−3 | 4.02 × 10−1 |
life | 8.58 × 1019 | 6.53 × 10−3 | 4.09 × 10−1 |
wtf | 8.56 × 1019 | 6.52 × 10−3 | 4.16 × 10−1 |
stop | 8.53 × 1019 | 6.50 × 10−3 | 4.22 × 10−1 |
dad | 8.51 × 1019 | 6.48 × 10−3 | 4.28 × 10−1 |
burning | 8.35 × 1019 | 6.36 × 10−3 | 4.35 × 10−1 |
sending | 8.28 × 1019 | 6.31 × 10−3 | 4.41 × 10−1 |
guess | 8.28 × 1019 | 6.30 × 10−3 | 4.47 × 10−1 |
guy | 8.25 × 1019 | 6.28 × 10−3 | 4.54 × 10−1 |
rapist | 8.11 × 1019 | 6.17 × 10−3 | 4.60 × 10−1 |
tbh | 7.85 × 1019 | 5.98 × 10−3 | 4.66 × 10−1 |
rule | 7.77 × 1019 | 5.92 × 10−3 | 4.72 × 10−1 |
care | 7.72 × 1019 | 5.88 × 10−3 | 4.78 × 10−1 |
run | 7.65 × 1019 | 5.82 × 10−3 | 4.84 × 10−1 |
dirty | 7.44 × 1019 | 5.67 × 10−3 | 4.89 × 10−1 |
islam | 7.09 × 1019 | 5.40 × 10−3 | 4.95 × 10−1 |
having | 6.82 × 1019 | 5.19 × 10−3 | 5.00 × 10−1 |
college | 6.79 × 1019 | 5.17 × 10−3 | 5.05 × 10−1 |
feminist | 6.69 × 1019 | 5.10 × 10−3 | 5.10 × 10−1 |
tell | 6.54 × 1019 | 4.98 × 10−3 | 5.15 × 10−1 |
make | 6.49 × 1019 | 4.94 × 10−3 | 5.20 × 10−1 |
come | 6.42 × 1019 | 4.89 × 10−3 | 5.25 × 10−1 |
role | 6.40 × 1019 | 4.88 × 10−3 | 5.30 × 10−1 |
way | 6.33 × 1019 | 4.82 × 10−3 | 5.35 × 10−1 |
whale | 6.11 × 1019 | 4.65 × 10−3 | 5.39 × 10−1 |
red | 6.11 × 1019 | 4.65 × 10−3 | 5.44 × 10−1 |
attractive | 5.99 × 1019 | 4.56 × 10−3 | 5.48 × 10−1 |
theyd | 5.90 × 1019 | 4.50 × 10−3 | 5.53 × 10−1 |
logic | 5.76 × 1019 | 4.39 × 10−3 | 5.57 × 10−1 |
white | 5.60 × 1019 | 4.27 × 10−3 | 5.62 × 10−1 |
liberal | 5.58 × 1019 | 4.25 × 10−3 | 5.66 × 10−1 |
forget | 5.54 × 1019 | 4.22 × 10−3 | 5.70 × 10−1 |
treat | 5.43 × 1019 | 4.14 × 10−3 | 5.74 × 10−1 |
trump | 5.42 × 1019 | 4.13 × 10−3 | 5.78 × 10−1 |
oppression | 5.29 × 1019 | 4.03 × 10−3 | 5.82 × 10−1 |
left | 5.29 × 1019 | 4.03 × 10−3 | 5.86 × 10−1 |
expect | 5.24 × 1019 | 3.99 × 10−3 | 5.90 × 10−1 |
funny | 5.24 × 1019 | 3.99 × 10−3 | 5.94 × 10−1 |
different | 5.15 × 1019 | 3.92 × 10−3 | 5.98 × 10−1 |
marriage | 5.10 × 1019 | 3.89 × 10−3 | 6.02 × 10−1 |
natural | 5.10 × 1019 | 3.88 × 10−3 | 6.06 × 10−1 |
hope | 5.09 × 1019 | 3.88 × 10−3 | 6.10 × 10−1 |
cuck | 4.98 × 1019 | 3.79 × 10−3 | 6.14 × 10−1 |
surprised | 4.98 × 1019 | 3.79 × 10−3 | 6.18 × 10−1 |
selfish | 4.93 × 1019 | 3.76 × 10−3 | 6.21 × 10−1 |
picture | 4.88 × 1019 | 3.72 × 10−3 | 6.25 × 10−1 |
wonder | 4.88 × 1019 | 3.71 × 10−3 | 6.29 × 10−1 |
getting | 4.78 × 1019 | 3.64 × 10−3 | 6.32 × 10−1 |
did | 4.73 × 1019 | 3.60 × 10−3 | 6.36 × 10−1 |
rt | 4.71 × 1019 | 3.59 × 10−3 | 6.40 × 10−1 |
dead | 4.67 × 1019 | 3.55 × 10−3 | 6.43 × 10−1 |
rest | 4.59 × 1019 | 3.49 × 10−3 | 6.47 × 10−1 |
suck | 4.58 × 1019 | 3.49 × 10−3 | 6.50 × 10−1 |
vote | 4.41 × 1019 | 3.36 × 10−3 | 6.53 × 10−1 |
course | 4.38 × 1019 | 3.34 × 10−3 | 6.57 × 10−1 |
number | 4.32 × 1019 | 3.29 × 10−3 | 6.60 × 10−1 |
idiot | 4.29 × 1019 | 3.27 × 10−3 | 6.63 × 10−1 |
hard | 4.15 × 1019 | 3.16 × 10−3 | 6.66 × 10−1 |
soros | 4.11 × 1019 | 3.13 × 10−3 | 6.70 × 10−1 |
report | 4.09 × 1019 | 3.11 × 10−3 | 6.73 × 10−1 |
begin | 4.08 × 1019 | 3.11 × 10−3 | 6.76 × 10−1 |
space | 4.08 × 1019 | 3.11 × 10−3 | 6.79 × 10−1 |
away | 4.07 × 1019 | 3.10 × 10−3 | 6.82 × 10−1 |
spend | 4.06 × 1019 | 3.09 × 10−3 | 6.85 × 10−1 |
ball | 4.04 × 1019 | 3.08 × 10−3 | 6.88 × 10−1 |
fucked | 3.98 × 1019 | 3.03 × 10−3 | 6.91 × 10−1 |
monkey | 3.96 × 1019 | 3.02 × 10−3 | 6.94 × 10−1 |
enemy | 3.96 × 1019 | 3.01 × 10−3 | 6.97 × 10−1 |
wait | 3.95 × 1019 | 3.01 × 10−3 | 7.00 × 10−1 |
wont | 3.89 × 1019 | 2.96 × 10−3 | 7.03 × 10−1 |
waiting | 3.86 × 1019 | 2.94 × 10−3 | 7.06 × 10−1 |
oh | 3.84 × 1019 | 2.93 × 10−3 | 7.09 × 10−1 |
send | 3.83 × 1019 | 2.91 × 10−3 | 7.12 × 10−1 |
id | 3.78 × 1019 | 2.88 × 10−3 | 7.15 × 10−1 |
going | 3.77 × 1019 | 2.87 × 10−3 | 7.18 × 10−1 |
wife | 3.74 × 1019 | 2.85 × 10−3 | 7.21 × 10−1 |
foid | 3.66 × 1019 | 2.79 × 10−3 | 7.23 × 10−1 |
thanks | 3.64 × 1019 | 2.78 × 10−3 | 7.26 × 10−1 |
thing | 3.60 × 1019 | 2.74 × 10−3 | 7.29 × 10−1 |
hate | 3.58 × 1019 | 2.73 × 10−3 | 7.32 × 10−1 |
place | 3.49 × 1019 | 2.66 × 10−3 | 7.34 × 10−1 |
current | 3.47 × 1019 | 2.64 × 10−3 | 7.37 × 10−1 |
easily | 3.45 × 1019 | 2.63 × 10−3 | 7.40 × 10−1 |
need | 3.41 × 1019 | 2.60 × 10−3 | 7.42 × 10−1 |
really | 3.28 × 1019 | 2.50 × 10−3 | 7.45 × 10−1 |
word | 3.26 × 1019 | 2.48 × 10−3 | 7.47 × 10−1 |
thank | 3.25 × 1019 | 2.48 × 10−3 | 7.50 × 10−1 |
say | 3.25 × 1019 | 2.48 × 10−3 | 7.52 × 10−1 |
lying | 3.25 × 1019 | 2.47 × 10−3 | 7.55 × 10−1 |
mean | 3.24 × 1019 | 2.47 × 10−3 | 7.57 × 10−1 |
female | 3.18 × 1019 | 2.42 × 10−3 | 7.60 × 10−1 |
state | 3.15 × 1019 | 2.40 × 10−3 | 7.62 × 10−1 |
men | 3.14 × 1019 | 2.39 × 10−3 | 7.64 × 10−1 |
actually | 3.13 × 1019 | 2.38 × 10−3 | 7.67 × 10−1 |
ground | 3.13 × 1019 | 2.38 × 10−3 | 7.69 × 10−1 |
12 | 3.12 × 1019 | 2.38 × 10−3 | 7.71 × 10−1 |
deserve | 3.07 × 1019 | 2.34 × 10−3 | 7.74 × 10−1 |
exist | 3.06 × 1019 | 2.33 × 10−3 | 7.76 × 10−1 |
wouldnt | 3.02 × 1019 | 2.30 × 10−3 | 7.78 × 10−1 |
hang | 2.98 × 1019 | 2.27 × 10−3 | 7.81 × 10−1 |
reason | 2.97 × 1019 | 2.26 × 10−3 | 7.83 × 10−1 |
lmao | 2.94 × 1019 | 2.24 × 10−3 | 7.85 × 10−1 |
daily | 2.91 × 1019 | 2.22 × 10−3 | 7.87 × 10−1 |
stand | 2.87 × 1019 | 2.19 × 10−3 | 7.90 × 10−1 |
wall | 2.85 × 1019 | 2.17 × 10−3 | 7.92 × 10−1 |
youll | 2.82 × 1019 | 2.15 × 10−3 | 7.94 × 10−1 |
ha | 2.80 × 1019 | 2.13 × 10−3 | 7.96 × 10−1 |
fact | 2.80 × 1019 | 2.13 × 10−3 | 7.98 × 10−1 |
potential | 2.77 × 1019 | 2.11 × 10−3 | 8.00 × 10−1 |
damage | 2.76 × 1019 | 2.10 × 10−3 | 8.02 × 10−1 |
gender | 2.75 × 1019 | 2.09 × 10−3 | 8.04 × 10−1 |
agree | 2.74 × 1019 | 2.08 × 10−3 | 8.07 × 10−1 |
giving | 2.71 × 1019 | 2.06 × 10−3 | 8.09 × 10−1 |
trap | 2.71 × 1019 | 2.06 × 10−3 | 8.11 × 10−1 |
use | 2.70 × 1019 | 2.06 × 10−3 | 8.13 × 10−1 |
imagine | 2.69 × 1019 | 2.05 × 10−3 | 8.15 × 10−1 |
thats | 2.68 × 1019 | 2.04 × 10−3 | 8.17 × 10−1 |
art | 2.68 × 1019 | 2.04 × 10−3 | 8.19 × 10−1 |
ring | 2.66 × 1019 | 2.02 × 10−3 | 8.21 × 10−1 |
lot | 2.62 × 1019 | 2.00 × 10−3 | 8.23 × 10−1 |
matter | 2.62 × 1019 | 1.99 × 10−3 | 8.25 × 10−1 |
smart | 2.61 × 1019 | 1.99 × 10−3 | 8.27 × 10−1 |
chance | 2.61 × 1019 | 1.99 × 10−3 | 8.29 × 10−1 |
inside | 2.60 × 1019 | 1.98 × 10−3 | 8.31 × 10−1 |
difference | 2.59 × 1019 | 1.97 × 10−3 | 8.33 × 10−1 |
shes | 2.58 × 1019 | 1.96 × 10−3 | 8.35 × 10−1 |
trying | 2.56 × 1019 | 1.95 × 10−3 | 8.37 × 10−1 |
user | 2.54 × 1019 | 1.93 × 10−3 | 8.39 × 10−1 |
want | 2.53 × 1019 | 1.93 × 10−3 | 8.41 × 10−1 |
cope | 2.51 × 1019 | 1.91 × 10−3 | 8.43 × 10−1 |
future | 2.51 × 1019 | 1.91 × 10−3 | 8.44 × 10−1 |
got | 2.50 × 1019 | 1.90 × 10−3 | 8.46 × 10−1 |
mom | 2.50 × 1019 | 1.90 × 10−3 | 8.48 × 10−1 |
rich | 2.44 × 1019 | 1.85 × 10−3 | 8.50 × 10−1 |
femininity | 2.42 × 1019 | 1.84 × 10−3 | 8.52 × 10−1 |
friend | 2.41 × 1019 | 1.84 × 10−3 | 8.54 × 10−1 |
instead | 2.40 × 1019 | 1.83 × 10−3 | 8.56 × 10−1 |
clinton | 2.39 × 1019 | 1.82 × 10−3 | 8.57 × 10−1 |
boring | 2.35 × 1019 | 1.79 × 10−3 | 8.59 × 10−1 |
immediately | 2.32 × 1019 | 1.77 × 10−3 | 8.61 × 10−1 |
plan | 2.31 × 1019 | 1.76 × 10−3 | 8.63 × 10−1 |
working | 2.31 × 1019 | 1.76 × 10−3 | 8.65 × 10−1 |
sister | 2.30 × 1019 | 1.75 × 10−3 | 8.66 × 10−1 |
toe | 2.28 × 1019 | 1.73 × 10−3 | 8.68 × 10−1 |
behavior | 2.27 × 1019 | 1.73 × 10−3 | 8.70 × 10−1 |
blame | 2.27 × 1019 | 1.73 × 10−3 | 8.71 × 10−1 |
bos | 2.24 × 1019 | 1.71 × 10−3 | 8.73 × 10−1 |
fought | 2.23 × 1019 | 1.69 × 10−3 | 8.75 × 10−1 |
dick | 2.23 × 1019 | 1.69 × 10−3 | 8.77 × 10−1 |
feminine | 2.20 × 1019 | 1.68 × 10−3 | 8.78 × 10−1 |
mgtow | 2.18 × 1019 | 1.66 × 10−3 | 8.80 × 10−1 |
mother | 2.14 × 1019 | 1.63 × 10−3 | 8.82 × 10−1 |
thinking | 2.14 × 1019 | 1.63 × 10−3 | 8.83 × 10−1 |
american | 2.13 × 1019 | 1.62 × 10−3 | 8.85 × 10−1 |
bang | 2.09 × 1019 | 1.59 × 10−3 | 8.86 × 10−1 |
self | 2.08 × 1019 | 1.59 × 10−3 | 8.88 × 10−1 |
problem | 2.08 × 1019 | 1.59 × 10−3 | 8.90 × 10−1 |
male | 2.06 × 1019 | 1.57 × 10−3 | 8.91 × 10−1 |
young | 2.04 × 1019 | 1.55 × 10−3 | 8.93 × 10−1 |
jew | 2.04 × 1019 | 1.55 × 10−3 | 8.94 × 10−1 |
worst | 2.03 × 1019 | 1.55 × 10−3 | 8.96 × 10−1 |
attention | 2.03 × 1019 | 1.55 × 10−3 | 8.97 × 10−1 |
said | 2.01 × 1019 | 1.53 × 10−3 | 8.99 × 10−1 |
start | 2.00 × 1019 | 1.52 × 10−3 | 9.00 × 10−1 |
shit | 2.00 × 1019 | 1.52 × 10−3 | 9.02 × 10−1 |
black | 1.98 × 1019 | 1.51 × 10−3 | 9.03 × 10−1 |
waste | 1.98 × 1019 | 1.50 × 10−3 | 9.05 × 10−1 |
fuck | 1.96 × 1019 | 1.49 × 10−3 | 9.06 × 10−1 |
kavanaugh | 1.94 × 1019 | 1.48 × 10−3 | 9.08 × 10−1 |
lol | 1.93 × 1019 | 1.47 × 10−3 | 9.09 × 10−1 |
le | 1.93 × 1019 | 1.47 × 10−3 | 9.11 × 10−1 |
wild | 1.93 × 1019 | 1.47 × 10−3 | 9.12 × 10−1 |
lead | 1.88 × 1019 | 1.43 × 10−3 | 9.14 × 10−1 |
virgin | 1.82 × 1019 | 1.39 × 10−3 | 9.15 × 10−1 |
realize | 1.80 × 1019 | 1.37 × 10−3 | 9.16 × 10−1 |
dont | 1.79 × 1019 | 1.36 × 10−3 | 9.18 × 10−1 |
hanging | 1.77 × 1019 | 1.35 × 10−3 | 9.19 × 10−1 |
typical | 1.74 × 1019 | 1.33 × 10−3 | 9.21 × 10−1 |
die | 1.73 × 1019 | 1.32 × 10−3 | 9.22 × 10−1 |
given | 1.73 × 1019 | 1.32 × 10−3 | 9.23 × 10−1 |
west | 1.69 × 1019 | 1.29 × 10−3 | 9.24 × 10−1 |
believe | 1.67 × 1019 | 1.27 × 10−3 | 9.26 × 10−1 |
super | 1.64 × 1019 | 1.25 × 10−3 | 9.27 × 10−1 |
doe | 1.59 × 1019 | 1.21 × 10−3 | 9.28 × 10−1 |
hold | 1.57 × 1019 | 1.20 × 10−3 | 9.29 × 10−1 |
maga | 1.57 × 1019 | 1.20 × 10−3 | 9.31 × 10−1 |
end | 1.57 × 1019 | 1.20 × 10−3 | 9.32 × 10−1 |
lonely | 1.51 × 1019 | 1.15 × 10−3 | 9.33 × 10−1 |
voter | 1.50 × 1019 | 1.14 × 10−3 | 9.34 × 10−1 |
incel | 1.48 × 1019 | 1.13 × 10−3 | 9.35 × 10−1 |
probably | 1.44 × 1019 | 1.10 × 10−3 | 9.36 × 10−1 |
plot | 1.40 × 1019 | 1.07 × 10−3 | 9.37 × 10−1 |
leg | 1.40 × 1019 | 1.06 × 10−3 | 9.38 × 10−1 |
loser | 1.37 × 1019 | 1.05 × 10−3 | 9.39 × 10−1 |
watch | 1.37 × 1019 | 1.04 × 10−3 | 9.41 × 10−1 |
sexual | 1.37 × 1019 | 1.04 × 10−3 | 9.42 × 10−1 |
wow | 1.33 × 1019 | 1.01 × 10−3 | 9.43 × 10−1 |
money | 1.32 × 1019 | 1.01 × 10−3 | 9.44 × 10−1 |
killed | 1.27 × 1019 | 9.70 × 10−4 | 9.45 × 10−1 |
lulz | 1.23 × 1019 | 9.34 × 10−4 | 9.45 × 10−1 |
cost | 1.22 × 1019 | 9.26 × 10−4 | 9.46 × 10−1 |
support | 1.21 × 1019 | 9.23 × 10−4 | 9.47 × 10−1 |
reply | 1.21 × 1019 | 9.20 × 10−4 | 9.48 × 10−1 |
willing | 1.19 × 1019 | 9.06 × 10−4 | 9.49 × 10−1 |
References
- Kurasawa, F.; Rondinelli, E.; Kilicaslan, G. Evidentiary activism in the digital age: On the rise of feminist struggles against gender-based online violence. Inf. Commun. Soc. 2021, 24, 2174–2194. [Google Scholar] [CrossRef]
- Papaevangelou, C. ‘The non-interference principle’: Debating online platforms’ treatment of editorial content in the European Union’s Digital Services Act. Eur. J. Commun. 2023, 38, 466–483. [Google Scholar] [CrossRef]
- Ortiz, S.M. “If Something Ever Happened, I’d Have No One to Tell:” how online sexism perpetuates young women’s silence. Fem. Media Stud. 2023, 24, 119–134. [Google Scholar] [CrossRef]
- Aldana-Bobadilla, E.; Molina-Villegas, A.; Montelongo-Padilla, Y.; Lopez-Arevalo, I.; Sordia, O.S. A language model for misogyny detection in Latin American Spanish driven by multisource feature extraction and transformers. Appl. Sci. 2021, 11, 10467. [Google Scholar] [CrossRef]
- Lee, F.L.; Liang, H.; Cheng, E.W.; Tang, G.K.; Yuen, S. Affordances, movement dynamics, and a centralized digital communication platform in a networked movement. Inf. Commun. Soc. 2022, 25, 1699–1716. [Google Scholar] [CrossRef]
- Feng, C. A simple voting mechanism for online sexist content identification. arXiv 2021, arXiv:2105.14309. [Google Scholar]
- Schütz, M.; Boeck, J.; Liakhovets, D.; Slijepcevic, D.; Kirchknopf, A.; Hecht, M.; Bogensperger, J.; Schlarb, S.; Schindler, A.; Zeppelzauer, M. Automatic Sexism Detection with Multilingual Transformer Models, CoRR abs/2106.04908. 2021. Available online: https://arxiv.org/abs/2106.04908 (accessed on 8 February 2023).
- Kumar, R.; Pal, S.; Pamula, R. Sexism Detection in English and Spanish Tweets. In Proceedings of the IberLEF@ SEPLN. 2021, pp. 500–505. Available online: https://ceur-ws.org/Vol-2943/exist_paper17.pdf (accessed on 1 September 2023).
- de Paula, A.F.M.; da Silva, R.F.; Schlicht, I.B. Sexism prediction in spanish and english tweets using monolingual and multilingual bert and ensemble models. arXiv 2021, arXiv:2111.04551. [Google Scholar]
- Altin, L.S.M.; Saggion, H. Automatic detection of sexism in social media with a multilingual approach. In Proceedings of the Iberian Languages Evaluation Forum (IberLEF 2021), Málaga, Espanya, 21 September 2021; [Málaga]: CEUR Workshop Proceedings Series. CEUR Workshop Proceedings: Aachen, Germany, 2021; pp. 415–419. [Google Scholar]
- Mehta, H.; Passi, K. Social media hate speech detection using explainable artificial intelligence (XAI). Algorithms 2022, 15, 291. [Google Scholar] [CrossRef]
- Gil Bermejo, J.L.; Martos Sánchez, C.; Vázquez Aguado, O.; García-Navarro, E.B. Adolescents, ambivalent sexism and social networks, a conditioning factor in the healthcare of women. Healthcare 2021, 9, 721. [Google Scholar] [CrossRef]
- Hoofnagle, C.J.; Van Der Sloot, B.; Borgesius, F.Z. The European Union general data protection regulation: What it is and what it means. Inf. Commun. Technol. Law 2019, 28, 65–98. [Google Scholar] [CrossRef]
- Mathew, B.; Saha, P.; Yimam, S.M.; Biemann, C.; Goyal, P.; Mukherjee, A. Hatexplain: A benchmark dataset for explainable hate speech detection. In Proceedings of the AAAI Conference on Artificial Intelligence, Vancouver, BC, Canada, 2–9 February 2021; Volume 35, pp. 14867–14875. [Google Scholar]
- Velankar, A.; Patil, H.; Joshi, R. A review of challenges in machine learning based automated hate speech detection. arXiv 2022, arXiv:2209.05294. [Google Scholar]
- Jiang, J.A. Identifying and addressing design and policy challenges in online content moderation. In Proceedings of the Extended Abstracts of the 2020 CHI Conference on Human Factors in Computing Systems, Honolulu, HI, USA, 25–30 April 2020; pp. 1–7. [Google Scholar]
- Danilevsky, M.; Qian, K.; Aharonov, R.; Katsis, Y.; Kawas, B.; Sen, P. A survey of the state of explainable AI for natural language processing. arXiv 2020, arXiv:2010.00711. [Google Scholar]
- Søgaard, A. Explainable Natural Language Processing; Morgan & Claypool Publishers: San Rafael, CA, USA, 2021. [Google Scholar]
- Mohammadi, H.; Giachanou, A.; Bagheri, A. Towards robust online sexism detection: A multi-model approach with BERT, XLM-RoBERTa, and DistilBERT for EXIST 2023 Tasks. In Working Notes of the Conference and Labs of the Evaluation Forum (CLEF 2023); CEUR Workshop Proceedings: Aachen, Germany, 2023. [Google Scholar]
- Böck, J.; Schütz, M.; Liakhovets, D.; Satriani, N.Q.; Babic, A.; Slijepčević, D.; Zeppelzauer, M.; Schindler, A. AIT_FHSTP at EXIST 2023 benchmark: Sexism detection by transfer learning, sentiment and toxicity embeddings and hand-crafted features. In Proceedings of the 14th International Conference of the CLEF Association, CLEF 2023, Thessaloniki, Greece, 17–21 September 2023. Working Notes of CLEF. [Google Scholar]
- Daouadi, K.E.; Boualleg, Y.; Guehairia, O. Deep Random Forest and AraBert for Hate Speech Detection from Arabic Tweets. J. Univers. Comput. Sci. 2023, 29, 1319–1335. [Google Scholar] [CrossRef]
- Lopez-Lopez, E.; Carrillo-de Albornoz, J.; Plaza, L. Combining Transformer-Based Models with Traditional Machine Learning Approaches for Sexism Identification in Social Networks at EXIST 2021. In Proceedings of the IberLEF@ SEPLN. 2021, pp. 431–441. Available online: https://ceur-ws.org/Vol-2943/exist_paper10.pdf (accessed on 1 September 2022).
- Samory, M.; Sen, I.; Kohne, J.; Flöck, F.; Wagner, C. “Call me sexist, but…”: Revisiting Sexism Detection Using Psychological Scales and Adversarial Samples. In Proceedings of the International AAAI Conference on Web and sOcial Media, Online, 7–10 June 2021; Volume 15, pp. 573–584. [Google Scholar]
- Rodríguez-Sánchez, F.; de Albornoz, J.C.; Plaza, L. Automatic Classification of Sexism in Social Networks: An Empirical Study on Twitter Data. IEEE Access 2020, 8, 219563–219576. [Google Scholar] [CrossRef]
- Jha, A.; Mamidi, R. When Does a Compliment Become Sexist? Analysis and Classification of Ambivalent Sexism Using Twitter Data. 2017, pp. 7–16. Available online: https://aclanthology.org/W17-2902/ (accessed on 3 August 2022).
- Jiang, A.; Yang, X.; Liu, Y.; Zubiaga, A. SWSR: A Chinese dataset and lexicon for online sexism detection. Online Soc. Netw. Media 2022, 27, 100182. [Google Scholar] [CrossRef]
- Das, A.; Rahgouy, M.; Zhang, Z.; Bhattacharya, T.; Dozier, G.; Seals, C.D. Online Sexism Detection and Classification by Injecting User Gender Information. In Proceedings of the 2023 IEEE International Conference on Artificial Intelligence, Blockchain, and Internet of Things (AIBThings), Mount Pleasant, MI, USA, 16–17 September 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1–5. [Google Scholar]
- Kirk, H.R.; Yin, W.; Vidgen, B.; Röttger, P. SemEval-2023 Task 10: Explainable Detection of Online Sexism. In Proceedings of the 17th International Workshop on Semantic Evaluation (SemEval-2023), Association for Computational Linguistics, Toronto, ON, Canada, 9–14 July 2023. [Google Scholar] [CrossRef]
- Tasneem, F.; Hossain, T.; Naim, J. KingsmanTrio at SemEval-2023 Task 10: Analyzing the Effectiveness of Transfer Learning Models for Explainable Online Sexism Detection. In Proceedings of the Proceedings of the 17th International Workshop on Semantic Evaluation (SemEval-2023), Toronto, ON, Canada, 31 January 2023; pp. 1916–1920.
- Kiritchenko, S.; Nejadgholi, I.; Fraser, K.C. Confronting abusive language online: A survey from the ethical and human rights perspective. J. Artif. Intell. Res. 2021, 71, 431–478. [Google Scholar] [CrossRef]
- Lamsiyah, S.; El Mahdaouy, A.; Alami, H.; Berrada, I.; Schommer, C. UL & UM6P at SemEval-2023 Task 10: Semi-Supervised Multi-task Learning for Explainable Detection of Online Sexism. In Proceedings of the 17th International Workshop on Semantic Evaluation (SemEval-2023), Toronto, ON, Canada, 31 January 2023; pp. 644–650. [Google Scholar]
- Kotapati, G.; Gandhimathi, S.K.; Rao, P.A.; Muppagowni, G.K.; Bindu, K.R.; Reddy, M.S.C. A Natural Language Processing for Sentiment Analysis from Text using Deep Learning Algorithm. In Proceedings of the 2023 2nd International Conference on Edge Computing and Applications (ICECAA), Namakkal, India, 19–21 July 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1028–1034. [Google Scholar]
- Chauhan, R.; Gusain, A.; Kumar, P.; Bhatt, C.; Uniyal, I. Fine Grained Sentiment Analysis using Machine Learning and Deep Learning. In Proceedings of the 2023 International Conference on Sustainable Emerging Innovations in Engineering and Technology (ICSEIET), Ghaziabad, India, 14–15 September 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 423–427. [Google Scholar]
- Mariappan, U.; Balakrishnan, D.; Subhashini, S.; Kumar, N.V.A.S.; Rao, S.L.S.M.; Alagusundar, N. Sentiment and Context-Aware Recurrent Convolutional Neural Network for Sentiment Analysis. In Proceedings of the 2023 3rd Asian Conference on Innovation in Technology (ASIANCON), Pune, India, 25–27 August 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1–6. [Google Scholar]
- Lundberg, S.M.; Lee, S.I. A unified approach to interpreting model predictions. Adv. Neural Inf. Process. Syst. 2017, 30, 4765–4774. [Google Scholar]
- Ribeiro, M.T.; Singh, S.; Guestrin, C. “Why should i trust you?” Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 1135–1144. [Google Scholar]
- Lai, V.; Carton, S.; Bhatnagar, R.; Liao, Q.V.; Zhang, Y.; Tan, C. Human-ai collaboration via conditional delegation: A case study of content moderation. In Proceedings of the 2022 CHI Conference on Human Factors in Computing Systems, New Orleans, LA, USA, 29 April–5 May 2022; pp. 1–18. [Google Scholar]
- Molina, M.D.; Sundar, S.S. When AI moderates online content: Effects of human collaboration and interactive transparency on user trust. J. Comput.-Mediat. Commun. 2022, 27, zmac010. [Google Scholar] [CrossRef]
- Rallabandi, S.; Kakodkar, I.G.; Avuku, O. Ethical U se of AI in Social Media. In Proceedings of the 2023 International Workshop on Intelligent Systems (IWIS), Ulsan, Republic of Korea, 9–11 August 2023; IEEE: Piscataway, NJ, USA, 2023; pp. 1–9. [Google Scholar]
- Beddiar, D.R.; Jahan, M.S.; Oussalah, M. Data expansion using back translation and paraphrasing for hate speech detection. Online Soc. Netw. Media 2021, 24, 100153. [Google Scholar] [CrossRef]
- Zheng, Z.; Cai, Y.; Li, Y. Oversampling method for imbalanced classification. Comput. Inform. 2015, 34, 1017–1037. [Google Scholar]
- Xu, Y.; Vaziri-Pashkam, M. Limits to visual representational correspondence between convolutional neural networks and the human brain. Nat. Commun. 2021, 12, 2065. [Google Scholar] [CrossRef] [PubMed]
- Devlin, J.; Chang, M.W.; Lee, K.; Toutanova, K. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv 2018, arXiv:1810.04805. [Google Scholar]
- Conneau, A.; Khandelwal, K.; Goyal, N.; Chaudhary, V.; Wenzek, G.; Guzmán, F.; Grave, E.; Ott, M.; Zettlemoyer, L.; Stoyanov, V. Unsupervised cross-lingual representation learning at scale. arXiv 2019, arXiv:1911.02116. [Google Scholar]
- Sanh, V.; Debut, L.; Chaumond, J.; Wolf, T. DistilBERT, a distilled version of BERT: Smaller, faster, cheaper and lighter. arXiv 2019, arXiv:1910.01108. [Google Scholar]
- Prabha, M.I.; Srikanth, G.U. Survey of sentiment analysis using deep learning techniques. In Proceedings of the 2019 1st International Conference on Innovations in Information and Communication Technology (ICIICT), Chennai, India, 25–26 April 2019; IEEE: Piscataway, NJ, USA, 2019; pp. 1–9. [Google Scholar]
- Mohammadi, H.; Giachanou, A.; Bagheri, A. Code for “Towards Robust Online Sexism Detection: A Multi-Model Approach with BERT, XLM-RoBERTa, and DistilBERT for EXIST 2023 Tasks”. 2023. Available online: https://zenodo.org/records/8144300 (accessed on 13 July 2023).
- Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar]
- Brownlee, J. A gentle introduction to early stopping to avoid overtraining neural networks. Mach. Learn. Mastery 2018, 7. Available online: https://machinelearningmastery.com/early-stopping-to-avoid-overtraining-neural-network-models/ (accessed on 10 June 2023).
Category | Records |
---|---|
Task A | |
Not sexist | 10,602 |
Sexist | 3398 |
Total | 14,000 |
Task B | |
1. Threats, plans to harm, and incitement | 310 |
2. Derogation | 1590 |
3. Animosity | 1165 |
4. Prejudiced discussion | 333 |
Total | 3398 |
Task C | |
1.1 Threats of harm | 56 |
1.2 Incitement and encouragement of harm | 254 |
2.1 Descriptive attacks | 717 |
2.2 Aggressive and emotive attacks | 673 |
2.3 Dehumanising attacks and overt sexual objectification | 200 |
3.1 Casual use of gendered slurs, profanities, and insults | 637 |
3.2 Immutable gender differences and gender stereotypes | 417 |
3.3 Backhanded gendered compliments | 64 |
3.4 Condescending explanations or unwelcome advice | 47 |
4.1 Supporting mistreatment of individual women | 75 |
4.2 Supporting systemic discrimination against women as a group | 258 |
Total | 3398 |
Symbol | Description |
---|---|
t | Token in the sentences |
SHAP value for token t | |
T | Set of all tokens |
Model prediction without the token t | |
SHAP Importance for token t | |
Number of sentences in which token t appears | |
SHAP value for token t in the i-th sentence | |
Mean of the SHAP scores | |
Standard deviation of the SHAP scores | |
Importance Ratio for token t | |
Cumulative Importance up to the k-th token | |
Threshold for cumulative importance, set to 0.95 | |
Modified predicted hard label indicator for sentence i | |
Sexsim Score for sentence i |
Parameter | Coefficient | Standard Error | z-Value | p-Value | 95% Confidence Interval |
---|---|---|---|---|---|
Intercept | −1.431497 | 0.044 | −32.262 | [−1.518, −1.345] | |
Text Length | 0.003579 | 0.000 | 7.532 | [0.003, 0.005] | |
Log-Likelihood: −7730.043 | |||||
R-Squared: 0.003650 |
Statistic | Value |
---|---|
Chi2 Statistic | 65.703 |
p-Value | |
Degrees of Freedom | 4 |
T-Statistic | 7.562 |
p-Value | |
Mean Text Length (Sexist) | 64.83 |
Mean Text Length (Non-Sexist) | 58.29 |
Standard Deviation (Sexist) | 51.41 |
Standard Deviation (Non-Sexist) | 50.77 |
Parameter | Description |
---|---|
Tokenization Max Length | 512 tokens |
Learning Rate Range | to (Default: ) |
Batch Sizes | 32, 64, 128 |
Learning Rate Scheduler | Cosine decay schedule |
Warm up Steps | 200 steps |
Early Stopping Patience | 5 epochs |
Loss Function | Binary cross-entropy |
Optimizer | Adam |
Precision Training Policy | Mixed float16 |
Model | Accuracy | Precision | Recall | F1 Score |
---|---|---|---|---|
Task A | ||||
Logistic Regression | 0.70 | 0.42 | 0.70 | 0.46 |
XGBOOST | 0.72 | 0.45 | 0.72 | 0.49 |
BERT | 0.76 | 0.57 | 0.76 | 0.65 |
XLM-RoBERTa | 0.76 | 0.57 | 0.76 | 0.65 |
DistilBERT | 0.77 | 0.74 | 0.77 | 0.72 |
CustomBERT | 0.79 | 0.77 | 0.79 | 0.76 |
Task B | ||||
Logistic Regression | 0.54 | 0.25 | 0.54 | 0.23 |
XGBOOST | 0.56 | 0.27 | 0.56 | 0.21 |
BERT | 0.68 | 0.52 | 0.68 | 0.59 |
XLM-RoBERTa | 0.67 | 0.51 | 0.67 | 0.58 |
DistilBERT | 0.69 | 0.66 | 0.69 | 0.65 |
CustomBERT | 0.71 | 0.69 | 0.71 | 0.68 |
Task C | ||||
Logistic Regression | 0.40 | 0.10 | 0.40 | 0.07 |
XGBOOST | 0.42 | 0.12 | 0.42 | 0.08 |
BERT | 0.63 | 0.44 | 0.63 | 0.52 |
XLM-RoBERTa | 0.64 | 0.46 | 0.64 | 0.53 |
DistilBERT | 0.65 | 0.62 | 0.65 | 0.60 |
CustomBERT | 0.67 | 0.65 | 0.67 | 0.64 |
Statistic | Value |
---|---|
Count | 14,000 |
Mean | −0.271917 |
Standard Deviation | 0.458922 |
Minimum | −0.963626 |
25th Percentile | −0.526098 |
50th Percentile (Median) | −0.483276 |
75th Percentile | −0.297328 |
Maximum | 0.962766 |
Bin | Accuracy | Precision | Recall | F1 Score |
---|---|---|---|---|
(−0.332, −0.0644] ⋃ (0.734, 0.984] | 0.79 | 0.78 | 0.79 | 0.78 |
(−0.0644, 0.202] ⋃ (0.202, 0.468] | 0.78 | 0.76 | 0.78 | 0.77 |
(0.468, 0.734] | 0.77 | 0.75 | 0.77 | 0.76 |
All data (Task A) | 0.79 | 0.77 | 0.79 | 0.76 |
(−0.332, −0.0644] ⋃ (0.734, 0.984] | 0.72 | 0.70 | 0.72 | 0.71 |
(−0.0644, 0.202] ⋃ (0.202, 0.468] | 0.71 | 0.69 | 0.71 | 0.70 |
(0.468, 0.734] | 0.70 | 0.68 | 0.70 | 0.69 |
All data (Task B) | 0.71 | 0.69 | 0.71 | 0.68 |
(-0.332, -0.0644] ⋃ (0.734, 0.984] | 0.68 | 0.66 | 0.68 | 0.67 |
(-0.0644, 0.202] ⋃ (0.202, 0.468] | 0.67 | 0.65 | 0.67 | 0.66 |
(0.468, 0.734] | 0.66 | 0.64 | 0.66 | 0.65 |
All data (Task C) | 0.67 | 0.65 | 0.67 | 0.64 |
Dataset Portion | Accuracy | Precision | Recall | F1 Score | Runtime (s) |
---|---|---|---|---|---|
All Sentences | 0.79 | 0.77 | 0.79 | 0.76 | 1578 (26.3 min) |
High Sexism Score (Top 80%) | 0.79 | 0.75 | 0.76 | 0.73 | 1342 (22.4 min) |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Mohammadi, H.; Giachanou, A.; Bagheri, A. A Transparent Pipeline for Identifying Sexism in Social Media: Combining Explainability with Model Prediction. Appl. Sci. 2024, 14, 8620. https://doi.org/10.3390/app14198620
Mohammadi H, Giachanou A, Bagheri A. A Transparent Pipeline for Identifying Sexism in Social Media: Combining Explainability with Model Prediction. Applied Sciences. 2024; 14(19):8620. https://doi.org/10.3390/app14198620
Chicago/Turabian StyleMohammadi, Hadi, Anastasia Giachanou, and Ayoub Bagheri. 2024. "A Transparent Pipeline for Identifying Sexism in Social Media: Combining Explainability with Model Prediction" Applied Sciences 14, no. 19: 8620. https://doi.org/10.3390/app14198620