MuhammadAnwar16/FactGuard-Multilingual-Fake-News-Detection-System

0

stars

18

commits

JavaScript

primary language

May 3, 2026

updated

artificial-intelligence
bert
fact-checking
fake-news-detection
machine-learning
multilingual-nlp
natural-language-processing-nlp
roberta
transformers

README

FactGuard — Multilingual Fake News Detection

FactGuard helps detect misinformation across languages by combining NLP modules, an optional custom fact-checking model, and a simple UI for non-technical users. It is built as a Django backend (API + analysis modules) and a React + Vite frontend.

What problem does this solve?

  • Identifies likely misinformation in short claims or headlines.
  • Extracts named entities and semantic cues to help analysts trace claims.
  • Provides a reproducible query history for auditing and exporting results.

How it works (high level)

  1. User submits text from the frontend or sends a POST to /analyze/.
  2. Backend runs NER (ner_module.py) and semantic analysis (semantic_module.py).
  3. Optionally calls an external custom fact-check model (configured via CUSTOM_MODEL_URL) to get a detailed verdict and sources.
  4. Similarity checks (similarity_module.py) run if a second text is provided.
  5. Results are returned to the frontend and saved to QueryHistory for later review or export.

Architecture

  • Frontend: React + Vite (factguard/) — UI, PDF export, account flows.
  • Backend: Django REST + DRF (ner_project/, ner_app/) — analysis endpoints and history API.
  • Optional external model: LLM / RAG host (private), accessed via CUSTOM_MODEL_URL & CUSTOM_MODEL_API_KEY.

Tech stack

LayerTechnology
BackendPython, Django, Django REST Framework
NLPCustom modules in ner_app (ner_module.py, semantic_module.py, similarity_module.py)
FrontendReact, Vite, Tailwind CSS
StorageSQLite (default) / Django ORM
Auth / ExtrasFirebase, Supabase (client libs included in frontend)

Quick start — Backend

  1. Create a Python virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set required environment variables (example):
export CUSTOM_MODEL_URL="http://private-model-host/query"
export CUSTOM_MODEL_API_KEY="your-api-key"
  1. Run migrations and start the server:
python manage.py migrate
python manage.py runserver 0.0.0.0:8000

The API root (home) responds at / and the analyze endpoint is at /analyze/.

Quick start — Frontend

  1. Install and run the frontend dev server:
cd factguard
npm install
npm run dev
  1. Open the address shown by Vite (usually http://localhost:5173).

API Examples

  • Analyze endpoint (POST /analyze/)
curl -X POST http://localhost:8000/analyze/ \
  -H "Content-Type: application/json" \
  -d '{"text":"The Eiffel Tower is in Berlin."}'

Sample response (abridged):

{
  "entities": [...],
  "sentiment": {...},
  "similarity": null,
  "customModel": {
    "success": true,
    "verdict": "VERIFIED",
    "credibility": "High (4/5)",
    "summary": "...",
    "sources": ["https://example.com/source"]
  }
}
  • History API (DRF router): GET /history/ returns stored QueryHistory items.

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7 Screenshot 8

Useful commands

  • Export query history (management command):
python manage.py export_history
  • Build frontend for production:
cd factguard
npm run build

Configuration notes

  • CUSTOM_MODEL_URL and CUSTOM_MODEL_API_KEY configure the external fact-checking model. If not set, the backend will attempt to hit the fallback URL and may return error responses.
  • The repository includes integration code for Firebase and Supabase in the frontend; add your credentials in the frontend environment as needed.

Contributing

  • Please open issues for bugs or feature requests.
  • For code contributions, create a branch and submit a pull request describing the change.

Maintainers / Contact


Contributors

Azfand-0

12 commits

MuhammadAnwar16/FactGuard-Multilingual-Fake-News-Detection-System

0

stars

18

commits

JavaScript

primary language

May 3, 2026

updated

artificial-intelligence
bert
fact-checking
fake-news-detection
machine-learning
multilingual-nlp
natural-language-processing-nlp
roberta
transformers

README

FactGuard — Multilingual Fake News Detection

FactGuard helps detect misinformation across languages by combining NLP modules, an optional custom fact-checking model, and a simple UI for non-technical users. It is built as a Django backend (API + analysis modules) and a React + Vite frontend.

What problem does this solve?

  • Identifies likely misinformation in short claims or headlines.
  • Extracts named entities and semantic cues to help analysts trace claims.
  • Provides a reproducible query history for auditing and exporting results.

How it works (high level)

  1. User submits text from the frontend or sends a POST to /analyze/.
  2. Backend runs NER (ner_module.py) and semantic analysis (semantic_module.py).
  3. Optionally calls an external custom fact-check model (configured via CUSTOM_MODEL_URL) to get a detailed verdict and sources.
  4. Similarity checks (similarity_module.py) run if a second text is provided.
  5. Results are returned to the frontend and saved to QueryHistory for later review or export.

Architecture

  • Frontend: React + Vite (factguard/) — UI, PDF export, account flows.
  • Backend: Django REST + DRF (ner_project/, ner_app/) — analysis endpoints and history API.
  • Optional external model: LLM / RAG host (private), accessed via CUSTOM_MODEL_URL & CUSTOM_MODEL_API_KEY.

Tech stack

LayerTechnology
BackendPython, Django, Django REST Framework
NLPCustom modules in ner_app (ner_module.py, semantic_module.py, similarity_module.py)
FrontendReact, Vite, Tailwind CSS
StorageSQLite (default) / Django ORM
Auth / ExtrasFirebase, Supabase (client libs included in frontend)

Quick start — Backend

  1. Create a Python virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Set required environment variables (example):
export CUSTOM_MODEL_URL="http://private-model-host/query"
export CUSTOM_MODEL_API_KEY="your-api-key"
  1. Run migrations and start the server:
python manage.py migrate
python manage.py runserver 0.0.0.0:8000

The API root (home) responds at / and the analyze endpoint is at /analyze/.

Quick start — Frontend

  1. Install and run the frontend dev server:
cd factguard
npm install
npm run dev
  1. Open the address shown by Vite (usually http://localhost:5173).

API Examples

  • Analyze endpoint (POST /analyze/)
curl -X POST http://localhost:8000/analyze/ \
  -H "Content-Type: application/json" \
  -d '{"text":"The Eiffel Tower is in Berlin."}'

Sample response (abridged):

{
  "entities": [...],
  "sentiment": {...},
  "similarity": null,
  "customModel": {
    "success": true,
    "verdict": "VERIFIED",
    "credibility": "High (4/5)",
    "summary": "...",
    "sources": ["https://example.com/source"]
  }
}
  • History API (DRF router): GET /history/ returns stored QueryHistory items.

Screenshots

Screenshot 1 Screenshot 2 Screenshot 3 Screenshot 4 Screenshot 5 Screenshot 6 Screenshot 7 Screenshot 8

Useful commands

  • Export query history (management command):
python manage.py export_history
  • Build frontend for production:
cd factguard
npm run build

Configuration notes

  • CUSTOM_MODEL_URL and CUSTOM_MODEL_API_KEY configure the external fact-checking model. If not set, the backend will attempt to hit the fallback URL and may return error responses.
  • The repository includes integration code for Firebase and Supabase in the frontend; add your credentials in the frontend environment as needed.

Contributing

  • Please open issues for bugs or feature requests.
  • For code contributions, create a branch and submit a pull request describing the change.

Maintainers / Contact


Contributors

Azfand-0

12 commits

Languages

JavaScript

77.5%

Python

16.3%

HTML

5.7%