Downloads · 30 days
20
1% of all-time downloads
emilyyy04/burmese-sentiment-xlm-roberta
burmese-sentiment-xlm-roberta is a text classification model from emilyyy04. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
This model is a fine-tuned version of FacebookAI/xlm-roberta-base for Burmese sentiment analysis. It classifies Burmese text into one of three sentiment categories: - Positive - Negative - Neutral
Downloads · 30 days
20
1% of all-time downloads
All-time downloads
1.6K
Public
Parameters
278M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 98%
From the Hugging Face model README
This model is a fine-tuned version of FacebookAI/xlm-roberta-base for Burmese sentiment analysis.
It classifies Burmese text into one of three sentiment categories:
The model was trained using publicly available Burmese sentiment datasets and additional manually curated data, with careful preprocessing to normalize encoding (Zawgyi → Unicode conversion).
my), with multilingual base model supportSources:
kalixlouiis/burmese-sentiment-analysischuuhtetnaing/myanmar-social-media-sentiment-analysis-datasetPreprocessing:
max_length=128Trainer)The model was evaluated on a held-out validation set using accuracy, precision, recall, and F1 score.
| Epoch | Val Loss | Accuracy | Precision | Recall | F1 |
|---|---|---|---|---|---|
| 1 | 0.6171 | 0.7859 | 0.7994 | 0.7859 | 0.7875 |
| 2 | 0.4268 | 0.8470 | 0.8465 | 0.8470 | 0.8464 |
| 3 | 0.4115 | 0.8451 | 0.8447 | 0.8451 | 0.8448 |
The final model used is the checkpoint with the highest F1 score.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model_name = "emilyyy04/burmese-sentiment-xlm-roberta" # Replace with actual repo name
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
text = "ဒီဇာတ်လမ်းက တကယ်ကောင်းတယ်။"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
outputs = model(**inputs)
predicted_class = torch.argmax(outputs.logits, dim=1).item()
label_map = {0: "positive", 1: "negative", 2: "neutral"}
print("Predicted Sentiment:", label_map[predicted_class])