-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
Conversation
…s from already done results
# Conflicts: # autorag/support.py
# Conflicts: # autorag/evaluator.py # autorag/nodes/retrieval/run.py # tests/autorag/nodes/retrieval/test_run_retrieval_node.py
# Conflicts: # autorag/nodes/retrieval/run.py # tests/autorag/nodes/retrieval/test_run_retrieval_node.py # tests/autorag/utils/test_util.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :>
have a nice night |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.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.
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.
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.