Skip to content

Latest commit

Β 

History

History
138 lines (102 loc) Β· 4.25 KB

File metadata and controls

138 lines (102 loc) Β· 4.25 KB

FalsifyNot

A Fake News Verification System


What is FalsifyNot?

FalsifyNot is a multimodal fact-checking system that takes text, images, web links, or YouTube videos, extracts check-worthy claims, retrieves evidence from a Wikipedia-scale knowledge base, verifies them using NLI (Natural Language Inference), and presents a rich, explainable verdict β€” complete with multimodal impact analysis and clickable external evidence links.


Pipeline

Text/Image/URL/Video Input
        β”‚
        β”œβ”€β”€β–Ί OCR / Web Scraping / Transcript Extraction
        β”‚
        └──► Claim Extraction
                β”œβ”€β”€β–Ί Evidence Retrieval ──► NLI Verification ──► Verdict
                β”‚
                β”œβ”€β”€β–Ί Wikipedia Links + YouTube Links
                └──► Visual Context + Multimodal Impact Analysis

Features

Feature Description
Multi-Source Input Verifies direct text, images (OCR via EasyOCR), web articles (newspaper3k), and video (youtube-transcript-api)
Claim Extraction Fine-tuned BERT model identifies check-worthy sentences
Semantic Retrieval FAISS + BGE embeddings search a Wikipedia-scale corpus
NLI Verification DeBERTa v3 classifies each claim-evidence pair as SUPPORTS / REFUTES / NEUTRAL
External Evidence Auto-generates Wikipedia links and YouTube search links for every claim
Multimodal Impact Analysis Compares text-only verdicts vs. image-augmented results to show visual influence
Explainability Highlights key terms, confidence breakdown, and model reasoning

Getting Started

Prerequisites

  • Node.js β‰₯ 18
  • Python 3.11
  • A Python virtual environment already created in backend/venv

To create the venv (first time only):

cd backend
py -3.11 -m venv venv

1. Setup (run once, or after pulling new dependencies)

npm run setup

This single command will:

  • Install all Node.js packages (npm install)
  • Activate the backend Python venv
  • Install all Python dependencies (pip install -r requirements.txt)

2. Start the development server

npm run dev

This starts both servers concurrently:


Project Structure

falsifynot/
β”œβ”€β”€ app/                  # Next.js pages (upload, dashboard, docs…)
β”œβ”€β”€ components/           # UI components (analysis-panel, upload-panel…)
β”œβ”€β”€ lib/
β”‚   └── api.ts            # Typed API client (text + multimodal)
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/routes/   # FastAPI endpoints (/analyze, /health)
β”‚   β”‚   β”œβ”€β”€ ml/           # ML modules
β”‚   β”‚   β”‚   β”œβ”€β”€ claim_inference.py
β”‚   β”‚   β”‚   β”œβ”€β”€ retriever.py
β”‚   β”‚   β”‚   β”œβ”€β”€ verifier.py
β”‚   β”‚   β”‚   β”œβ”€β”€ ocr_service.py   # EasyOCR
β”‚   β”‚   β”‚   β”œβ”€β”€ clip_service.py  # CLIP similarity
β”‚   β”‚   β”‚   └── link_service.py  # Wikipedia + YouTube links
β”‚   β”‚   β”œβ”€β”€ models/       # Pydantic schemas + responses
β”‚   β”‚   └── services/     # Claim, retrieval, verification services
β”‚   └── data/
β”‚       β”œβ”€β”€ wiki_faiss.index
β”‚       └── wiki_corpus_metadata.csv
└── package.json

API

Method Endpoint Description
POST /api/v1/analyze Analyze text + optional image (multipart/form-data)
GET /api/v1/health API health check
GET /docs Interactive Swagger UI

Example request with image:

curl -X POST http://localhost:8000/api/v1/analyze \
  -F "text=Earth's average temperature has risen by 1.1Β°C since 1880." \
  -F "image=@/path/to/screenshot.png"

License

Copyright Β© 2025 FalsifyNot. All Rights Reserved.
This code is for viewing purposes only. No part of this repository may be reproduced, distributed, or modified without prior written permission.