Model Card: RoBERTa Fine-Tuned on Empathetic Dialogues

Model Description

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.

Emotion Classes

The model is trained to classify conversations into the following emotional categories:

  • Surprised
  • Angry
  • Sad
  • Joyful
  • Anxious
  • Hopeful
  • Confident
  • Disappointed

Model Details

  • Base Model: roberta-base
  • Task: Emotion Classification in Conversations
  • Dataset: Empathetic Dialogues
  • Training Approach: Full Fine-Tuning
  • Number of Emotion Classes: 8

Model Performance

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

Usage

Hugging Face Transformers Pipeline

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)

Direct Model Loading

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)

Limitations

  • Performance may vary with out-of-domain conversational contexts
  • Emotion classification limited to the 8 specified emotional categories
  • Relies on the specific emotional nuances in the Empathetic Dialogues dataset
  • Requires careful interpretation in real-world applications

Ethical Considerations

  • Emotion classification can be subjective
  • Potential for bias based on training data
  • Should not be used for making critical decisions about individuals

License

Apache 2.0

Citations

@misc{roberta-base-conv-emotion,
  title={RoBERTa Fine-Tuned on Empathetic Dialogues},
  author={Sidharthan},
  year={2024},
  publisher={Hugging Face}
}

Contact

For more information, please contact the model's author.

Downloads last month
108
Safetensors
Model size
125M params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for Sidharthan/roberta-base-conv-emotion

Finetuned
(1375)
this model

Dataset used to train Sidharthan/roberta-base-conv-emotion