Description Usage Arguments Value See Also Examples
Visualize analogies for given terms. A visualization of embeddings is
two main components from PCA plotted by ggplot on the 2D plane.
Additionally, the terms from each given pair are
connected to one another. If the embeddings are of good quality, the connection
lines should be almost parallel to each other. If find_analogies = TRUE
only the pairs with at least one solved analogy task are plotted.
1 2 | visualize_analogies(term_vectors, terms, find_analogies = FALSE,
n = 5L, save = FALSE, path_to_save)
|
term_vectors |
A matrix of embeddings of terms |
terms |
A list of two character vectors: the first and the second elements of analogy pairs |
find_analogies |
A logical indicating if the term analogy task should be performed before the plotting (default: FALSE) |
n |
An optional number of neighbors included in analogies (default: 5),
needed only if |
save |
A logical indicating if the plot should be saved to the file |
path_to_save |
An optional string of the path to the target PDF file |
A generated plot of embeddings.
analogy_task
, evaluate_term_embeddings
, terms_pairs_test
1 2 3 4 5 | term_vectors <- embed_terms(examinations, embedding_size = 5L,
term_count_min = 1L)
visualize_analogies(term_vectors, terms_pairs_test$person)
visualize_analogies(term_vectors, terms_pairs_test$person,
find_analogies = TRUE, n = 10)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.