This is a Colab-compatible Python chatbot that integrates:
distilbert-base-uncased-emotion
)It predicts the user’s emotion and stress level using both BERT and LSTM models and gives human-like responses.
The chatbot performs the following tasks:
bhadresh-savani/distilbert-base-uncased-emotion
)facebook/blenderbot-400M-distill
).File | Description |
---|---|
chatbot.py |
Full Python script to run the chatbot |
lstm_model.h5 |
Pre-trained LSTM model (upload to Colab) |
tokenizer.pkl |
Tokenizer fitted on the training dataset for LSTM |
requirements.txt |
All necessary Python packages |
example_inputs_outputs.txt |
Sample I/O showing how the chatbot works |
.gitignore |
Ignore compiled files, model weights, cache, etc. |
Install required packages using:
pip install -r requirements.txt
Or manually:
pip install transformers torch torchvision torchaudio tensorflow scikit-learn
lstm_model.h5
and tokenizer.pkl
when prompted.chatbot.py
script:python chatbot.py
In Google Colab, use
files.upload()
to upload the two files.
anger
, fear
, happy
, neutral
, sad
, surprise
Emotion | Stress |
---|---|
anger | High |
fear | High |
sad | High |
neutral | Low |
happy | Low |
surprise | Low |
You: I'm feeling down today.
Bot: I'm here for you. Do you want to talk about it?
BERT Emotion: sadness (0.92) → Stress: High
LSTM Emotion: sad (0.88) → Stress: High
You: exit
Bot: Take care! 💙
🔍 Emotion Detection (BERT): bhadresh-savani/distilbert-base-uncased-emotion
♻️ LSTM Model: Custom-trained TensorFlow model on labeled emotion datasets
💬 Chat Response: facebook/blenderbot-400M-distill
This project is licensed under the MIT License.
Created by Harini Muthukumar
Feel free to star ⭐ the repository and contribute!