Get Vector Embeddings (uses Python)
get_embeddings.RdThis 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.
Examples
if (FALSE) { # \dontrun{
if(requireNamespace("reticulate", quietly = TRUE)){
tmp <- get_embeddings(c("cat", "my cat", "dog"),
model_path = "scibert_scivocab_uncased")
}
} # }