Skip to content

vaijaaaaa/TrueLens

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

35 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

TrueLens

AI-Powered Fake News and Political Bias Detection

A browser extension that analyzes news articles in real-time to detect misinformation, identify political bias, and verify claims against trusted fact-checking sources.


Model Architecture

TruLens

Overview

TrueLens is a full-stack application consisting of three components:

  • Browser Extension - Chrome extension built with React that extracts article content and displays analysis results
  • Node.js Backend - Express server that handles API requests and coordinates between the extension and ML service
  • Python ML Service - FastAPI server running machine learning models for text analysis

Features

  • Real-time credibility scoring for news articles
  • Political bias detection (left, center, right)
  • Automatic claim extraction from article text
  • Fact-checking against Google Fact Check API
  • Privacy-focused design with no data collection

Tech Stack

Extension

  • React 18
  • Vite
  • Tailwind CSS
  • Chrome Manifest V3

Backend

  • Node.js
  • Express 5

ML Service

  • Python 3.10+
  • FastAPI
  • spaCy (en_core_web_sm)
  • Transformers (RoBERTa, BART-MNLI)
  • PyTorch

Installation

Prerequisites

  • Node.js v18+
  • Python 3.10+
  • Chrome browser

Clone the Repository

git clone https://github.com/vaijaaaaa/TrueLens.git
cd TrueLens

Backend Setup

cd backend
npm install
npm run dev

The backend runs on http://localhost:5000

ML Service Setup

cd ml-service
python -m venv venv
venv\Scripts\activate  # On Windows
pip install -r requirements.txt
python -m spacy download en_core_web_sm
uvicorn app.main:app --reload --port 8000

The ML service runs on http://localhost:8000

Extension Setup

cd extension
npm install
npm run build

Then load the extension in Chrome:

  1. Open chrome://extensions/
  2. Enable "Developer mode"
  3. Click "Load unpacked"
  4. Select the extension/dist folder

Usage

  1. Start the backend server
  2. Start the ML service
  3. Navigate to any news article
  4. Click the TrueLens extension icon
  5. View the analysis results including credibility score, bias detection, and fact-checks

Project Structure

TrueLens/
β”œβ”€β”€ backend/           # Node.js Express server
β”‚   └── src/
β”‚       └── index.js
β”œβ”€β”€ ml-service/        # Python FastAPI ML service
β”‚   └── app/
β”‚       β”œβ”€β”€ main.py
β”‚       └── models/
β”œβ”€β”€ extension/         # Chrome extension
β”‚   └── src/
β”‚       β”œβ”€β”€ popup/
β”‚       └── content.js
└── frontend/          # Landing page website
    └── src/
        └── Components/

API Endpoints

Backend

  • POST /analyze - Analyze article text for fake news and bias

ML Service

  • POST /ml - Process text through ML models
  • GET /health - Health check endpoint

License

MIT License


Author

Built by vaijaaaaa

About

🚨 Detect political bias and fake news across the web using AI.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published