Downloads · 30 days
15
19% of all-time downloads
ZycckZ/phobert-base_SA_finetuned
phobert-base_SA_finetuned is a text classification model from ZycckZ. Use it when you need a label for a piece of text. It is set up for transformers.
This model is a fine-tuned version of vinai/phobert-base for general Sentiment Analysis (SA) on Vietnamese text. It is designed to classify sentences into three emotional categories: Negative, Neutral, and Positive.
Downloads · 30 days
15
19% of all-time downloads
All-time downloads
77
Public
Parameters
135M
540 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors540 MB · 100%
From the Hugging Face model README
This model is a fine-tuned version of vinai/phobert-base for general Sentiment Analysis (SA) on Vietnamese text. It is designed to classify sentences into three emotional categories: Negative, Neutral, and Positive.
The model was trained on a comprehensive collection of Vietnamese sentiment datasets to ensure robustness:
The model was evaluated on a dedicated test set (3166 samples).
| Class | Precision | Recall | F1-Score | Support |
|---|---|---|---|---|
| Negative | 0.94 | 0.97 | 0.96 | 1409 |
| Neutral | 0.73 | 0.49 | 0.59 | 167 |
| Positive | 0.95 | 0.96 | 0.95 | 1590 |
Observations:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
tokenizer = AutoTokenizer.from_pretrained("ZycckZ/phobert-base_SA_finetuned")
model = AutoModelForSequenceClassification.from_pretrained("ZycckZ/phobert-base_SA_finetuned")
text = "Sản phẩm dùng rất tốt, giao hàng nhanh chóng."
inputs = tokenizer(text, return_tensors="pt")
with torch.no_grad():
logits = model(**inputs).logits
predicted_class_id = logits.argmax().item()
# Map: 0: Negative, 1: Neutral, 2: Positive