Views
No views yet
nreimers/mMiniLMv2-L6-H384-distilled-from-XLMR-Large0 = fake (tin giả), 1 = real (tin thật)| Split | Score |
|---|---|
| VI test (F1-macro) | 0.8262 |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4REPO = "phuy1125/mminilm-l6-fakenews-kd"
5tok = AutoTokenizer.from_pretrained(REPO, trust_remote_code=True)
6model = AutoModelForSequenceClassification.from_pretrained(REPO, trust_remote_code=True).eval()
7
8# Input format used in training: "claim | evidence" (drop the pipe if one side is empty)
9text = "Một tuyên bố cần kiểm chứng | bằng chứng liên quan"
10enc = tok(text, truncation=True, max_length=256, return_tensors="pt")
11with torch.no_grad():
12 logits = model(**enc).logits
13pred = int(logits.argmax(-1))
14print(model.config.id2label[pred]) # 'fake' or 'real'Note: training used head-tail truncation (ids[:127] + ids[-127:]) atmax_length=256. Plain truncation above is fine for most short inputs.