├── LICENSE.txt ├── README.md ├── RRAG ├── dataset │ ├── __init__.py │ ├── load_dureader.py │ ├── load_hotpotqa.py │ ├── load_musique.py │ └── load_nq.py ├── models │ ├── modeling_rag.py │ └── modeling_rrag.py ├── prompts │ ├── qa.prompt │ ├── qa_cot.prompt │ ├── qa_similarity.prompt │ ├── qa_similarity_zh.prompt │ └── qa_zh.prompt └── utils │ ├── metrics.py │ └── trainer.py ├── assets └── intro.png ├── retrieval ├── feature_extraction.py ├── feature_extraction_openai.py ├── finetune_retriever.py ├── label_dureader.ipynb └── retrieval_utils.py ├── runner.py └── scripts ├── feature_extraction ├── extraction_2wiki.sh ├── extraction_hotpotqa.sh ├── extraction_musique.sh ├── extraction_nq.sh └── extraction_nq_openai.sh ├── inference └── eval_nq.sh ├── retriever ├── finetune_2wiki.sh ├── finetune_hotpotqa.sh ├── finetune_musique.sh └── finetune_nq.sh └── train ├── train_2wiki.sh ├── train_hotpotqa.sh ├── train_musique.sh ├── train_nq.sh └── train_nq_lora.sh /LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/LICENSE.txt -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/README.md -------------------------------------------------------------------------------- /RRAG/dataset/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /RRAG/dataset/load_dureader.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/dataset/load_dureader.py -------------------------------------------------------------------------------- /RRAG/dataset/load_hotpotqa.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/dataset/load_hotpotqa.py -------------------------------------------------------------------------------- /RRAG/dataset/load_musique.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/dataset/load_musique.py -------------------------------------------------------------------------------- /RRAG/dataset/load_nq.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/dataset/load_nq.py -------------------------------------------------------------------------------- /RRAG/models/modeling_rag.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/models/modeling_rag.py -------------------------------------------------------------------------------- /RRAG/models/modeling_rrag.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/models/modeling_rrag.py -------------------------------------------------------------------------------- /RRAG/prompts/qa.prompt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/prompts/qa.prompt -------------------------------------------------------------------------------- /RRAG/prompts/qa_cot.prompt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/prompts/qa_cot.prompt -------------------------------------------------------------------------------- /RRAG/prompts/qa_similarity.prompt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/prompts/qa_similarity.prompt -------------------------------------------------------------------------------- /RRAG/prompts/qa_similarity_zh.prompt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/prompts/qa_similarity_zh.prompt -------------------------------------------------------------------------------- /RRAG/prompts/qa_zh.prompt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/prompts/qa_zh.prompt -------------------------------------------------------------------------------- /RRAG/utils/metrics.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/utils/metrics.py -------------------------------------------------------------------------------- /RRAG/utils/trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/RRAG/utils/trainer.py -------------------------------------------------------------------------------- /assets/intro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/assets/intro.png -------------------------------------------------------------------------------- /retrieval/feature_extraction.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/retrieval/feature_extraction.py -------------------------------------------------------------------------------- /retrieval/feature_extraction_openai.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/retrieval/feature_extraction_openai.py -------------------------------------------------------------------------------- /retrieval/finetune_retriever.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/retrieval/finetune_retriever.py -------------------------------------------------------------------------------- /retrieval/label_dureader.ipynb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/retrieval/label_dureader.ipynb -------------------------------------------------------------------------------- /retrieval/retrieval_utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/retrieval/retrieval_utils.py -------------------------------------------------------------------------------- /runner.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/runner.py -------------------------------------------------------------------------------- /scripts/feature_extraction/extraction_2wiki.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/feature_extraction/extraction_2wiki.sh -------------------------------------------------------------------------------- /scripts/feature_extraction/extraction_hotpotqa.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/feature_extraction/extraction_hotpotqa.sh -------------------------------------------------------------------------------- /scripts/feature_extraction/extraction_musique.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/feature_extraction/extraction_musique.sh -------------------------------------------------------------------------------- /scripts/feature_extraction/extraction_nq.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/feature_extraction/extraction_nq.sh -------------------------------------------------------------------------------- /scripts/feature_extraction/extraction_nq_openai.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/feature_extraction/extraction_nq_openai.sh -------------------------------------------------------------------------------- /scripts/inference/eval_nq.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/inference/eval_nq.sh -------------------------------------------------------------------------------- /scripts/retriever/finetune_2wiki.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/retriever/finetune_2wiki.sh -------------------------------------------------------------------------------- /scripts/retriever/finetune_hotpotqa.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/retriever/finetune_hotpotqa.sh -------------------------------------------------------------------------------- /scripts/retriever/finetune_musique.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/retriever/finetune_musique.sh -------------------------------------------------------------------------------- /scripts/retriever/finetune_nq.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/retriever/finetune_nq.sh -------------------------------------------------------------------------------- /scripts/train/train_2wiki.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/train/train_2wiki.sh -------------------------------------------------------------------------------- /scripts/train/train_hotpotqa.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/train/train_hotpotqa.sh -------------------------------------------------------------------------------- /scripts/train/train_musique.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/train/train_musique.sh -------------------------------------------------------------------------------- /scripts/train/train_nq.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/train/train_nq.sh -------------------------------------------------------------------------------- /scripts/train/train_nq_lora.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/YeFD/RRAG/HEAD/scripts/train/train_nq_lora.sh --------------------------------------------------------------------------------