Data and code for:
Zhu, Yutong. "Explaining Gendered Language Through Embedding Approximation: How 'Stupid' Became a Man's Word." Social Forces, forthcoming.
The paper adapts the A La Carte (ALC) embedding approximation to trace how individual sentences and context words drive a word's position on a semantic axis, and applies it to the twentieth-century masculinization of "unintelligence" words (e.g., "stupid") in the Corpus of Historical American English (COHA). It finds the shift tracks a change in pragmatic register — from affiliative ease to confrontational intensity — rather than a change in gendered judgments of intelligence.
This repository exists to back the paper's Data and Code Availability Statement. The result files under results/ and the NRC lexicon under data/ are the complete data behind every figure and table — that part is not optional.
The pipeline scripts and the 06_analysis/ notebooks are included as a bonus, not as a requirement: they document how the results were produced and let you re-run the specific notebooks that reproduce a published figure or table. A few notebooks that exist in the original research project but were exploratory, superseded, or depend on inputs not redistributed here (see below) are not included.
01_preprocessing/ corpus cleaning and lowercasing
02_embedding_training/ bootstrapped Word2Vec models (20 samples x year)
03_context_extraction/ per-year context-word counts and vectors
04_alacarte/ the paper's core method: transformation matrix + application
05_semantic_parsing/ dependency parsing for pejorative-adjective targets; insult-bigram counts
06_analysis/ notebooks that produce the paper's figures and tables
schematics/ source diagrams for Figures 2, 3, and 7
data/ NRC Emotion Lexicon (third-party, redistributed under its own terms)
results/ output data referenced by the figures, tables, and appendices
.sbatch files show the SLURM resource requests used to run each stage on the original compute cluster; --account/--partition are placeholders, since those name a specific institutional allocation rather than anything about the method.
- The COHA corpus itself. It is licensed, not public — purchase access at english-corpora.org/coha. This also means COHA document-level metadata (titles, authors, source file paths) is not redistributed here.
- Trained embeddings and other intermediate model artifacts (bootstrapped Word2Vec models, transformation matrices, cached context vectors). These total tens of gigabytes and can be regenerated from the corpus using the scripts in
02_embedding_training/and04_alacarte/; they aren't needed to inspect or check the results reported in the paper. results/context_counts_lower/here holds only the context words needed by the included notebooks — the paper's curated soft/harsh/gender-identity lists (Appendix B) plus the NRC emotion-category words used in Table 3 and Appendix D — not the full per-year word-count matrices for the entire corpus vocabulary, which run into the tens of millions of cells and are almost entirely words the paper never discusses.- One analysis notebook is intentionally excluded: an internal robustness-checks notebook that mostly explored results not reported in the manuscript. Every notebook that reproduces a published figure or table is included.
dimensions.ipynb(the generator forresults/gender_analysis/) andAppendix_F_Genres.ipynbare included for documentation but can't be run standalone in this repo: they read the bootstrapped Word2Vec models and raw COHA source metadata directly, neither of which is redistributed here. Each notebook says so at the top.
| Output | Notebook / script | Data |
|---|---|---|
| Figure 1 | 06_analysis/Figure1_New.ipynb |
results/context_counts_lower/, results/gender_analysis/ |
| Figure 2, 3, 7 | schematics/ (source diagrams) |
— |
| Figure 4 | 06_analysis/Figure4.ipynb |
results/context_counts_lower/, results/gender_analysis/ |
| Figure 5, Table 3 | 06_analysis/Figure5_Table3.ipynb |
results/context_counts_lower/, results/gender_analysis/, data/NRC-Emotion-Lexicon/ |
| Figure 6a | 06_analysis/dimensions.ipynb (generator; documents the method, not runnable standalone here) |
results/gender_analysis/ |
| Figure 6b | 05_semantic_parsing/count-bigrams.ipynb |
results/normalized_bigram_frequencies.txt (precomputed) |
| Table 1 | 04_alacarte/alacarte_words.py |
results/alacarte_words/stupid_ranked_word_scores.csv |
| Appendix A | 05_semantic_parsing/parser.py |
results/semantic_parser/ |
| Appendix D (Table D1) | 06_analysis/Appendix_D_NRC_Pairwise.ipynb |
results/context_counts_lower/, results/gender_analysis/, data/NRC-Emotion-Lexicon/ |
| Appendix F | 06_analysis/Appendix_F_Genres.ipynb (documents the method, not runnable standalone here) |
COHA source metadata (not redistributed here) |
Notebook filenames don't always match figure numbers one-to-one — Figure4.ipynb, for instance, was originally written as "Figure 2" before the manuscript's figures were renumbered during review. The table above is the authoritative mapping.
Python 3, gensim, scikit-learn, spaCy (en_core_web_sm), pandas, numpy, scipy, matplotlib, statsmodels, joblib, python-docx.
If you use this code or data, please cite the paper above. COHA users should also cite Davies (2012). This repository redistributes the NRC Emotion Lexicon (data/NRC-Emotion-Lexicon/) under its own terms; if you use it, cite Mohammad and Turney (2010, 2013) — see the NRC lexicon project page for details.
MIT — see LICENSE.
Last edited: 2026-08-04