Wrapper around Python BERTopic.visualize_topics_per_class(). This
visualizes how topics are distributed across a set of classes, using the
output of Python topics_per_class(docs, classes).
bertopic_visualize_topics_per_class(
model,
topics_per_class,
top_n_topics = 10L,
topics = NULL,
normalize_frequency = FALSE,
custom_labels = FALSE,
title = NULL,
width = NULL,
height = NULL,
file = NULL
)If file is NULL, an htmltools::HTML object. Otherwise, the
normalized file path is returned invisibly.
A "bertopic_r" model.
A data frame or Python object as returned by
BERTopic.topics_per_class(docs, classes).
Integer; number of most frequent topics to display.
Optional integer vector of topic IDs to include.
Logical; whether to normalize each topic's frequency within classes.
Logical or character scalar controlling label behavior (forwarded to Python).
Optional character plot title.
Optional integer figure width/height in pixels.
Optional HTML output path. If NULL, an htmltools::HTML
object is returned.