A simple yet effective FAQ-based chatbot web application built using Flask, TF-IDF vectorization, and Cosine Similarity.
The chatbot intelligently matches user queries with predefined FAQs and returns the most relevant response in real time.
This project demonstrates basic NLP concepts, Flask backend development, and clean frontend integration.
- 💬 Interactive web-based chat interface
- 🧠 NLP-powered question matching using TF-IDF + Cosine Similarity
- 📚 Predefined FAQ dataset (JSON-based, easy to extend)
- ⚡ Fast and lightweight Flask backend
- 🎯 Confidence-based response selection
- 🧩 Clean and modular project structure
- Python
- Flask
- HTML
- CSS
- Vanilla JavaScript
- TF-IDF Vectorizer (scikit-learn)
- Cosine Similarity
- Text preprocessing
ChatBotFAQs/
│
├── app.py # Flask application
├── requirements.txt # Python dependencies
├── README.md # Project documentation
│
├── data/
│ └── faqs.json # FAQ dataset
│
├── templates/
│ └── index.html # Frontend UI
│
├── static/
│ └── style.css # Styling
│
└── utils/
└── text_preprocessing.py # Text cleaning utilities
#1️⃣ Clone the repository
#2️⃣ Install dependencies
python app.py
🧪 How It Works
- User enters a question in the chat interface
- Input text is cleaned and vectorized using TF-IDF
- Cosine similarity is calculated against stored FAQ questions
- The most relevant answer is returned if confidence exceeds the threshold
🔮 Future Improvements
- Upgrade to Sentence-BERT for semantic similarity
- Add admin panel to manage FAQs
- REST API version (FastAPI)
- Database integration
- Multi-language support
💼 AI / ML & Full-Stack Enthusiast 🔗 GitHub: https://github.com/Bilal-73
⭐ ### Show Your Support
If you found this project useful: ⭐ Star the repository 🍴 Fork it 🧠 Suggest improvements