adityaG04/fake-news-bert-finetuned
07
language: en license: mit tags:
- fake-news-detection
- roberta
- text-classification
- transfer-learning datasets:
- GonzaloA/fake_news metrics:
- accuracy
- f1 pipeline_tag: text-classification model-index:
- name: fake-news-bert-finetuned results:
- task: type: text-classification name: Fake News Detection dataset: name: GonzaloA/fakenews type: GonzaloA/fakenews metrics:
- type: accuracy value: 0.98
- type: f1 value: 0.98 ---
🔬 Fake News Detector (Fine-Tuned RoBERTa)
A RoBERTa-based fake news classifier fine-tuned using transfer learning.
Model Details
Training Details
- Method: Transfer learning with layer freezing
- Frozen Layers: Layers 0-5 (embeddings + first 6 encoder layers)
- Trainable Layers: Layers 6-11 + Classification head
- Learning Rate: 2e-5 with cosine scheduler
- Batch Size: 32 (effective)
- Epochs: 5 with early stopping (patience=2)
- Optimizer: AdamW with weight decay 0.01
Usage
from transformers import pipeline
classifier = pipeline("text-classification", model="adityaG04/fake-news-bert-finetuned")
# Test with a real news article
result = classifier("The Federal Reserve raised interest rates by 0.25 percentage points on Wednesday.")
print(result)
# [{'label': 'LABEL_1', 'score': 0.99}] → REAL ✅
# Test with a fake article
result = classifier("BREAKING: Scientists confirm drinking bleach cures all diseases!")
print(result)
# [{'label': 'LABEL_0', 'score': 0.98}] → FAKE 🔴 