Bangla fake news classifier (fine-tuned Bangla BERT)
This is the fine-tuned model from the paper "Combating deep-fake news in Bengali: detection and prevention of manipulated social media's content using machine learning" (Md. Jane Alam, Md. Ashikur Rahman Khan, Ishtiaq Ahammad, Abir Hosen, Joysri Rani Das; International Journal of Advanced Computer Research 16(76), 2026, doi:10.19101/IJACR.2025.1570025).
Given a Bangla news article, it returns the probability that the article is fake rather than authentic.
- Interactive demo (runs in the browser): https://huggingface.co/spaces/abir71/bangla-fake-news-demo
Not a fact-checker. The model judges writing style, not truth. Do not use it as proof that an article is true or false.
Model
- Base:
sagorsarker/bangla-bert-base. A linear layer on the final [CLS] embedding gives two logits: 0 = authentic, 1 = fake. This is a custom head, notBertForSequenceClassification, so load it withmodeling_bangla_fake_news.py. - Fine-tuning: 3 epochs, AdamW (learning rate 2e-5, no weight decay), batch size 8, cross-entropy loss, maximum 512 tokens.
- Training data: BanFakeNews (Hossain et al., LREC 2020). All 1,299 fake articles were used, together with 3,900 authentic ones, which keeps the natural ratio of about 1 fake to 3 authentic. The data were split 75/25 into training and test sets.
| File | Contents |
|---|---|
model.safetensors |
full-precision weights (658 MB) |
bert_config/config.json |
BERT encoder configuration |
tokenizer.json, tokenizer_config.json |
WordPiece tokenizer of the base model |
modeling_bangla_fake_news.py |
model class, text cleaning and predict() |
onnx/model_quantized.onnx |
8-bit ONNX copy (165 MB) used by the browser demo |
Usage
pip install torch transformers safetensors huggingface_hub
from huggingface_hub import snapshot_download
import sys
path = snapshot_download("abir71/bangla-fake-news-bert", ignore_patterns=["onnx/*"])
sys.path.insert(0, path)
from modeling_bangla_fake_news import load, predict
model, tokenizer = load(path)
print(predict(model, tokenizer, ["...বাংলা সংবাদের লেখা..."]))
# [{'label': 'fake' or 'authentic', 'p_fake': ...}]
The ONNX file takes input_ids and attention_mask (int64, shape batch × tokens) and returns logits (batch × 2).
It can run with onnxruntime or onnxruntime-web.
Evaluation (paper, held-out test set)
| Metric | Value |
|---|---|
| Accuracy | 94.49 % |
| F1-score (fake class) | 89.03 % |
| Recall (fake class) | 90.28 % |
| ROC-AUC | 98.36 % |
The paper's classical baselines on the same data were:
- logistic regression: 91.38 % accuracy, 80.95 % F1;
- random forest: 90.23 % accuracy.
The 8-bit ONNX copy gave the same label as the full model on 120 checked articles, with fake-class probabilities within 0.06.
Limitations
- Source and style shortcuts. Most fake articles in BanFakeNews come from a few satire and clickbait sites (for example earki.com, channeldhaka.news and motikontho.wordpress.com). The model can therefore partly recognise their style, vocabulary and topics instead of falsehood itself.
- Time shift. The articles are mostly from around 2018, so newer events, names and writing styles may confuse the model.
- Base rate. The model was trained and tested at about 1 fake per 3 authentic articles. Fake news is far rarer in real news streams, so many "fake" flags on new articles will be false alarms.
- Input type. Headlines alone, very short texts and social-media posts were not part of training.
- Length. Only the first 512 tokens of an article are read.
Citation
Alam MJ, Khan MAR, Ahammad I, Hosen A, Das JR. Combating deep-fake news in Bengali: detection and prevention of manipulated social media's content using machine learning. International Journal of Advanced Computer Research. 2026;16(76). doi:10.19101/IJACR.2025.1570025
Dataset: Hossain MZ, Rahman MA, Islam MS, Kar S. BanFakeNews: A dataset for detecting fake news in Bangla. LREC 2020.