Description Usage Arguments Value Author(s) Examples
Given a vector words, this function returns the nearest neighbors in the vector space. Users may select a different language for the nearest neighbors than is used in the input embedding.
1 | ft_nn(words, lang = "en", lang_out = lang, nn = 10L)
|
words |
a character vector of the words for which an embedding should be returned |
lang |
the two letter language code specifying the language to use for the embedding of the inputs |
lang_out |
the two letter language code specifying the language to use for the embedding of the outputs. |
nn |
positive integer. The number of nearest neighbors to return in the output. |
A matrix with nn
columns and one row for each
input word. Rows associated with input words not found
in the embedding are set to NA
.
Taylor B. Arnold, taylor.arnold@acm.org
1 2 3 | ft_load_model(lang = "en")
ft_load_model(lang = "fr")
ft_nn(c("the", "and", "I"), lang = "en", lang_out = "fr", nn = 5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.