AI-Powered News Credibility & Verification Platform
Transparent machine learning verification with Explainable AI (XAI), URL extraction, and clickbait auditing.
FactCheck Engine is a modern, full-stack AI platform designed to evaluate news credibility. Unlike traditional "black-box" classifiers, FactCheck Engine provides complete transparency: it predicts whether an article is REAL or FAKE, calculates exact mathematical feature attributions to highlight the words that influenced the model, and audits the headline for emotional manipulation and clickbait.
-
🧠 Explainable AI (XAI):
- Uses mathematical feature attribution (
$w_i \cdot x_i$ ) to explain why the model made its prediction. - Highlights specific keywords pushing toward Misinformation (Fake Cues) vs. Credibility (Real Cues).
- Uses mathematical feature attribution (
-
⚡ Clickbait & Exaggeration Checker:
- Scans headlines for ALL-CAPS shouting, excessive punctuation (
!!,?!), curiosity gaps, and alarmist phrasing. - Provides an instant risk score (LOW, MODERATE, HIGH) with specific detection explanations.
- Scans headlines for ALL-CAPS shouting, excessive punctuation (
-
🔗 Direct URL Auto-Extraction:
- Paste any live web link to automatically scrape the article title, publication domain, and clean body text.
- Hardened with Server-Side Request Forgery (SSRF) defense against private and loopback networks.
-
🌐 Publisher Domain Credibility:
- Evaluates domain reputation against a database of wire services (Reuters, AP, BBC, NPR), verified publishers, satire networks, and unverified blogs.
-
🔒 Privacy-First Local Cache (Zero Database):
- Recent scan history is stored 100% inside your browser's local cache (
localStorage). - No databases required, zero server storage, and zero tracking of scanned articles.
- Recent scan history is stored 100% inside your browser's local cache (
-
📱 Fully Responsive Design:
- Optimized for desktop, tablet, and mobile with fluid typography, balanced grid columns, and touch-screen support.
-
📄 One-Click Export & Print Reports:
- Copy verification summaries to the clipboard or export clean PDF dossiers using the built-in print stylesheet.
Fake_News_Detector-main/
├── backend/
│ ├── app.py # Flask REST API, ML inference, SSRF protection, scraper
│ ├── models/ # Serialized Scikit-learn models
│ │ ├── model.pkl # Logistic Regression classifier
│ │ ├── vectorizer.pkl # TF-IDF n-gram vectorizer
│ │ └── selector.pkl # SelectKBest 10,000-feature selector
│ └── requirements.txt # Python dependencies
├── frontend/
│ ├── index.html # Semantic HTML5 interface
│ ├── style.css # Vanilla CSS responsive design system
│ └── script.js # Client application logic & localStorage cache
└── README.md # Project documentation
- Backend: Python 3.8+, Flask, Flask-CORS, Gunicorn
- Machine Learning: Scikit-Learn (Logistic Regression + SelectKBest), NumPy, NLTK (Lemmatization & Stopwords)
- Web Scraping: Requests, BeautifulSoup4 (BS4) with SSRF network validation
- Frontend: Vanilla HTML5, Modern CSS (Glassmorphism, Grid/Flexbox), Vanilla JavaScript (ES6+)
- Python 3.8 or higher installed on your machine.
pippackage manager.
Clone or extract the repository, then navigate to the project directory:
cd Fake_News_Detector-main/backendCreate a virtual environment (recommended):
# Windows
python -m venv venv
venv\Scripts\activate
# Linux / macOS
python3 -m venv venv
source venv/bin/activateInstall the required dependencies:
pip install -r requirements.txtLaunch the Flask development server:
python app.pyOpen your browser and navigate to:
http://127.0.0.1:5000
- SSRF Defense: The URL scraper validates target hostnames against DNS resolution to block private IP ranges (RFC 1918), loopback interfaces (
127.0.0.1,localhost), and cloud metadata IP addresses (169.254.169.254). - Defensive Type Coercion: Input sanitization prevents server crashes (
AttributeError/ 500) when handling empty ornullJSON values. - WSGI Lifecycle Readiness: Models load immediately upon module import, preventing cold-start delays or 503 errors under production WSGI servers like Gunicorn.
- Zero Database Footprint: All user scan history is stored client-side in
localStorage, maintaining complete user privacy.
A dedicated, lightweight health endpoint is provided for external uptime monitors (such as UptimeRobot):
- Endpoint:
GET /health(also supportsHEAD) - Expected Response:
HTTP 200 OKwith body:{ "status": "ok" } - Purpose: External uptime services can be configured outside the application to ping
https://<YOUR-RENDER-APP>.onrender.com/healthperiodically (e.g., every 5 to 14 minutes). This helps reduce Render Free-tier idle spin-down and cold-start latency. - Note: Periodic external pings reduce idle sleep behavior, but do not guarantee that the service can never restart or achieve 100% permanent uptime, as Render Free-tier instances periodically restart during platform maintenance and are subject to monthly free instance-hour quotas.
This project is licensed under the MIT License - see the LICENSE file for details.