Text Classification
Transformers
Safetensors
English
distilbert
fake
real
news
text-embeddings-inference
Instructions to use KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier") model = AutoModelForSequenceClassification.from_pretrained("KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier") - Notebooks
- Google Colab
- Kaggle
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier")
model = AutoModelForSequenceClassification.from_pretrained("KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier")Quick Links
DistilBERT Fake News Classifier
Model Description
This DistilBERT-based model achieves 97.18% accuracy in classifying news articles as real or fake, with balanced precision (97.17%) and recall (97.30%).
Training Performance
| Epoch | Training Loss | Validation Loss | Accuracy | F1 Score |
|---|---|---|---|---|
| 1 | - | 0.1115 | 96.08% | 96.09% |
| 2 | 0.2026 | 0.1077 | 97.25% | 97.28% |
| 3 | 0.0647 | 0.1119 | 97.45% | 97.50% |
Final Test Results
| Metric | Score |
|---|---|
| Accuracy | 97.18% |
| F1 Score | 97.23% |
| Precision | 97.17% |
| Recall | 97.30% |
Usage
from transformers import pipeline
classifier = pipeline("text-classification",
model="KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier")
result = classifier("Scientists confirm climate change accelerating beyond previous estimates")
# Output: {'label': 'REAL', 'score': 0.982}
- Downloads last month
- 4
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="KenLumod/ML-Project-DistilBERT-Fake-and-Real-Classifier")