flashrag-dev 0.1.4.dev20250805__tar.gz → 0.3.0.dev20250818__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/PKG-INFO +25 -10
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/README.md +24 -9
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/utils/utils.py +8 -1
- flashrag_dev-0.3.0.dev20250818/flashrag/version.py +1 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/PKG-INFO +25 -10
- flashrag_dev-0.1.4.dev20250805/flashrag/version.py +0 -1
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/LICENSE +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/config/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/config/basic_config.yaml +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/config/config.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/dataset/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/dataset/dataset.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/dataset/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/_bleu.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/evaluator.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/metrics.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/fid.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/generator.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/multimodal_generator.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/openai_generator.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/stop_word_criteria.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/judger/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/judger/judger.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/ReaRAG_utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/active_pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/branching_pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/mm_pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/reasoning_pipeline.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/replug_utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/base_prompt.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/coRAG_prompt.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/mm_prompt.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/selfask_examplars.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/trace_examplars.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/kg_refiner.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/llmlingua_compressor.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/refiner.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/selective_context_compressor.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/__main__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/encoder.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/index_builder.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/reranker.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/retriever.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/utils.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/utils/__init__.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/utils/constants.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/utils/pred_parse.py +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/SOURCES.txt +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/dependency_links.txt +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/requires.txt +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/top_level.txt +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/pyproject.toml +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/setup.cfg +0 -0
- {flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flashrag_dev
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.dev20250818
|
|
4
4
|
Summary: A library for efficient Retrieval-Augmented Generation research
|
|
5
5
|
Home-page: https://github.com/RUC-NLPIR/FlashRAG
|
|
6
6
|
Author: Jiajie Jin, Yutao Zhu, Chenghao Zhang, Xinyu Yang, Zhicheng Dou
|
|
@@ -42,7 +42,7 @@ License-File: LICENSE
|
|
|
42
42
|
</h4>
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
FlashRAG is a Python toolkit for the reproduction and development of Retrieval Augmented Generation (RAG) research. Our toolkit includes 36 pre-processed benchmark RAG datasets and
|
|
45
|
+
FlashRAG is a Python toolkit for the reproduction and development of Retrieval Augmented Generation (RAG) research. Our toolkit includes 36 pre-processed benchmark RAG datasets and **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that combine reasoning ability with retrieval.
|
|
46
46
|
|
|
47
47
|
<p align="center">
|
|
48
48
|
<img src="asset/framework.jpg">
|
|
@@ -76,7 +76,9 @@ https://github.com/user-attachments/assets/8ca00873-5df2-48a7-b853-89e7b18bc6e9
|
|
|
76
76
|
|
|
77
77
|
- **Comprehensive Benchmark Datasets**: A collection of 36 pre-processed RAG benchmark datasets to test and validate RAG models' performances.
|
|
78
78
|
|
|
79
|
-
- **Pre-implemented Advanced RAG Algorithms**: Features
|
|
79
|
+
- **Pre-implemented Advanced RAG Algorithms**: Features **23 advancing RAG algorithms** with reported results, based on our framework. Easily reproducing results under different settings.
|
|
80
|
+
|
|
81
|
+
- **🚀 Reasoning-based Methods**: **NEW!** We now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks.
|
|
80
82
|
|
|
81
83
|
- **Efficient Preprocessing Stage**: Simplifies the RAG workflow preparation by providing various scripts like corpus processing for retrieval, retrieval index building, and pre-retrieval of documents.
|
|
82
84
|
|
|
@@ -92,13 +94,15 @@ FlashRAG is still under development and there are many issues and room for impro
|
|
|
92
94
|
- [x] Provdide instructions for each component
|
|
93
95
|
- [x] Integrate sentence Transformers
|
|
94
96
|
- [x] Support multimodal RAG
|
|
97
|
+
- [x] Support reasoning-based methods
|
|
95
98
|
- [ ] Inlcude more RAG approaches
|
|
96
|
-
- [ ] Add more evaluation metrics (e.g., Unieval, name-entity F1) and benchmarks (e.g., RGB benchmark)
|
|
97
99
|
- [ ] Enhance code adaptability and readability
|
|
98
100
|
- [ ] Add support for api-based retriever (vllm server)
|
|
99
101
|
|
|
100
102
|
## :page_with_curl: Changelog
|
|
101
|
-
[25/
|
|
103
|
+
[25/08/06] 🎯 **NEW!** We have added support for **Reasoning Pipeline**, which is a new paradigm that combines reasoning ability and retrieval, representing work that includes [R1-Searcher](https://github.com/SsmallSong/R1-Searcher), [Search-R1](https://github.com/PeterGriffinJin/Search-R1),.... We evaluate the performance of the pipeline on various RAG benchmarks, it can achieve F1 scores close to 60 on multi hop inference datasets such as HotpotQA. See it in [**result table**](#robot-supporting-methods).
|
|
104
|
+
|
|
105
|
+
[25/03/21] 🚀 **Major Update!** We have expanded our toolkit to support **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that significantly improve performance on complex reasoning tasks. This represents a major milestone in our toolkit's evolution!
|
|
102
106
|
|
|
103
107
|
[25/02/24] 🔥🔥🔥 We have added support for **multimodal RAG**, including [**MLLMs like Llava, Qwen, InternVL**](https://ruc-nlpir.github.io/FlashRAG/#/zh-cn/component/generator?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e7%94%9f%e6%88%90%e5%99%a8), and various [**multimodal retrievers with Clip architecture**](https://ruc-nlpir.github.io/FlashRAG/#/zh-cn/component/retriever?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e6%a3%80%e7%b4%a2%e5%99%a8). More information can be found in our new version of arxiv article and our documentation. Try it!
|
|
104
108
|
|
|
@@ -587,7 +591,7 @@ python interface.py
|
|
|
587
591
|
|
|
588
592
|
## :robot: Supporting Methods
|
|
589
593
|
|
|
590
|
-
We have implemented
|
|
594
|
+
We have implemented **23 works** with a consistent setting of:
|
|
591
595
|
|
|
592
596
|
- **Generator:** LLAMA3-8B-instruct with input length of 2048
|
|
593
597
|
- **Retriever:** e5-base-v2 as embedding model, retrieve 5 docs per query
|
|
@@ -597,7 +601,7 @@ For open-source methods, we implemented their processes using our framework. For
|
|
|
597
601
|
|
|
598
602
|
For necessary settings and hyperparameters specific to some methods, we have documented them in the **specific settings** column. For more details, please consult our [<u>reproduce guidance</u>](./docs/original_docs/reproduce_experiment.md) and [<u>method details</u>](./docs/original_docs/baseline_details.md).
|
|
599
603
|
|
|
600
|
-
It
|
|
604
|
+
It's important to note that, to ensure consistency, we have utilized a uniform setting. However, this setting may differ from the original setting of the method, leading to variations in results compared to the original outcomes.
|
|
601
605
|
|
|
602
606
|
| Method | Type | NQ (EM) | TriviaQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | PopQA (F1) | WebQA(EM) | Specific setting |
|
|
603
607
|
| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |
|
|
@@ -618,10 +622,21 @@ It’s important to note that, to ensure consistency, we have utilized a uniform
|
|
|
618
622
|
| [FLARE](https://arxiv.org/abs/2305.06983) | Loop | 22.5 | 55.8 | 28.0 | 33.9 | 20.7 | 20.2 | |
|
|
619
623
|
| [Iter-Retgen](https://arxiv.org/abs/2305.15294), [ITRG](https://arxiv.org/abs/2310.05149) | Loop | 36.8 | 60.1 | 38.3 | 21.6 | 37.9 | 18.2 | |
|
|
620
624
|
| [IRCoT](https://aclanthology.org/2023.acl-long.557.pdf) | Loop | 33.3 | 56.9 | 41.5 | 32.4 | 45.6 | 20.7 | |
|
|
621
|
-
| [RQRAG](https://arxiv.org/abs/2404.00610) | Loop | 32.6 | 52.5 | 33.5 | 35.8 | 46.4 | 26.2 | Use trained rqrag-llama2-7B |
|
|
622
|
-
|
|
623
|
-
|
|
625
|
+
| [RQRAG](https://arxiv.org/abs/2404.00610) | Loop | 32.6 | 52.5 | 33.5 | 35.8 | 46.4 | 26.2 | Use trained rqrag-llama2-7B |
|
|
626
|
+
|
|
627
|
+
#### 🚀 Reasoning-based Methods (NEW!)
|
|
628
|
+
|
|
629
|
+
We now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks:
|
|
624
630
|
|
|
631
|
+
| Method | Type | NQ (EM) | TriviaQA (EM) | PopQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | Musique (F1) | Bamboogle (F1) | Specific setting |
|
|
632
|
+
| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |
|
|
633
|
+
| [Search-R1](https://arxiv.org/abs/2503.09516) | Reasoning | 45.2 | 62.2 | 49.2 | 54.5 | 42.6 | 29.2 | 59.9 | SearchR1-nq_hotpotqa_train-qwen2.5-7b-em-ppo |
|
|
634
|
+
| [R1-Searcher](https://arxiv.org/pdf/2503.05592) | Reasoning | 36.9 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-2.5-7B-base-RAG-RL |
|
|
635
|
+
| [O2-Searcher](https://arxiv.org/pdf/2505.16582) | Reasoning | 41.4 | 51.4 | 46.8 | 43.4 | 48.6 | 19.0 | 47.6 | O2-Searcher-Qwen2.5-3B-GRPO |
|
|
636
|
+
| [AutoRefine](https://www.arxiv.org/pdf/2505.11277) | Reasoning | 43.8 | 59.8 | 32.4 | 54.0 | 50.3 | 23.6 | 46.6 | AutoRefine-Qwen2.5-3B-Base |
|
|
637
|
+
| [ReaRAG](https://arxiv.org/abs/2503.21729) | Reasoning | 26.3 | 51.8 | 24.6 | 42.9 | 41.6 | 21.2 | 41.9 | ReaRAG-9B |
|
|
638
|
+
| [CoRAG](https://arxiv.org/abs/2503.21729) | Reasoning | 40.9 | 63.1 | 36.0 | 56.6 | 60.7 | 31.9 | 54.1 | CoRAG-Llama3.1-8B-MultihopQA |
|
|
639
|
+
| [SimpleDeepSearcher](https://arxiv.org/pdf/2505.16834) | Reasoning | 36.1 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-7B-SimpleDeepSearcher |
|
|
625
640
|
|
|
626
641
|
## :notebook: Supporting Datasets & Document Corpus
|
|
627
642
|
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
</h4>
|
|
26
26
|
|
|
27
27
|
|
|
28
|
-
FlashRAG is a Python toolkit for the reproduction and development of Retrieval Augmented Generation (RAG) research. Our toolkit includes 36 pre-processed benchmark RAG datasets and
|
|
28
|
+
FlashRAG is a Python toolkit for the reproduction and development of Retrieval Augmented Generation (RAG) research. Our toolkit includes 36 pre-processed benchmark RAG datasets and **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that combine reasoning ability with retrieval.
|
|
29
29
|
|
|
30
30
|
<p align="center">
|
|
31
31
|
<img src="asset/framework.jpg">
|
|
@@ -59,7 +59,9 @@ https://github.com/user-attachments/assets/8ca00873-5df2-48a7-b853-89e7b18bc6e9
|
|
|
59
59
|
|
|
60
60
|
- **Comprehensive Benchmark Datasets**: A collection of 36 pre-processed RAG benchmark datasets to test and validate RAG models' performances.
|
|
61
61
|
|
|
62
|
-
- **Pre-implemented Advanced RAG Algorithms**: Features
|
|
62
|
+
- **Pre-implemented Advanced RAG Algorithms**: Features **23 advancing RAG algorithms** with reported results, based on our framework. Easily reproducing results under different settings.
|
|
63
|
+
|
|
64
|
+
- **🚀 Reasoning-based Methods**: **NEW!** We now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks.
|
|
63
65
|
|
|
64
66
|
- **Efficient Preprocessing Stage**: Simplifies the RAG workflow preparation by providing various scripts like corpus processing for retrieval, retrieval index building, and pre-retrieval of documents.
|
|
65
67
|
|
|
@@ -75,13 +77,15 @@ FlashRAG is still under development and there are many issues and room for impro
|
|
|
75
77
|
- [x] Provdide instructions for each component
|
|
76
78
|
- [x] Integrate sentence Transformers
|
|
77
79
|
- [x] Support multimodal RAG
|
|
80
|
+
- [x] Support reasoning-based methods
|
|
78
81
|
- [ ] Inlcude more RAG approaches
|
|
79
|
-
- [ ] Add more evaluation metrics (e.g., Unieval, name-entity F1) and benchmarks (e.g., RGB benchmark)
|
|
80
82
|
- [ ] Enhance code adaptability and readability
|
|
81
83
|
- [ ] Add support for api-based retriever (vllm server)
|
|
82
84
|
|
|
83
85
|
## :page_with_curl: Changelog
|
|
84
|
-
[25/
|
|
86
|
+
[25/08/06] 🎯 **NEW!** We have added support for **Reasoning Pipeline**, which is a new paradigm that combines reasoning ability and retrieval, representing work that includes [R1-Searcher](https://github.com/SsmallSong/R1-Searcher), [Search-R1](https://github.com/PeterGriffinJin/Search-R1),.... We evaluate the performance of the pipeline on various RAG benchmarks, it can achieve F1 scores close to 60 on multi hop inference datasets such as HotpotQA. See it in [**result table**](#robot-supporting-methods).
|
|
87
|
+
|
|
88
|
+
[25/03/21] 🚀 **Major Update!** We have expanded our toolkit to support **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that significantly improve performance on complex reasoning tasks. This represents a major milestone in our toolkit's evolution!
|
|
85
89
|
|
|
86
90
|
[25/02/24] 🔥🔥🔥 We have added support for **multimodal RAG**, including [**MLLMs like Llava, Qwen, InternVL**](https://ruc-nlpir.github.io/FlashRAG/#/zh-cn/component/generator?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e7%94%9f%e6%88%90%e5%99%a8), and various [**multimodal retrievers with Clip architecture**](https://ruc-nlpir.github.io/FlashRAG/#/zh-cn/component/retriever?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e6%a3%80%e7%b4%a2%e5%99%a8). More information can be found in our new version of arxiv article and our documentation. Try it!
|
|
87
91
|
|
|
@@ -570,7 +574,7 @@ python interface.py
|
|
|
570
574
|
|
|
571
575
|
## :robot: Supporting Methods
|
|
572
576
|
|
|
573
|
-
We have implemented
|
|
577
|
+
We have implemented **23 works** with a consistent setting of:
|
|
574
578
|
|
|
575
579
|
- **Generator:** LLAMA3-8B-instruct with input length of 2048
|
|
576
580
|
- **Retriever:** e5-base-v2 as embedding model, retrieve 5 docs per query
|
|
@@ -580,7 +584,7 @@ For open-source methods, we implemented their processes using our framework. For
|
|
|
580
584
|
|
|
581
585
|
For necessary settings and hyperparameters specific to some methods, we have documented them in the **specific settings** column. For more details, please consult our [<u>reproduce guidance</u>](./docs/original_docs/reproduce_experiment.md) and [<u>method details</u>](./docs/original_docs/baseline_details.md).
|
|
582
586
|
|
|
583
|
-
It
|
|
587
|
+
It's important to note that, to ensure consistency, we have utilized a uniform setting. However, this setting may differ from the original setting of the method, leading to variations in results compared to the original outcomes.
|
|
584
588
|
|
|
585
589
|
| Method | Type | NQ (EM) | TriviaQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | PopQA (F1) | WebQA(EM) | Specific setting |
|
|
586
590
|
| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |
|
|
@@ -601,10 +605,21 @@ It’s important to note that, to ensure consistency, we have utilized a uniform
|
|
|
601
605
|
| [FLARE](https://arxiv.org/abs/2305.06983) | Loop | 22.5 | 55.8 | 28.0 | 33.9 | 20.7 | 20.2 | |
|
|
602
606
|
| [Iter-Retgen](https://arxiv.org/abs/2305.15294), [ITRG](https://arxiv.org/abs/2310.05149) | Loop | 36.8 | 60.1 | 38.3 | 21.6 | 37.9 | 18.2 | |
|
|
603
607
|
| [IRCoT](https://aclanthology.org/2023.acl-long.557.pdf) | Loop | 33.3 | 56.9 | 41.5 | 32.4 | 45.6 | 20.7 | |
|
|
604
|
-
| [RQRAG](https://arxiv.org/abs/2404.00610) | Loop | 32.6 | 52.5 | 33.5 | 35.8 | 46.4 | 26.2 | Use trained rqrag-llama2-7B |
|
|
605
|
-
|
|
606
|
-
|
|
608
|
+
| [RQRAG](https://arxiv.org/abs/2404.00610) | Loop | 32.6 | 52.5 | 33.5 | 35.8 | 46.4 | 26.2 | Use trained rqrag-llama2-7B |
|
|
609
|
+
|
|
610
|
+
#### 🚀 Reasoning-based Methods (NEW!)
|
|
611
|
+
|
|
612
|
+
We now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks:
|
|
607
613
|
|
|
614
|
+
| Method | Type | NQ (EM) | TriviaQA (EM) | PopQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | Musique (F1) | Bamboogle (F1) | Specific setting |
|
|
615
|
+
| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |
|
|
616
|
+
| [Search-R1](https://arxiv.org/abs/2503.09516) | Reasoning | 45.2 | 62.2 | 49.2 | 54.5 | 42.6 | 29.2 | 59.9 | SearchR1-nq_hotpotqa_train-qwen2.5-7b-em-ppo |
|
|
617
|
+
| [R1-Searcher](https://arxiv.org/pdf/2503.05592) | Reasoning | 36.9 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-2.5-7B-base-RAG-RL |
|
|
618
|
+
| [O2-Searcher](https://arxiv.org/pdf/2505.16582) | Reasoning | 41.4 | 51.4 | 46.8 | 43.4 | 48.6 | 19.0 | 47.6 | O2-Searcher-Qwen2.5-3B-GRPO |
|
|
619
|
+
| [AutoRefine](https://www.arxiv.org/pdf/2505.11277) | Reasoning | 43.8 | 59.8 | 32.4 | 54.0 | 50.3 | 23.6 | 46.6 | AutoRefine-Qwen2.5-3B-Base |
|
|
620
|
+
| [ReaRAG](https://arxiv.org/abs/2503.21729) | Reasoning | 26.3 | 51.8 | 24.6 | 42.9 | 41.6 | 21.2 | 41.9 | ReaRAG-9B |
|
|
621
|
+
| [CoRAG](https://arxiv.org/abs/2503.21729) | Reasoning | 40.9 | 63.1 | 36.0 | 56.6 | 60.7 | 31.9 | 54.1 | CoRAG-Llama3.1-8B-MultihopQA |
|
|
622
|
+
| [SimpleDeepSearcher](https://arxiv.org/pdf/2505.16834) | Reasoning | 36.1 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-7B-SimpleDeepSearcher |
|
|
608
623
|
|
|
609
624
|
## :notebook: Supporting Datasets & Document Corpus
|
|
610
625
|
|
|
@@ -184,5 +184,12 @@ def extract_between(text: str, start_tag: str, end_tag: str):
|
|
|
184
184
|
return matches[-1].strip()
|
|
185
185
|
return None
|
|
186
186
|
|
|
187
|
+
def extract_between_all(text:str, start_tag:str, end_tag:str):
|
|
188
|
+
pattern = re.escape(start_tag) + r"(.*?)" + re.escape(end_tag)
|
|
189
|
+
matches = re.findall(pattern, text, flags=re.DOTALL)
|
|
190
|
+
if matches:
|
|
191
|
+
return matches
|
|
192
|
+
return None
|
|
193
|
+
|
|
187
194
|
def get_device() -> str:
|
|
188
|
-
return "cuda" if torch.cuda.is_available() else "cpu"
|
|
195
|
+
return "cuda" if torch.cuda.is_available() else "cpu"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.0dev20250818"
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: flashrag-dev
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.dev20250818
|
|
4
4
|
Summary: A library for efficient Retrieval-Augmented Generation research
|
|
5
5
|
Home-page: https://github.com/RUC-NLPIR/FlashRAG
|
|
6
6
|
Author: Jiajie Jin, Yutao Zhu, Chenghao Zhang, Xinyu Yang, Zhicheng Dou
|
|
@@ -42,7 +42,7 @@ License-File: LICENSE
|
|
|
42
42
|
</h4>
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
FlashRAG is a Python toolkit for the reproduction and development of Retrieval Augmented Generation (RAG) research. Our toolkit includes 36 pre-processed benchmark RAG datasets and
|
|
45
|
+
FlashRAG is a Python toolkit for the reproduction and development of Retrieval Augmented Generation (RAG) research. Our toolkit includes 36 pre-processed benchmark RAG datasets and **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that combine reasoning ability with retrieval.
|
|
46
46
|
|
|
47
47
|
<p align="center">
|
|
48
48
|
<img src="asset/framework.jpg">
|
|
@@ -76,7 +76,9 @@ https://github.com/user-attachments/assets/8ca00873-5df2-48a7-b853-89e7b18bc6e9
|
|
|
76
76
|
|
|
77
77
|
- **Comprehensive Benchmark Datasets**: A collection of 36 pre-processed RAG benchmark datasets to test and validate RAG models' performances.
|
|
78
78
|
|
|
79
|
-
- **Pre-implemented Advanced RAG Algorithms**: Features
|
|
79
|
+
- **Pre-implemented Advanced RAG Algorithms**: Features **23 advancing RAG algorithms** with reported results, based on our framework. Easily reproducing results under different settings.
|
|
80
|
+
|
|
81
|
+
- **🚀 Reasoning-based Methods**: **NEW!** We now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks.
|
|
80
82
|
|
|
81
83
|
- **Efficient Preprocessing Stage**: Simplifies the RAG workflow preparation by providing various scripts like corpus processing for retrieval, retrieval index building, and pre-retrieval of documents.
|
|
82
84
|
|
|
@@ -92,13 +94,15 @@ FlashRAG is still under development and there are many issues and room for impro
|
|
|
92
94
|
- [x] Provdide instructions for each component
|
|
93
95
|
- [x] Integrate sentence Transformers
|
|
94
96
|
- [x] Support multimodal RAG
|
|
97
|
+
- [x] Support reasoning-based methods
|
|
95
98
|
- [ ] Inlcude more RAG approaches
|
|
96
|
-
- [ ] Add more evaluation metrics (e.g., Unieval, name-entity F1) and benchmarks (e.g., RGB benchmark)
|
|
97
99
|
- [ ] Enhance code adaptability and readability
|
|
98
100
|
- [ ] Add support for api-based retriever (vllm server)
|
|
99
101
|
|
|
100
102
|
## :page_with_curl: Changelog
|
|
101
|
-
[25/
|
|
103
|
+
[25/08/06] 🎯 **NEW!** We have added support for **Reasoning Pipeline**, which is a new paradigm that combines reasoning ability and retrieval, representing work that includes [R1-Searcher](https://github.com/SsmallSong/R1-Searcher), [Search-R1](https://github.com/PeterGriffinJin/Search-R1),.... We evaluate the performance of the pipeline on various RAG benchmarks, it can achieve F1 scores close to 60 on multi hop inference datasets such as HotpotQA. See it in [**result table**](#robot-supporting-methods).
|
|
104
|
+
|
|
105
|
+
[25/03/21] 🚀 **Major Update!** We have expanded our toolkit to support **23 state-of-the-art RAG algorithms**, including **7 reasoning-based methods** that significantly improve performance on complex reasoning tasks. This represents a major milestone in our toolkit's evolution!
|
|
102
106
|
|
|
103
107
|
[25/02/24] 🔥🔥🔥 We have added support for **multimodal RAG**, including [**MLLMs like Llava, Qwen, InternVL**](https://ruc-nlpir.github.io/FlashRAG/#/zh-cn/component/generator?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e7%94%9f%e6%88%90%e5%99%a8), and various [**multimodal retrievers with Clip architecture**](https://ruc-nlpir.github.io/FlashRAG/#/zh-cn/component/retriever?id=%e5%a4%9a%e6%a8%a1%e6%80%81%e6%a3%80%e7%b4%a2%e5%99%a8). More information can be found in our new version of arxiv article and our documentation. Try it!
|
|
104
108
|
|
|
@@ -587,7 +591,7 @@ python interface.py
|
|
|
587
591
|
|
|
588
592
|
## :robot: Supporting Methods
|
|
589
593
|
|
|
590
|
-
We have implemented
|
|
594
|
+
We have implemented **23 works** with a consistent setting of:
|
|
591
595
|
|
|
592
596
|
- **Generator:** LLAMA3-8B-instruct with input length of 2048
|
|
593
597
|
- **Retriever:** e5-base-v2 as embedding model, retrieve 5 docs per query
|
|
@@ -597,7 +601,7 @@ For open-source methods, we implemented their processes using our framework. For
|
|
|
597
601
|
|
|
598
602
|
For necessary settings and hyperparameters specific to some methods, we have documented them in the **specific settings** column. For more details, please consult our [<u>reproduce guidance</u>](./docs/original_docs/reproduce_experiment.md) and [<u>method details</u>](./docs/original_docs/baseline_details.md).
|
|
599
603
|
|
|
600
|
-
It
|
|
604
|
+
It's important to note that, to ensure consistency, we have utilized a uniform setting. However, this setting may differ from the original setting of the method, leading to variations in results compared to the original outcomes.
|
|
601
605
|
|
|
602
606
|
| Method | Type | NQ (EM) | TriviaQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | PopQA (F1) | WebQA(EM) | Specific setting |
|
|
603
607
|
| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |
|
|
@@ -618,10 +622,21 @@ It’s important to note that, to ensure consistency, we have utilized a uniform
|
|
|
618
622
|
| [FLARE](https://arxiv.org/abs/2305.06983) | Loop | 22.5 | 55.8 | 28.0 | 33.9 | 20.7 | 20.2 | |
|
|
619
623
|
| [Iter-Retgen](https://arxiv.org/abs/2305.15294), [ITRG](https://arxiv.org/abs/2310.05149) | Loop | 36.8 | 60.1 | 38.3 | 21.6 | 37.9 | 18.2 | |
|
|
620
624
|
| [IRCoT](https://aclanthology.org/2023.acl-long.557.pdf) | Loop | 33.3 | 56.9 | 41.5 | 32.4 | 45.6 | 20.7 | |
|
|
621
|
-
| [RQRAG](https://arxiv.org/abs/2404.00610) | Loop | 32.6 | 52.5 | 33.5 | 35.8 | 46.4 | 26.2 | Use trained rqrag-llama2-7B |
|
|
622
|
-
|
|
623
|
-
|
|
625
|
+
| [RQRAG](https://arxiv.org/abs/2404.00610) | Loop | 32.6 | 52.5 | 33.5 | 35.8 | 46.4 | 26.2 | Use trained rqrag-llama2-7B |
|
|
626
|
+
|
|
627
|
+
#### 🚀 Reasoning-based Methods (NEW!)
|
|
628
|
+
|
|
629
|
+
We now support **7 reasoning-based methods** that combine reasoning ability with retrieval, achieving superior performance on complex multi-hop tasks:
|
|
624
630
|
|
|
631
|
+
| Method | Type | NQ (EM) | TriviaQA (EM) | PopQA (EM) | Hotpotqa (F1) | 2Wiki (F1) | Musique (F1) | Bamboogle (F1) | Specific setting |
|
|
632
|
+
| ----------------------------------------------------------------------------------------- | ----------- | ------- | ------- | ------------- | ------------- | ---------- | ---------- | --------- | ----------------------------------------------- |
|
|
633
|
+
| [Search-R1](https://arxiv.org/abs/2503.09516) | Reasoning | 45.2 | 62.2 | 49.2 | 54.5 | 42.6 | 29.2 | 59.9 | SearchR1-nq_hotpotqa_train-qwen2.5-7b-em-ppo |
|
|
634
|
+
| [R1-Searcher](https://arxiv.org/pdf/2503.05592) | Reasoning | 36.9 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-2.5-7B-base-RAG-RL |
|
|
635
|
+
| [O2-Searcher](https://arxiv.org/pdf/2505.16582) | Reasoning | 41.4 | 51.4 | 46.8 | 43.4 | 48.6 | 19.0 | 47.6 | O2-Searcher-Qwen2.5-3B-GRPO |
|
|
636
|
+
| [AutoRefine](https://www.arxiv.org/pdf/2505.11277) | Reasoning | 43.8 | 59.8 | 32.4 | 54.0 | 50.3 | 23.6 | 46.6 | AutoRefine-Qwen2.5-3B-Base |
|
|
637
|
+
| [ReaRAG](https://arxiv.org/abs/2503.21729) | Reasoning | 26.3 | 51.8 | 24.6 | 42.9 | 41.6 | 21.2 | 41.9 | ReaRAG-9B |
|
|
638
|
+
| [CoRAG](https://arxiv.org/abs/2503.21729) | Reasoning | 40.9 | 63.1 | 36.0 | 56.6 | 60.7 | 31.9 | 54.1 | CoRAG-Llama3.1-8B-MultihopQA |
|
|
639
|
+
| [SimpleDeepSearcher](https://arxiv.org/pdf/2505.16834) | Reasoning | 36.1 | 61.6 | 42.0 | 49.0 | 49.1 | 24.7 | 57.7 | Qwen-7B-SimpleDeepSearcher |
|
|
625
640
|
|
|
626
641
|
## :notebook: Supporting Datasets & Document Corpus
|
|
627
642
|
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.1.4dev20250805"
|
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/config/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/config/basic_config.yaml
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/dataset/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/dataset/dataset.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/_bleu.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/evaluator.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/metrics.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/evaluator/utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/generator.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/generator/utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/judger/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/ReaRAG_utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/mm_pipeline.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/pipeline.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/pipeline/replug_utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/base_prompt.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/coRAG_prompt.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/mm_prompt.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/prompt/trace_examplars.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/kg_refiner.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/refiner/refiner.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/__main__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/encoder.py
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/reranker.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/retriever.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/retriever/utils.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/utils/__init__.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/utils/constants.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag/utils/pred_parse.py
RENAMED
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{flashrag_dev-0.1.4.dev20250805 → flashrag_dev-0.3.0.dev20250818}/flashrag_dev.egg-info/requires.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|