Description Usage Arguments Value Examples
View source: R/visualize_embeddings.R
Calculate the 2D PCA for a collection of embedding vectors, in preparation for plotting.
1 2 3 4 5 |
embedding_df |
A tbl_df of embedding vectors; from the output of
|
project_vectors |
A tbl_df of embedding vectors to be used for
calculating the PCA projection matrix. Defaults to |
disambiguate_tokens |
Logical; whether to append example and token index to the literal token for display purposes. |
A tbl_df of the embedding vectors projected onto two principal axes.
1 2 3 4 5 6 7 8 9 10 | ## Not run:
# assuming something like the following has been run:
# feats <- RBERT::extract_features(...) # See RBERT documentation
# Then:
pca_df <- feats$output %>%
filter_layer_embeddings(layer_indices = 12L) %>%
keep_tokens("[CLS]") %>%
do_pca()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.