Thai Sentiment Analysis - PhayaThaiBERT

Fine-tuned PhayaThaiBERT for Thai sentiment classification.

Model Details

  • Base Model: PhayaThaiBERT (110M parameters)
  • Task: 3-class sentiment (positive/neutral/negative)
  • Dataset: Wisesight Sentiment (21k training samples)
  • Performance: 82% accuracy, 0.81 weighted F1

Usage

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
Downloads last month
20
Safetensors
Model size
0.3B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Dataset used to train SiemonCha/thai-sentiment-phayabert

Space using SiemonCha/thai-sentiment-phayabert 1

Evaluation results