Description Usage Arguments Value Examples
View source: R/visualize_embeddings.R
Given the output of do_pca
, make the plot object.
1 2 |
pca_df |
A tbl_df of pca vectors with class "rbert_pca"; output from a
call to |
color_field |
Character scalar; optional column name to assign to color aesthetic in the plot. |
A ggplot2 plot of the embedding vectors projected onto two principal axes.
1 2 3 4 5 6 7 8 9 10 11 | ## Not run:
# assuming something like the following has been run:
# feats <- RBERT::extract_features(...) # See RBERT documentation
# Then:
feats$output %>%
filter_layer_embeddings(layer_indices = 12L) %>%
keep_tokens("[CLS]") %>%
do_pca() %>%
autoplot()
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.