Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,80 @@
|
|
1 |
-
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- text-classification
|
4 |
+
- multi-label
|
5 |
+
- go-emotions
|
6 |
+
- transformers
|
7 |
+
- huggingface
|
8 |
+
license: apache-2.0
|
9 |
+
library_name: transformers
|
10 |
+
language:
|
11 |
+
- en
|
12 |
+
metrics:
|
13 |
+
- accuracy
|
14 |
+
- f1
|
15 |
+
base_model:
|
16 |
+
- google-bert/bert-base-uncased
|
17 |
+
pipeline_tag: text-classification
|
18 |
+
---
|
19 |
+
|
20 |
+
# π₯ Fine-Tuned BERT on GoEmotions Dataset
|
21 |
+
|
22 |
+
## π Model Overview
|
23 |
+
This model is a **fine-tuned version of BERT** (`bert-base-uncased`) on the **GoEmotions** dataset for **multi-label emotion classification**. It can predict multiple emotions per input text.
|
24 |
+
|
25 |
+
## π Performance
|
26 |
+
| Metric | Score |
|
27 |
+
|----------------|-------|
|
28 |
+
| **Accuracy** | 46.57% |
|
29 |
+
| **F1 Score** | 56.41% |
|
30 |
+
| **Hamming Loss** | 3.39% |
|
31 |
+
|
32 |
+
## π Model Usage
|
33 |
+
```python
|
34 |
+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
35 |
+
import torch
|
36 |
+
|
37 |
+
# Load model and tokenizer
|
38 |
+
model_name = "codewithdark/bert-Gomotions"
|
39 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
40 |
+
model = AutoModelForSequenceClassification.from_pretrained(model_name)
|
41 |
+
|
42 |
+
# Example text
|
43 |
+
text = "I'm so happy today!"
|
44 |
+
inputs = tokenizer(text, return_tensors="pt")
|
45 |
+
|
46 |
+
# Predict
|
47 |
+
with torch.no_grad():
|
48 |
+
outputs = model(**inputs)
|
49 |
+
probs = torch.sigmoid(outputs.logits)
|
50 |
+
|
51 |
+
print(probs) # Multi-label predictions
|
52 |
+
```
|
53 |
+
|
54 |
+
## ποΈββοΈ Training Details
|
55 |
+
- **Model:** `bert-base-uncased`
|
56 |
+
- **Dataset:** [GoEmotions](https://huggingface.co/datasets/go_emotions)
|
57 |
+
- **Optimizer:** AdamW
|
58 |
+
- **Loss Function:** BCEWithLogitsLoss (Binary Cross-Entropy for multi-label classification)
|
59 |
+
- **Batch Size:** 16
|
60 |
+
- **Epochs:** 3
|
61 |
+
- **Evaluation Metrics:** Accuracy, F1 Score, Hamming Loss
|
62 |
+
|
63 |
+
## π How to Use in Hugging Face
|
64 |
+
```python
|
65 |
+
from transformers import pipeline
|
66 |
+
|
67 |
+
classifier = pipeline("text-classification", model="your-username/bert-go-emotions", top_k=None)
|
68 |
+
classifier("I'm so excited about the trip!")
|
69 |
+
```
|
70 |
+
|
71 |
+
## π οΈ Citation
|
72 |
+
If you use this model, please cite:
|
73 |
+
```bibtex
|
74 |
+
@misc{your_model,
|
75 |
+
author = {codewithdark},
|
76 |
+
title = {Fine-tuned BERT on GoEmotions},
|
77 |
+
year = {2025},
|
78 |
+
url = {https://huggingface.co/codewithdark/bert-Gomotions}
|
79 |
+
}
|
80 |
+
```
|