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 🙂 |
ZanSara
left a comment
There was a problem hiding this comment.
A comment about the release notes
|
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. |
ZanSara
left a comment
There was a problem hiding this comment.
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... |
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