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

feat: Add Cohere ranker #643

Merged
merged 5 commits into from
Apr 8, 2024

Conversation

AnushreeBannadabhavi
Copy link
Contributor

@AnushreeBannadabhavi AnushreeBannadabhavi commented Apr 4, 2024

Related Issues

Proposed Changes:

Add CohereRanker for Haystack 2.0.
Performs reranking of documents using Cohere reranking models. Reranks retrieved documents based on semantic relevance to a query.
For more information refer to Cohere reranker

How did you test it?

  • Tests have been added in test_cohere.py
  • Tested the example: cohere_ranker_in_a_pipeline.py

@AnushreeBannadabhavi AnushreeBannadabhavi requested a review from a team as a code owner April 4, 2024 22:46
@AnushreeBannadabhavi AnushreeBannadabhavi requested review from anakin87 and removed request for a team April 4, 2024 22:46
@CLAassistant
Copy link

CLAassistant commented Apr 4, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added integration:cohere type:documentation Improvements or additions to documentation labels Apr 4, 2024
@AnushreeBannadabhavi AnushreeBannadabhavi changed the title Add Cohere ranker feat: Add Cohere ranker Apr 5, 2024
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Very good work. Thanks! 💙

  • I found some small opportunities for improvement (see the comments).

  • for security reasons, the integration tests that require an API key do not run on community PRs. Have you had the chance to try your component locally?

  • I also (moved and) update the corresponding issue (CohereRanker #645) to keep track of all the work needed (by you and us) to declare this feature ready.

@AnushreeBannadabhavi
Copy link
Contributor Author

Hi @anakin87! Thank you for your feedback! :)
I agree with all your comments and suggestions and I've implemented them.

To your second point, yes I've tried the component locally. I ran integration tests by setting the COHERE_API_KEY environment variable and also tested with the example in cohere_ranker_in_a_pipeline.py. Let me know if any additional testing is required and I can do that too.

@anakin87 anakin87 self-requested a review April 8, 2024 13:26
Copy link
Member

@anakin87 anakin87 left a comment

Choose a reason for hiding this comment

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

Excellent work!

I have tried the component and works as expected.

@anakin87 anakin87 merged commit 40fe61a into deepset-ai:main Apr 8, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration:cohere type:documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants