dair-ai/emotion
Viewer β’ Updated β’ 437k β’ 34.5k β’ 531
Run tsid7710/distillbert-emotion-model on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Use HF Jobs to fine-tune https://huggingface.co/tsid7710/distillbert-emotion-model. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Use HF Jobs to run batch inference with https://huggingface.co/tsid7710/distillbert-emotion-model on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
How to use tsid7710/distillbert-emotion-model with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="tsid7710/distillbert-emotion-model") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("tsid7710/distillbert-emotion-model")
model = AutoModelForSequenceClassification.from_pretrained("tsid7710/distillbert-emotion-model", device_map="auto")This is a fine-tuned DistilBERT model for emotion classification trained on the dair-ai/emotion dataset.
| Metric | Value |
|---|---|
| Accuracy | 0.919 |
| F1 Score | 0.918 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "tsid7710/distillbert-emotion-model"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "I am feeling great today!"
inputs = tokenizer(text, return_tensors="pt")
with torch.inference_mode():
logits = model(**inputs).logits
pred = torch.argmax(logits, dim=-1).item()
print(pred)