[Paper Review] A Bayesian approach to modeling topic-metadata relationships
This paper proposes a fully Bayesian Beta regression approach to model topic-metadata relationships in text data, improving upon the stm package's frequentist OLS method by accounting for the bounded (0,1) nature of topic proportions. The method uses Monte Carlo sampling within a Bayesian framework to produce more coherent, valid predictions and posterior predictive distributions, demonstrated on German MPs' Twitter data with improved accuracy and interpretability over OLS and frequentist Beta regression.
The objective of advanced topic modeling is not only to explore latent topical structures, but also to estimate relationships between the discovered topics and theoretically relevant metadata. Methods used to estimate such relationships must take into account that the topical structure is not directly observed, but instead being estimated itself in an unsupervised fashion, usually by common topic models. A frequently used procedure to achieve this is the method of composition, a Monte Carlo sampling technique performing multiple repeated linear regressions of sampled topic proportions on metadata covariates. In this paper, we propose two modifications of this approach: First, we substantially refine the existing implementation of the method of composition from the R package stm by replacing linear regression with the more appropriate Beta regression. Second, we provide a fundamental enhancement of the entire estimation framework by substituting the current blending of frequentist and Bayesian methods with a fully Bayesian approach. This allows for a more appropriate quantification of uncertainty. We illustrate our improved methodology by investigating relationships between Twitter posts by German parliamentarians and different metadata covariates related to their electoral districts, using the Structural Topic Model to estimate topic proportions.
Motivation & Objective
- To address the limitations of the stm package’s OLS regression for topic-metadata relationships, which produces invalid predictions outside (0,1).
- To replace the hybrid frequentist-Bayesian approach in stm with a fully Bayesian framework that better accounts for uncertainty in topic proportions.
- To develop a method that enables coherent, interpretable, and valid inference on how metadata covariates relate to latent topics in text.
- To demonstrate the method’s advantages through analysis of German MPs’ Twitter posts, linking topics to time and socioeconomic metadata.
Proposed method
- Replace OLS regression with Beta regression, which models topic proportions as bounded in (0,1), ensuring predictions remain within valid range.
- Integrate Beta regression within the method of composition, using Monte Carlo sampling to draw topic proportions from their posterior distribution.
- Use a fully Bayesian framework to estimate the posterior predictive distribution of topic proportions across different values of metadata covariates.
- Apply the method to the Structural Topic Model (STM), leveraging its ability to incorporate document-level metadata into topic proportion estimation.
- Use MCMC or variational inference to obtain posterior distributions over model parameters, enabling full Bayesian inference.
- Visualize results via posterior predictive means and quantiles (e.g., 85th, 90th, 95th) to show uncertainty and variation across documents.
Experimental results
Research questions
- RQ1How do topic proportions in German MPs' Twitter posts vary over time, particularly around major events like the 2019 UN Climate Action Summit?
- RQ2What is the relationship between topic proportions for 'Climate Protection' and socioeconomic indicators such as unemployment rate, GDP per capita, and immigrant share in an MP’s district?
- RQ3To what extent do OLS-based estimates in the stm package produce implausible predictions (e.g., negative topic proportions) due to ignoring the bounded nature of topic proportions?
- RQ4Can a fully Bayesian Beta regression approach produce more accurate and interpretable estimates of topic-metadata relationships than frequentist alternatives?
- RQ5How does the posterior predictive distribution of topic proportions vary across different metadata values, revealing heterogeneity in individual MP behavior?
Key findings
- The OLS-based approach in the stm package produces invalid predictions, including negative topic proportions, due to ignoring the (0,1) constraint on topic proportions.
- Frequentist Beta regression improves on OLS by ensuring predictions remain within (0,1), but still lacks full uncertainty quantification and coherent Bayesian interpretation.
- The proposed fully Bayesian Beta regression produces valid, bounded predictions and enables visualization of the full posterior predictive distribution, revealing greater uncertainty and variation across MPs.
- For the 'Climate Protection' topic, higher immigrant shares in an MP’s district are associated with lower discussion frequency, while GDP per capita shows a nonlinear relationship peaking around EUR 70k.
- The posterior predictive distribution shows substantial variation in topic proportions across MPs at different covariate values, highlighting individual-level heterogeneity not captured by point estimates.
- The Bayesian approach allows for richer, more comprehensive exploration of topic-metadata relationships, including quantiles of the predictive distribution, enhancing interpretability and robustness.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.