Conversation
Owner
Author
|
Supported by the discussion deepset-ai/haystack#1305 |
leomaurodesenv
added a commit
that referenced
this pull request
Aug 1, 2025
* feat(experiments): add doc retriever * feat(experiments): refactoring dataset switch * feat(experiments): add argparsers to doc retriever
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(experiments): Add document retriever experiments
This pull request introduces a new experiment script to evaluate and compare different document retrieval models. This complements the existing document reader experiments by allowing us to benchmark the first crucial stage of a modern Question Answering pipeline: finding relevant documents from a large corpus.
The new script leverages the Haystack framework to test various retrieval algorithms like BM25, TF-IDF, and Dense Passage Retriever (DPR) against our datasets.
Key Changes:
New Document Retriever Experiment:
experiments/doc_retriever.py, a new script dedicated to running document retrieval evaluations.DocumentSearchPipelineto measure the performance of different retrievers.Supported Retriever Models:
retriever_switchfunction has been implemented to easily select between:BM25RetrieverTfidfRetrieverDensePassageRetriever(DPR)Dynamic Configuration with Argparse:
argparseto allow for flexible configuration from the command line. Users can now specify:--model: The retriever model to use (e.g.,BM25,DPR).--dataset: The dataset for evaluation (e.g.,QASports,SQuAD).--sport: The specific sport for theQASportsdataset.--num_k: The number of top documents to retrieve.Refactoring:
dataset_switchfunction inexperiments/module.pywas refactored for better clarity and to seamlessly support both the document reader and the new document retriever experiments.How to Run the New Experiment:
The
README.mdhas been updated with instructions. You can run the experiment as follows:Local Tests