JuaKazi Gender Sensitization Engine — bias detection & correction for African languages (EN/SW/FR/KI/ZU/HA)
---
title: JuaKazi Gender Sensitization Engine
emoji: ⚖️
colorFrom: red
colorTo: green
sdk: docker
app_port: 7860
pinned: false
---
# JuaKazi Gender Sensitization Engine
A multilingual gender bias detection and correction system for African language text, built for the AI BRIDGE programme.
## What it does
Detects and rewrites gender-biased language in **Swahili, English, French, Gikuyu, Hausa, and Zulu**. Supports single-sentence and batch API input.
## Current metrics (May 2026)
| Language | F1 | Precision | Recall | Samples |
|---|---|---|---|---|
| English | 1.000 | 1.000 | 1.000 | 66 |
| Swahili | 0.851 | 0.822 | 0.881 | 67,290 |
| French | 0.970 | 1.000 | 0.941 | 165 |
| Gikuyu | 0.667 | 0.967 | 0.510 | 11,622 |
| Hausa | 0.043 | 1.000 | 0.022 | 10,054 |
| Zulu | 0.732 | 1.000 | 0.577 | 2,000 |
Hausa: precision-first initial lexicon (36 rules); recall requires ML classifier (planned). Zulu: morphological suffix rules with context gating for zero false positives.
## Live demo
huggingface.co
## ML models
| Model | Base | Val F1 | Val Precision | Val Recall | Notes |
|---|---|---|---|---|---|
| sw-bias-classifier-v1 | afro-xlmr-base | 0.854 | 0.938 | 0.784 | Full fine-tune, 51K rows |
| sw-bias-classifier-v2 | afro-xlmr-base | 0.953 | 0.940 | 0.960 | Overfit on val — invalid |
| sw-bias-classifier-v3 | afro-xlmr-base | 0.871 | 0.810 | 0.942 | Current deployed model |
SW ML classifier is Stage 2 fallback only — runs when rules find nothing.
## Architecture
- **Detection**: Deterministic lexicon rules (primary) + AfroXLM-R fine-tuned ML fallback (Swahili only)
- **Correction**: Word-level substitution with semantic preservation check (threshold 0.70)
- **Languages**: Separate lexicons per language — no cross-lingual transfer
- **Context gating**: 11 suppression conditions (biographical, quote, statistical, counter-stereotype, Zulu neutral profession, etc.)
- **Integration**: `caller` field allows ups …