Get instant answers from a smart chatbot trained on 1000+ real-world questions — without any heavy LLMs!
Built using Python, TF-IDF, cosine similarity and deployed via Streamlit.
- Reads a CSV of 1000+ questions and answers across various topics
- Converts user input + stored questions into TF-IDF vectors
- Uses cosine similarity to find the best-matching response
- If no match crosses a confidence threshold, returns a fallback message
- Runs inside a clean Streamlit UI for fast and easy use
- General Knowledge
- Science & Technology
- Programming
- Health & Wellness
- Islamic / Spiritual
- Education
- FAQs, Casual Chat, and more...
- Clone the repo
git clone https://github.com/masfaatanveer/QnA-Chatbot.git
cd QnA-Chatbot
- Install dependencies
pip install -r requirements.txt
- Run the app
streamlit run app.py
- Chat away!
Ask anything similar to the dataset — the bot will respond instantly.
📁 QnA-Chatbot/
├── app.py # Streamlit UI + chatbot logic
├── chatbot.py # Core TF-IDF + cosine chatbot class
├── data/
│ └── qna_dataset.csv # 1000+ question-answer pairs
├── demo.mp4 # Optional demo file for reference
├── requirements.txt
└── README.md
- ⚡ Super lightweight — no LLMs or APIs needed
- 🚀 Fast inference with 1000+ real QnA samples
- 🧩 Easy to customize — just replace the CSV!
- 💬 Works offline — perfect for internal, embedded, or edge use
- 🧠 Great for demos, AI interviews, chatbot courses, or helpdesk bots
- Add feedback system to improve accuracy
- Upgrade to contextual memory (or RAG-based)
- Export chat history / save sessions
- Add voice (speech-to-text) support
🎥 See this project in action on my LinkedIn:
🔗 Chatbot Demo + Post
Masfa Dhillon
GitHub • LinkedIn
MIT License — Free to use, modify, and deploy with credit.