Automatic Speech Recognition
NeMo
Bambara
speech
audio
CTC
QuartzNet
Bambara
spoken-numbers
NeMo
Eval Results (legacy)
Instructions to use RobotsMali/quartznum-v0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- NeMo
How to use RobotsMali/quartznum-v0 with NeMo:
import nemo.collections.asr as nemo_asr asr_model = nemo_asr.models.ASRModel.from_pretrained("RobotsMali/quartznum-v0") transcriptions = asr_model.transcribe(["file.wav"]) - Notebooks
- Google Colab
- Kaggle
Document QuartzNum architecture, results, usage, and limitations
Browse files
README.md
CHANGED
|
@@ -1,196 +1,120 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
library_name: nemo
|
| 3 |
license: cc-by-4.0
|
|
|
|
| 4 |
tags:
|
| 5 |
-
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
- NeMo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
---
|
| 8 |
|
| 9 |
-
#
|
| 10 |
|
| 11 |
-
|
| 12 |
-
img {
|
| 13 |
-
display: inline;
|
| 14 |
-
}
|
| 15 |
-
</style>
|
| 16 |
|
| 17 |
-
|
| 18 |
-
| [](#model-architecture)
|
| 19 |
-
| [](#datasets)
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
|
|
|
|
| 25 |
|
| 26 |
-
## NVIDIA NeMo
|
| 27 |
|
| 28 |
-
|
|
|
|
| 29 |
```
|
| 30 |
-
pip install nemo_toolkit['all']
|
| 31 |
-
```
|
| 32 |
-
|
| 33 |
-
## How to Use this Model
|
| 34 |
-
|
| 35 |
-
The model is available for use in the NeMo toolkit [3], and can be used as a pre-trained checkpoint for inference or for fine-tuning on another dataset.
|
| 36 |
-
|
| 37 |
-
### Automatically instantiate the model
|
| 38 |
-
|
| 39 |
-
**NOTE**: Please update the model class below to match the class of the model being uploaded.
|
| 40 |
|
| 41 |
```python
|
| 42 |
-
|
| 43 |
-
model = ModelPT.from_pretrained("RobotsMali/quartznum-v0")
|
| 44 |
-
```
|
| 45 |
-
|
| 46 |
-
### NOTE
|
| 47 |
-
|
| 48 |
-
Add some information about how to use the model here. An example is provided for ASR inference below.
|
| 49 |
-
|
| 50 |
-
### Transcribing using Python
|
| 51 |
-
First, let's get a sample
|
| 52 |
-
```
|
| 53 |
-
wget https://dldata-public.s3.us-east-2.amazonaws.com/2086-149220-0033.wav
|
| 54 |
-
```
|
| 55 |
-
Then simply do:
|
| 56 |
-
```
|
| 57 |
-
asr_model.transcribe(['2086-149220-0033.wav'])
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
-
### Transcribing many audio files
|
| 61 |
-
|
| 62 |
-
```shell
|
| 63 |
-
python [NEMO_GIT_FOLDER]/examples/asr/transcribe_speech.py pretrained_name="RobotsMali/quartznum-v0" audio_dir=""
|
| 64 |
-
```
|
| 65 |
-
|
| 66 |
-
### Input
|
| 67 |
-
|
| 68 |
-
**Add some information about what are the inputs to this model**
|
| 69 |
-
|
| 70 |
-
### Output
|
| 71 |
-
|
| 72 |
-
**Add some information about what are the outputs of this model**
|
| 73 |
-
|
| 74 |
-
## Model Architecture
|
| 75 |
-
|
| 76 |
-
**Add information here discussing architectural details of the model or any comments to users about the model.**
|
| 77 |
-
|
| 78 |
-
## Training
|
| 79 |
-
|
| 80 |
-
**Add information here about how the model was trained. It should be as detailed as possible, potentially including the the link to the script used to train as well as the base config used to train the model. If extraneous scripts are used to prepare the components of the model, please include them here.**
|
| 81 |
-
|
| 82 |
-
### NOTE
|
| 83 |
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
### Datasets
|
| 92 |
-
|
| 93 |
-
**Try to provide as detailed a list of datasets as possible. If possible, provide links to the datasets on HF by adding it to the manifest section at the top of the README (marked by ---).**
|
| 94 |
-
|
| 95 |
-
### NOTE
|
| 96 |
-
|
| 97 |
-
An example for the manifest section is provided below for ASR datasets
|
| 98 |
-
|
| 99 |
-
datasets:
|
| 100 |
-
- librispeech_asr
|
| 101 |
-
- fisher_corpus
|
| 102 |
-
- Switchboard-1
|
| 103 |
-
- WSJ-0
|
| 104 |
-
- WSJ-1
|
| 105 |
-
- National-Singapore-Corpus-Part-1
|
| 106 |
-
- National-Singapore-Corpus-Part-6
|
| 107 |
-
- vctk
|
| 108 |
-
- voxpopuli
|
| 109 |
-
- europarl
|
| 110 |
-
- multilingual_librispeech
|
| 111 |
-
- mozilla-foundation/common_voice_8_0
|
| 112 |
-
- MLCommons/peoples_speech
|
| 113 |
|
| 114 |
-
|
| 115 |
|
| 116 |
-
|
| 117 |
|
| 118 |
-
|
| 119 |
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 131 |
|
|
|
|
| 132 |
|
| 133 |
-
|
| 134 |
|
| 135 |
-
|
| 136 |
|
| 137 |
-
##
|
| 138 |
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
model-index:
|
| 142 |
-
- name: PUT_MODEL_NAME
|
| 143 |
-
results:
|
| 144 |
-
- task:
|
| 145 |
-
name: Automatic Speech Recognition
|
| 146 |
-
type: automatic-speech-recognition
|
| 147 |
-
dataset:
|
| 148 |
-
name: AMI (Meetings test)
|
| 149 |
-
type: edinburghcstr/ami
|
| 150 |
-
config: ihm
|
| 151 |
-
split: test
|
| 152 |
-
args:
|
| 153 |
-
language: en
|
| 154 |
-
metrics:
|
| 155 |
-
- name: Test WER
|
| 156 |
-
type: wer
|
| 157 |
-
value: 17.10
|
| 158 |
-
- task:
|
| 159 |
-
name: Automatic Speech Recognition
|
| 160 |
-
type: automatic-speech-recognition
|
| 161 |
-
dataset:
|
| 162 |
-
name: Earnings-22
|
| 163 |
-
type: revdotcom/earnings22
|
| 164 |
-
split: test
|
| 165 |
-
args:
|
| 166 |
-
language: en
|
| 167 |
-
metrics:
|
| 168 |
-
- name: Test WER
|
| 169 |
-
type: wer
|
| 170 |
-
value: 14.11
|
| 171 |
|
| 172 |
-
|
|
|
|
|
|
|
| 173 |
|
| 174 |
-
|
| 175 |
|
| 176 |
## Limitations
|
| 177 |
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
An example is provided below
|
| 184 |
-
|
| 185 |
-
Since this model was trained on publicly available speech datasets, the performance of this model might degrade for speech which includes technical terms, or vernacular that the model has not been trained on. The model might also perform worse for accented speech.
|
| 186 |
-
|
| 187 |
|
| 188 |
## License
|
| 189 |
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
## References
|
| 193 |
-
|
| 194 |
-
**Provide appropriate references in the markdown link format below. Please order them numerically.**
|
| 195 |
-
|
| 196 |
-
[1] [NVIDIA NeMo Toolkit](https://github.com/NVIDIA/NeMo)
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- bm
|
| 4 |
library_name: nemo
|
| 5 |
license: cc-by-4.0
|
| 6 |
+
base_model: RobotsMali/stt-bm-quartznet15x5-v2
|
| 7 |
tags:
|
| 8 |
+
- automatic-speech-recognition
|
| 9 |
+
- speech
|
| 10 |
+
- audio
|
| 11 |
+
- CTC
|
| 12 |
+
- QuartzNet
|
| 13 |
+
- Bambara
|
| 14 |
+
- spoken-numbers
|
| 15 |
- NeMo
|
| 16 |
+
metrics:
|
| 17 |
+
- wer
|
| 18 |
+
pipeline_tag: automatic-speech-recognition
|
| 19 |
+
model-index:
|
| 20 |
+
- name: quartznum-v0
|
| 21 |
+
results:
|
| 22 |
+
- task:
|
| 23 |
+
name: Automatic Speech Recognition
|
| 24 |
+
type: automatic-speech-recognition
|
| 25 |
+
dataset:
|
| 26 |
+
name: MobileBAMking spoken-number test split
|
| 27 |
+
type: mobilebamking-spoken-numbers
|
| 28 |
+
split: test
|
| 29 |
+
args:
|
| 30 |
+
language: bm
|
| 31 |
+
metrics:
|
| 32 |
+
- name: Test WER
|
| 33 |
+
type: wer
|
| 34 |
+
value: 17.241379618644714
|
| 35 |
---
|
| 36 |
|
| 37 |
+
# QuartzNum v0
|
| 38 |
|
| 39 |
+
QuartzNum is an 18M-parameter QuartzNet 15x5 CTC model specialized for recognizing **Bambara spoken amounts, account numbers, and phone numbers**. It is fine-tuned from [`RobotsMali/stt-bm-quartznet15x5-v2`](https://huggingface.co/RobotsMali/stt-bm-quartznet15x5-v2) and is intended as a narrow component, not a replacement for general-purpose Bambara ASR.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
The model is deployed in the [`mobilebamspeech`](https://github.com/RobotsMali-AI/mobilebamspeech) integration demo and the voice-first [`mobileBAMking`](https://github.com/RobotsMali-AI/mobileBAMking) proof of concept. [`NeMoOnnxSharp`](https://github.com/RobotsMali-AI/NeMoOnnxSharp) provides the ONNX Runtime/.NET inference path used on Android.
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
## Intended Use
|
| 44 |
|
| 45 |
+
Use QuartzNum to transcribe short, isolated number expressions in the vocabulary and speaking conditions represented by the banking voice collection. Pass its text through a Bambara number parser/normalizer and validate the resulting value before application use.
|
| 46 |
|
| 47 |
+
Do not use this research checkpoint by itself to authorize transactions, identify speakers, or transcribe unrestricted speech.
|
| 48 |
|
| 49 |
+
## Use with NVIDIA NeMo
|
| 50 |
|
| 51 |
+
```bash
|
| 52 |
+
pip install "nemo-toolkit[asr]"
|
| 53 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
```python
|
| 56 |
+
from nemo.collections.asr.models import EncDecCTCModel
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
|
| 58 |
+
model = EncDecCTCModel.from_pretrained("RobotsMali/quartznum-v0")
|
| 59 |
+
model.eval()
|
| 60 |
+
predictions = model.transcribe(["spoken_number.wav"])
|
| 61 |
+
print(predictions[0].text)
|
| 62 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
+
Input audio is converted by the model preprocessor to mono 16 kHz features. Output is a greedy CTC hypothesis over a lowercase character vocabulary containing the Bambara letters `ŋ`, `ɔ`, `ɛ`, and `ɲ`.
|
| 65 |
|
| 66 |
+
## NeMo 2.5.0 Compatibility
|
| 67 |
|
| 68 |
+
This checkpoint was created with NeMo 2.5.0. Loading it with newer NeMo versions (observed with 2.7.x) can fail because the strict decoding schema expects `key_phrase_items_list`; see [NVIDIA-NeMo/Speech#15658](https://github.com/NVIDIA-NeMo/Speech/issues/15658). The following workaround was tested with Python 3.12 and allows the 2.5.0 checkpoint to load in the newer environment:
|
| 69 |
|
| 70 |
+
```python
|
| 71 |
+
from pathlib import Path
|
| 72 |
+
|
| 73 |
+
from nemo.collections.asr.models import ASRModel
|
| 74 |
+
from omegaconf import OmegaConf
|
| 75 |
+
|
| 76 |
+
model_name = "RobotsMali/quartznum-v0"
|
| 77 |
+
cfg = ASRModel.from_pretrained(model_name, return_config=True)
|
| 78 |
+
OmegaConf.set_struct(cfg, False)
|
| 79 |
+
|
| 80 |
+
for decoder in ("greedy", "beam"):
|
| 81 |
+
boosting_tree = OmegaConf.select(cfg, f"decoding.{decoder}.boosting_tree")
|
| 82 |
+
if boosting_tree is not None:
|
| 83 |
+
boosting_tree.key_phrase_items_list = None
|
| 84 |
+
|
| 85 |
+
config_path = Path("patched_config.yaml").resolve()
|
| 86 |
+
OmegaConf.save(cfg, config_path)
|
| 87 |
+
model = ASRModel.from_pretrained(
|
| 88 |
+
model_name=model_name,
|
| 89 |
+
override_config_path=str(config_path),
|
| 90 |
+
strict=False,
|
| 91 |
+
)
|
| 92 |
+
config_path.unlink()
|
| 93 |
+
```
|
| 94 |
|
| 95 |
+
## Architecture and Training
|
| 96 |
|
| 97 |
+
QuartzNet 15x5 uses one-dimensional time-channel separable convolutions and a character CTC decoder. Training used NeMo 2.5.0, BF16 mixed precision, batches of 16, Adam at `5e-4`, and cosine annealing with 80 warm-up steps. The run allowed up to 50 epochs with early stopping patience of 15. The [training script, configuration, and archived result](https://github.com/RobotsMali-AI/bambara-asr/tree/main/quartznum) are public.
|
| 98 |
|
| 99 |
+
Training clips were derived from the 588-command MobileBAMking voice collection. For transfer commands, the preparation pipeline extracts separately recorded amount and account/phone-number audio and normalizes the labels with `bambara-normalizer`. This application-collected training set is not currently published as a standalone Hugging Face dataset.
|
| 100 |
|
| 101 |
+
## Evaluation
|
| 102 |
|
| 103 |
+
The archived held-out evaluation reports:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 104 |
|
| 105 |
+
| Split | Decoding | WER (%) ↓ | Test loss |
|
| 106 |
+
| --- | --- | ---: | ---: |
|
| 107 |
+
| MobileBAMking spoken-number test split | Greedy CTC | **17.24** | 36.29 |
|
| 108 |
|
| 109 |
+
WER measures token transcription, not end-to-end numeric-value accuracy. The split is small, narrow-domain, and drawn from the same collection workflow as training, so the figure should not be generalized to arbitrary speakers or acoustic conditions.
|
| 110 |
|
| 111 |
## Limitations
|
| 112 |
|
| 113 |
+
- Long digit strings can be costly even when only one character is wrong; validate parsed values explicitly.
|
| 114 |
+
- Accuracy may degrade with noise, overlap, dialects, recording hardware, or number forms absent from training.
|
| 115 |
+
- The model does not provide confidence calibration, speaker verification, or transaction safety controls.
|
| 116 |
+
- General Bambara words and sentences are outside its intended domain.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
## License
|
| 119 |
|
| 120 |
+
The model is released under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|