Detect whether a news article is Real or Fake using Natural Language Processing (NLP) and Machine Learning with a modern Flask web interface.
FakeNews AI is a machine learning web application that classifies news articles into Real or Fake using TF-IDF Vectorization and a Logistic Regression classifier.
The application provides an intuitive interface where users can paste any news article and instantly receive:
- Prediction (Real/Fake)
- Confidence Score
- Prediction History
- Fast Response Time
- Interactive UI
- AI-powered Fake News Detection
- News Article Classification
- Confidence Score
- Real-Time Prediction
- TF-IDF Feature Extraction
- Logistic Regression Classifier
- Text Cleaning using NLTK
- Local Prediction History
- Dark / Light Theme
- Fully Responsive Design
flowchart LR
A[User] --> B[Flask Web Application]
B --> C[Input News Article]
C --> D[Text Preprocessing]
D --> E[TF-IDF Vectorizer]
E --> F[Logistic Regression Model]
F --> G[Prediction]
G --> H[Confidence Score]
H --> I[Display Result on UI]
User
│
▼
Enter News Article
│
▼
Text Cleaning (NLTK)
│
▼
TF-IDF Feature Extraction
│
▼
Logistic Regression Prediction
│
▼
Confidence Score Calculation
│
▼
Display Result
FakeNews-AI/
│
├── app.py
├── requirements.txt
├── README.md
│
├── dataset/
│ └── news_data.csv
│
├── models/
│ └── fake_news_model.pkl
│
├── src/
│ ├── preprocess.py
│ └── train_model.py
│
├── static/
│ ├── css/
│ ├── js/
│ └── images/
│
├── templates/
│ └── index.html
│
└── screenshots/
- Lowercase Conversion
- Remove Punctuation
- Remove Numbers
- Remove Stopwords
- Clean Text
↓
TF-IDF Vectorization
↓
Logistic Regression
↓
Real News / Fake News
| Technology | Purpose |
|---|---|
| Python | Backend |
| Flask | Web Framework |
| HTML5 | Frontend |
| CSS3 | Styling |
| JavaScript | Client-side Interaction |
| Scikit-Learn | Machine Learning |
| NLTK | Text Preprocessing |
| Joblib | Model Serialization |
| TF-IDF | Feature Extraction |
| Logistic Regression | Classification |
| Metric | Value |
|---|---|
| Algorithm | Logistic Regression |
| Feature Extraction | TF-IDF |
| Accuracy | 97.33% |
| Prediction Speed | ~1 Second |
Clone the repository
git clone https://github.com/MobeenFatimaa/FakeNews-Detection-ApplicationGo to the project
cd FakeNews-AICreate virtual environment
python -m venv .venvActivate
Windows
.venv\Scripts\activateLinux/Mac
source .venv/bin/activateInstall dependencies
pip install -r requirements.txtRun the application
python app.pyOpen
http://127.0.0.1:5000
The application provides:
- Modern Landing Page
- News Analyzer
- AI Loading Animation
- Result Card
- Confidence Meter
- Prediction History
- Statistics Section
- Responsive Design
- BERT / DistilBERT Integration
- Fake News Source Detection
- Explainable AI (XAI)
- Multilingual News Detection
- User Authentication
- Cloud Deployment
- News URL Analysis
- Live News API Integration
View the complete machine learning notebook on Kaggle:
(https://www.kaggle.com/code/mobeenfatimah/fake-news-detection-97-1-accuracy)
Mobeen Fatima
Computer Science Student
Machine Learning & AI Enthusiast
GitHub: https://github.com/MobeenFatimaa
LinkedIn: https://www.linkedin.com/in/mobeen-fatima-599a35347/
If you found this project useful, consider giving it a ⭐ on GitHub.
It helps others discover the project and motivates future improvements.
This project is licensed under the MIT License.