Document pdf based Question-Answering With RAG+Mistral
This system integrates the Retrieval-Augmented Generation (RAG) framework with the Mistral model to deliver advanced document question-answering capabilities. RAG combines the strengths of information retrieval and generative modeling, allowing it to fetch relevant context from PDF documents and generate precise answers. Mistral, a state-of-the-art language model, powers the generative component, ensuring high-quality responses. The system is designed for scenarios where users need fast, accurate answers from extensive documents, making it ideal for research, legal, or educational purposes.
Python (>=3.8)
GPU (optional but recommended for faster inference)
Libraries: PyTorch, Hugging Face Transformers, FAISS, PyMuPDF (for PDF processing)
Install required dependencies:
pip install torch transformers faiss-cpu pymupdf sentence-transformers
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
Clone or download the project files:
git clone https://github.com/ravigithubshankar/PDF-Chat-Mistral7B-RAG.git
cd PDF-Chat-Mistral7B-RAG
python3 app.py
The system will retrieve relevant document excerpts, generate a contextually appropriate answer, and display it in the console or API response.