An intelligent FAQ chatbot built using Flask, Natural Language Processing (NLP), and TF-IDF vectorization.
The chatbot understands user queries and returns the most relevant response using cosine similarity.
This project demonstrates:
- Text preprocessing using NLTK
- Stopword removal
- TF-IDF feature extraction
- Cosine similarity for semantic matching
- Flask-based web interface
- Dynamic Jinja template rendering
The chatbot intelligently matches user queries with a predefined FAQ database.
1️⃣ User enters a message
2️⃣ Text is preprocessed (tokenized + cleaned)
3️⃣ Converted into TF-IDF vector
4️⃣ Cosine similarity calculated with FAQ dataset
5️⃣ Most similar answer returned
6️⃣ If similarity score is low → fallback response
faq-chatbot/
│
├── templates/
│ └── index.html
├── static/
│ └── chatbot-ui.png
├── app.py
├── requirements.txt
└── README.md
- Python
- Flask
- NLTK
- Scikit-learn
- TF-IDF Vectorizer
- Cosine Similarity
- HTML + CSS (Custom UI)
✔ Intelligent semantic matching
✔ Clean modern chat interface
✔ Greeting / Thanks / Goodbye handling
✔ Fallback response logic
✔ Lightweight and fast
✔ Modular and easy to expand
- Lowercasing
- Tokenization
- Stopword removal
- TF-IDF transformation
- Similarity scoring
- Add conversation memory
- Upgrade to Deep Learning (LSTM / BERT)
- Add REST API endpoint
- Add database-backed dynamic FAQs
- Add voice integration
Arijit Sen
BTech – Electronics & Communication Engineering
AI & Intelligent Systems Enthusiast
⭐ If you find this project useful, consider giving it a star!
