Visualise Latent Dirichlet Allocation models with pyLDAvis.

prepare_ldavis(model, corpus, dictionary, ...)

show_ldavis(prepared_vis)

# S3 method for pyLDAvis._prepare.PreparedData
show_ldavis(prepared_vis)

plot_ldavis(model, corpus, dictionary)

ldavis_as_html(prepared_vis)

# S3 method for pyLDAvis._prepare.PreparedData
ldavis_as_html(prepared_vis)

Arguments

model

A model as returned by model_lda.

corpus

A corpus as returned by doc2bow.

dictionary

A dictionary as returned by corpora_dictionary.

...

Additional arguments from the official documentation.

prepared_vis

Prepapred vis as returned by prepapre_ldavis.

Details

plot_ldavis is a wrapper around prepapre_ldavis and show_ldavis. Note that a plot method that can be used instead of show_ldavis.

Examples

docs <- prepare_documents(corpus)
#> Preprocessing 9 documents #> 9 documents after perprocessing
dict <- corpora_dictionary(docs) corpora <- doc2bow(dict, docs) # lda model model <- model_lda( corpus = corpora, id2word = dict, iterations = 50L, num_topics = 2L ) # visualise vis <- prepare_ldavis(model, corpora, dict)
# NOT RUN { plot(vis) # }