Skip to content

Latest commit

 

History

History
122 lines (83 loc) · 2.94 KB

File metadata and controls

122 lines (83 loc) · 2.94 KB

Python Flask NLP scikit-learn Status License

🤖 ChatBotFAQs – FAQ Chatbot using Flask & NLP

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.



✨ Features

  • 💬 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

🛠️ Tech Stack

Backend

  • Python
  • Flask

Frontend

  • HTML
  • CSS
  • Vanilla JavaScript

NLP / ML

  • TF-IDF Vectorizer (scikit-learn)
  • Cosine Similarity
  • Text preprocessing

📂 Project Structure

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

⚙️ Installation & Setup

#1️⃣ Clone the repository

image

#2️⃣ Install dependencies

image

3️⃣ Run the Application

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

👤 Author

Bilal Imran

💼 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