Thai Sentiment WangchanBERTa (normalized)

WangchanBERTa fine-tuned for 4-class sentiment classification (pos / neu / neg / q) on Wisesight Sentiment, trained on text passed through a custom Thai normalizer (normalize_thai()) that collapses elongation, maps emoji to sentiment tags, and corrects slang via a dictionary mined from MultiLexNorm++.

Full project, code, and the normalization pipeline this model is paired with: https://github.com/thitiwutsuk/Thai-Slang-NLP-Normalize

Usage

from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

tokenizer = AutoTokenizer.from_pretrained("thitiwutsuk/thai-sentiment-wangchanberta")
model = AutoModelForSequenceClassification.from_pretrained("thitiwutsuk/thai-sentiment-wangchanberta")

inputs = tokenizer("อาหารอร่อยมาก", return_tensors="pt", truncation=True, max_length=64, padding="max_length")
with torch.no_grad():
    probs = torch.softmax(model(**inputs).logits, dim=-1)
print(probs)  # [pos, neu, neg, q]

Note: for best results, run input text through normalize_thai() from the project repo above before tokenizing — this model was trained on normalized text, not raw text.

Downloads last month
23
Safetensors
Model size
0.1B params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for thitiwutsuk/thai-sentiment-wangchanberta

Finetuned
(65)
this model

Dataset used to train thitiwutsuk/thai-sentiment-wangchanberta