Description Usage Arguments Value Examples
View source: R/visualize_embeddings.R
Keeps only specified tokens in the given table of embeddings.
1 | keep_tokens(embedding_df, tokens = "[CLS]")
|
embedding_df |
A tbl_df of embedding vectors; the output of
|
tokens |
Character vector; which tokens to keep. |
The input tbl_df of embedding vectors, with the specified filtering applied.
1 2 3 4 5 6 7 8 9 | ## Not run:
# assuming something like the following has been run:
# feats <- RBERT::extract_features(...) # See RBERT documentation
# Then:
embeddings_layer12_cls <- feats$output %>%
filter_layer_embeddings(layer_indices = 12L) %>%
keep_tokens("[CLS]")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.