Skip to content

yassinezadod/FactCheck-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔍 AI Fact Check — Real-Time Fact Checking Chrome Extension

AI Fact Check is a full-stack tool built to fight misinformation on social media. Select any zone on your screen, and within seconds get a clear verdict: True ✅ False ❌ Misleading ⚠️


🏗️ How It Works

[Screen Capture] → [Multilingual OCR] → [Claim Extraction] → [Live Web Search] → [Verdict]
  1. The Chrome Extension captures the selected screen zone
  2. OCR.space extracts the text (Arabic, French, English)
  3. Groq / Llama 3 isolates the main claim
  4. Tavily API searches live web sources in real time
  5. FastAPI returns a structured verdict with a trust score and summary

📁 Project Structure

factcheck-extension/     ← Chrome Extension (MV3)
backend/                 ← FastAPI Cloud Backend

💻 1. Chrome Extension

Features

  • Area Selector — drag-and-drop zone selection directly on any webpage
  • DPR Scaling — supports Retina, 4K, and high-density displays
  • Service Worker — handles all API calls from background.js, bypassing CORS
  • Multilingual OCR — Arabic (cursive), French, and English support

Installation

  1. Clone or download this repository
  2. Open Chrome → chrome://extensions/
  3. Enable Developer mode (top-right toggle)
  4. Click Load unpacked
  5. Select the factcheck-extension/ folder
  6. The 🔍 icon appears in your Chrome toolbar — you're ready

⚡ 2. FastAPI Backend

Features

  • Async pipeline — FastAPI + Uvicorn for low-latency execution
  • Claim isolation — Groq (Llama 3) distills noisy social media text into a clean query
  • Live search — Tavily API queries high-authority news and fact-checking sources
  • Structured output — returns verdict, trust score, summary, and sources

Installation

cd backend
python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r requirements.txt

Environment Variables

Create a .env file in the backend/ folder:

GROQ_API_KEY=your_groq_api_key
GROQ_MODEL=llama3-8b-8192
TAVILY_API_KEY=your_tavily_api_key

Run the Server

uvicorn app.main:app --reload

Server runs at http://localhost:8000
Swagger docs at http://localhost:8000/docs


🔌 API Reference

POST /api/v1/check

Runs the full RAG pipeline on the provided text and returns a fact-check report.

Request

{
  "post_content": "Text extracted from the social media image..."
}

Response

{
  "verdict": "مضلل",
  "trust_score": 25,
  "summary": "Explanation generated in Arabic based on verified live web sources.",
  "sources": [{ "title": "Source title", "url": "https://..." }]
}
Field Type Description
verdict string صحيح / خاطئ / مضلل (True / False / Misleading)
trust_score integer Reliability score from 0 to 100
summary string Contextual explanation in Arabic
sources array List of sources used for verification

🛠️ Tech Stack

Layer Technology
Chrome Extension JavaScript, HTML5, CSS3 — Manifest V3
OCR OCR.space API — Engine 3
Backend Python, FastAPI, Pydantic v2, Uvicorn
AI Engine Groq Cloud SDK — Llama 3
Web Search Tavily API

📄 License

MIT — open-source, free to use, fork, and improve.
Pull requests are welcome.

About

Intelligent Chrome Extension (MV3) & FastAPI backend for instant social media fact-checking using RAG (Groq, Llama 3, Tavily API) and multilingual OCR.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors