Skip to content
kartik-commitsPublic

About

ANTI-INDIA & ANTI-HINDU HATE DETECTION MODEL + EXTENSION

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

19 Commits

Folders and files

Repository files navigation

AI Hate Detection Model and Browser Extension

This repository is split into two independent products:

  • model/: reusable NLP model pipeline and inference contract for detecting hate directed at Indians, Hindus, and related target groups.
  • extension/: Chrome/Firefox WebExtension that consumes exported browser-compatible model artifacts and performs local inference by default.

The extension must not import training code. It consumes versioned artifacts and the shared prediction contract only.

Current Status

This is a production-oriented scaffold with:

  • deterministic preprocessing and rule baseline;
  • stable prediction schema;
  • model/export/benchmark commands;
  • optional FastAPI backend;
  • WebExtension source architecture for Twitter/X;
  • local-first privacy and security documentation;

Quick Start

Python model package:

cd model
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev,backend]"
pytest
python -m hate_guard.cli predict "All [GROUP] are disgusting."

Browser extension:

cd extension
npm install
npm run typecheck
npm run test
npm run build

Optional backend:

cd backend
uvicorn app.main:app --reload

Privacy Defaults

  • No telemetry by default.
  • No cloud inference unless explicitly enabled by the user.
  • Raw restricted examples and slur-heavy datasets belong under model/datasets/restricted/, which is ignored by Git.
  • Public tests and docs use redacted or synthetic examples.

Release artifacts

Production extension archives are generated by CI from a validated trained ONNX bundle and are not committed to Git. Run python scripts/package_release.py --model-artifact-dir PATH with a bundle containing both ONNX graphs, tokenizer.json, tokenizer configuration, thresholds, and a checksum manifest. Packaging fails for placeholder, stub, corrupt, or tokenizer-incomplete bundles. Use --dry-run to validate inputs and display commands without writing release files.

About

ANTI-INDIA & ANTI-HINDU HATE DETECTION MODEL + EXTENSION

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages