Skip to content

Commit

Permalink
feat(ranker): fix the idf
Browse files Browse the repository at this point in the history
  • Loading branch information
nan-wang committed Apr 13, 2020
1 parent e1c6b90 commit e6227c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion jina/executors/rankers/tfidf.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def get_idf(match_idx):
"""
q_df, q_id = TfIdfRanker._get_df(match_idx)
total_df = np.sum(q_df)
return {idx: np.log10((total_df + 1.) / (df + 0.5)) for idx, df in zip(q_id, q_df)}
return {idx: np.log10((total_df + 1.) / (df + 0.5)) ** 2 for idx, df in zip(q_id, q_df)}

def get_tf(self, match_idx, match_chunk_meta):
"""Get the tf dictionary for query chunks that matched a given doc.
Expand Down

0 comments on commit e6227c0

Please sign in to comment.