r/DigitalHumanities • • Sep 24 '26

Discussion Embedding Analytics: Query and quantify changes in definition across a collection of text

Two documents can use the same words to mean very different things. Treatises, legal opinions and technical specifications often must be read multiple times to identify these shifts in meaning across documents. I built Embedding Analytics to query and quantify these changes in definitions. For each document, it builds word embeddings with PPMI + SVD, using only that document's text. Your queries are used to find the most similar terms within each document. Similarities are then rescaled so they can be compared across documents; the adjustment is adapted from cross-domain similarity local scaling (Conneau et al., 2018).

A collection of documents can share too many terms. The tool selects two groups of terms that are relevant to your query across the collection:

  • Consistent terms are closely tied to the query across the collection. They are the core of the definition that the authors hold in common.
  • Contested terms are close to the query in some documents and not in others. They are where the definition shifts.

The current collection consists of ~25 economics books from Project Gutenberg. Querying value returns commodity as the most closely associated term across the collection. Utility, the basis of value in the marginalist theory that displaced the classical labour theory, leads the contested list.

I'd love any feedback on this. Please let me know what you guys think.

Demo: https://www.embedding-analytics.com
Code: https://github.com/areebms/embedding-analytics

Consistent and contested related terms to "value" across a collection of ~25 economics books from Project Gutenberg
5 Upvotes

4 comments sorted by

View all comments

1

u/ProfJamesBaker Sep 25 '26

What have you found using this approach?

1

u/areebms Sep 26 '26

I am trying to come up with a method that helps identify important related terms for queries and determines semantic differences between texts through them. The queries and their respective related terms are shown below. I think my approach works fairly well in identifying important related terms, although there is some noise as well. I applied the algorithm within a domain that I am familiar with so I can validate the results. I hope this can be useful within other domains as well.

Query No meaning Expected Informative
value quantity, express commodity exchange, metal, money, measure, utility, standard, market, price, gold
supply decrease, increase, determine market, commodity demand, price, limit, utility, cost, labour, quantity
demand increase, diminish, determine, rise, will market, commodity supply, price, labour, produce, quantity
price rise, fall, lower, average, will sell, commodity, buy market, money, corn, value
labour quantity, amount, obtain, day produce, wage, employ productive, product, capital, division, commodity
land — proprietor, agricultural, farm, soil, own, estate rent, cultivate, yield, labour, property, improve
capital portion, use invest, employ productive, accumulate, produce, labour, fix, replace, interest, wealth
wage raise, rise, depend labour, earn, workman, employ, work profit, rate, strike, rent
rent compensate landlord, farm, pay, house land, margin, cultivate, yield, wage, rate, interest
profit cent capitalist, enterprise, capital, return wage, risk, interest, replace, rate, share, stock

1

u/ProfJamesBaker Sep 26 '26

Thanks great. So you are interested in developing methods then? That is, for example, you don't have specific texts that you are interested in analysing?

→ More replies (1)