A real-time fake news detection web application built using a fine-tuned BERT model with an elegant Streamlit interface. The system supports manual input and URL-based article analysis with multilingual support and clean visual feedback.
The Fake News Detection Web Application is a locally deployed tool that uses traditional machine learning algorithms like Logistic Regression and Random Forest to classify news articles as real or fake. It offers a simple web interface for real-time predictions, aiming to combat misinformation and promote media awareness.
- π§ BERT-based classification of news articles as Fake or Real
- π URL scraping using
newspaper3kand auto language detection - β¨ Real-time feedback with model-wise comparison: Logistic Regression, Random Forest, SVM, Naive Bayes, and BERT
- π Dynamic confidence bars (green = Real, red = Fake)
- π Auto-translation for non-English news using Google Translate
- π± Streamlit-powered UI with dark mode and modern UX
- Frontend: Streamlit
- ML Models:
- Logistic Regression
- Random Forest
- Naive Bayes
- SVM
- BERT (
transformersby HuggingFace)
- Vectorizers:
TfidfVectorizer,CountVectorizer - Tools:
joblib,torch,langdetect,deep-translator,newspaper3k
git clone https://github.com/PankajMahanto/FakeNewsDetection.git
cd FakeNewsDetectionpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
bash
pip install -r requirements.txt
bash
streamlit run app.py
bash
|ββ .gitattributes
|ββ app.ipynb
|ββ app.py
|ββ app_rf.ipynb
|ββ bert_fakenews
| |ββ config.json
| |ββ model.safetensors
| |ββ special_tokens_map.json
| |ββ tokenizer.json
| |ββ tokenizer_config.json
| |ββ vocab.txt
|ββ bert_fakenews_vs.ipynb
|ββ copy-app.py
|ββ Datasets
| |ββ Fake.csv
| |ββ True.csv
|ββ Datasets.zip
|ββ lr_model.jb
|ββ model.jb
|ββ model_load.ipynb
|ββ nb_model.jb
|ββ r.md
|ββ requirements.txt
|ββ rf_model.jb
|ββ rf_model.zip
|ββ svm_model.jb
|ββ tfidf_vectorizer.jb
|ββ train_bert.py
|ββ train_bert_news.ipynb
|ββ Train_nb.ipynb
|ββ train_svm.ipynb
|ββ vectorizer.jb
|ββ vectorizer_nb.jb
|ββ vectorizer_rf.jb
|ββ visualization_of_project.ipynb
- software
OS: Debian unstable (May 2021), Ubuntu LTS Python: 3.8.5 (anaconda) PyTorch: 1.7.1, 1.8.1 - hardware
CPU: Intel Xeon 6226R / Normal CPU work GPU: No Needed RAM: At least 8GB
Made with β€οΈ by Pankaj Mahanta





