Logo Lanfrica

KabulaBenjamin/kabras-ai-project

Domain:

natural language processing

Record type:

software
Creator:
Kab
Host:
# Kabras AI Translator A speech translation app for the **Kabras language** β€” a Luhya dialect spoken in Western Kenya. Built to support language preservation through accessible AI tooling. ## Features - πŸŽ™οΈ Live microphone recording or audio file upload - πŸ” Exact and fuzzy matching against a growing Kabras lexicon - πŸ“Š Confidence scoring with top alternative matches - πŸ“ Dual logging to JSON and CSV for research use - βž• In-app lexicon expansion with duplicate detection - πŸ”Ž Admin gap analysis β€” surfaces most-needed phrases by frequency - πŸ“€ Export translation history as JSON or CSV ## Project structure ``` kabras-ai-project/ β”œβ”€β”€ app/ β”‚ β”œβ”€β”€ gradio_app.py # Main Gradio UI and all logic β”‚ β”œβ”€β”€ main.py # Entry point β€” run this β”‚ β”œβ”€β”€ lexicon/ β”‚ β”‚ └── kabras_lexicon.json β”‚ β”œβ”€β”€ datasets/ β”‚ β”‚ └── translations_log.csv # Auto-generated on first translation β”‚ └── config/ β”‚ └── settings.yaml β”œβ”€β”€ docs/ β”‚ └── README.md └── requirements.txt ``` ## Setup ```bash git clone github.com cd kabras-ai-project python -m venv .venv .venv\Scripts\activate # Windows pip install -r requirements.txt ``` ## Run ```bash python app/main.py ``` Then open 127.0.0.1 in your browser. ## How it works 1. Audio is captured via microphone or file upload 2. Google Speech Recognition transcribes it (Swahili first, English fallback) 3. The transcription is matched against `kabras_lexicon.json`: - **Exact match** β†’ 100% confidence - **Fuzzy match** (β‰₯ 62% similarity) β†’ confidence score + alternatives shown - **No match** β†’ logged and flagged for lexicon expansion 4. Every attempt is logged to `datasets/translations_log.csv` ## Research companion This app generates the dataset used by the kabras-asr-research project for WER analysis and confidence visualisations. ## Contributing To add new Kabras phrases, use the **Expand Lexicon** tab in the app, or edit `lexicon/kabras_lexicon.json` direct …