This project designed for question-answering tasks using the Retrieval-Augmented Generation (RAG) approach. It leverages a pre-trained language model (ollama) and a retrieval model (ColBERTv2) to generate accurate answers to a variety of questions. The module includes functionality to easily configure and use alternative datasets, such as SQuAD, for diverse question-answering needs.
- RAG Model Integration: Combines retrieval and generation models for enhanced answer accuracy.
- Configurable Retrieval: Adjust the number of passages retrieved to optimize context relevance.
- Chain of Thought Generation: Uses a chain of thought process to generate coherent answers.
- Dataset Flexibility: Easily switch between different datasets (e.g., SQuAD, HotPotQA) for diverse question-answering needs.
- Installation: Install dependencies using
pip install -r requirements.txt
. - Configure Server: Ensure the
ollama
server is running locally. - Load Dataset: Modify
rag_model.py
to use the desired dataset (default is SQuAD). - Run Module: Execute
python rag_model.py
to check server, configure DSPy, and ask sample questions.