Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation about ranges to scoring functions for Phrases #2242

Merged
merged 2 commits into from
Dec 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gensim/models/phrases.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,11 @@ def original_scorer(worda_count, wordb_count, bigram_count, len_vocab, min_count
corpus_word_count : int
Not used in this particular scoring technique.

Returns
-------
float
Score for given bi-gram, greater than or equal to 0.

Notes
-----
Formula: :math:`\frac{(bigram\_count - min\_count) * len\_vocab }{ (worda\_count * wordb\_count)}`.
Expand Down Expand Up @@ -703,6 +708,11 @@ def npmi_scorer(worda_count, wordb_count, bigram_count, len_vocab, min_count, co
corpus_word_count : int
Total number of words in the corpus.

Returns
-------
float
Score for given bi-gram, in the range -1 to 1.

Notes
-----
Formula: :math:`\frac{ln(prop(word_a, word_b) / (prop(word_a)*prop(word_b)))}{ -ln(prop(word_a, word_b)}`,
Expand Down