Instructions to use NightPrince/Nemo-Arabic-STT-Diacritized with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- NeMo
How to use NightPrince/Nemo-Arabic-STT-Diacritized with NeMo:
import nemo.collections.asr as nemo_asr asr_model = nemo_asr.models.ASRModel.from_pretrained("NightPrince/Nemo-Arabic-STT-Diacritized") transcriptions = asr_model.transcribe(["file.wav"]) - Notebooks
- Google Colab
- Kaggle
Add model card
Browse files
README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-4.0
|
| 3 |
+
language:
|
| 4 |
+
- ar
|
| 5 |
+
tags:
|
| 6 |
+
- automatic-speech-recognition
|
| 7 |
+
- arabic
|
| 8 |
+
- diacritization
|
| 9 |
+
- tashkeel
|
| 10 |
+
- speech
|
| 11 |
+
pipeline_tag: automatic-speech-recognition
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Nemo-Arabic-STT-Diacritized
|
| 15 |
+
|
| 16 |
+
An Arabic speech-to-text pipeline that produces fully diacritized (tashkeel) transcripts. It
|
| 17 |
+
combines two independently developed models in sequence; it is a packaged inference pipeline,
|
| 18 |
+
not a single jointly trained architecture.
|
| 19 |
+
|
| 20 |
+
## Pipeline
|
| 21 |
+
|
| 22 |
+
1. **Speech recognition**: [NVIDIA NeMo FastConformer Hybrid](https://huggingface.co/nvidia/stt_ar_fastconformer_hybrid_large_pcd_v1.0)
|
| 23 |
+
(`stt_ar_fastconformer_hybrid_large_pcd_v1.0`) transcribes Arabic speech to plain,
|
| 24 |
+
undiacritized text.
|
| 25 |
+
2. **Diacritization**: [CATT](https://github.com/abjadai/catt) (Character-based Arabic Tashkeel
|
| 26 |
+
Transformer) adds tashkeel to the transcript.
|
| 27 |
+
|
| 28 |
+
Audio in, diacritized Arabic text out. Neither checkpoint was retrained or fine-tuned for this
|
| 29 |
+
repository.
|
| 30 |
+
|
| 31 |
+
## Files
|
| 32 |
+
|
| 33 |
+
| File | Description | Source |
|
| 34 |
+
|---|---|---|
|
| 35 |
+
| `stt_ar_fastconformer_hybrid_large_pcd_v1.0.nemo` | ASR checkpoint, unmodified | NVIDIA, CC-BY-4.0 |
|
| 36 |
+
| `best_ed_mlm_ns_epoch_178.pt` | Diacritizer checkpoint, unmodified | abjadai/CATT, Apache-2.0 |
|
| 37 |
+
| `diacritize.py`, `catt/` | Diacritizer inference code (vendored from CATT) | abjadai/CATT, Apache-2.0 |
|
| 38 |
+
| `server.py` | Reference FastAPI server implementing the full pipeline | This repository |
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
import nemo.collections.asr as nemo_asr
|
| 44 |
+
from diacritize import Diacritizer # from this repository
|
| 45 |
+
|
| 46 |
+
asr_model = nemo_asr.models.EncDecHybridRNNTCTCBPEModel.restore_from(
|
| 47 |
+
"stt_ar_fastconformer_hybrid_large_pcd_v1.0.nemo"
|
| 48 |
+
)
|
| 49 |
+
diacritizer = Diacritizer(ckpt="best_ed_mlm_ns_epoch_178.pt")
|
| 50 |
+
|
| 51 |
+
text = asr_model.transcribe(["audio.wav"])[0].text
|
| 52 |
+
diacritized = diacritizer.diacritize_texts([text])[0]
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
Or run `server.py` directly for an HTTP API (`POST /transcribe`, `GET /health`).
|
| 56 |
+
|
| 57 |
+
## Example
|
| 58 |
+
|
| 59 |
+
Input audio (Arabic speech) transcribed and diacritized:
|
| 60 |
+
|
| 61 |
+
```
|
| 62 |
+
plain: ุงูุณูุงู
ุนูููู
ูุฑุญู
ุฉ ุงููู ูุจุฑูุงุชู ููู ูู
ูููู ู
ุณุงุนุฏุชู ุงูููู
ุ
|
| 63 |
+
diacritized: ุงูุณููููุงู
ู ุนูููููููู
ู ููุฑูุญูู
ูุฉู ุงูููููู ููุจูุฑูููุงุชููู ูููููู ููู
ูููููููู ู
ูุณูุงุนูุฏูุชููู ุงููููููู
ูุ
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
## Limitations
|
| 67 |
+
|
| 68 |
+
- Diacritization quality depends on ASR transcript quality; transcription errors propagate to
|
| 69 |
+
diacritization.
|
| 70 |
+
- CATT diacritizes using full-sentence context; very short or ambiguous transcripts may
|
| 71 |
+
diacritize imperfectly.
|
| 72 |
+
- Developed and tested on general Modern Standard Arabic conversational speech, not evaluated on
|
| 73 |
+
Quranic recitation.
|
| 74 |
+
|
| 75 |
+
## Attribution and License
|
| 76 |
+
|
| 77 |
+
- ASR model: NVIDIA, [stt_ar_fastconformer_hybrid_large_pcd_v1.0](https://huggingface.co/nvidia/stt_ar_fastconformer_hybrid_large_pcd_v1.0), CC-BY-4.0.
|
| 78 |
+
- Diacritizer: [abjadai/CATT](https://github.com/abjadai/catt), Apache-2.0.
|
| 79 |
+
- This repository (packaging and inference code) is released under CC-BY-4.0, consistent with
|
| 80 |
+
the ASR model's license and compatible with CATT's Apache-2.0 terms.
|
| 81 |
+
|
| 82 |
+
Built for the [Muslim](https://huggingface.co/NightPrince) Arabic voice AI companion project.
|