Extract the document-topic probabilities as a matrix. If probabilities were not computed during fitting, returns NULL (with a warning).
bertopic_as_document_topic_matrix(model, sparse = TRUE, prefix = TRUE)A matrix or sparse Matrix of size n_docs x n_topics, or NULL.
A "bertopic_r" model object.
Logical; if TRUE and Matrix is available, returns a sparse matrix.
Logical; if TRUE, prefix columns as topic ids.