Downloads · 30 days
8
5% of all-time downloads
zhafyz/arabic-fake-news-arbert-afnd
arabic-fake-news-arbert-afnd is a text classification model from zhafyz. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
Fine-tuned UBC-NLP/ARBERT on the AFND dataset (600k+ Arabic news articles). Classifies Arabic news text as credible or notcredible.
Downloads · 30 days
8
5% of all-time downloads
All-time downloads
168
Public
Parameters
163M
651 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors651 MB · 100%
From the Hugging Face model README
Fine-tuned UBC-NLP/ARBERT on the AFND dataset (600k+ Arabic news articles).
Classifies Arabic news text as credible or not_credible.
Best for: Formal Modern Standard Arabic (MSA) news articles.
Reference benchmark: 98.8% accuracy (Nassif et al. 2022)
from transformers import pipeline
import pyarabic.araby as araby, re
def clean(text):
text = re.sub(r'http\S+|<[^>]+>|[@#]', ' ', text)
text = araby.strip_tashkeel(text)
text = araby.strip_tatweel(text)
text = araby.normalize_alef(text)
text = araby.normalize_teh(text)
text = re.sub(r'[^\u0600-\u06FF0-9\s]', ' ', text)
return re.sub(r'\s+', ' ', text).strip()
clf = pipeline('text-classification', model='YOUR_HF_USERNAME/arabic-fake-news-arbert-afnd')
result = clf(clean('نص الخبر العربي هنا...'))
| Metric | Score |
|---|---|
| Accuracy | ~98% |
| F1 (macro) | ~97% |