awlassche/european-gender-drama

0

stars

23

commits

Python

primary language

Jul 24, 2026

updated

README

Performing Gender on the Early Modern Stage

This repository contains code for data extraction, embeddings, classification, clustering and analysis for the article:

[Anonymous]. (under review). Performing Gender on the Early Modern Stage. A Computational and Cross-Lingual Approach to Male and Female Speech in European Drama.

Useful directions πŸ“Œ

  • european-gender-drama/ the main folder contains the Python files to extract data, get embeddings, train classifiers and run clustering experiments
  • /notebooks/ contains a notebook exploring the extracted speech texts
  • /data/ contains the per-language speech/gender corpora and corpus statistics
  • /results/ contains results of the classification, clustering and temporal experiments
  • /figs/ contains the figures generated from those results

Data & article πŸ“

The extracted and classified dataset will be made available upon acceptance.

Speech data is drawn from DraCor (Dutch, English, French, German, Italian and Spanish/Catalan corpora). Sentence embeddings are pushed to and loaded from HuggingFace. Links will be added later.

Project Organization πŸ—οΈ

β”œβ”€β”€ README.md                        <- The top-level README for developers using this project.
β”‚
β”œβ”€β”€ requirements.txt                 <- Python dependencies.
β”‚
β”œβ”€β”€ clustering_task.py               <- Clustering task (KMeans + V-measure) to choose the best embedding model per language.
β”‚
β”œβ”€β”€ check_chunksize.py               <- Inspects how many usable speech chunks result from different chunk sizes / top-speaker cutoffs.
β”‚
β”œβ”€β”€ get_embeddings_europe.py         <- Chunk speech data and push sentence embeddings (BGE-M3 etc.) for all languages to the Hugging Face Hub.
β”‚
β”œβ”€β”€ train_classifiers_europe.py      <- Train logistic regression classifiers (TF-IDF and embeddings) to predict speaker gender, per language.
β”‚
β”œβ”€β”€ train_temporal_fre.py            <- Temporal version of the classification task: trains classifiers on 25-year subcorpora (1625–1800) of the French corpus.
β”‚
β”œβ”€β”€ add_year_to_ndjson.py            <- Adds publication year (from DraCor metadata) to the per-language NDJSON files.
β”‚
β”œβ”€β”€ add_year_to_hf_dataset.py        <- Propagates the 'year' column from the NDJSON files to the pushed Hugging Face embedding datasets.
β”‚
β”œβ”€β”€ push_to_hub.py                   <- Merges per-language local embedding datasets and pushes the combined dataset to the Hugging Face Hub.
β”‚
β”œβ”€β”€ visualize_corpus_stats.py        <- Figures on corpus composition: plays per decade, % female characters/lines, centrality by gender, speech length over time, and % female lines/characters over time for the French corpus.
β”‚
β”œβ”€β”€ visualize_method_comparison.py   <- Figures comparing classification accuracy across languages and embedding/TF-IDF methods.
β”‚
β”œβ”€β”€ visualize_temporal_results.py    <- Figures for the temporal French classification results.
β”‚
β”œβ”€β”€ data/                            <- Per-language speech/gender NDJSON files (zipped), plus corpus_stats/ (per-play and per-character CSVs) created by the notebooks.
β”‚
β”œβ”€β”€ notebooks/                       <- Jupyter notebooks.
β”‚      β”‚
β”‚      └── explore_speech_texts.ipynb            <- Exploratory look at the extracted speech texts.
β”‚
β”œβ”€β”€ figs/                            <- Figures generated by the visualize_*.py scripts.
β”‚
└── results/                         <- Results from the clustering, classification and temporal experiments (incl. v_measures/ subfolder).

Contributors

awlassche

23 commits

awlassche/european-gender-drama

0

stars

23

commits

Python

primary language

Jul 24, 2026

updated

README

Performing Gender on the Early Modern Stage

This repository contains code for data extraction, embeddings, classification, clustering and analysis for the article:

[Anonymous]. (under review). Performing Gender on the Early Modern Stage. A Computational and Cross-Lingual Approach to Male and Female Speech in European Drama.

Useful directions πŸ“Œ

  • european-gender-drama/ the main folder contains the Python files to extract data, get embeddings, train classifiers and run clustering experiments
  • /notebooks/ contains a notebook exploring the extracted speech texts
  • /data/ contains the per-language speech/gender corpora and corpus statistics
  • /results/ contains results of the classification, clustering and temporal experiments
  • /figs/ contains the figures generated from those results

Data & article πŸ“

The extracted and classified dataset will be made available upon acceptance.

Speech data is drawn from DraCor (Dutch, English, French, German, Italian and Spanish/Catalan corpora). Sentence embeddings are pushed to and loaded from HuggingFace. Links will be added later.

Project Organization πŸ—οΈ

β”œβ”€β”€ README.md                        <- The top-level README for developers using this project.
β”‚
β”œβ”€β”€ requirements.txt                 <- Python dependencies.
β”‚
β”œβ”€β”€ clustering_task.py               <- Clustering task (KMeans + V-measure) to choose the best embedding model per language.
β”‚
β”œβ”€β”€ check_chunksize.py               <- Inspects how many usable speech chunks result from different chunk sizes / top-speaker cutoffs.
β”‚
β”œβ”€β”€ get_embeddings_europe.py         <- Chunk speech data and push sentence embeddings (BGE-M3 etc.) for all languages to the Hugging Face Hub.
β”‚
β”œβ”€β”€ train_classifiers_europe.py      <- Train logistic regression classifiers (TF-IDF and embeddings) to predict speaker gender, per language.
β”‚
β”œβ”€β”€ train_temporal_fre.py            <- Temporal version of the classification task: trains classifiers on 25-year subcorpora (1625–1800) of the French corpus.
β”‚
β”œβ”€β”€ add_year_to_ndjson.py            <- Adds publication year (from DraCor metadata) to the per-language NDJSON files.
β”‚
β”œβ”€β”€ add_year_to_hf_dataset.py        <- Propagates the 'year' column from the NDJSON files to the pushed Hugging Face embedding datasets.
β”‚
β”œβ”€β”€ push_to_hub.py                   <- Merges per-language local embedding datasets and pushes the combined dataset to the Hugging Face Hub.
β”‚
β”œβ”€β”€ visualize_corpus_stats.py        <- Figures on corpus composition: plays per decade, % female characters/lines, centrality by gender, speech length over time, and % female lines/characters over time for the French corpus.
β”‚
β”œβ”€β”€ visualize_method_comparison.py   <- Figures comparing classification accuracy across languages and embedding/TF-IDF methods.
β”‚
β”œβ”€β”€ visualize_temporal_results.py    <- Figures for the temporal French classification results.
β”‚
β”œβ”€β”€ data/                            <- Per-language speech/gender NDJSON files (zipped), plus corpus_stats/ (per-play and per-character CSVs) created by the notebooks.
β”‚
β”œβ”€β”€ notebooks/                       <- Jupyter notebooks.
β”‚      β”‚
β”‚      └── explore_speech_texts.ipynb            <- Exploratory look at the extracted speech texts.
β”‚
β”œβ”€β”€ figs/                            <- Figures generated by the visualize_*.py scripts.
β”‚
└── results/                         <- Results from the clustering, classification and temporal experiments (incl. v_measures/ subfolder).

Contributors

awlassche

23 commits

Languages

Python

72.1%

Jupyter Notebook

27.9%