similarity | R Documentation |
Compute the cosine similarity between word vectors for selected words.
similarity(x, words, mode = c("words", "values"))
x |
a |
words |
words for which similarity is computed. |
mode |
specify the type of resulting object. |
a matrix
of cosine similarity scores when mode = "values"
or of
words sorted in descending order by the similarity scores when mode = "words"
.
When words
is a named numeric vector, word vectors are weighted and summed
before computing similarity scores.
probability()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.