| get_embeddings | R Documentation |
This function wraps the 'transformers' library in 'Python', to obtain vector embeddings (a numerical representation of meaning) for a character vector based on a pretrained model.
get_embeddings(x, model_path = NULL)
x |
Character vector of text to be embedded. |
model_path |
Atomic character vector referring to a folder with a pretrained model. Default: NULL |
Matrix
## Not run:
if(requireNamespace("reticulate", quietly = TRUE)){
tmp <- get_embeddings(c("cat", "my cat", "dog"),
model_path = "scibert_scivocab_uncased")
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.