text_lda_dtm: Calculate LDA topic model

Description Usage Arguments Value Examples

View source: R/text_lda_dtm.R

Description

Calculate LDA topic model

Usage

1
text_lda_dtm(data_dtm, k = 2, burnin = 1000, iter = 1000, keep = 50)

Arguments

data_dtm

Document-Term matrix as prepared by text_dtm_prep

k

Number of topics to detect

burnin

parameter for Gibbs LDA

iter

parameter for Gibbs LDA

keep

parameter for Gibbs LDA

Value

list with elements: lda_out (full LDA topicmodel), beta (beta scores), gamma (gamma scores), and logLik (Log likelihood of topicmodel object)

Examples

1
2
3
4
tidytext::unnest_tokens(dummy_response, 'word', colnames(dummy_response)[7]) %>%
text_dtm_prep(., 'response_id') %>%
pluck(.,"dtm_prep") %>%
text_lda_dtm(., k = 5)

DataS-DHSC/consultations documentation built on Jan. 28, 2022, 1:56 a.m.