harkishan99's picture
Add README.md
8532391 verified

A newer version of the Gradio SDK is available: 6.1.0

Upgrade
metadata
title: Emotion Detection
emoji: 🎭
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.44.0
app_file: app.py
pinned: false
license: mit

🎭 Multi-Label Emotion Detection

Detect multiple emotions in text using DeBERTa-v3-base fine-tuned for multi-label emotion classification.

Features

  • Multi-Label Classification: Detect multiple emotions simultaneously
  • 5 Emotions: Anger, Fear, Joy, Sadness, Surprise
  • State-of-the-Art Model: DeBERTa-v3-base (184M parameters)
  • High Performance: F1 Score ~0.85 on validation set

Model Architecture

  • Base Model: microsoft/deberta-v3-base
  • Task: Multi-label emotion classification
  • Training: Fine-tuned on emotion detection dataset
  • Parameters: 184 million

How to Use

  1. Enter or paste text in the input box
  2. Click "Analyze Emotions" or press Enter
  3. View detected emotions and their probabilities
  4. Try the example texts for demonstration

Performance

  • Validation F1 Score: ~0.85
  • Validation Accuracy: ~0.55
  • Training: 12 epochs with early stopping
  • Optimizer: AdamW with linear warmup

Dataset

Trained on multi-label emotion classification dataset with:

  • 6,827 training samples
  • 1,707 test samples
  • 5 emotion labels

Examples

Happy:

"I just got accepted into my dream university! I can't believe it!"

Fearful:

"I'm so worried about the exam tomorrow. I haven't studied enough."

Mixed Emotions:

"I'm frustrated with this project but also excited about the possibilities."

Technical Details

  • Framework: PyTorch, Transformers, Gradio
  • Tokenizer: DeBERTa-v3-base tokenizer
  • Max Length: 160 tokens
  • Threshold: 0.5 for emotion detection

License

MIT License

Acknowledgments

  • Model: Microsoft DeBERTa-v3-base
  • Framework: Hugging Face Transformers
  • UI: Gradio

Built with ❤️ for Deep Learning and Gen AI course