Abstract
We propose a latent variable model to enhance historical analysis of large corpora. This work extends prior work in topic modelling by incorporating metadata, and the interactions between the components in metadata, in a general way. To test this, we collect a corpus of slavery-related United States property law judgements sampled from the years 1730 to 1866. We study the language use in these legal cases, with a special focus on shifts in opinions on controversial topics across different regions. Because this is a longitudinal data set, we are also interested in understanding how these opinions change over the course of decades. We show that the joint learning scheme of our sparse mixed-effects model improves on other state-of-the-art generative and discriminative models on the region and time period identification tasks. Experiments show that our sparse mixed-effects model is more accurate quantitatively and qualitatively interesting, and that these improvements are robust across different parameter settings.
Introduction
Historical research traditionally relies on "close reading," where historians manually review primary sources. While precise, this method suffers from low recall and is nearly impossible to scale to the thousands of court opinions generated over centuries. Existing computational tools like Latent Dirichlet Allocation (LDA) often fall short because they produce "noisy" topics filled with uninformative background words. Furthermore, standard models struggle to account for complex metadata interactions—for example, how the language of a "property law" topic might differ specifically in a Northern state during the 1850s compared to a Southern state in the 1790s.
To address these challenges, we developed the Sparse Mixed-Effects (SME) latent variable model. By extending sparse topic modeling to incorporate metadata like geography and time, the model successfully identifies how legal language regarding slavery shifted across U.S. regions and decades, outperforming standard machine learning baselines in both accuracy and interpretability.
Methods
The SME model builds upon the Sparse Additive Generative Model (SAGE). Unlike LDA, which uses Dirichlet distributions, SAGE models topics as sparse deviations from a constant background language distribution in log-frequency space. The SME model introduces three key components:
- Sparse Latent Variables: It incorporates specific variables for Region and Time, allowing the model to learn what language is unique to a specific location or era.
- Interaction Terms: It includes a third latent variable that captures the interaction between topic, region, and time. This allows the model to see how a specific legal concept (like "manumission") evolves differently in different places.
- Weight Estimation: A multiclass perceptron-style method is used to estimate the contributions of these different latent variables to the final word probabilities.
By enforcing sparsity (forcing the model to use as few words as possible to explain a deviation), the resulting topics are much cleaner and more interpretable than those from traditional models.
Datasets and Evaluation
The study uses a specialized corpus of 5,240 slavery-related U.S. State Supreme Court legal opinions sampled from 1730 to 1866. The geography covers 24 states, categorized into "Free" (R1) and "Slave" (R2) regions, while time is divided into four quartiles (Q1: pre-1837; Q2: 1838–1848; Q3: 1849–1855; Q4: 1856 and later). The model was evaluated on its ability to predict the region and time quartile of a document based solely on its text.
Key Results
The SME model demonstrated significant improvements over both generative and discriminative baselines. In time-period identification, the SME model achieved 41.9% accuracy, a notable improvement over the Linear SVM (36.1%) and the baseline SAGE model. In region identification, it reached 74.8% accuracy.
Crucially, the SME model's advantage over the SVM became more pronounced as the vocabulary size increased, proving it handles high-dimensional, sparse text data more gracefully than simple "bag-of-features" classification.
Historical Insights and Validation
Beyond quantitative metrics, the model provided several qualitative insights that align with historical records:
- Sparsity and Specificity: By penalizing background words, the SME model surfaces highly specific legal terms (e.g., "remainder-man," "mulattoes") that carry heavy historical weight.
- Linguistic "Silences": The model revealed that the word "runaway" was a top keyword in Northern (Free) states but not in Southern (Slave) states for the same topic. This reflects the historical reality that property claims over runaways were rarely contested in Southern courts, making the term less "distinctive" there.
- Evolution of Legal Stances: The model tracked the disappearance of "manumission" (the act of a slave owner freeing a slave) keywords in Southern courts as the conflict over slavery deepened and legal stances hardened.
Conclusion
The Sparse Mixed-Effects model offers a robust framework for automating the analysis of historical documents. By modeling the underlying structure of language alongside metadata, it provides a more effective tool for social science research than traditional classification methods. Future work includes applying the SME framework to other domains, such as analyzing shifts in political rhetoric or online community evolution, where metadata is abundant but underutilized.
Summary updated