tridm/UIT-VSMEC
Viewer • Updated • 6.93k • 179 • 3
How to use BaoNhan/mbert-UITVSMEC with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="BaoNhan/mbert-UITVSMEC") # Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("BaoNhan/mbert-UITVSMEC")
model = AutoModelForSequenceClassification.from_pretrained("BaoNhan/mbert-UITVSMEC", device_map="auto")This model is bert-base-multilingual-cased fine-tuned for UIT-VSMEC emotion recognition on UIT-VSMEC.
best_model from seed 42, selected by development Macro-F1.Metrics are reported as mean ± sample standard deviation over the completed seeds listed above.
| Metric | Mean ± std |
|---|---|
| Test Macro-F1 | 0.4270 ± 0.0063 |
| Test accuracy | 0.5286 ± 0.0058 |
| Test macro precision | 0.4717 ± 0.0118 |
| Test macro recall | 0.4188 ± 0.0062 |
| Development Macro-F1 | 0.4061 ± 0.0112 |
| seed | dev_macro_f1 | test_macro_f1 | test_accuracy |
|---|---|---|---|
| 22.000000 | 0.393204 | 0.420134 | 0.522367 |
| 42.000000 | 0.414044 | 0.432377 | 0.529582 |
| 202.000000 | 0.410958 | 0.428554 | 0.533911 |
{
"0": "Anger",
"1": "Disgust",
"2": "Enjoyment",
"3": "Fear",
"4": "Other",
"5": "Sadness",
"6": "Surprise"
}
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
model_id = "BaoNhan/mbert-UITVSMEC"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_fast=False)
model = AutoModelForSequenceClassification.from_pretrained(model_id)
text = "Đây là nội dung tiếng Việt cần phân loại."
inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=256)
with torch.no_grad():
probabilities = model(**inputs).logits.softmax(dim=-1)[0]
predicted_id = int(probabilities.argmax())
print(model.config.id2label[predicted_id], probabilities.tolist())
aggregate_metrics.json: aggregate metrics and publishing metadata.artifacts/per_seed_results.csv: available completed-seed results.UIT-VSMEC is small and class-imbalanced and reflects Vietnamese social-media language from a particular collection period. Emotion labels are subjective, and predictions must not be treated as psychological assessment.
@inproceedings{ho-etal-2019-emotion,
title={Emotion Recognition for Vietnamese Social Media Text},
author={Ho, Vong Anh and Nguyen, Duong Huynh-Cong and Nguyen, Danh Hoang and Pham, Linh Thi-Van and Nguyen, Duc-Vu and Nguyen, Kiet Van and Nguyen, Ngan Luu-Thuy},
booktitle={Proceedings of the 16th International Conference of the Pacific Association for Computational Linguistics (PACLING 2019)},
year={2019},
pages={319--333},
url={https://arxiv.org/abs/1911.09339}
}
Base model
google-bert/bert-base-multilingual-cased