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

Make Hybrid Retrieval RRF module and edit run.py for it #98

Merged
merged 17 commits into from
Feb 2, 2024
Merged

Conversation

vkehfdl1
Copy link
Contributor

@vkehfdl1 vkehfdl1 commented Feb 1, 2024

close #82

1. Add Hybrid RRF module. Reciprocal Rank fusion the results of retrievals. It uses ids and scores from `already-done` results.

To use Hybrid module, you need to do 2 things at your yaml file.
First, you need to set more than 2 retrieval modules.
Second, set names of your module as target_modules at yaml file as tuple.

  1. Add tuple function at yaml loader.
    Initially, tuple does not support at yaml file.
    But, there was no way to pass multiple value parameters at module functions in AutoRAG, due to make_combinations function. It is function that make all combinations inside module params list.
    So, I make tuple at config yaml file, and turn it to real tuple using convert_string_to_tuple_in_dict function.
    Now, you can load tuple as single module parameter.

  2. Execution time of hybrid retrieval.
    Hybrid Retrieval module in AutoRAG did not acutally run each modules, so it can't get real execution time.
    So, I extract best module from each target_modules, and get their exectuion time and sum it.
    This way, we can properly filter by speed (execution_time) at hybrid retrieval.

  3. Fix error at make_combinations at delete duplication.
    As you see at number 2, tuple occured error at list(set()) for deleting duplication at module params.
    So, from now, we do not perform duplication delete at unhashable objects like tuple, list, dict..
    Most of time, the duplication deletion feature will perform.

@vkehfdl1 vkehfdl1 enabled auto-merge (squash) February 1, 2024 21:29
bwook00
bwook00 previously approved these changes Feb 1, 2024
Copy link
Contributor

@bwook00 bwook00 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@Eastsidegunn Eastsidegunn left a comment

Choose a reason for hiding this comment

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

LGTM :>

@Eastsidegunn
Copy link
Contributor

have a nice night

Copy link
Contributor

@bwook00 bwook00 left a comment

Choose a reason for hiding this comment

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

LGTM

@vkehfdl1 vkehfdl1 merged commit 7a143fc into main Feb 2, 2024
3 checks passed
@vkehfdl1 vkehfdl1 deleted the Feature/#82 branch February 2, 2024 09:02
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.

Add Hybrid Retrieval Module
3 participants