Return raw language model ('LM') embeddings from package text and function definitions.
Source:R/embeddings.R
pkgmatch_embeddings_from_pkgs.Rd
The embeddings are currently retrieved from a local 'ollama' server running Jina AI embeddings.
Value
If !functions_only
, a list of two matrices of embeddings: one for
the text descriptions of the specified packages, including individual
descriptions of all package functions, and one for the entire code base. For
functions_only
, a single matrix of embeddings for all function
descriptions.
See also
Other embeddings:
pkgmatch_embeddings_from_text()
Examples
if (FALSE) { # \dontrun{
packages <- c ("cli", "fs")
emb_fns <- pkgmatch_embeddings_from_pkgs (packages, functions_only = TRUE)
colnames (emb_fns) # All functions of the two packages
emb_pkg <- pkgmatch_embeddings_from_pkgs (packages, functions_only = FALSE)
names (emb_pkg) # text_with_fns, text_wo_fns, code
colnames (emb_pkg$text_with_fns) # cli, fs
} # }