Visualize Topics Over Time using BERTopic
visualize_topics_over_time.RdThis function visualizes topics over time from a BERTopic model using Python's Plotly library. The visualization is saved as an interactive HTML file, which can be opened and viewed in a web browser.
Usage
visualize_topics_over_time(
model,
topics_over_time_model,
top_n_topics = 20,
filename = "topics_over_time"
)Arguments
- model
A BERTopic model object. The model must have the method
visualize_topics_over_time.- topics_over_time_model
A topics-over-time model object created using the BERTopic model.
- top_n_topics
An integer specifying the number of top topics to display in the visualization. Default is 20. Must be a positive integer.
- filename
A character string specifying the name of the HTML file to save the visualization. The default value is "topics_over_time". The filename should not contain illegal characters.