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

Reranking #385

Merged
merged 8 commits into from
Jun 12, 2024
Merged

Reranking #385

merged 8 commits into from
Jun 12, 2024

Conversation

20001LastOrder
Copy link
Collaborator

@20001LastOrder 20001LastOrder commented May 31, 2024

Description

Create the reranking capability for actions involving retrieval (BaseRetrieval actions). It can be activated by setting perform_reranking to true in the following actions

  • GoogleSearch
  • ArxivSearch
  • ContextSearch

It can be used for any actions inheriting the BaseRetrievalAction class

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Maintenance
  • New release

Related issues

Closes #362

Checklists

To speed up the review process, please follow these checklists:

Development

  • The Pull Request is small and focused on one topic
  • Lint rules pass locally (make format && make lint)
  • The code changed/added as part of this pull request has been covered with tests
  • All tests related to the changed code pass in development (make test)
  • The changes generate no new warnings (or explain any new warnings and why they're ok)
  • Commit messages are detailed
  • Changed code is self-explanatory and/or I added comments
  • I updated the documentation (docstrings, /docs)
    See the testing guidelines for help on tests, especially those involving web services.

Code review

  • This pull request has a descriptive title and information useful to a reviewer. There may be a screenshot or screencast attached.
  • I have performed a self-review of my code
  • Issue from task tracker has a link to this pull request

💔 Thank you for submitting a pull request!

@20001LastOrder 20001LastOrder requested a review from Eyobyb May 31, 2024 20:33


def test_default_reranker(mock_google_search, mock_embedding_func):
reranker = RerankingByQuery(embedding_func=mock_embedding_func)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we need to have a base embedding function class since some of them are not callable. For example, SentenceTransformerEmbeddings has embed_query instead of it self being callable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm hoping to have an adapter for all of them so that we will not directly use the embedding from the langchain. But I think create a base embedding is a good idea.

@saminegash saminegash self-requested a review June 7, 2024 12:45
Copy link
Contributor

@saminegash saminegash left a comment

Choose a reason for hiding this comment

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

resolve conflict

Copy link
Contributor

@saminegash saminegash left a comment

Choose a reason for hiding this comment

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

LGTM,

@amirfz amirfz merged commit ba9e631 into Aggregate-Intellect:main Jun 12, 2024
1 check passed
@20001LastOrder 20001LastOrder deleted the reranking branch December 19, 2024 04:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Reranking of the Search Results
4 participants