--- title: شَمْل - Arabic Diacritization emoji: 🎙️ colorFrom: indigo colorTo: purple sdk: docker app_port: 7860 pinned: false license: apache-2.0 short_description: Arabic speech-to-text + diacritization --- # شَمْل (Lisan / Shaml) — Arabic Diacritization AI-powered Arabic diacritization platform combining: - **Whisper ASR** for Classical Arabic speech-to-text - **Diac (NAACL 2024)** transformer for restoring tashkeel - **FastAPI** backend serving a React (Vite) frontend - Optional **Supabase** persistence for audio + text records ## Workflow 1. Record or upload an Arabic audio clip 2. Whisper transcribes it 3. Edit the transcription if needed 4. Diac restores diacritics on the edited text 5. (Optional) Save the audio + texts to Supabase ## Environment Variables (Secrets) Set the following as **Repository Secrets** in the Space settings (not Variables): - `SUPABASE_URL` — your Supabase project URL - `SUPABASE_SERVICE_ROLE_KEY` — backend-only secret (never expose client-side) Optional: - `API_KEY` — protect the API behind a header (`X-API-Key`) - `MODEL_NAME` — override default Hugging Face Diac model - `ASR_MODEL_NAME` — override default Whisper model - `CORS_ORIGINS` — comma-separated allowed origins (default permissive) ## Resources - Free tier: 2 vCPU / 16 GB RAM / 50 GB disk (non-persistent) - First boot downloads Whisper + Diac models from Hugging Face (~3-4 GB) - Subsequent boots use cached models ## API - `GET /api/` — service info - `GET /api/health` — model & Supabase status - `POST /api/transcribe/audio` — Whisper transcription - `POST /api/diacritize` — text diacritization - `POST /api/diacritize/audio` — one-shot audio → diacritized text - `POST /api/records/save` — save to Supabase - `GET /docs` — interactive OpenAPI ## Credits Based on the NAACL 2024 paper: > Shatnawi, S., Alqahtani, S., Aldarmaki, H. (2024). *Automatic Restoration of Diacritics for Speech Data Sets*.