Saves the embeddings matrix from an sm_corpus to an RDS file on disk.
This allows caching expensive embedding computations for later reuse
with sm_embed_load().
Usage
sm_embed_save(corpus, path, call = rlang::caller_env())Arguments
- corpus
An sm_corpus object with a non-
NULLembeddingsmatrix.- path
Character; file path to write the embeddings to. Should end in
.rds.- call
Caller environment for error reporting.
See also
Other embedding:
sm_embed_load(),
sm_embed_works()
Examples
if (FALSE) { # \dontrun{
corpus <- sm_example_corpus(with_embeddings = TRUE)
sm_embed_save(corpus, "my_embeddings.rds")
} # }