Skip to content

Commit

Permalink
Fix for fusion retriever sometime return Nonetype query(s) before sim…
Browse files Browse the repository at this point in the history
…ilarity search. (#13112)
  • Loading branch information
datvodinh authored Apr 25, 2024
1 parent c80e56a commit fcf1913
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def _get_queries(self, original_query: str) -> List[QueryBundle]:

# assume LLM proper put each query on a newline
queries = response.text.split("\n")
queries = [q.strip() for q in queries if q.strip()]
if self._verbose:
queries_str = "\n".join(queries)
print(f"Generated queries:\n{queries_str}")
Expand All @@ -99,7 +100,8 @@ def _get_queries(self, original_query: str) -> List[QueryBundle]:
def _reciprocal_rerank_fusion(
self, results: Dict[Tuple[str, int], List[NodeWithScore]]
) -> List[NodeWithScore]:
"""Apply reciprocal rank fusion.
"""
Apply reciprocal rank fusion.
The original paper uses k=60 for best results:
https://plg.uwaterloo.ca/~gvcormac/cormacksigir09-rrf.pdf
Expand Down

0 comments on commit fcf1913

Please sign in to comment.