Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sj29-innovate committed Jan 8, 2018
1 parent 37bc8d4 commit 80dc13d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gensim/summarization/bm25.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@ def get_score(self, document, index, average_idf):
if word not in self.f[index]:
continue
idf = self.idf[word] if self.idf[word] >= 0 else EPSILON * average_idf
doc_length = len(self.corpus[index])
score += (idf * self.f[index][word] * (PARAM_K1 + 1)
/ (self.f[index][word] + PARAM_K1 * (1 - PARAM_B + PARAM_B * len(document) / self.avgdl)))
/ (self.f[index][word] + PARAM_K1 * (1 - PARAM_B + PARAM_B * doc_length / self.avgdl)))
return score

def get_scores(self, document, average_idf):
Expand Down

0 comments on commit 80dc13d

Please sign in to comment.