Create README.md
#1
by
Pulk17
- opened
README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- Pulk17/Fake-News-Detection-dataset
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
metrics:
|
| 8 |
+
- accuracy
|
| 9 |
+
- precision
|
| 10 |
+
- recall
|
| 11 |
+
base_model:
|
| 12 |
+
- google-bert/bert-base-uncased
|
| 13 |
+
pipeline_tag: text-classification
|
| 14 |
+
library_name: transformers
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# Fake News Detection Model
|
| 18 |
+
|
| 19 |
+
## Model Overview
|
| 20 |
+
|
| 21 |
+
This model is designed to classify news articles as real or fake based on their textual content. It uses a BERT-based transformer model (`bert-base-uncased`) fine-tuned on a custom dataset of news articles. The model predicts whether a given article is fake or real with high accuracy.
|
| 22 |
+
|
| 23 |
+
## Model License
|
| 24 |
+
|
| 25 |
+
This model is licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0).
|
| 26 |
+
|
| 27 |
+
## Datasets Used
|
| 28 |
+
|
| 29 |
+
The model was trained on a variety of datasets, including:
|
| 30 |
+
- **Fake News Dataset**: Contains labeled news articles with "fake" or "real" classifications.
|
| 31 |
+
- **News Articles Dataset**: A collection of news articles used for training and validation.
|
| 32 |
+
|
| 33 |
+
## Languages
|
| 34 |
+
|
| 35 |
+
The model primarily works with English-language news articles, but it could be extended to other languages with appropriate data.
|
| 36 |
+
|
| 37 |
+
## Metrics
|
| 38 |
+
|
| 39 |
+
The model's performance was evaluated on the following metrics:
|
| 40 |
+
- **Accuracy**: 99.58%
|
| 41 |
+
- **Precision**: 99.27%
|
| 42 |
+
- **Recall**: 99.88%
|
| 43 |
+
- **ROC-AUC**: 99.99%
|
| 44 |
+
- **F1-Score**: 99.57%
|
| 45 |
+
|
| 46 |
+
## Model Details
|
| 47 |
+
|
| 48 |
+
- **Base Model**: `bert-base-uncased`
|
| 49 |
+
- **Fine-Tuning**: The model was fine-tuned on a news dataset with labeled examples of real and fake news.
|
| 50 |
+
- **Training Epochs**: 3
|
| 51 |
+
- **Batch Size**: 32
|
| 52 |
+
- **Optimizer**: Adam with weight decay
|
| 53 |
+
- **Learning Rate**: 2e-5
|
| 54 |
+
|
| 55 |
+
## Usage
|
| 56 |
+
|
| 57 |
+
To use this model, you can interact with it via the Hugging Face Inference API or integrate it into your Python-based applications.
|
| 58 |
+
|
| 59 |
+
Example code for inference:
|
| 60 |
+
```python
|
| 61 |
+
import requests
|
| 62 |
+
|
| 63 |
+
url = "https://api-inference.huggingface.co/models/your-username/fake-news-bert"
|
| 64 |
+
headers = {"Authorization": "Bearer YOUR_HUGGINGFACE_API_KEY"}
|
| 65 |
+
payload = {"inputs": "The news article content here"}
|
| 66 |
+
|
| 67 |
+
response = requests.post(url, headers=headers, json=payload)
|
| 68 |
+
prediction = response.json()
|
| 69 |
+
|
| 70 |
+
print(f"Prediction: {prediction}")
|