Skip to content

yanaiela/demog-text-removal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adv-Demog-Text

Adversarial Removal of Demographic Attributes from Text Data

This is the code used in the paper:

"Adversarial Removal of Demographic Attributes from Text Data" Yanai Elazar and Yoav Goldberg. EMNLP 2018. Paper

Prerequisites

  • python 2.7
# create a clean conda env
conda create -n adv-demog-text python==2.7 anaconda
source activate adv-demog-text

# additional python pacakges from requirements.txt
pip install -r requirements.txt

# install dynet version out of my branch
git clone git@github.com:yanaiela/dynet.git

# checkout to the relevant commit
git checkout 5c2a49f595a2a1e286609f348977b714b2db12a1

# now follow the manual source installation of dynet in:
# https://dynet.readthedocs.io/en/latest/python.html

Acquiring the Data:

read the README.md in the src/data folder

Running the Models:

The main components of each experiment are the trainer.py and the attacker.py which correspond to the Adversarial Training and Attacker Network respectively.

NOTE: The first class is also used to train the baseline models.

Each script has its parameters to run with, and the overall experiments used for this work can be found in the runs.md file.

For running these models:

Citing

If you find this work relevant to yours, please consider citing us:

@InProceedings{elazar:2018,
 author    = {Elazar, Yanai and Goldberg, Yoav},
 title     = {Adversarial Removal of Demographic Attributes from Text Data},
 booktitle = {Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing},
 year      = {2018}
}

Contact

If you have any question, issue or suggestions, feel free to contact us with the emails listed in the paper.

This project is based on the cookiecutter data science project template. #cookiecutterdatascience