Skip to content

Commit

Permalink
Weight up title and keywords for chunks in terms of retrieval (#3750)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?


### Type of change

- [x] Performance Improvement
  • Loading branch information
KevinHuSh authored Nov 29, 2024
1 parent 0dafce3 commit 0f08b0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rag/nlp/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def rerank(self, sres, query, tkweight=0.3,
content_ltks = sres.field[i][cfield].split()
title_tks = [t for t in sres.field[i].get("title_tks", "").split() if t]
important_kwd = sres.field[i].get("important_kwd", [])
tks = content_ltks + title_tks + important_kwd
tks = content_ltks + title_tks*2 + important_kwd*5
ins_tw.append(tks)

sim, tksim, vtsim = self.qryr.hybrid_similarity(sres.query_vector,
Expand Down

0 comments on commit 0f08b0f

Please sign in to comment.