Spaces:
Sleeping
Sleeping
created a README file
Browse files
README.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: DeBERTa+ViT FakeNews
|
| 3 |
+
emoji: 🐠
|
| 4 |
+
colorFrom: pink
|
| 5 |
+
colorTo: purple
|
| 6 |
+
sdk: gradio
|
| 7 |
+
sdk_version: 5.35.0
|
| 8 |
+
app_file: app.py
|
| 9 |
+
pinned: false
|
| 10 |
+
license: mit
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
## Fake News Classifier (DeBERT+ViT)
|
| 17 |
+
|
| 18 |
+
This project focuses on detecting fake news using a multimodal approach that combines a fine-tuned DeBERTa model for text analysis and a Vision Transformer (ViT) model for image classification.
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## ⚠️Disclaimer
|
| 23 |
+
|
| 24 |
+
- This project is for **educational and experimental purposes only**.
|
| 25 |
+
- It is **not suitable for real-world fact-checking** or serious decision-making.
|
| 26 |
+
- The system classifies content based on learned patterns, not actual truth or factual accuracy.
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Project Overview
|
| 31 |
+
|
| 32 |
+
This fake news classifier was built as part of a research internship to:
|
| 33 |
+
|
| 34 |
+
- This project explores fake news detection using a multimodal approach, combining both text and image analysis.
|
| 35 |
+
- It utilizes DeBERTa for binary classification of news content and Vision Transformer (ViT) for evaluating associated images.
|
| 36 |
+
- The system is trained on labeled datasets from Kaggle and Hugging Face, aiming to improve detection accuracy by analyzing both linguistic and visual patterns.
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
# 🧠 How it Works
|
| 41 |
+
|
| 42 |
+
*DeBERTa Model*
|
| 43 |
+
|
| 44 |
+
- A *DeBERTa-based model* was fine-tuned on labeled news text for fake news detection.
|
| 45 |
+
- Input text was preprocessed and tokenized using DebertaTokenizer.
|
| 46 |
+
- The model performs binary classification, where *0=Fake and 1=Real*
|
| 47 |
+
|
| 48 |
+
*ViT Model*
|
| 49 |
+
|
| 50 |
+
- A *Vision Transformer model* was fine-tuned on real vs fake news images using the vit-base-patch16-224-in21k checkpoint.
|
| 51 |
+
- Images were preprocessed into patches using ViTImageProcessor and passed through the model for binary classification.
|
| 52 |
+
- Outputs are binary class predictions where *0 = Fake, 1 = Real*.
|
| 53 |
+
|
| 54 |
+
---
|
| 55 |
+
|
| 56 |
+
## 🛠Libraries Used
|
| 57 |
+
|
| 58 |
+
- `transformers`
|
| 59 |
+
- `datasets`
|
| 60 |
+
- `torch`
|
| 61 |
+
- `scikit-learn`
|
| 62 |
+
- `pandas`
|
| 63 |
+
- `nltk` (optional preprocessing)
|
| 64 |
+
- TorchVision
|
| 65 |
+
|
| 66 |
+
---
|