Downloads · 30 days
9
20% of all-time downloads
benzrshf/thai-sentiment-phayabert
thai-sentiment-phayabert is a machine learning model from benzrshf. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Fine-tuned PhayaThaiBERT for Thai sentiment classification.
Downloads · 30 days
9
20% of all-time downloads
All-time downloads
44
Public
Parameters
277M
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
Fine-tuned PhayaThaiBERT for Thai sentiment classification.
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
model = AutoModelForSequenceClassification.from_pretrained("yourusername/thai-sentiment-phayabert")
tokenizer = AutoTokenizer.from_pretrained("yourusername/thai-sentiment-phayabert")
text = "อาหารอร่อยมาก"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1).item()
labels = {0: "positive", 1: "neutral", 2: "negative"}
print(labels[prediction]) # positive