This repo contains code for EMNLP 2021 paper: Uncovering Implicit Gender Bias Through Commonsense Inference
To get a local copy up and running follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
- Prerequisites
pip install -r requirements.txt
Download RocStory dataset from https://cs.rochester.edu/nlp/rocstories/
Download StanfordNERTagger
-
COMeT2
Install COMeT2 according to https://github.com/vered1986/comet-commonsense
-
Classify stories according to protagonsit's gender
python preprocess.py <story_filename.tsv>
-
Anonymization
python replaceGender.py
-
Extract stories having more than two characters
python extractTwo.py
-
Classify sentences according to protagonist
python findSubj.py
-
Get COMeT outputs
python generate_inferences.py
-
Calculate Valence, arousal scores
python connotation_COMET_NRC.py
-
Calculate Intellect, Appearance, Power scores
python get_lexicon_average.py
Acknowledgement:
We borrowed some code from this repository: https://github.com/ddemszky/textbook-analysis