AfriPunctCap: Pan-African Punctuation & Capitalization Restoration Model

A fast, lightweight multilingual model fine-tuned on 3.3 Million multi-sentence passages across 751 African languages and dialects to restore commas, sentence-ending periods, and capitalization in unpunctuated ASR transcripts and text.

Part of the AfriSpeech open-source speech initiative.

๐Ÿ“Š Precision Comparison: INT8 Quantized (Default CPU) vs. FP16 (GPU)

We evaluated the exact same held-out test sets using the dynamic quantized CPU engine (INT8 ONNX) and the full precision GPU model (bfloat16 / FP16):

Language Language Family INT8 Comma F1 (Default) FP16 Comma F1 INT8 Period F1 FP16 Period F1 Accuracy Retained
Swahili (swh) Niger-Congo (Bantu) 0.641 0.649 0.953 0.953 98.8%
Zulu (zul) Niger-Congo (Bantu) 0.609 0.628 0.860 0.886 97.0%
Hausa (hau) Afroasiatic (Chadic) 0.579 0.611 0.899 0.908 94.8%
Yoruba (yor) Niger-Congo (Defoid) 0.562 0.503 0.847 0.842 100.0%
Akan / Twi (aka) Niger-Congo (Kwa) 0.540 0.543 0.899 0.870 99.4%
Ewe (ewe) Niger-Congo (Gbe) 0.561 0.597 0.711 0.747 94.0%
Lingala (lin) Niger-Congo (Bantu) 0.448 0.438 0.846 0.843 100.0%
Kinyarwanda (kin) Niger-Congo (Bantu) 0.496 0.504 0.836 0.871 98.4%
Wolof (wol) Niger-Congo (Senegambian) 0.568 0.570 0.752 0.734 99.6%
Somali (som) Afroasiatic (Cushitic) 0.468 0.438 0.798 0.790 100.0%
Average (Core) Pan-African Benchmark 0.547 0.548 0.840 0.844 99.8% Retained

Key Benchmark Takeaways:

  1. INT8 is the Recommended Default: INT8 dynamic quantization retains 99.8% of the full FP16 accuracy while cutting memory footprint in half to 278 MB.
  2. Sub-30ms CPU Latency: Single-sentence inference runs in 15โ€“25 ms on standard commodity CPUs without needing a GPU.
  3. Zero Language Tags Required: Operates in pure text mode across all languages without requiring language specification.

๐ŸŽ™๏ธ Restoring Omitted Punctuation for African Text-to-Speech (TTS)

Across African languages, writers conventionally omit commas, despite native speakers making clear, audible pauses in normal speech:

  • Written Habits: Commas are routinely skipped before conjunctions (like ne in Akan, ร ti in Yoruba, na in Swahili), complementizers, appositives, and compound titles.
  • The TTS Bottleneck: For Text-to-Speech (TTS) models, punctuation is the single most critical signal for breath pauses and prosodic rhythm. Without commas, TTS engines rush through clauses unnaturally without breathing.
  • Syntactic Restoration: Fine-tuned on 3.3 Million multi-sentence passages, this model systematically compensates for commas conventionally ignored in writing, matching natural spoken rhythm.

Model Formats Available

  • onnx/model_quantized.onnx (278 MB, Default INT8 quantized for ultra-fast CPU inference)
  • onnx/model.onnx (1.1 GB, full precision ONNX)
  • model_fp16.safetensors (540 MB, Optional half-precision weights for GPU)
  • model.safetensors & pytorch_model.bin (Full precision PyTorch)
  • Complete SentencePiece tokenizer files

Live Interactive Demo

Try the model online: AfriSpeech/afri-punct-cap-demo

GitHub Repository

Code, pipelines, and data preparation: AfriSpeech/afri-punct-cap

Downloads last month
24
Safetensors
Model size
0.3B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Space using AfriSpeech/afri-punct-cap 1