-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fixed join_docs.py concatenate #5970
Conversation
Added an example about hybrid search for faq pipeline on covid dataset
added test for hybrid search
updated comment
Hey @nickprock! When fixing issues and modifying the behavior of some node, we normally ask contributors to add automated tests to verify that their changes behave as expected. In this case, the tests for You just need to add at the end of the file a piece of code similar to this: @pytest.mark.unit
@pytest.mark.parametrize("join_mode", ["concatenate", "merge", "reciprocal_rank_fusion"])
def test_joindocuments_keep_only_highest_ranking_duplicate(join_mode):
inputs = [
{"documents": [Document(content="text document 1", content_type="text", score=0.2)]},
{"documents": [Document(content="text document 2", content_type="text", score=0.3)]},
{"documents": [Document(content="text document 2", content_type="text", score=0.7)]},
]
expected_outputs = [
{"documents": [Document(content="text document 1", content_type="text", score=0.2)]},
{"documents": [Document(content="text document 2", content_type="text", score=0.7)]},
]
join_docs = JoinDocuments(join_mode=join_mode)
result, _ = join_docs.run(inputs)
assert len(result["documents"]) == 2
assert result["documents"] == expected_outputs (note: I haven't tested this code, you might have to adjust it a bit). Once the test is added this PR is ready for another review 🙂 |
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.
A comment about the release notes
releasenotes/notes/fix-joinDocuments-concatenate-56a7cdba00a7248e.yaml
Outdated
Show resolved
Hide resolved
Also, don't forget to update your branch every now and then, to make sure your PR is not too out of date with |
Hi @ZanSara I hope the PR is ok now. |
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.
One last detail and we're ready to merge 😊
Hi @ZanSara,
|
Hey, @nickprock! 👋 We have problems with main, which we are trying to solve in #6029. When these problems are solved, we can take care of pushing this PR to the finish line... |
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! Thank you for your contribution!
Related Issues
Proposed Changes:
I merged the two lists keeping only the document with the highest score
How did you test it?
Manual verification.
Checklist