Downloads ยท 30 days
7
16% of all-time downloads
anup069/results
results is a text classification model from anup069. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads ยท 30 days
7
16% of all-time downloads
All-time downloads
45
Public
Parameters
67M
268 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors268 MB ยท 100%
From the Hugging Face model README
๐ฐ Fake News Detection with Fine-Tuned DistilBERT
This repository contains a fine-tuned version of DistilBERT for fake news detection, trained on the LIAR dataset. The model predicts credibility scores on a scale of 0 to 5, rather than just a binary classification.
This model is a fine-tuned version of distilbert-base-uncased on the fake.csv & true.csv (Binary classification) dataset. It achieves the following results on the evaluation set:
Model: Fine-tuned DistilBERT (distilbert-base-uncased)
Dataset: fake.csv & true.csv (Binary classification)
Labels:
0 โ Real News ๐ฐ
1 โ Fake News ๐จ
Use Case: Detect misinformation and classify news as real or fake Deployment: Hosted on Hugging Face and accessible via FastAPI
๐ https://huggingface.co/anup069/results
โ Intended Uses
Fake News Detection: Classifies news articles as FAKE (1) or REAL (0).
Misinformation Analysis: Helps identify misleading or fabricated news.
News Verification Tools: Can be integrated into fact-checking websites, browser extensions, or news aggregator platforms.
Educational Purposes: Useful for research and academic projects on NLP and misinformation detection.
More information needed
โ ๏ธ Limitations
Limited Dataset: Trained only on fake.csv and true.csv, which may not represent all news sources.
Context Understanding: The model classifies based on text patterns, not fact-checking against external sources.
Adversarial Attacks: It may be fooled by well-crafted fake news.
Bias & Generalization: Might struggle with different writing styles, languages, or new topics outside its training data.
Continuous Updates Needed: Fake news trends evolve, requiring periodic retraining with fresh data.
The model was trained on a binary classification dataset consisting of:
fake.csv โ Contains fake news articles
true.csv โ Contains real news articles
๐น Data Preprocessing
Text Cleaning: Removed special characters, extra spaces, and stopwords.
Tokenization: Used DistilBERT tokenizer to convert text into input tokens.
Label Encoding: Assigned 1 for fake news and 0 for real news.
Train-Test Split: 80% for training, 20% for evaluation.
๐ Evaluation Metrics
The model was evaluated using:
Accuracy
Precision, Recall, F1-score
Loss (Cross-Entropy Loss)
๐น Training Process
Loaded fake.csv and true.csv โ Preprocessed the text
Used Hugging Faceโs Trainer API to fine-tune DistilBERT
Monitored validation loss & accuracy after each epoch
Saved the best-performing model to Hugging Face
The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.0021 | 1.0 | 395 | 0.0089 | 0.9983 |
| 0.0034 | 2.0 | 790 | 0.0008 | 0.9997 |
| 0.0001 | 3.0 | 1185 | 0.0000 | 1.0 |
| 0.0 | 4.0 | 1580 | 0.0006 | 0.9997 |
| 0.0 | 5.0 | 1975 | 0.0001 | 1.0 |
The model is already deployed using FastAPI for real-time predictions.
๐ API Endpoint
๐ Base URL: https://anup069-fake-news-detection-api.hf.space/verify/
๐ How to Use the API
You can send a POST request to the API to classify news as FAKE (1) or REAL (0).
Example Request:
curl -X POST "https://anup069-fake-news-detection-api.hf.space/verify/"
-H "Content-Type: application/json"
-d '{"text": "Breaking news: Scientists discover a new planet!"}'
Example Response:
{ "label": "FAKE", "score": 0.98 }
โ Features
โ๏ธ Real-time inference with low latency
โ๏ธ Scalable & FastAPI-based backend
โ๏ธ Can be integrated into web apps, Chrome extensions, or other platforms