This project aims to detect whether a given news article is fake or reliable using a hybrid machine learning approach. The system combines the strengths of:
- 🔮 Deep Learning LSTM Classifier
- 🔍 K-means Clustering Model
- 🧠 Naive Bayes Classifier for merging predictions.
The model is deployed using Shiny for Python, allowing users to:
- Input news articles 📰.
- Receive predictions on authenticity ✅/❌.
- View LIME explanations for interpretability ✨.
- Hybrid System:
- 🔮 LSTM Classifier for advanced text classification.
- 📊 K-means Clustering for article grouping.
- 🧠 Naive Bayes Classifier for combining model predictions.
- Interactive Interface: Built with Shiny for Python.
- Detailed Predictions:
- 🔵 Probabilities for "Real" vs "Fake."
- 🔦 LIME explanations highlighting key phrases influencing predictions.
- Shiny for Python: Interactive user interface.
- Deep Learning (LSTM): Text classification backbone.
- K-means Clustering: For unsupervised grouping.
- Naive Bayes Classifier: For merging results.
- LIME: To explain model decisions.
- Clone the repository:
git clone https://github.com/FestusNzuma/hybrid-fake-news-detection.git
- Install Python dependencies:
pip install tensorflow shiny lime
- Run the Shiny app:
shiny run --app app.py
- Launch the app using the command above.
- Paste or type a news article in the input box 🖊️.
- Review the output:
- Prediction: Real or Fake 🟢/🔴.
- Probabilities: Confidence levels 📈.
- LIME Explanation: Highlights the words contributing to the prediction 🔦.
- Predictions for long articles may take more time.
- The model was trained on articles approximately 200 words long, so similar lengths are recommended for optimal performance.
The app is live and can be accessed here: Hybrid Fake News Detection App.
We welcome contributions! Here's how to get started:
- Fork the Repository 📤.
- Create a feature branch:
git checkout -b feature-name
- Commit your changes:
git commit -m "Add new feature"
- Push to the branch:
git push origin feature-name
- Submit a Pull Request 📬.
This project is licensed under the MIT License.
Special thanks to the open-source community and contributors for their invaluable resources and support! 🌟