How wajih1234/enstab_bot works
ENSTAB Chatbot combines a Node/Express authentication and message API with a Flask chatbot service. Students log in or sign up, open the chatbot, send a message for intent-based prediction, and receive a response; conversation messages are stored for history. The trained PyTorch model uses intent data and French NLP preprocessing. The sampled client also posts user messages to the Node API, while Flask independently stores user and bot turns. Some documented history behavior is represented by the Node message API; the excerpts do not show the client loading that history.
Main entry points: server.js Auth and message API · train.py Model trainer · app.js Chat interface · chat.py Intent response
Components 15
Web experience
- Login form
logpfa2/public/login.js - Chat interface
ENSTA_BOT1/static/app.js - Chat page
ENSTA_BOT1/templates/base.html
Identity and history
- Auth and message API
logpfa2/server.js - User records
logpfa2/server.js - Message records
logpfa2/server.js
Chat inference
- Chatbot API
ENSTA_BOT1/app.py - Intent response
ENSTA_BOT1/chat.py - NLP preprocessing
ENSTA_BOT1/nltk_utils.py - Neural network
ENSTA_BOT1/model.py - Chat messages
ENSTA_BOT1/app.py
Model training
- Intent definitions
ENSTA_BOT1/intents.json - Model trainer
ENSTA_BOT1/train.py - Trained weights
data.pth
Other components
- Student
Connections 20
- Student → Login form: enters credentials
logpfa2/public/login.js - Login form → Auth and message API: submits login
logpfa2/public/login.js - Auth and message API → User records: checks or saves
logpfa2/server.js - Auth and message API → Student: returns token
logpfa2/server.js - Student → Chat page: opens chatbot
- Chat page → Chat interface: loads script
- Chat interface → Student: renders messages
ENSTA_BOT1/static/app.js - Chat interface → Auth and message API: posts user message
ENSTA_BOT1/static/app.js - Chat interface → Chatbot API: requests prediction
ENSTA_BOT1/static/app.js - Chatbot API → Intent response: requests response
ENSTA_BOT1/app.py - Intent response → NLP preprocessing: tokenizes and vectors
ENSTA_BOT1/chat.py - Intent response → Neural network: runs classification
ENSTA_BOT1/chat.py - Intent response → Trained weights: loads weights
ENSTA_BOT1/chat.py - Chatbot API → Chat messages: saves both turns
ENSTA_BOT1/app.py - Auth and message API → Message records: saves and retrieves
logpfa2/server.js - Student → Model trainer: trains intents model
README.md - Intent definitions → Model trainer: provides patterns
ENSTA_BOT1/train.py - Model trainer → NLP preprocessing: preprocesses text
ENSTA_BOT1/train.py - Model trainer → Neural network: trains network
ENSTA_BOT1/train.py - Model trainer → Trained weights: saves weights
ENSTA_BOT1/train.py