Learn R Programming

bertopicr (version 0.3.6)

load_bertopic_model: Load a BERTopic Model Bundle

Description

Load a BERTopic model saved with save_bertopic_model() along with its companion RDS file containing R-side extras.

Usage

load_bertopic_model(path, embedding_model = NULL)

Value

A list with two elements: model (the BERTopic model) and extras

(the R-side data saved in the companion RDS file).

Arguments

path

Directory path where the Python model was saved.

embedding_model

Optional embedding model to pass through to BERTopic$load() when the embedding model is not serialized.

Examples

Run this code
# \donttest{
if (dir.exists("topic_model")) {
  loaded <- load_bertopic_model("topic_model")
  print(loaded$extras)
} else {
  message("No saved model found at 'topic_model'.")
}
# }

Run the code above in your browser using DataLab