Authors: Caleb Ziems, Diyi Yang
This repository contains data links and code for the paper:
Ziems, C. & Yang, D. (2021). To Protect and To Serve? Analyzing Entity-Centric Framing of Police Violence In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP).
@inproceedings{ziems2021protect,
author = {Ziems, Caleb and Yang, Diyi},
booktitle = {Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing (EMNLP)},
title = {{To Protect and To Serve? Analyzing Entity-Centric Framing of Police Violence}},
year = {2021}
}
- anaconda Create main project environment
conda create --name framing-pv python=3.7
conda activate dragnet
pip install -r requirements_dragnet.txt
conda deactivate
conda create --name coref python=3.7
conda activate coref
pip install -r requirements_coref.txt
conda deactivate
conda create --name framing-pv python=3.7
conda activate framing-pv
pip install -r requirements.txt
python -m spacy download en_core_web_sm
All data is contained in a zip file in the Drive directory
-
Download all data and setup repo by running
bash populate_repo.sh
-
Run
python 01_pull_shooting_articles.py
to scrape news articles on police killings -
Clean the retrieved articles by first switching to
conda activate dragnet
and runningpython 03_dragnet_clean.py --input_glob "data/raw/shootings-articles/*/*.html" --output "data/raw/shootings-txt"
-
Return to
conda activate framing-pv
and compile all scraped shooting articles with their political leanings by runningpython 04_build_shooting_df.py
-
Switch to
conda activate coref
and extract all frames by runningpython 05_framing_functions.py
-
Switch back to
conda activate framing-pv
and runpython 06_clean_framing_file.py
to generate the composite file for framing analysis -
Run the analyses in
paper-analysis.ipynb
andprotest-granger.ipynb