Wrong return types in docstrings for wv.evaluate_word_analogies and wv.evaluate_word_pairs #2203
Labels
bug
Issue described a bug
difficulty easy
Easy issue: required small fix
documentation
Current issue related to documentation
Hacktoberfest
Issues marked for hacktoberfest
This is the documented return type for
KeyedVectors.evaluate_word_analogies
:https://github.com/RaRe-Technologies/gensim/blob/6a4424d3e465dea0afcddc4f4e2410cf0f52dba1/gensim/models/keyedvectors.py#L1070
The dicts in the second element of the return tuple have as values either a string or a list of 4-tuples. For instance:
So I believe the return value of
evaluate_word_analogies
is actuallyTuple[float, List[Dict[str, Union[str, List[Tuple[str, str, str, str]]]]]
(in PEP-484 style annotation).Then, in
KeyedVectors.evaluate_word_pairs
, the documented return type is:https://github.com/RaRe-Technologies/gensim/blob/6a4424d3e465dea0afcddc4f4e2410cf0f52dba1/gensim/models/keyedvectors.py#L1284
Here, the second and third elements of the return tuple are actually pairs of floats, since they are the values returned from
scipy.stats.pearsonr
andspearmanr
, which return both the correlation and a p-value. I don't know whether the p-value should be discarded or the documented return type be updated to(float, (float, float), (float, float))
.The text was updated successfully, but these errors were encountered: