How avibadola510/emotion-sense works
Emotion-Sense is a web app that predicts one of six emotions from text. The user enters text in the browser UI, which submits it to the FastAPI prediction endpoint; the server cleans and tokenizes the text, pads the sequence, runs the loaded BiGRU model, and returns a label and probabilities for display. The tree and excerpts support the API, model assets, and browser result rendering. Training or other notebook capabilities are not described in the supplied README, so their behavior is not mapped.
Main entry points: main.py Prediction endpoint · index.html Emotion UI · script.js UI interactions · BiGRU_Model.keras Emotion classifier
Components 11
Web interface
- Emotion UI
static/index.html - UI interactions
static/script.js
Prediction API
- Prediction endpoint
main.py - Prediction results
main.py - Health check
main.py - Static file service
main.py
Inference runtime
- Text preprocessing
main.py - Sequence encoding
main.py - Emotion classifier
Artifacts/BiGRU_Model.keras - Tokenizer
Artifacts/tokenizer.pkl
Other components
- User
Connections 11
- User → Emotion UI: uses
- Emotion UI → UI interactions: loads interactions
static/script.js - UI interactions → Prediction endpoint: POSTs text
static/script.js - Prediction endpoint → Text preprocessing: cleans text
main.py - Prediction endpoint → Sequence encoding: encodes sequence
main.py - Prediction endpoint → Emotion classifier: predicts with
main.py - Prediction endpoint → Tokenizer: loads tokenizer
main.py - Prediction endpoint → Prediction results: returns probabilities
main.py - UI interactions → Prediction results: renders response
static/script.js - Prediction endpoint → Health check: exposes
main.py - Emotion UI → Static file service: served by
main.py