Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rag): Fix rerank bug of EmbeddingRetriever #1499

Merged
merged 1 commit into from
May 9, 2024

Conversation

FOkvj
Copy link
Contributor

@FOkvj FOkvj commented May 8, 2024

Description

The EmbeddingRetriever's _aretrieve_with_score and _aretrieve methods do not pass the query parameter to the rank function when calling the ranker to re-rank the retrieval results.

How Has This Been Tested?

  1. initialize a EmbeddingRetiever with the CrossEncoderRanker

retriever = EmbeddingRetriever( vector_store_connector=vector_store_connector, top_k=100, rerank=CrossEncoderRanker(topk=3), )

  1. call aretrieve_with_scores

retriever.aretrieve_with_scores("what is awel talk about", 0.3)
3. debug at "/DB-GPT/dbgpt/rag/retriever/rerank.py", line 211
4. check whether the value of parameter query is None, if not, bug is fixed.

Closes #1498

Snapshots:

Include snapshots for easier review.

Checklist:

  • My code follows the style guidelines of this project
  • I have already rebased the commits and make the commit message conform to the project standard.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • Any dependent changes have been merged and published in downstream modules

@github-actions github-actions bot added the fix Bug fixes label May 8, 2024
@Aries-ckt
Copy link
Collaborator

Aries-ckt commented May 8, 2024

thanks for your contribution.

Copy link
Collaborator

@csunny csunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+

@fangyinc fangyinc changed the title fix(rag):[retriever] fix rerank bug of EmbeddingRetriever fix(rag): Fix rerank bug of EmbeddingRetriever May 9, 2024
Copy link
Collaborator

@Aries-ckt Aries-ckt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Aries-ckt Aries-ckt merged commit 87a67cc into eosphoros-ai:main May 9, 2024
7 checks passed
Hopshine pushed a commit to Hopshine/DB-GPT that referenced this pull request Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fixes
Projects
None yet
3 participants