https://github.com/gesiscss/socialcad
https://github.com/gesiscss/socialcad
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/gesiscss/socialcad
- Owner: gesiscss
- License: gpl-3.0
- Created: 2021-09-09T19:14:21.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2023-05-04T22:39:14.000Z (about 3 years ago)
- Last Synced: 2025-03-31T06:51:11.929Z (over 1 year ago)
- Language: Jupyter Notebook
- Size: 369 KB
- Stars: 3
- Watchers: 10
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SocialCAD
This repository contains the code for the EMNLP'21 paper, ['How Does Counterfactually Augmented Data Impact Models for Social Computing Constructs?'](https://aclanthology.org/2021.emnlp-main.28/) and the follow-up NAACL'21 paper, ['Counterfactually augmented data and unintended bias: The case of sexism and hate speech detection'](https://aclanthology.org/2022.naacl-main.347/)
### to install
python requirements and resources:
```shell
pip install -r requirements.txt
```
### Data
- we make the type of counterfactual annotations available in the data folder with the respective ids. Please download the original datasets from their sources.
### to run
- to train and test models (RQ1): (will automatically generate tables with model performance and store in results): ``train_models.py``
- to annotate CAD types: ``find and classify diffs.ipynb``
- to train models on different types of CAD (RQ2): ``train_by_typology.py``
- to get feature weights (RQ3) and significance tests (RQ1): ``explain model predictions.ipynb``
- injection analysis (in Appendix): ``injection_percent.py``
- unintended bias analysis (in the NAACL'22 paper): ``detect unintended biases typology.ipynb``