Views
No views yet
airesearch/wangchanberta-base-att-spm-uncased: BERT ภาษาไทยจาก AIResearchscam (1) และ not scam (0)| Metric | Score |
|---|---|
| Accuracy | 86% |
| Precision | 91% (not scam), 82% (scam) |
| Recall | 80% (not scam), 92% (scam) |
| F1-score | 85% (not scam), 87% (scam) |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model = AutoModelForSequenceClassification.from_pretrained("your_username/thai-scam-detector-v1")
5tokenizer = AutoTokenizer.from_pretrained("your_username/thai-scam-detector-v1")
6
7text = "คุณได้รับรางวัลมูลค่า 1 ล้านบาท กรุณาโอนค่าธรรมเนียมเพื่อยืนยันรับรางวัล"
8inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
9
10with torch.no_grad():
11 logits = model(**inputs).logits
12 prediction = torch.argmax(logits, dim=1).item()
13
14print("Scam" if prediction == 1 else "Not Scam")