Topic modelling
Also: Topic modeling
An unsupervised technique that groups documents or passages by the themes they share, surfaced as lists of related words per topic.
Last updated
On this page
Topic modelling groups documents or passages by the themes they share, surfaced as lists of related words per topic. Classical methods (LDA, NMF on TF-IDF) treat documents as bags of words; modern methods like BERTopic use embeddings plus clustering.
Why it matters for your research
Topic modelling and embedding-clustering answer overlapping but not identical questions. Classical LDA highlights distinctive vocabulary; embedding methods highlight meaning. Running both on the same corpus often surfaces structure that either alone would miss.
In Archēglyph
On the roadmap as an alternative cluster view that sits beside the HDBSCAN output.
Not to be confused with
Clustering groups by similarity in any space; topic modelling specifically yields labelled topics described by word lists.
A worked example
Run LDA over a corpus of correspondence and you might get a topic whose top words are “harvest, wheat, price, market, tenant” — a farm-management topic — sitting alongside one reading “regiment, muster, supply, march, quarters” — a military-logistics topic. Neither label is assigned by the algorithm; a researcher reads the word list and names the topic, then checks a sample of the documents assigned to it to confirm the label actually fits. Two letters can carry both topics in different proportions — LDA is a mixed-membership model, so a document is not forced into a single bucket the way hard clustering would.
The parameter that quietly matters most
Both LDA and NMF need the number of topics fixed in advance, and that choice reshapes the output more than almost any other setting: too few topics and distinct themes get merged into one incoherent word list; too many and a single real theme fragments into near-duplicate topics that differ only in noise. There is no formula that picks the right number for a given corpus — coherence scores can narrow the search, but reading the actual topics at a few candidate values is still the reliable check.
BERTopic versus classical LDA
BERTopic replaces LDA’s bag-of-words assumption with document embeddings, clusters those embeddings (typically with HDBSCAN after a UMAP projection), and then derives each cluster’s representative word list with a class-based TF-IDF variant. That means it inherits embeddings’ grasp of meaning rather than surface vocabulary — a document about “vessels” and one about “ships” can land in the same topic even without sharing a word — at the cost of needing enough documents per candidate topic for the clustering step to find a stable group at all.
Relationship to plain clustering
Every topic-modelling run is a form of clustering, but not every clustering run is topic modelling: a plain HDBSCAN pass over embeddings groups similar passages without producing a word-list description of what each group is about, which is why Archēglyph’s cluster browser and a future topic-modelling plugin are described as complementary views of the same underlying groups rather than one replacing the other.
When to reach for it over search
Keyword search answers “where does this term appear”; topic modelling answers “what does this corpus talk about, and in what proportions” — useful at the start of a project when a researcher doesn’t yet know which terms to search for. A topic model run early, before close reading begins, often surfaces the vocabulary a researcher didn’t know to look for, which then feeds back into more targeted search and reading later.
Topics drift with corpus composition
Adding a batch of new documents to a dataset and re-running the pipeline can shift topic boundaries even for documents that were already there, since LDA and NMF fit their topics to the whole corpus at once rather than per document. A topic labelled and cited from one version of a dataset is not guaranteed to exist in the same shape in the next, which is another reason a citation should reference a specific version, not just a topic number.