Skip to content

Commit

Permalink
refine token similarity calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinHuSh committed Oct 8, 2024
1 parent a3ab5ba commit c5e57bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rag/nlp/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,4 +190,4 @@ def similarity(self, qtwt, dtwt):
#d = 1e-9
# for k, v in dtwt.items():
# d += v * v
return s / q / max(1, math.sqrt(math.log10(max(len(qtwt.keys()), len(dtwt.keys())))))# math.sqrt(q) / math.sqrt(d)
return s / q #/ max(1, math.sqrt(math.log10(max(len(qtwt.keys()), len(dtwt.keys())))))# math.sqrt(q) / math.sqrt(d)

0 comments on commit c5e57bb

Please sign in to comment.