Downloads · 30 days
19
1% of all-time downloads
sdeakin/fine_tuned_bert_emotions_large
fine_tuned_bert_emotions_large is a text classification model from sdeakin. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
- Base: bert-large-uncased - Task: multi-label emotion classification (GoEmotions-level emotions) - Fine-tuning: tri-tower setup with contrastive context/label alignment - Max length: 256 - Labels: same 28 GoEmotions…
Downloads · 30 days
19
1% of all-time downloads
All-time downloads
2.5K
Public
Parameters
335M
1.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.3 GB · 100%
From the Hugging Face model README
bert-large-uncasedexample_very_unclear)Replace with your best numbers:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "sdeakin/fine_tuned_bert_emotions_large"
tok = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "I’m excited but a bit nervous about tomorrow!"
enc = tok(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
logits = model(**enc).logits
probs = torch.sigmoid(logits)[0]
label_map = model.config.id2label
preds = [(label_map[i], probs[i].item()) for i in range(len(probs))]
print(sorted(preds, key=lambda x: x[1], reverse=True)[:5])