|
--- |
|
library_name: transformers |
|
pipeline_tag: text-classification |
|
datasets: |
|
- EXt1/Thai-True-Fake-News |
|
language: |
|
- th |
|
metrics: |
|
- accuracy |
|
base_model: |
|
- microsoft/mdeberta-v3-base |
|
--- |
|
|
|
# mdeberta-v3-base-thai-fakenews |
|
|
|
This model is a fine-tuned version of the microsoft/mdeberta-v3-base model. It was fine-tuned using the EXt1/Thai-True-Fake-News dataset, a collection of Thai news articles labeled as either real or fake. The model is designed for fake news detection in the Thai language, achieving an accuracy of 91% on a test set. This model is part of the senior project of CPE35 students at King Mongkut's University of Technology Thonburi (KMUTT). |
|
|
|
### Model Description |
|
|
|
- **Base Mode: `microsoft/mdeberta-v3-base`** |
|
- **Dataset: `EXt1/Thai-True-Fake-News`** |
|
- **Model Size: 279M parameters** |
|
- **Language: Thai** |
|
- **Labels:** |
|
- 0: True News |
|
- 1: Fake News |
|
|
|
### Evaluation Results |
|
- **Loss: 0.25065** |
|
- **Accuracy: 91% on the test set** |
|
|
|
### Usage |
|
``` |
|
from transformers import AutoTokenizer, AutoModelForSequenceClassification |
|
import torch |
|
|
|
tokenizer = AutoTokenizer.from_pretrained("EXt1/mdeberta-v3-base-thai-fakenews") |
|
model = AutoModelForSequenceClassification.from_pretrained("EXt1/mdeberta-v3-base-thai-fakenews") |
|
|
|
text = "M-Flow ส่ง SMS แจ้งให้ชำระค่าปรับจราจรด้วยการคลิกลิงก์" |
|
|
|
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True) |
|
|
|
with torch.no_grad(): |
|
logits = model(**inputs).logits |
|
|
|
predicted_class = torch.argmax(logits, dim=1).item() |
|
|
|
if predicted_class == 1: |
|
print("ข่าวปลอม") |
|
else: |
|
print("ข่าวจริง") |
|
|
|
``` |
|
### Use Cases |
|
|
|
This model is designed for text classification tasks, specifically for distinguishing between true and fake news in the Thai language. It can be applied to various use cases, such as: |
|
|
|
- Detecting fake news articles in the Thai language on social media or news websites. |
|
- Supporting news verification systems or automated content moderation tools. |
|
|