Description Usage Arguments Value See Also Examples
Solve the term synonym task for given embeddings and pairs of synonyms. This task similarly to
analogy_task validates the quality of the embeddings. Here the terms in pairs are synonyms
– are related to the same object, so their embeddings should be close to one another.
For every ordered pair of embeddings (term1, term2)
the task is solved if term2
is in the n
closest terms to term1
.
1 | synonym_task(term_vectors, n = 1, terms)
|
term_vectors |
A matrix of embeddings of the terms |
n |
A number of neighbors included in the context (default: 1) |
terms |
A list of two character vectors: the first and the second elements of pairs |
A list of:
accuracy |
An accuracy of the fulfilled questions |
questions |
A data frame of the all synonym questions and results |
1 2 3 4 5 | term_vectors <- embed_terms(examinations,
embedding_size = 5L, term_count_min = 1L)
terms <- terms_pairs_test$synonym
synonym_task(term_vectors, 1, terms)
synonym_task(term_vectors, 5, terms)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.