Luffy AI is a high-performance, hybrid fake news detection platform consisting of an Apple-style Web Dashboard and a Manifest V3 Chrome Browser Extension.
The system leverages a hybrid detection pipeline combining a locally trained Machine Learning Stylistic Classifier and deep semantic Gemini AI Fact-Checking with real-time Google Search grounding.
- Apple Pro Obsidian Theme: A modern, high-contrast, pure pitch-black dashboard with responsive card highlights and smooth scroll-snapping layout animations.
- Hybrid Classification Pipeline:
- Stylistic Classification (ML): Evaluates linguistic structures, sensationalism, and stylistic syntax using TF-IDF and Logistic Regression.
- Semantic Verification (AI): Extracts specific claims from articles and fact-checks them against active Google Search indexes using Gemini.
- Social Media Scraping Fallback: Standard scraping blocks on social media sites (Facebook, X, etc.) are bypassed by using Gemini Google Search Grounding to fetch verified context on URLs.
- Chrome Extension: Scan the active webpage with a single click, fetching immediate credibility verdicts, clickbait scores, and claim-level details directly from your browser toolbar.
- SQLite Database Logging: Scan records are stored locally, letting you browse, search, filter, and audit detailed historical reports.
The Local ML Classifier is trained on a merged corpus of public datasets loaded from Hugging Face:
- GonzaloA/fake_news (24,353 records)
- ErfanMoosaviMonazzah/fake-news-detection-dataset-English (30,000 records)
The labels in both datasets were normalized into a single unified format:
0= Reliable / Real1= Misleading / Fake
- Vectorization: TF-IDF Vectorizer with unigrams and bigrams.
- Model: Logistic Regression.
- Test Accuracy:
98.19%accuracy achieved on the merged 54,000+ record test split. - Model Files: Saved locally in
backend/data/for instantaneous inference inside FastAPI endpoints:tfidf_vectorizer.joblibfake_news_model.joblib
├── backend/ # Python FastAPI backend
│ ├── app/ # Application logic (routes, database, analyzer, ML model)
│ ├── data/ # Trained models (.joblib) and local SQLite database (.db)
│ ├── train.py # ML training script utilizing Hugging Face datasets
│ └── requirements.txt# Python backend dependencies
├── frontend/ # Web Dashboard files
│ ├── index.html # Dashboard markup with scroll-snap welcome page
│ ├── style.css # Obsidian Dark CSS design system
│ └── app.js # Chart rendering and API integrations
├── extension/ # Manifest V3 Chrome Extension
│ ├── manifest.json # Chrome Extension configuration
│ ├── popup.html # Extension layout
│ ├── popup.css # Obsidian-themed styling
│ └── popup.js # Tab scraper and backend connector
└── README.md # Documentation
- Navigate to the backend directory:
cd backend - Create and activate a Python virtual environment:
python -m venv .venv # On Windows: .venv\Scripts\activate # On macOS/Linux: source .venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Start the development server:
The backend will boot up at
python -m uvicorn app.main:app --host 127.0.0.1 --port 8000
http://127.0.0.1:8000.
Open your browser and navigate to http://localhost:8000 (or http://127.0.0.1:8000) to view the dashboard. Scroll down to enter and explore.
- Open Google Chrome and go to
chrome://extensions/. - Enable Developer mode (toggle in top-right).
- Click Load unpacked (top-left).
- Select the
extension/folder in this project repository. - The extension is now loaded! Pin it to your toolbar to start scanning articles.
- Go to the Settings tab in the Web Dashboard.
- Enter your Google Gemini API Key (get one free from Google AI Studio).
- Click Save API Key. The system will dynamically switch from heuristics mode to active claim fact-checking!