How regnrok/rag-based-domain-specific-qa works
Project type and purpose
• This is a full‑stack, domain‑specific QA web application using a Retrieval‑Augmented Generation (RAG) architecture.
• Purpose: Load financial documents (PDFs), index them in a vector database, retrieve relevant passages at query time, and generate answers with a fine‑tuned Flan‑T5‑XL model. It also supports training, evaluation, and model deployment.
File structure
• Top‑level scripts:
• app.py → Streamlit front‑end
• rag.py → RAG pipeline (retriever + generator)
• model.py → Fine‑tuning Flan‑T5‑XL on TAT‑QA
• evaluation.py, testing.py → Model evaluation and tests
• hf_push.py → Push model to Hugging Face Hub
• Data directories:
• Data/TAT‑QA/dataset_raw → Raw JSON splits for training/eval
• chroma_db → ChromaDB SQLite files storing embeddings
• output → CSV and visualization outputs for evaluation
• Config files:
• requirements.txt → Dependencies
• Patterns:
• Single‑process Python scripts (no microservices)
• Monolithic repo with clear separation of concerns (UI, pipeline, training, evaluation, deployment)
README for additional insights
• Architecture: RAG (retriever + generator) over a vector database (ChromaDB)
• Tech stack:
• Streamlit for UI
• Hugging Face Transformers (Flan‑T5‑XL)
• ChromaDB for vector storage
• Standard ML evaluation metrics (ROUGE, BLEU, F1, etc.)