keyATM0.5.5 package

Keyword Assisted Topic Models

by_strata_DocTopic

Estimate document-topic distribution by strata (for covariate models)

by_strata_TopicWord

Estimate subsetted topic-word distribution

calc_PGtheta_R

Calculate the probability for Polya-Gamma Covariate Model

covariates_get

Return covariates used in the iteration

covariates_info

Show covariates information

keyATM_fit_base

Run the Collapsed Gibbs sampler for the keyATM Base

keyATM_fit_cov

Run the Collapsed Gibbs sampler for the keyATM covariates (Dir-Multi)

keyATM_fit_covPG

Run the Collapsed Gibbs sampler for the keyATM covariates (Polya-Gamma...

keyATM_fit_HMM

Run the Collapsed Gibbs sampler for the keyATM Dynamic

keyATM_fit_LDA

Run the Collapsed Gibbs sampler for weighted LDA

keyATM_fit_LDAcov

Run the Collapsed Gibbs sampler for weighted LDA with covariates

keyATM_fit_LDAHMM

Run the Collapsed Gibbs sampler for the weighted LDA with HMM model

keyATM_initialize

Initialize a keyATM model

keyATM_output

Create an output object

keyATM_read

Read texts

keyATM-package

Keyword Assisted Topic Models

keyATM

keyATM main function

keyATMvb_call

Run the Variational Bayes for the keyATM models

keyATMvb_fit

Fit a keyATM model with Collapsed Variational Bayes

keyATMvb

keyATM with Collapsed Variational Bayes

make_wsz_cpp

Initialize assignments

multiPGreg

Run multinomial regression with Polya-Gamma augmentation

plot_alpha

Show a diagnosis plot of alpha

plot_modelfit

Show a diagnosis plot of log-likelihood and perplexity

plot_pi

Show a diagnosis plot of pi

plot_timetrend

Plot time trend

plot_topicprop

Show the expected proportion of the corpus belonging to each topic

plot.strata_doctopic

Plot document-topic distribution by strata (for covariate models)

predict.keyATM_output

Predict topic proportions for the covariate keyATM

read_dfm_cpp

Read files from the quanteda dfm (this is the same as dgCMatrix)

read_keywords

Convert a quanteda dictionary to keywords

refine_keywords

Refine keywords

save_fig

Save a figure

semantic_coherence

Semantic Coherence: Mimno et al. (2011)

top_docs

Show the top documents for each topic

top_topics

Show the top topics for each document

top_words

Show the top words for each topic

values_fig

Get values used to create a figure

visualize_keywords

Visualize keywords

weightedLDA

Weighted LDA main function

word_in_doc

Checking if a word is in a document

Fits keyword assisted topic models (keyATM) using collapsed Gibbs samplers. The keyATM combines the latent dirichlet allocation (LDA) models with a small number of keywords selected by researchers in order to improve the interpretability and topic classification of the LDA. The keyATM can also incorporate covariates and directly model time trends. The keyATM is proposed in Eshima, Imai, and Sasaki (2024) <doi:10.1111/ajps.12779>.

  • Maintainer: Shusei Eshima
  • License: GPL-3
  • Last published: 2026-01-17