evaluate_term_embeddings: Evaluate Term Embeddings

Description Usage Arguments Value See Also Examples

View source: R/analogies.R

Description

Evaluate given term embeddings based on analogy_task and synonym_task. The list of test pairs should be given. The analogy_task is performed for each type of given analogies (initially, there are 7 proposed types of analogies, see terms_pairs_test). The accuracy is measured for the context size from 1 (the most restrictive) to the given n_max.

Usage

1
evaluate_term_embeddings(term_vectors, terms_pairs = NULL, n_max = 5L)

Arguments

term_vectors

A matrix of embeddings of the terms

n_max

A maximum number of neighbors included in the context (default: 5)

terms_pairs:

A list of lists of the test pairs, each list of pairs should contain two vectors of terms; if the list contains the element "synonym", the synonym_task is performed for these terms, for the rest pairs there is performed analogy_task

Value

A data frame of accuracies of the analogy task and the synonym task for each given list of pairs for the context from 1 to n_max.

See Also

analogy_task, synonym_task, terms_pairs_test

Examples

1
2
3
term_vectors <- embed_terms(examinations, embedding_size = 5L,
  term_count_min = 1L)
evaluate_term_embeddings(term_vectors, terms_pairs = terms_pairs_test)

adamgdobrakowski/memr documentation built on Sept. 4, 2021, 3:45 a.m.