Emotion_Classifier / README.md
Shreyas Pulle
Upload 9 files
5ac332c verified
---
title: How Am I Feeling? - Emotion Classifier
emoji: 🎭
colorFrom: purple
colorTo: blue
sdk: docker
pinned: false
license: mit
---
# 🎭 How Am I Feeling? - AI Emotion Classifier
An AI-powered emotion detection system that analyzes text and identifies 10 different emotions with 88.6% accuracy.
## 🌟 Features
- **10 Emotion Classes**: happiness, sadness, fear, embarrassment, disgust, drive, surprise, loneliness, love, excitement
- **Beautiful Web UI**: Modern, responsive interface with real-time analysis
- **High Accuracy**: 88.6% validation accuracy
- **Fast Inference**: <10ms per sentence
- **Word2Vec + Neural Network**: 300-dim embeddings β†’ 128β†’64β†’10 network
## πŸš€ Try It Out
Simply type or paste any text to see what emotions it conveys!
**Example sentences:**
- "I'm so grateful for this beautiful day!" β†’ happiness
- "I miss the way things used to be" β†’ sadness
- "I can't wait for the concert tomorrow!" β†’ excitement
- "Every moment with you makes my heart complete" β†’ love
- "I'm terrified of what might happen next" β†’ fear
## 🧠 Technical Details
### Architecture
```
Input Text β†’ Preprocessing β†’ Word2Vec (300-dim) β†’ Neural Network (128β†’64β†’10) β†’ Top-5 Predictions
```
### Dataset
- **Size**: 100,000 sentences (10,000 per emotion)
- **Source**: Generated using LLaMA 3.1 70B via Deepinfra
- **Quality**: Diverse, natural language examples
### Model
- **Embeddings**: Word2Vec (Skip-gram, 300 dimensions)
- **Classifier**: Fully-connected neural network
- **Parameters**: 34,634 trainable parameters
- **Training**: 50 epochs with early stopping
- **Validation Accuracy**: 88.6%
## πŸ“Š Performance
Per-emotion accuracy:
- Best: happiness, love, excitement (~92%)
- Good: sadness, fear, surprise (~88%)
- Moderate: embarrassment, drive, disgust (~84%)
## πŸ’» API Usage
```bash
curl -X POST http://your-space-url/analyze \
-H "Content-Type: application/json" \
-d '{"text": "I am so excited about this!"}'
```
Response:
```json
{
"success": true,
"predictions": [
{"emotion": "excitement", "confidence": 0.92, "percentage": 92.0},
{"emotion": "happiness", "confidence": 0.85, "percentage": 85.0},
...
]
}
```
## πŸ› οΈ Built With
- **TensorFlow/Keras** - Deep learning
- **Gensim** - Word2Vec embeddings
- **Flask** - Web framework
- **NLTK** - Text processing
## πŸ“ License
MIT License - Free to use for personal or commercial projects!
## πŸ”— Links
- **GitHub**: [emotion-classifier](https://github.com/yourusername/emotion-classifier)
- **Dataset**: Coming soon to Hugging Face Datasets
---
Built with ❀️ and Python