shantanumohod23/pdf-chatbot-genai
๐ค A Generative AI chatbot that answers questions from PDFs using FLAN-T5 and sentence-transformers, built with Streamlit.
๐ค PDF Chatbot AI โ A Generative AI Application
A Generative AI-powered chatbot built with Streamlit that allows users to upload PDF documents and get detailed, human-like answers to their questions using state-of-the-art language models.
๐ Features
โ
Upload and analyze PDF files ๐
โ
Extract and segment text using PyPDF2 + NLTK โ๏ธ
โ
Convert text into semantic embeddings using all-mpnet-base-v2 ๐
โ
Retrieve the most relevant context based on user questions ๐ง
โ
Generate context-aware answers using FLAN-T5-Large (Generative AI) โจ
โ
Clean and interactive UI with Streamlit ๐ฌ
๐ ๏ธ Installation
1โฃ Clone the repository
git clone https://github.com/shantanumohod23/pdf-chatbot-ai.git
cd pdf-chatbot-ai2โฃ Create and activate a virtual environment
# Windows
python -m venv .venv
.venv\Scripts\activate
# Mac/Linux
python3 -m venv .venv
source .venv/bin/activate3โฃ Install dependencies
pip install -r requirements.txtโถ๏ธ How to Run
Once installed, start the Streamlit app:
streamlit run app.pyUpload a PDF file, ask your question, and let the AI generate an insightful answer! ๐ค๐
๐ Folder Structure
๐ pdf-chatbot-ai
โโโ app.py # Main Streamlit app
โโโ requirements.txt # Required Python libraries
โโโ config.toml # Streamlit config
โโโ README.md # Project documentation
โโโ LICENSE # License file
๐ง Technologies Used
- Python ๐
- Streamlit โ UI for interaction
- PyPDF2 โ PDF text extraction
- NLTK โ Sentence segmentation
- Sentence Transformers โ
all-mpnet-base-v2for semantic similarity - Hugging Face Transformers โ
google/flan-t5-largefor generative responses
๐ฑ Future Improvements
โ
Add support for scanned PDFs via OCR
โ
Expand to handle multiple documents
โ
Let users select different AI models
โ
Deploy online via Hugging Face Spaces or Streamlit Cloud
๐โโ๏ธ About the Creator
๐ Shantanu Mohod โ Passionate about AI, Data Science, and Full-Stack Development
๐ GitHub: shantanumohod23
๐ LinkedIn: Shantanu Mohod