Deep Learning · 2026
Emotion Classification (BiLSTM)
Bidirectional LSTM in PyTorch classifying text into six emotions.
Model
- Embedding → bidirectional LSTM → dense head
- Six-class softmax (e.g. sadness, joy, love, anger, fear, surprise)
- Class weighting to handle label imbalance
Dataset
Twitter emotion corpus (six emotion labels) with train/validation/test splits.
Results & metrics
- Classes
- 6 emotions
- Test accuracy
- ~0.92
- Backbone
- BiLSTM
Deployment steps
- 1Preprocess and tokenize tweets
- 2Train the BiLSTM with weighted loss
- 3Save the best checkpoint by validation F1
- 4Wrap inference in a small predict function/script
Tech stack
- PyTorch
- BiLSTM
- NLP