NightPrince commited on
Commit
f407a3e
·
verified ·
1 Parent(s): 8627d5b

Add library_name: nemo, add one-call DiacritizedASR usage

Browse files
Files changed (1) hide show
  1. README.md +16 -1
README.md CHANGED
@@ -2,6 +2,7 @@
2
  license: cc-by-4.0
3
  language:
4
  - ar
 
5
  tags:
6
  - automatic-speech-recognition
7
  - arabic
@@ -35,13 +36,27 @@ repository.
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"
 
2
  license: cc-by-4.0
3
  language:
4
  - ar
5
+ library_name: nemo
6
  tags:
7
  - automatic-speech-recognition
8
  - arabic
 
36
  | `stt_ar_fastconformer_hybrid_large_pcd_v1.0.nemo` | ASR checkpoint, unmodified | NVIDIA, CC-BY-4.0 |
37
  | `best_ed_mlm_ns_epoch_178.pt` | Diacritizer checkpoint, unmodified | abjadai/CATT, Apache-2.0 |
38
  | `diacritize.py`, `catt/` | Diacritizer inference code (vendored from CATT) | abjadai/CATT, Apache-2.0 |
39
+ | `pipeline.py` | `DiacritizedASR` — loads both models once, audio in / diacritized text out in a single call | This repository |
40
  | `server.py` | Reference FastAPI server implementing the full pipeline | This repository |
41
 
42
  ## Usage
43
 
44
+ ```python
45
+ from pipeline import DiacritizedASR
46
+
47
+ model = DiacritizedASR(
48
+ nemo_path="stt_ar_fastconformer_hybrid_large_pcd_v1.0.nemo",
49
+ catt_ckpt="best_ed_mlm_ns_epoch_178.pt",
50
+ )
51
+ diacritized = model.transcribe("audio.wav")
52
+ ```
53
+
54
+ Both models load once at construction; each `.transcribe()` call runs ASR followed immediately
55
+ by diacritization in the same process. For the two steps individually:
56
+
57
  ```python
58
  import nemo.collections.asr as nemo_asr
59
+ from diacritize import Diacritizer
60
 
61
  asr_model = nemo_asr.models.EncDecHybridRNNTCTCBPEModel.restore_from(
62
  "stt_ar_fastconformer_hybrid_large_pcd_v1.0.nemo"