Home / Science / Humanities and archaeology / Digital humanities / Topic modelling (LDA)Tool #414

Topic modelling with LDA for small text collections, in your browser (seeded, with CSV)

Find the topics in a small collection of letters, notes or articles with latent Dirichlet allocation (collapsed Gibbs sampling): top words per topic, the topic mix of every document, and CSV downloads. Seeded, so runs repeat exactly. Nothing is uploaded.

Keep it one tap away for everyday use.

Bookmark Topic modelling (LDA)?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. Documents
  2. Clean words
  3. Sample
  4. Topics
Nothing is uploadedWorks offline once open

Documents

Each opened file becomes one document. Up to 2,000 documents and 5 MB of text; this is for small corpora.

Smaller alpha: each document keeps to fewer topics. Smaller beta: each topic keeps to fewer words. The same seed and settings always give the same topics.

What it does

A topic model reads a collection of documents and finds groups of words that tend to turn up together, such as harbour, sailors, cargo or choir, organ, hymn. Each group is a topic, and every document gets a mix of topics. Historians use it to map what a run of letters, sermons, newspapers or minutes talks about, and how that changes.

This tool fits latent Dirichlet allocation (LDA) with collapsed Gibbs sampling, the method of Griffiths and Steyvers (2004), in your browser. It is meant for small collections: from a dozen to a couple of thousand short documents. Nothing is uploaded and it works offline.

How to use it

  1. Paste your documents with a blank line between them, or start each with a line ### name. Open text files adds each file as one document.
  2. Choose the number of Topics. Try a few values; there is no single right number.
  3. Press Find topics. The page runs the sweeps in small steps, so it stays usable, and shows its progress.
  4. Read the topics, the topic mix of each document and the convergence line, then download the CSVs or the report.

What the settings do

  • Sweeps: how many times the sampler revisits every word. 500 is plenty for small sets; more rarely hurts.
  • Seed: the starting point of the random numbers. The same text, settings and seed always give the same topics, so a result can be repeated and cited. Change it to see whether the topics are stable.
  • Alpha: how many topics a document may mix. Small (0.1) keeps documents to one or two topics.
  • Beta: how many words a topic spreads over. Small (0.01) gives sharper topics.
  • Remove common English words: drops a built-in list of about 230 words such as the, of and which. Add your own (for example names of months, or chapter) in the box below it.
  • Shortest word and Drop words used fewer than remove very short and very rare words, which carry little topic information and slow the sampler.

Worked example

Press Use the example. It loads 15 short notes from an imaginary parish archive about farming, shipping and church music. After removing 228 common words and 106 words used only once, 42 distinct words (128 in all) are left. With 3 topics, seed 1, alpha 0.1, beta 0.01 and 500 sweeps, the page finds:

  • Topic 1: barley, farmers, hay, harvest, barn, fields, …
  • Topic 2: harbour, sailors, captain, quay, cargo, voyage, …
  • Topic 3: choir, sang, organist, hymn, church, service, …

The perplexity is 15.69. Most notes are 96 % or more one topic, but Note 12, about the harvest festival in church, is 58 % farming and 41 % church: exactly the kind of mixed document LDA is designed to show.

Tips and FAQ

How many documents do I need? LDA works best with hundreds of documents of at least 50 words. With a handful, topics are unstable. Split long texts into pages or chapters.

What is perplexity? How surprised the model is by the words, on average; lower is better. It is shown every 10 sweeps so you can see the sampler settle. Comparing perplexity between different numbers of topics on the same documents favours more topics, so judge the topics by reading them too.

Why do topic numbers change between seeds? Topics have no natural order; topic 1 in one run may be topic 3 in another.

Is my text uploaded? No. Everything runs on your device.

Where the numbers come from

  • Model: D. Blei, A. Ng and M. Jordan (2003), "Latent Dirichlet allocation", Journal of Machine Learning Research 3, 993-1022. Sampler: T. Griffiths and M. Steyvers (2004), "Finding scientific topics", PNAS 101 (suppl. 1), 5228-5235.
  • Checked against a line-by-line Python port of the sampler (same random numbers, identical topic for every word after 30 sweeps) and against scikit-learn's LatentDirichletAllocation on a corpus with 4 planted topics: both recover all 4 and give the same perplexity, 16.5454919306.
  • The stop-word list was written for fibub. The example notes are made up for this tool.

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-09.

Related tools

k-mer counter and spectrum #176 Count every k-letter word in FASTA or FASTQ files (gzip too, any size), with reverse complements together. See the k-mer spectrum, the most common k-mers, a look-up box and a rough genome size from the spectrum's peak. Download the spectrum as CSV. Nothing is uploaded. Stylometry: Burrows' Delta #413 Paste or open several texts, compare them on their most frequent words with Burrows' Delta, see a clustered heat map of the distances, and find the closest candidate author for a disputed text. Nothing is uploaded. Correspondence network visualiser #417 Paste or open a list of letters (sender, recipient, date, place) and see the network of correspondents: a force-directed picture, letters per person, degree, strength, betweenness, communities by modularity, and a date filter. CSV and report downloads; nothing is uploaded. Historic calendar converter #415 Convert a date between the Julian and Gregorian calendars (with the 1582 switch), the tabular Islamic (Hijri) calendar, the Hebrew calendar and the Julian Day Number, and find its day of the week. Convert a whole list and download it as CSV. Manuscript image annotator #416 Open photos or scans of a manuscript from your device, draw rectangles and polygons on lines, words or damage, type a transcription and a note for each, and export them as W3C Web Annotation JSON or CSV. Reads a local IIIF manifest. Nothing is uploaded. 1D Schrödinger solver #923 Choose a textbook potential, type a formula or draw your own, and get the lowest energy levels and wavefunctions of the one-dimensional Schrödinger equation by the matrix (finite-difference) method, with the exact levels alongside for the box, harmonic oscillator, finite well, Morse, linear and Pöschl–Teller potentials.