Group: Corentin Genton, Lucille Niederhauser, Viola Renne (Group 11)
Course: EE-559 - Deep Learning
Teacher: Cavallaro Andrea
WARNING: The repository contains content that are offensive and/or hateful in nature.
REFERENCES: In this repository, we replicate and build upon the results of the following papers:
These models are used in the code:
Many deep-learning models have been developed to detect hate speech in social media. Though they can achieve good performances, their decision-making processes are often unclear, making it harder for models to comply with certain ethical and legal guidelines. We thus decided to study how models for hate speech detection, and more precisely sexism detection, could gain in explainability. We explored methods building on the work of Mathew et al. 2022 mainly through different pre-processing, fine-tuning of existing models and knowledge distillation.
./Data --> Contains the dataset related files.
./preprocessing_sexism_dataset --> Contains the code for processing sexism dataset
./Pretrained_Model --> Contains the definition of BERT + MLP model
./Rationales --> Contains the figures for the rationales analysis
Notice that for HateXplain, everything is automatically downloaded from Hugging Face. For sexism dataset it is required to download data from here and unzip it in the data folder and call them sexism_data.csv. To use sexism dataset in aggregation to HateXplain dataset, you first need to call sexism_preprocessing.py which will create a sexism_data_preprocessed.json.
python preprocessing_sexism_dataset/sexism_preprocessing.py
Parameters : This describes all the different parameter that are used in this code
Install the libraries using the following command (preferably inside an environment)
pip install -r requirements.txt
To train the basic model use the following command.
python main.py
Everything is handled by the wrapper, to limit the complexity. Training and Inference : This describes how to train and use our models.
1 commits
Python
96.4%
Jupyter Notebook
3.6%
Group: Corentin Genton, Lucille Niederhauser, Viola Renne (Group 11)
Course: EE-559 - Deep Learning
Teacher: Cavallaro Andrea
WARNING: The repository contains content that are offensive and/or hateful in nature.
REFERENCES: In this repository, we replicate and build upon the results of the following papers:
These models are used in the code:
Many deep-learning models have been developed to detect hate speech in social media. Though they can achieve good performances, their decision-making processes are often unclear, making it harder for models to comply with certain ethical and legal guidelines. We thus decided to study how models for hate speech detection, and more precisely sexism detection, could gain in explainability. We explored methods building on the work of Mathew et al. 2022 mainly through different pre-processing, fine-tuning of existing models and knowledge distillation.
./Data --> Contains the dataset related files.
./preprocessing_sexism_dataset --> Contains the code for processing sexism dataset
./Pretrained_Model --> Contains the definition of BERT + MLP model
./Rationales --> Contains the figures for the rationales analysis
Notice that for HateXplain, everything is automatically downloaded from Hugging Face. For sexism dataset it is required to download data from here and unzip it in the data folder and call them sexism_data.csv. To use sexism dataset in aggregation to HateXplain dataset, you first need to call sexism_preprocessing.py which will create a sexism_data_preprocessed.json.
python preprocessing_sexism_dataset/sexism_preprocessing.py
Parameters : This describes all the different parameter that are used in this code
Install the libraries using the following command (preferably inside an environment)
pip install -r requirements.txt
To train the basic model use the following command.
python main.py
Everything is handled by the wrapper, to limit the complexity. Training and Inference : This describes how to train and use our models.
1 commits
Python
96.4%
Jupyter Notebook
3.6%