Topic Modeling for Communication Research

Machine Learning
Introduced by
David Blei et al. (LDA); Roberts, Stewart & Tingley (STM)
Year
2003
Type
Unsupervised probabilistic model of latent themes in document collections
Family
Text-as-data discovery methods

What does it do?

Topic modeling is an unsupervised technique for discovering latent themes in a document collection.

It represents each document as a mixture of topics and each topic as a distribution over words, so themes are inferred from patterns of word co-occurrence rather than assigned in advance. In communication research it is used to map issues, frames and themes in news, social media and political text. This page covers Latent Dirichlet Allocation (LDA) and its covariate-based extension, the Structural Topic Model (STM).

The intuition behind the method

Articles about a single event usually blend several recurring themes, and certain words tend to appear together when a theme is being discussed. Topic modeling works backward from this pattern. It assumes each document is a blend of hidden topics and each topic is a characteristic mix of words, then estimates both from the words actually observed across the corpus. No one labels the topics beforehand. They emerge from co-occurrence and must be read and named by the analyst. STM adds document metadata such as outlet, date or author affiliation, so the researcher can ask whether topic prevalence differs across those groups.

History

Latent Dirichlet Allocation was introduced by Blei, Ng, and Jordan in 2003. For the social sciences, the Structural Topic Model was developed by Roberts, Stewart and Airoldi (2013), and Roberts et al. (2014) applied it to open-ended survey responses and experiments, showing how document covariates such as author affiliation or treatment assignment can be incorporated into topic analysis. Grimmer and Stewart (2013) framed automated text methods, including topic models, as tools that require extensive, problem-specific validation.

When to use it

Choose topic modeling when you have a large text corpus, no predefined categories, and an exploratory or hypothesis-generating aim, such as mapping what an archive or stream is about or comparing theme prevalence across outlets and time. STM is the variant to use when you need to relate topic prevalence to document metadata. The method assumes that themes appear as distinctive word co-occurrence patterns and that a bag-of-words representation is adequate. Do not use it when your categories are already defined and you need to measure their frequency; a validated supervised classifier suits that task better. Be cautious with very short documents such as tweets, where LDA's assumptions are strained and pooling or specialised variants are needed. Also avoid it when topics must correspond exactly to a theoretical construct, since topics are emergent patterns that may not align with the intended concept.

Limitations and considerations

  • Results depend on the chosen K and on preprocessing choices such as stopword removal, stemming and vocabulary pruning, so different settings can yield different topics.
  • Topics are word co-occurrence patterns, not theoretical concepts; a single topic may merge two frames or split one theme into several.
  • The bag-of-words assumption ignores word order, syntax and negation, so the same vocabulary used with opposite stance is treated identically.
  • Standard LDA performs poorly on very short texts such as tweets, where co-occurrence information is sparse.

Source conditions do not replace independent scientific review or validation by an analysis engine.

Strengths

  • Identifies themes from the corpus itself, so it can surface issues a researcher did not anticipate in an archive too large to read manually.
  • STM relates topic prevalence to document covariates such as outlet or author affiliation, allowing emphasis to be compared across groups with uncertainty estimates.
  • Produces per-document topic proportions that can be used as variables in later analysis.
  • The probabilistic specification makes the model's assumptions explicit, and fitted models can be compared on held-out likelihood and coherence.

Applications

  • Mapping the issues and themes in large news archives over years or decades.
  • Discovering frames and agendas in political speeches, manifestos, and debates.
  • Analyzing themes in social-media discourse and open-ended survey responses.
  • Estimating how topic emphasis differs by outlet, party, or time using STM covariates.
  • Generating candidate categories for a subsequent supervised, validated content analysis.

How it works

How it works

1

LDA specifies a generative story. Each document's topic proportions θ_d are drawn from a Dirichlet prior. For each word position, a topic assignment z is drawn from those proportions, and the word itself is drawn from that topic's word distribution β. Documents are therefore treated as bags of words produced by a shared set of topics, and word order is not part of the model.

Formula
\theta_d \sim \mathrm{Dir}(\alpha),\quad z_{dn} \sim \mathrm{Mult}(\theta_d),\quad w_{dn} \sim \mathrm{Mult}(\beta_{z_{dn}})
2

Only the words w are observed, so the hidden quantities (topic proportions and topic assignments) must be inferred from the posterior, the conditional distribution of θ and z given w. This posterior cannot be computed exactly and is approximated, commonly by variational inference or by sampling methods. The output is a per-document topic share and a per-topic word distribution.

Formula
p(\theta, z \mid w, \alpha, \beta) = \frac{p(\theta, z, w \mid \alpha, \beta)}{p(w \mid \alpha, \beta)}
3

STM replaces LDA's prior on topic proportions with a logistic-normal prior whose mean depends on document covariates X_d through coefficients Γ, with covariance Σ. Covariates such as outlet, date or ideology can therefore shape topic prevalence, and the model reports uncertainty in these associations.

Formula
\theta_d \sim \mathrm{LogisticNormal}(X_d \Gamma, \Sigma)
4

The number of topics K is set by the researcher and has no single correct value. Compare models across a range of K using held-out likelihood, semantic coherence and exclusivity diagnostics, and favour the solution whose topics are most interpretable for the research question. Report how findings change across the values considered rather than presenting one value as the answer.

5

Each topic is interpreted from its highest-probability words and from documents that load heavily on it. The analyst then labels the topic and checks its coherence. Because topics are statistical regularities rather than validated concepts, human reading and validation against coded examples are required before substantive claims are made. Validation should be operational: have human coders judge whether each topic's top words form a coherent theme and whether an intruder word or document can be identified among them, then compare the model's topic assignments with a hand-coded validation sample using an agreement statistic. Grimmer and Stewart (2013) argue that such problem-specific validation is essential before automated output is used in substantive analysis.

Common pitfalls

  • Treating discovered topics as measured categories rather than emergent patterns that need interpretation and labeling.
  • Selecting K to optimise one diagnostic, or choosing the value that gives the most readable topics, without reporting sensitivity to K.
  • Labeling topics impressionistically from a few top words and then making claims about frames or agendas that those words do not show.
  • Applying vanilla LDA to short social-media posts without pooling documents or using a variant designed for short texts.

Frequently asked questions

How do I choose the number of topics K?

There is no single correct K. Fit models across a range of values and compare them using held-out likelihood, semantic coherence (do a topic's top words co-occur meaningfully?) and exclusivity (are its words distinctive to that topic?). Weight substantive interpretability most heavily, because a model is useful only if its topics make sense for your question. Report how results change across the K values you considered rather than presenting one value as the answer.

What does the Structural Topic Model add over LDA?

STM lets document-level metadata such as outlet, date, author ideology or treatment condition influence both how prevalent each topic is (topical prevalence) and how a topic is worded (topical content). This means you can directly estimate and test, with uncertainty, whether different sources emphasise different themes or frame the same theme differently, which is the kind of comparison communication research needs. Plain LDA treats all documents as exchangeable and offers no built-in way to relate topics to covariates.

Can topic models replace human frame or theme coding?

Not by themselves. Topics are emergent word co-occurrence patterns, not validated concepts, and they may blend or split themes in ways that do not match your theoretical categories. They are useful for discovery, surfacing what a corpus is about and generating hypotheses, but substantive claims require human interpretation, labeling and validation against coded samples. Use topic models to explore and propose categories, then validate those categories rather than treating raw topics as final measures.

Related methods

Sources

  1. Blei, D. M., Ng, A. Y., & Jordan, M. I. (2003). Latent Dirichlet allocation. Journal of Machine Learning Research, 3, 993–1022.

    Open publication reference
  2. Roberts, M. E., Stewart, B. M., Tingley, D., Lucas, C., Leder-Luis, J., Gadarian, S. K., Albertson, B., & Rand, D. G. (2014). Structural topic models for open-ended survey responses. American Journal of Political Science, 58(4), 1064–1082.

    Open DOI reference
  3. Grimmer, J., & Stewart, B. M. (2013). Text as data: The promise and pitfalls of automatic content analysis methods for political texts. Political Analysis, 21(3), 267–297.

    Open DOI reference