Loads a previously saved embeddings matrix from an RDS file and attaches it to the corpus. Only embeddings for works present in the corpus are loaded; mismatches are reported.
Usage
sm_embed_load(corpus, path, call = rlang::caller_env())Arguments
- corpus
An sm_corpus object.
- path
Character; file path to read embeddings from (an
.rdsfile created bysm_embed_save()).- call
Caller environment for error reporting.
See also
Other embedding:
sm_embed_save(),
sm_embed_works()
Examples
if (FALSE) { # \dontrun{
corpus <- sm_example_corpus(with_embeddings = FALSE)
corpus <- sm_embed_load(corpus, "my_embeddings.rds")
dim(corpus$embeddings)
} # }