Fake News Detection Model
This model is trained to detect fake news articles using DistilBERT.
Training Data
The model was trained on a dataset of fake and real news articles. The dataset was preprocessed to remove irrelevant information and to balance the classes.
Performance
The model was evaluated using 5-fold cross-validation. The average metrics across all folds are as follows:
Metric | Value |
---|---|
Accuracy | 0.973 |
Precision | 0.962 |
Recall | 0.986 |
F1 | 0.973 |
ROC AUC | 0.973 |
Usage
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("HugMi/M3-Assignment2")
model = AutoModelForSequenceClassification.from_pretrained("HugMi/M3-Assignment2")
def classify_text(text):
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
predicted_class = outputs.logits.argmax().item()
return predicted_class # 0 for fake, 1 for real
---
- Downloads last month
- 15
Inference Providers
NEW
This model isn't deployed by any Inference Provider.
๐
Ask for provider support
HF Inference deployability: The model has no library tag.