knitr::opts_chunk$set(eval = T, echo = TRUE)
library(keyATM) data(keyATM_data_bills) bills_dfm <- keyATM_data_bills$doc_dfm # quanteda object keyATM_docs <- keyATM_read(bills_dfm)
out <- weightedLDA(docs = keyATM_docs, # text input number_of_topics = 7, # number of topics model = "base", # select the model options = list(seed = 100)) top_words(out)
library(keyATM) data(keyATM_data_bills) bills_dfm <- keyATM_data_bills$doc_dfm # quanteda object bills_cov <- keyATM_data_bills$cov keyATM_docs <- keyATM_read(bills_dfm)
out <- weightedLDA(docs = keyATM_docs, # text input number_of_topics = 7, # number of topics model = "covariates", # select the model model_settings = list(covariates_data = bills_cov), options = list(seed = 100)) top_words(out)
library(keyATM) data(keyATM_data_bills) bills_dfm <- keyATM_data_bills$doc_dfm # quanteda object bills_time_index <- keyATM_data_bills$time_index bills_time_index <- as.integer(bills_time_index - 100) keyATM_docs <- keyATM_read(bills_dfm)
fitted <- weightedLDA(docs = keyATM_docs, # text input number_of_topics = 7, # number of topics model = "dynamic", # select the model model_settings = list(time_index = bills_time_index, num_states = 5), options = list(seed = 100)) top_words(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.