Safetensors
English

LLaMA-3.2B Fine-tuned for Emotion Classification (SemEval 2025)

This model is a fine-tuned version of meta-llama/Llama-3.2-3B for emotion classification on English text. It has been trained on the SemEval 2025 dataset to detect the presence of five key emotions in text: anger, fear, joy, sadness, and surprise.


Model Details

Model Description

This model classifies emotions in English text. It outputs the probability of five emotions (anger, fear, joy, sadness, surprise) for each input sentence.

  • Model type: Transformer-based (LLaMA architecture)
  • Language(s): English
  • Finetuned from model: meta-llama/Llama-3.2-3B

Model Sources


Uses

Direct Use

This model can be used to classify the emotions in any English text. The model outputs probabilities for five emotions, with higher values indicating stronger predictions.

Out-of-Scope Use

This model is not suitable for non-English text or highly specific emotion subcategories.


Bias, Risks, and Limitations

This model may misclassify emotions in texts with sarcasm, irony, or cultural nuances not well represented in the training data. The model also has limitations when applied to texts outside of the SemEval dataset's domain.


How to Get Started with the Model

You can load the model using Hugging Face's transformers library:

from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch

# Load the model and tokenizer
model = AutoModelForSequenceClassification.from_pretrained("gsi-upm/llama-3b-emotion-classifier", num_labels=5)
tokenizer = AutoTokenizer.from_pretrained("gsi-upm/llama-3b-emotion-classifier")

# Input text
text = "I just got a promotion and I feel amazing!"

# Tokenize the input
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)

# Predict emotions
with torch.no_grad():
    logits = model(**inputs).logits
    probs = torch.sigmoid(logits)

# Display results
labels = ['anger', 'fear', 'joy', 'sadness', 'surprise']
results = {label: float(prob) for label, prob in zip(labels, probs[0])}
print(results)

Output Format

The model outputs a dictionary of emotion probabilities:

{
  'anger': 0.02,
  'fear': 0.10,
  'joy': 0.91,
  'sadness': 0.05,
  'surprise': 0.23
}

Training Details

Training Data

The model was trained on the SemEval 2025 dataset, which consists of English text with labeled emotions.

  • Labels: anger, fear, joy, sadness, surprise

Evaluation

The model was evaluated on a held-out test set from the SemEval 2025 dataset using accuracy, precision, recall, and F1-score for each emotion class.

Results

  • Precision: 0.7713
  • Recall: 0.6607
  • Weighted F1-score: 0.7421

Citation

If you use this model, please cite the following:

BibTeX:

@misc{llama-emotion-classifier,
  author = {GSI-UPM},
  title = {LLaMA-3.2B Fine-tuned for Emotion Classification},
  year = {2025},
  publisher = {Hugging Face},
  url = {https://huggingface.co/gsi-upm/llama-3b-emotion-classifier}
}

APA:

Adrián Maldonado Robles. (2025). LLaMA-3.2B Fine-tuned for Emotion Classification. Hugging Face. Available at: https://huggingface.co/gsi-upm/llama-3b-emotion-classifier


Model Card Contact

For questions or inquiries, please contact [[email protected]].

Framework versions

  • PEFT: 0.14.0
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for gsi-upm/llama-3b-emotion-classifier

Finetuned
(261)
this model

Dataset used to train gsi-upm/llama-3b-emotion-classifier