Downloads · 30 days
23
53% of all-time downloads
roblesadrian/llama-3b-emotion-classifier
llama-3b-emotion-classifier is a machine learning model from roblesadrian. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
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, fea…
Downloads · 30 days
23
53% of all-time downloads
All-time downloads
43
Public
Parameters
3.2B
12.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors12.9 GB · 100%
From the Hugging Face model README
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.
This model classifies emotions in English text. It outputs the probability of five emotions (anger, fear, joy, sadness, surprise) for each input sentence.
meta-llama/Llama-3.2-3BThis 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.
This model is not suitable for non-English text or highly specific emotion subcategories.
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.
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("roblesadrian/llama-3b-emotion-classifier", num_labels=5)
tokenizer = AutoTokenizer.from_pretrained("roblesadrian/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)
The model outputs a dictionary of emotion probabilities:
{
'anger': 0.02,
'fear': 0.10,
'joy': 0.91,
'sadness': 0.05,
'surprise': 0.23
}
The model was trained on the SemEval 2025 dataset, which consists of English text with labeled emotions.
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.
If you use this model, please cite the following:
BibTeX:
@misc{llama-emotion-classifier,
author = {Adrián Maldonado Robles},
title = {LLaMA-3.2B Fine-tuned for Emotion Classification},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/roblesadrian/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/roblesadrian/llama-3b-emotion-classifier
For questions or inquiries, please contact [[email protected]].