Logo Lanfrica

umarkhemis/afrilang

Domaine:

natural language processing

Type de record:

softwaretools
Créateur:
uma
Hôte:
Simplifying Access to African Language AI AfriLang Unified translation and speech API for 30+ African languages Built by Beta-Tech Labs --- ## What is AfriLang? AfriLang is a production-grade API and Python SDK for translating text and processing speech across 30+ African languages. It intelligently routes each request to the best available model — Sunbird AI for Ugandan languages, Helsinki-NLP for West and East Africa — and falls back gracefully when needed. ```bash pip install afrilang ``` ```python from afrilang import AfriLang client = AfriLang(api_key="afrlk_...") # Translate result = client.translate("Hello, how are you?", target="lug") print(result) # "Oli otya?" # Batch batch = client.translate_batch([ {"id": "1", "text": "Good morning", "target": "yo"}, {"id": "2", "text": "Thank you", "target": "sw"}, {"id": "3", "text": "Welcome", "target": "ha"}, ]) # Speech to Text stt = client.transcribe("audio.wav", language="lug") print(stt.transcript) # Text to Speech tts = client.synthesise("Oli otya?", language="lug") print(tts.audio_url) ``` ## Features - **30+ African languages** - Luganda, Swahili, Yoruba, Hausa, Igbo, Zulu, Acholi, Runyankole, Ateso, Lugbara, Kinyarwanda, Amharic, and more - **Intelligent routing** - automatically selects the highest-quality model per language pair - **Speech AI** - STT and TTS for East African languages via Sunbird AI - **Batch processing** - translate up to 50 texts in one API call - **Async support** - full `async`/`await` for FastAPI, Django async, and asyncio - **Production ready** - auth, Redis rate limiting, retries, Docker deployment - **MIT licensed** - free for commercial use ## Provider routing | Provider | Languages | Quality | |---|---|---| | Sunbird AI | lug, nyn, ach, teo, lgg | 0.92 | | Helsinki-NLP | sw, yo, ha, ig, zu, rw | 0.78-0.85 | | opus-mt-en-mul | 100+ language fallback | 0.62 | ## Documentation Full documentation at **docs.afrilang.betatechlabs.io** - Installation - Quick Start - API Reference - Python SDK …