An intelligent chatbot built using Python and Flask for e-commerce platforms. It can handle user queries, assist with product navigation, and respond to common customer questions. The chatbot is integrated into a web interface with basic routes and templates.
- π§ NLP-based chatbot for intelligent responses
- ποΈ Product page route (/product) with UI integration
- π¬ Chat interface via AJAX (Flask + JS)
- π Dynamic response system using JSON
- π Modular code (chat logic, model training, and routes separated)
| Layer | Tech Used |
|---|---|
| Frontend | HTML5, CSS, JavaScript |
| Backend | Python, Flask |
| NLP | NLTK / custom model |
| Others | JSON, Pickle |
ecommerce-chatbot/
βββ app.py # Main Flask app with route handling
βββ chat.py # Chatbot logic and response generation
βββ model.py # Handles model loading or predictions
βββ train.py # Train chatbot with intents.json
βββ nltk_utils.py # Tokenization, stemming, bag of words
βββ data.pth # Trained model data (torch/pickle)
βββ intents.json # Training data for chatbot
β
βββ static/
β βββ app.js # JS for frontend chat interaction
β βββ style.css # Basic styling
β βββ images/ # Placeholder for any assets
β
βββ templates/
β βββ base.html # Homepage
β βββ product.html # Product page
β
βββ venv/ # Virtual environment
git clone https://github.com/yourusername/ecommerce-chatbot.gitpython -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install flaskpython train.py
python app.pyVisit: http://127.0.0.1:5000
{
"tag": "greeting",
"patterns": ["Hi", "Hello", "Is anyone there?"],
"responses": ["Hello! How can I assist you today?"]
}Pull requests are welcome. Open issues for suggestions or bugs. Support Us https://aniclothe.roytechub.com/
Bidyut Roy πΌ Portfolio: https://github.com/roytechub