# \donttest{
if (exists("topic_model") && exists("texts_cleaned") && exists("embeddings")) {
visualize_documents_2d(model = topic_model,
texts = texts_cleaned,
reduced_embeddings = embeddings,
custom_labels = FALSE,
hide_annotation = TRUE,
filename = "plot",
auto_open = TRUE)
} else {
message("Missing topic_model/texts_cleaned/embeddings. Train a model first.")
}
# }
Run the code above in your browser using DataLab