Description Usage Arguments Details Examples
Shiny application to interactively play with embeddings. User provides a pivot word and the n most similar word are projected on a scatter plot.
1 2 | interactive_embedding_exploration(annoy_model, default_number_neighbors = 100,
default_number_rounds = 500, default_perplexity = 30)
|
annoy_model |
RcppAnnoy model generated with get_annoy_model |
default_number_neighbors |
set the number of neighbors slider to this value |
default_number_rounds |
set the number of |
default_perplexity |
set the |
For large list of texts, the auto-complete can be slow.
Increasing the number of neighbors can make things very slow,
in particular with T-SNE
approach.
500 neighbors is usually a good value to have an understanding
of the neighborhood of a vector.
Colors in the scatter plot represents clusters found by dbscan.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | if(interactive()){
# This example should be run with a higher quality model
# than the one embedded in fastrtext
library(projector)
library(fastrtext)
model_test_path <- system.file("extdata",
"model_unsupervised_test.bin",
package = "fastrtext")
model <- load_model(model_test_path)
word_embeddings <- get_word_vectors(model, words = head(get_dictionary(model), 2e5))
annoy_model <- get_annoy_model(word_embeddings, 5)
interactive_embedding_exploration(annoy_model)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.