Downloads · 30 days
14
13% of all-time downloads
visolex/emotion-mbert
emotion-mbert is a text classification model from visolex. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This model is a fine-tuned version of bert-base-multilingual-cased on the VSMEC dataset for emotion recognition in Vietnamese text.
Downloads · 30 days
14
13% of all-time downloads
All-time downloads
104
Public
Parameters
178M
2.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.pt1.4 GB · 67%
From the Hugging Face model README
This model is a fine-tuned version of bert-base-multilingual-cased on the VSMEC dataset for emotion recognition in Vietnamese text.
322e-51002560.01500The model was trained on the VSMEC dataset, which contains 6,927 Vietnamese social media text samples annotated with emotion labels. The dataset includes the following emotion categories:
The model was evaluated using the following metrics:
0.00000.00000.00000.0000You can use this model for emotion recognition in Vietnamese text. Below is an example of how to use it with the HuggingFace Transformers library:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("visolex/emotion-mbert")
model = AutoModelForSequenceClassification.from_pretrained("visolex/emotion-mbert")
# Example text
text = "Tôi rất vui vì hôm nay trời đẹp!"
# Tokenize
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
# Predict
outputs = model(**inputs)
predicted_class = outputs.logits.argmax(dim=-1).item()
# Map to emotion name
emotion_map = {
0: "Enjoyment",
1: "Sadness",
2: "Anger",
3: "Fear",
4: "Disgust",
5: "Surprise",
6: "Other"
}
predicted_emotion = emotion_map[predicted_class]
print(f"Text: {text}")
print(f"Predicted emotion: {predicted_emotion}")
This model is released under the Apache-2.0 license.