Spaces:
Running
Running
title: Fake News Detector | |
emoji: π | |
colorFrom: purple | |
colorTo: blue | |
sdk: gradio | |
sdk_version: 5.33.0 | |
app_file: app.py | |
pinned: false | |
license: mit | |
short_description: 'Detects Fake News using the ensemble of 3 Models ' | |
# π Fake News Detector | |
**Detects Fake News using an ensemble of 3 Models (Naive Bayes, Logistic Regression, and GloVe-based embeddings)** | |
--- | |
## π¨ Important Disclaimer | |
> β οΈ This project is built purely for **educational and experimental purposes** to explore basic Natural Language Processing (NLP) and Machine Learning (ML) techniques. | |
> | |
> β It is **not suitable for real-world fact-checking or decision-making**. | |
> | |
> The models used are simple, non-contextual, and cannot understand language nuances or factual correctness. Misusing this tool for serious analysis may lead to incorrect or harmful conclusions. | |
> | |
> **Please do not trust or rely on the outputs of this demo.** It is meant for **learning only.** | |
--- | |
## π― Purpose | |
This project was created as a part of our research internship as a way to: | |
- Practice building an ensemble model using different NLP approaches | |
- Learn to deploy ML apps with Gradio and Hugging Face Spaces | |
- Experiment with basic text classification on news headlines/articles | |
It is **not** a robust or reliable system for determining truth or accuracy in media. | |
--- | |
## βοΈ How It Works | |
This Fake News Detector uses an ensemble of 3 models: | |
1. **Naive Bayes with TF-IDF** β assigns 55% weight | |
2. **Logistic Regression** β assigns 10% weight | |
3. **GloVe Embedding-Based Classifier** β assigns 35% weight | |
Each model contributes a score between 0 and 1 indicating the likelihood of the input text being "Real." The final prediction is based on a weighted average. | |
--- | |
## π License & Attribution | |
This project is licensed under the **MIT License**. | |
### Libraries and Tools Used: | |
- π§ [GloVe Embeddings by Stanford NLP](https://nlp.stanford.edu/projects/glove/) | |
- π [Gradio Interface Library](https://www.gradio.app/) | |
- π [scikit-learn](https://scikit-learn.org/) for model implementation | |
- π [NLTK](https://www.nltk.org/) for basic NLP preprocessing | |
- [Dataset](https://www.kaggle.com/datasets/stevenpeutz/misinformation-fake-news-text-dataset-79k) | |
## π¦ Installation | |
```bash | |
pip install -r requirements.txt | |
python app.py | |