Skip to content

Commit

Permalink
Update return sections for KeyedVectors.evaluate_word_* (#2205)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stigjb authored and menshikh-iv committed Oct 3, 2018
1 parent 28da936 commit b3d7ba6
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions gensim/models/keyedvectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1067,8 +1067,12 @@ def evaluate_word_analogies(self, analogies, restrict_vocab=300000, case_insensi
Returns
-------
(float, list of dict of (str, (str, str, str))
Overall evaluation score and full lists of correct and incorrect predictions divided by sections.
score : float
The overall evaluation score on the entire evaluation set
sections : list of dict of {str : str or tuple of (str, str, str, str)}
Results broken down by each section of the evaluation set. Each dict contains the name of the section
under the key 'section', and lists of correctly and incorrectly predicted 4-tuples of words under the
keys 'correct' and 'incorrect'.
"""
ok_vocab = [(w, self.vocab[w]) for w in self.index2word[:restrict_vocab]]
Expand Down Expand Up @@ -1281,9 +1285,13 @@ def evaluate_word_pairs(self, pairs, delimiter='\t', restrict_vocab=300000,
Returns
-------
(float, float, float)
Pearson correlation coefficient, Spearman rank-order correlation coefficient between the similarities
from the dataset and the similarities produced by the model itself, ratio of pairs with unknown words.
pearson : tuple of (float, float)
Pearson correlation coefficient with 2-tailed p-value.
spearman : tuple of (float, float)
Spearman rank-order correlation coefficient between the similarities from the dataset and the
similarities produced by the model itself, with 2-tailed p-value.
oov_ratio : float
The ratio of pairs with unknown words.
"""
ok_vocab = [(w, self.vocab[w]) for w in self.index2word[:restrict_vocab]]
Expand Down

0 comments on commit b3d7ba6

Please sign in to comment.