Downloads · 30 days
13
2% of all-time downloads
Sidharthan/roberta-base-conv-emotion
roberta-base-conv-emotion is a text classification model from Sidharthan. 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.
This is a RoBERTa-based model fine-tuned on the Empathetic Dialogues dataset for conversational emotion classification. The model leverages the powerful RoBERTa architecture to understand and classify emotional contex…
Downloads · 30 days
13
2% of all-time downloads
All-time downloads
570
Public
Parameters
125M
499 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors499 MB · 99%
From the Hugging Face model README
This is a RoBERTa-based model fine-tuned on the Empathetic Dialogues dataset for conversational emotion classification. The model leverages the powerful RoBERTa architecture to understand and classify emotional contexts in conversational text.
The model is trained to classify conversations into the following emotional categories:
| Metric | Score |
|---|---|
| Test Loss | 0.8107 |
| Test Accuracy | 73.01% |
| Test F1 Score | 72.96% |
| Runtime | 10.99 seconds |
| Samples per Second | 61.68 |
| Steps per Second | 1.001 |
from transformers import pipeline
# Initialize the emotion classification pipeline
classifier = pipeline(
"text-classification",
model="Sidharthan/roberta-base-conv-emotion"
)
# Classify emotion in a conversation
text = "I'm feeling really frustrated with work lately."
result = classifier(text)
print(result)
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
# Load the model and tokenizer
model_name = "Sidharthan/roberta-base-conv-emotion"
model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Prepare input
text = "I'm feeling really frustrated with work lately."
inputs = tokenizer(text, return_tensors="pt")
# Predict
with torch.no_grad():
outputs = model(**inputs)
predictions = torch.softmax(outputs.logits, dim=1)
predicted_class = torch.argmax(predictions, dim=1)
Apache 2.0
@misc{roberta-base-conv-emotion,
title={RoBERTa Fine-Tuned on Empathetic Dialogues},
author={Sidharthan},
year={2024},
publisher={Hugging Face}
}
For more information, please contact the model's author.