Save a fitted BERTopic model to disk. Depending on the serialization method, this may produce either a single file (e.g., *.pkl / *.pt / *.safetensors) or a directory bundle. The function does not pre-create the target path; it only ensures the parent directory exists and lets BERTopic decide the layout.
bertopic_save(
model,
path,
serialization = c("pickle", "safetensors", "pt"),
save_embedding_model = FALSE,
overwrite = FALSE
)Invisibly returns the normalized path.
A "bertopic_r" model.
Destination path (file or directory, as required by BERTopic).
One of "pickle", "safetensors", or "pt". Default "pickle".
Logical; whether to include the embedding model. Default FALSE.
Logical; if TRUE and the target exists, it will be replaced.