File size: 976 Bytes
62e66e6
9c2c8d1
 
 
 
62e66e6
6c30dcb
62e66e6
 
9c2c8d1
62e66e6
 
9c2c8d1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6c30dcb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
title: Emotion Text Classifier
emoji: 😊
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 6.10.0
app_file: app.py
pinned: false
license: mit
---

# Emotion Text Classifier

Fine-tuned `roberta-base` on the [dair-ai/emotion](https://huggingface.co/datasets/dair-ai/emotion) dataset.

Classifies text into 6 emotions: sadness, joy, love, anger, fear, surprise.

## Files

| File | Purpose |
|------|---------|
| `train.py` | Fine-tune roberta-base on dair-ai/emotion (run on Colab) |
| `push_to_hub.py` | Push trained model to HuggingFace Hub with model card |
| `app.py` | Gradio demo app |
| `requirements.txt` | Python dependencies |

## Quick Start (Colab)

```bash
# 1. Install dependencies
pip install transformers datasets scikit-learn accelerate

# 2. Train
python train.py

# 3. Push to Hub (log in first: huggingface-cli login)
python push_to_hub.py --repo_id your-username/emotion-roberta

# 4. Test the demo locally
pip install gradio
python app.py
```