Structural Topic Modelling

Description

A topic model in which document metadata (segment, date, rating) shapes topic prevalence and wording, allowing statistical comparison of themes across groups.

LDA discovers topics but treats documents as exchangeable. STM incorporates covariates: topic prevalence can depend on metadata (e.g. how much churned versus retained users discuss pricing) and topic content can vary by covariate (how different segments talk about the same topic). Estimates come with uncertainty, enabling regression-style inference about themes. Tools for model selection (semantic coherence and exclusivity), stability across initialisations and representative document retrieval support validation. For UX, STM links open-ended survey responses, reviews or tickets to user attributes and time, making qualitative-scale text quantitatively comparable.

Attributes

Loss type
Unmigrated
Data
Mixed
Effort
Weeks

Steps

  1. Assemble a corpus (survey comments, reviews, tickets) with document-level metadata.
  2. Preprocess text carefully (stop words, lemmatisation) and document decisions.
  3. Fit STMs for a range of K, choosing by semantic coherence, exclusivity and held-out likelihood.
  4. Label topics by reading representative documents, ideally with two researchers independently.
  5. Estimate covariate effects on topic prevalence with uncertainty (estimateEffect) and examine content covariate differences.
  6. Validate key topics against human-coded samples and follow up qualitatively.

Sources

  • Roberts et al., Structural topic models for open-ended survey responses (2014), American Journal of Political Science
  • Roberts, Stewart & Tingley, stm: An R package for structural topic models (2019), Journal of Statistical Software

Also known as

  • STM
  • Topic models with covariates

Categories

  • Analytics & Behaviour
  • Computational & Machine Learning