ldavis.Rd
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)
model | A model as returned by |
---|---|
corpus | A corpus as returned by |
dictionary | A dictionary as returned by |
... | Additional arguments from the official documentation. |
prepared_vis | Prepapred vis as returned by |
plot_ldavis
is a wrapper around prepapre_ldavis
and show_ldavis
. Note that a plot
method that can be used
instead of show_ldavis
.
#> → Preprocessing 9 documents #> ← 9 documents after perprocessingdict <- 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) # }