A modular and extensible Retrieval-Augmented Generation (RAG) evaluation framework, including independent modules for query interpretation, retrieval, compression, and answer generation.
This project separates the RAG pipeline into four independent, reusable components:
BenchRAG/
βββ benchrag
ββββββββ interpreter/ # Query understanding and expansion
ββββββββ retriever/ # BM25, dense, hybrid retrievers
ββββββββ compressor/ # LLM or rule-based compressors
ββββββββ generator/ # LLM-based answer generators
ββββββββ llm/ # Basic LLM APIs
ββββββββ utils/ # Utilities including IO and evaluation
βββ datasets/ # Loaders for BEIR, MTEB, HotpotQA, Bright
βββ script/ # Full RAG pipeline runner
βββ examples/ # examples for running each component
βββ requirements.txt
βββ README.md
git clone https://github.com/gomate-community/BenchRAG.git
cd BenchRAG
conda create -n benchrag python=3.10
conda activate benchrag
pip install -r requirements.txt
python scripts/download_deps.py
python examples/retriever/bm25_example.py
python examples/compressor/provence_example.py
Currently, you can use this repo to reproduce some experiments results on several open-sourced benchmarks, by following scripts in these files.
Just following the guidlines, or you can directly run the scripts:
# To run the interpret stage, you need to update the path of datasets and models in the scripts.
# 1. update the `cache_dir` to your local huggingface path.
# 2. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BEIR/run_beir_interpret.sh
# To run the retrieve stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local beir dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BEIR/run_beir_search.sh
Just following the guidlines, or you can directly run the scripts:
# To run the interpret stage, you need to update the path of datasets and models in the scripts.
# 1. update the `cache_dir` to your local huggingface path.
# 2. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/Bright/run_bright_interpret.sh
# To run the retrieve stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local bright dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/Bright/run_bright_search.sh
Just following the guidlines, or you can directly run the scripts:
# To run the interpret stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local browsecomp-plus dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BrowseComp-Plus/run_browsecompplus_interpret.sh
# To run the retrieve stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local browsecomp-plus dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BrowseComp-Plus/run_browsecompplus_search.sh
prepare the dataset:
bash datasets/download_CompAct_dataset.sh
download the models into ./models:
#python -c "from transformers import AutoModel; AutoModel.from_pretrained('naver/provence-reranker-debertav3-v1', local_files_only=False)"
#python -c "from transformers import AutoModel; AutoModel.from_pretrained('meta-llama/Llama-3.1-8B', local_files_only=False)"
run the scripts:
bash scripts/run_Provence.sh
Python
80.6%
Shell
19.4%
A modular and extensible Retrieval-Augmented Generation (RAG) evaluation framework, including independent modules for query interpretation, retrieval, compression, and answer generation.
This project separates the RAG pipeline into four independent, reusable components:
BenchRAG/
βββ benchrag
ββββββββ interpreter/ # Query understanding and expansion
ββββββββ retriever/ # BM25, dense, hybrid retrievers
ββββββββ compressor/ # LLM or rule-based compressors
ββββββββ generator/ # LLM-based answer generators
ββββββββ llm/ # Basic LLM APIs
ββββββββ utils/ # Utilities including IO and evaluation
βββ datasets/ # Loaders for BEIR, MTEB, HotpotQA, Bright
βββ script/ # Full RAG pipeline runner
βββ examples/ # examples for running each component
βββ requirements.txt
βββ README.md
git clone https://github.com/gomate-community/BenchRAG.git
cd BenchRAG
conda create -n benchrag python=3.10
conda activate benchrag
pip install -r requirements.txt
python scripts/download_deps.py
python examples/retriever/bm25_example.py
python examples/compressor/provence_example.py
Currently, you can use this repo to reproduce some experiments results on several open-sourced benchmarks, by following scripts in these files.
Just following the guidlines, or you can directly run the scripts:
# To run the interpret stage, you need to update the path of datasets and models in the scripts.
# 1. update the `cache_dir` to your local huggingface path.
# 2. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BEIR/run_beir_interpret.sh
# To run the retrieve stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local beir dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BEIR/run_beir_search.sh
Just following the guidlines, or you can directly run the scripts:
# To run the interpret stage, you need to update the path of datasets and models in the scripts.
# 1. update the `cache_dir` to your local huggingface path.
# 2. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/Bright/run_bright_interpret.sh
# To run the retrieve stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local bright dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/Bright/run_bright_search.sh
Just following the guidlines, or you can directly run the scripts:
# To run the interpret stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local browsecomp-plus dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BrowseComp-Plus/run_browsecompplus_interpret.sh
# To run the retrieve stage, you need to update the path of datasets and models in the scripts.
# 1. update the `dataset_dir` to your local browsecomp-plus dataset directory.
# 2. update the `cache_dir` to your local huggingface path.
# 3. update the `output_dir` to your local result path. This path will save all the expanded queries.
bash scripts/BrowseComp-Plus/run_browsecompplus_search.sh
prepare the dataset:
bash datasets/download_CompAct_dataset.sh
download the models into ./models:
#python -c "from transformers import AutoModel; AutoModel.from_pretrained('naver/provence-reranker-debertav3-v1', local_files_only=False)"
#python -c "from transformers import AutoModel; AutoModel.from_pretrained('meta-llama/Llama-3.1-8B', local_files_only=False)"
run the scripts:
bash scripts/run_Provence.sh
Python
80.6%
Shell
19.4%