This vignette shows how to load a previously saved BERTopic model in
a new session and reuse the extras stored alongside it. Set
eval = TRUE for the chunks you want to run.
Python environment selection and checks are handled in the hidden setup chunk at the top of the vignette.
visualize_barchart(model = model, filename = "barchart_demo")
visualize_distribution(
model = model,
text_id = 1,
probabilities = extras$probabilities,
filename = "vis_topic_dist_demo"
)
visualize_heatmap(model = model, filename = "vis_heat_demo")
visualize_topics(model = model, filename = "dist_map_demo")visualize_documents(model = model, docs, reduced_embeddings = extras$reduced_embeddings_2d)
visualize_documents_2d(model = model, docs, reduced_embeddings = extras$reduced_embeddings_2d)
visualize_documents_3d(model = model, docs, reduced_embeddings = extras$reduced_embeddings_3d)The following visualizations work only if topics_over_time
and topics_per_class were defined after model training or
within the train_bertopic_model() function.