AI_pdf_reader / README.md
memoona-nz's picture
Upload 3 files
909ffed verified
|
Raw History Blame Contribute Delete
1.72 kB

A newer version of the Gradio SDK is available: 6.32.0

Upgrade
metadata
title: AI PDF Q&A Chatbot
emoji: πŸ“„
colorFrom: blue
colorTo: green
sdk: gradio
sdk_version: 5.31.0
app_file: app.py
pinned: false

πŸ“„ AI PDF Q&A Chatbot (RAG System)

An AI-powered PDF Question Answering chatbot built using:

  • LangChain
  • FAISS
  • Hugging Face Transformers
  • FLAN-T5
  • Gradio

Upload PDF documents and ask questions from them using Retrieval-Augmented Generation (RAG).


πŸš€ Features

βœ… Extract and split document text
βœ… Semantic search using embeddings
βœ… Retrieval-Augmented Generation (RAG)
βœ… Detailed educational answers
βœ… Modern Gradio UI


🧠 Model Used

Text Generation

  • google/flan-t5-base

Embeddings

  • sentence-transformers/all-MiniLM-L6-v2

πŸ“¦ Technologies

  • Python
  • Gradio
  • LangChain
  • FAISS
  • Transformers
  • PyTorch

▢️ Run Locally

Install dependencies:

pip install -r requirements.txt

Run app:

python app.py

🌐 Deploy on Hugging Face Spaces

  1. Create a new Space
  2. Select:
    • SDK: Gradio
  3. Upload:
    • app.py
    • requirements.txt
    • README.md

The app will build automatically.


⚠️ Important Notes

  • First startup may take time because models download automatically.
  • CPU Spaces are supported.
  • No API key required.
  • Recommended Space Hardware:
    • CPU Basic or higher

πŸ“š How It Works

  1. Upload PDFs
  2. Documents are split into chunks
  3. Embeddings are generated
  4. FAISS stores vectors
  5. Relevant chunks are retrieved
  6. FLAN-T5 generates detailed answers

πŸ‘©β€πŸ’» Author

Built using Hugging Face + Gradio + LangChain.