How malavika-suresh/ai-chatbot works
This is a Django chatbot: a visitor opens the web interface, submits a question, and receives a response selected from the configured intents. The request routes to the chatbot view, which invokes intent matching and renders the result. Inside the inference layer, text is tokenized and lemmatized, converted to a bag of words, and scored by the trained model before response selection. The README also documents responsive UI, CSRF-protected handling, and customizable intents. Asset loading uses hard-coded paths in the sampled view; no database-backed chatbot behavior is shown.
Main entry points: views.py Intent predictor · chat/urls.py Project routes · chatbot/urls.py Chat routes · index.html Chat page
Components 13
Web interface
- Project routes
chat/urls.py - Chat routes
chatbot/urls.py - Request views
chatbot/views.py - Chat page
chatbot/templates/webbot/index.html
Intent inference
- Response selector
chatbot/views.py - Intent predictor
chatbot/views.py - Text vectorizer
chatbot/views.py - Sentence cleaner
chatbot/views.py
Chatbot assets
- Trained model
files/model_new.h5 - Intent responses
files/new_intent.json - Word list
files/words.pkl - Intent classes
files/classes.pkl
Other components
- Visitor
Connections 12
- Visitor → Project routes: sends request
chat/urls.py - Project routes → Chat routes: includes routes
chat/urls.py - Chat routes → Request views: routes requests
chatbot/urls.py - Request views → Chat page: renders page
chatbot/views.py - Request views → Response selector: gets response
chatbot/views.py - Response selector → Intent predictor: predicts intent
chatbot/views.py - Intent predictor → Text vectorizer: vectorizes text
chatbot/views.py - Text vectorizer → Sentence cleaner: cleans sentence
chatbot/views.py - Intent predictor → Trained model: scores vector
chatbot/views.py - Intent predictor → Word list: uses vocabulary
chatbot/views.py - Intent predictor → Intent classes: maps classes
chatbot/views.py - Response selector → Intent responses: selects response
chatbot/views.py