Skip to content

Samad80/Ex_PDF_QA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“˜ Explainable PDF Question Answering (RAG App)

An Explainable Retrieval-Augmented Generation (RAG) system that allows users to upload a PDF, ask questions about its content, and receive:

  • πŸ“– A grounded answer
  • 🧠 An explanation of why specific context was used
  • πŸ“„ Source pages with relevance scores

Built using Gradio, LangChain, ChromaDB, and Hugging Face models.


πŸš€ Features

  • πŸ“‚ Upload and index any PDF
  • πŸ” Semantic search using embeddings (MiniLM)
  • πŸ€– Question answering using FLAN-T5
  • 🧠 Explainability layer: why this answer?
  • πŸ“„ Source attribution with relevance scores
  • πŸ’» Runs fully on CPU (Colab / low-resource friendly)

🧠 Architecture (High Level)

  1. PDF Loader
    Uses PyPDFLoader to extract text from PDFs.

  2. Text Chunking
    Splits text into overlapping chunks using RecursiveCharacterTextSplitter.

  3. Embeddings

    • Model: sentence-transformers/all-MiniLM-L6-v2
    • Normalized embeddings for accurate similarity scoring.
  4. Vector Store

    • ChromaDB for fast semantic retrieval
    • Persistent storage
  5. LLM

    • google/flan-t5-base
    • Used twice:
      • Answer generation
      • Explanation generation
  6. UI

    • Built with Gradio Blocks
    • Simple and interactive interface

πŸ›  Tech Stack

  • Python
  • Gradio
  • LangChain
  • ChromaDB
  • Hugging Face Transformers
  • PyTorch

πŸ“¦ Installation

pip install gradio torch transformers langchain langchain-community chromadb sentence-transformers pypdf

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages