Word and title embeddings
An embedding turns a word into a list of numbers so that words used in similar ways get similar lists. We use embeddings to measure what a book was about from its title alone. This page explains how the vectors are built, in four steps, and why we built them this way.
Why a vector and not a subject class
The Universal Short Title Catalogue assigns each edition one of about 20 subject classes. A class supports counts and shares. It cannot say how far apart two books are. Erasmus on the freedom of the will and Luther's reply are both filed under Religious, and so are a Catholic devotional manual and a Calvinist catechism. A vector gives every title a position, and positions have distances. Every measure in the paper is a distance between titles or between averages of titles.
Step 1. Count which words appear together
The idea behind every embedding is that a word is known by the company it keeps (Mikolov et al. 2013, Pennington, Socher, and Manning 2014). In Latin titles medicus appears near chirurgia and rex appears near imperator. For each language we count how often each pair of words appears within five words of one another in a title. Words that appear fewer than 20 times are left out. The result is a large table with one row and one column for every word.
Step 2. Correct for how common each word is
Raw counts mostly track frequency. Two common words appear together often whether or not they are related. Pointwise mutual information compares how often a pair appears together with how often it would if the two words were unrelated (Church and Hanks 1990).
A pair that appears together exactly as often as chance predicts has a PMI of zero. Negative values are set to zero because a negative value for a rare pair rests on very few observations. The result is called positive PMI.
Step 3. Compress the table to 200 dimensions
The table has thousands of columns and most cells are zero. We reduce it to 200 columns with a truncated singular value decomposition. The decomposition keeps the 200 directions that account for the most variation in the table and drops the rest, which is mostly noise. Each word now has a vector of 200 numbers. Levy and Goldberg (2014) show that the neural method word2vec implicitly factors a table of this kind, so the two approaches are close relatives. Ours has no random initialization and the same input always gives the same vectors.
Two words are compared by the cosine of the angle between their vectors.
The cosine is 1 when two vectors point the same way, 0 when they are at right angles, and −1 when they point in opposite directions. The cosine distance runs from 0 to 2. Length does not enter, so a long title and a short title on the same subject are close.
Step 4. Average the words of a title
A title's vector is a weighted average of its word vectors. We use the smooth inverse frequency weights of Arora, Liang, and Ma (2017). A word that makes up the share \(p(w)\) of all words in the language gets the weight
Common words such as de and et get little weight and rare words get nearly full weight. After averaging we remove the first principal component of all title vectors in the language. That component carries what all titles share, such as common syntax, and removing it leaves the differences in content.
What comes out
Each title has a vector of 200 numbers that can be compared with any other title in the same language. Each language is trained on its own titles so a Latin vector and a German vector lie in different spaces and are never compared. Every measure in the paper is a distance inside one language.
| Setting | Value |
|---|---|
| Context window | 5 words |
| Minimum word frequency | 20 |
| Dimensions kept | 200 |
| Smoothing constant in the title average | 0.001 |
| Languages trained separately | Latin, German, French, Italian, English, Dutch, Spanish |
Why not a modern language model
Pretrained neural models are trained on modern text. None exists for sixteenth-century Latin, German, or Dutch titles in their original spelling. Ganguli et al. (2026) show for patents that the choice of text representation can reverse a measured trend so a text measure has to be validated before its trend is read. We train on the catalog's own titles and check the result against things we know. The nearest titles to William Harvey's De motu cordis are reprints of Harvey and other works on the circulation of the blood, and the catalog files them under three different classes. You can search any word's neighbors in the companion.
Word embeddings are now a standard tool in economics. They have been used to measure the similarity of firms and of patents (Hoberg and Phillips 2010, Kelly et al. 2021) and to trace change in the meaning of words over time (Hamilton, Leskovec, and Jurafsky 2016). Gentzkow, Kelly, and Taddy (2019) survey text as data for economists.
What to keep in mind
- A title is short. The vectors capture what a title says a book is about and nothing about its contents.
- Spelling is not standardized. Variant spellings of one word are separate words that usually end up as near neighbors.
- The vectors record usage in the catalog. A word's neighbors are the words printers put beside it on title pages.
References
- Sanjeev Arora, Yingyu Liang, and Tengyu Ma (2017). A Simple but Tough-to-Beat Baseline for Sentence Embeddings. International Conference on Learning Representations (ICLR).
- Kenneth W. Church and Patrick Hanks (1990). Word Association Norms, Mutual Information, and Lexicography. Computational Linguistics 16(1), 22–29.
- Ina Ganguli, Jeffrey Lin, Vitaly Meursault, and Nicholas Reynolds (2026). Spreading Out Across Expanding Idea Space. Working Paper, Federal Reserve Bank of Philadelphia.
- Matthew Gentzkow, Bryan Kelly, and Matt Taddy (2019). Text as Data. Journal of Economic Literature 57(3), 535–574.
- William L. Hamilton, Jure Leskovec, and Dan Jurafsky (2016). Diachronic Word Embeddings Reveal Statistical Laws of Semantic Change. Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (ACL), 1489–1501.
- Gerard Hoberg and Gordon Phillips (2010). Product Market Synergies and Competition in Mergers and Acquisitions: A Text-Based Analysis. Review of Financial Studies 23(10), 3773–3811.
- Bryan Kelly, Dimitris Papanikolaou, Amit Seru, and Matt Taddy (2021). Measuring Technological Innovation Over the Long Run. American Economic Review: Insights 3(3), 303–320.
- Omer Levy and Yoav Goldberg (2014). Neural Word Embedding as Implicit Matrix Factorization. Advances in Neural Information Processing Systems 27 (NeurIPS 2014), 2177–2185.
- Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg Corrado, and Jeffrey Dean (2013). Distributed Representations of Words and Phrases and their Compositionality. Advances in Neural Information Processing Systems, 3111–3119.
- Jeffrey Pennington, Richard Socher, and Christopher D. Manning (2014). GloVe: Global Vectors for Word Representation. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), 1532–1543.
- Universal Short Title Catalogue (2022). USTC Database. University of St Andrews, https://ustc.ac.uk.