lukab commited on
Commit
4e8b060
·
verified ·
1 Parent(s): b2141d0

ka-fastconformer-v2: NVIDIA's Georgian FastConformer fine-tuned on 357 h

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +149 -0
  3. ka-fastconformer-v2.nemo +3 -0
  4. training_config.yaml +53 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ ka-fastconformer-v2.nemo filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - ka
4
+ license: cc-by-4.0
5
+ library_name: nemo
6
+ pipeline_tag: automatic-speech-recognition
7
+ base_model: nvidia/stt_ka_fastconformer_hybrid_large_pc
8
+ datasets:
9
+ - Peacockery/georgian-asr-corpus-v0
10
+ - google/fleurs
11
+ tags:
12
+ - automatic-speech-recognition
13
+ - speech
14
+ - audio
15
+ - georgian
16
+ - FastConformer
17
+ - Transducer
18
+ - CTC
19
+ - hybrid
20
+ - NeMo
21
+ ---
22
+
23
+ # ka-fastconformer-v2: Georgian speech recognition (FastConformer, 115M)
24
+
25
+ A Georgian speech-to-text model. It is NVIDIA's
26
+ [stt_ka_fastconformer_hybrid_large_pc](https://huggingface.co/nvidia/stt_ka_fastconformer_hybrid_large_pc)
27
+ fine-tuned on 357 hours of Georgian speech, most of it unscripted speech from YouTube videos with creator-made subtitles.
28
+
29
+ The base model was trained on read speech (Common Voice and FLEURS). On spontaneous speech from YouTube channels that neither
30
+ model saw in training, this model gets 0.268 WER, against 0.456 for the base model. On read speech it is also a little
31
+ better (FLEURS 0.115 vs 0.124).
32
+
33
+ - **Size and decoders:** 115M parameters. A FastConformer encoder feeds two decoders: Transducer (the default, more
34
+ accurate) and CTC (faster).
35
+ - **Output:** Georgian letters and spaces only. There is no punctuation, and numbers are written as words. The base model
36
+ writes punctuation; this one was trained on normalized labels.
37
+ - **Input:** 16 kHz mono audio. It was trained on clips of 1–25 s; cut longer audio into windows of up to 30 s (see below).
38
+
39
+ ## Results
40
+
41
+ Both models were scored on the same test clips. Every transcript was normalized the same way before scoring: lowercase,
42
+ no punctuation, numbers as words. WER is the share of words wrong and CER the share of letters wrong; lower is better.
43
+
44
+ | test set | clips | base model (zero-shot), WER / CER | this model, Transducer | this model, CTC decoder |
45
+ |---|---|---|---|---|
46
+ | YouTube, 7 channels never seen in training | 1,952 (7.8 h) | 0.456 / 0.225 | **0.268 / 0.119** | 0.307 / 0.121 |
47
+ | FLEURS Georgian, test | 774 (2.3 h) | 0.124 / 0.030 | **0.115 / 0.027** | 0.141 / 0.033 |
48
+ | Common Voice Georgian, test (see the note) | 3,000 (4.9 h) | 0.039 / 0.009 | 0.042 / 0.009 | 0.057 / 0.012 |
49
+
50
+ - **YouTube:** the 95% bootstrap interval of the Transducer WER is 0.261–0.277. Per channel, this model is better than the
51
+ base model on all 7 channels, with WER between 0.217 and 0.346 (base: 0.280–0.579).
52
+ - **FLEURS:** sentences that contain digits are left out, because the copy we used had their numbers spelled out wrongly.
53
+ - **Common Voice:** don't read these numbers as a fair score for either model. The base model was trained on Common Voice 17,
54
+ and Common Voice reshuffles its splits between releases. Many of these test recordings were probably in the base model's
55
+ training data. Our fine-tuning used only Common Voice train splits.
56
+
57
+ ### Long recordings and speed
58
+
59
+ - **Long recordings:** we took the first 10 minutes of one video from each test channel (7 videos, 67.5 min) and cut them
60
+ into fixed 30 s windows.
61
+ - Transducer: WER 0.254, CER 0.113.
62
+ - CTC decoder: WER 0.287, CER 0.117.
63
+ - Base model: WER 0.439, CER 0.218.
64
+ - **Speed:** measured on one NVIDIA RTX 6000 Ada with batches of 16 windows.
65
+ - Transducer: 478× real time; a single 30 s window takes 264 ms.
66
+ - CTC decoder: 3,328× real time; a single window takes 40 ms.
67
+ - On an A100 80 GB the same network ran at 470× (Transducer) and 2,814× (CTC).
68
+
69
+ ## How to use
70
+
71
+ ```python
72
+ # pip install "nemo_toolkit[asr]"
73
+ import nemo.collections.asr as nemo_asr
74
+
75
+ model = nemo_asr.models.ASRModel.from_pretrained("lukab/ka-fastconformer-v2")
76
+ print(model.transcribe(["audio.wav"])[0].text) # 16 kHz mono
77
+
78
+ model.change_decoding_strategy(decoder_type="ctc") # optional: the faster CTC decoder
79
+ ```
80
+
81
+ To transcribe a long recording, cut it into windows of up to 30 s:
82
+
83
+ ```python
84
+ import soundfile as sf
85
+
86
+ audio, sr = sf.read("long.wav", dtype="float32") # 16 kHz mono
87
+ win = 30 * sr
88
+ chunks = [audio[i:i + win] for i in range(0, len(audio), win)]
89
+ text = " ".join(h.text for h in model.transcribe(chunks, batch_size=16))
90
+ ```
91
+
92
+ Fixed cuts can split a word at a window edge. Cutting at pauses avoids that.
93
+
94
+ ## Training
95
+
96
+ - **Starting point:** all weights of `nvidia/stt_ka_fastconformer_hybrid_large_pc`. The tokenizer (SentencePiece, 1,024
97
+ tokens) is unchanged.
98
+ - **Data:** 124,861 clips, 356.8 hours.
99
+
100
+ | source | hours |
101
+ |---|---|
102
+ | YouTube: creator-subtitled videos with human speakers | 226.1 |
103
+ | YouTube: narration channels not verified as human | 28.8 |
104
+ | YouTube: AI-narrated channels (capped) | 5.0 |
105
+ | Common Voice Georgian (train splits) | 93.2 |
106
+ | FLEURS Georgian (train) | 3.7 |
107
+
108
+ - Common Voice and FLEURS come from the
109
+ [Peacockery/georgian-asr-corpus-v0](https://huggingface.co/datasets/Peacockery/georgian-asr-corpus-v0) collection,
110
+ with its own splits.
111
+ - The YouTube audio is not released.
112
+ - **YouTube clips:** creator subtitles were merged into 3–20 s segments that end at a sentence end where possible.
113
+ - Segments were dropped if they had ambiguous numbers (times, decimals), foreign scripts or an implausible speaking rate.
114
+ - Videos are split by channel, so the 5 dev channels and 7 test channels never appear in training.
115
+ - **Labels:** lowercase, no punctuation, numbers spelled out.
116
+ - **Quality filter:** 3,262 training clips (2.5%) were dropped. In each, the transcript of Meta's untouched Omnilingual ASR
117
+ CTC 300M disagreed with the subtitle (CER above 0.5).
118
+ - **Recipe (NeMo):**
119
+ - 3 epochs: 11,706 updates of 32 clips each.
120
+ - Optimizer: AdamW (betas 0.9 and 0.98, weight decay 1e-3).
121
+ - Learning rate: peak 2e-4, 10% warmup, cosine decay to 1e-6.
122
+ - Gradient clipping at 1.0 and bf16 mixed precision.
123
+ - Hybrid loss: Transducer + 0.3 × CTC.
124
+ - Augmentation: NVIDIA's SpecAugment plus speed perturbation (0.9 / 1.0 / 1.1).
125
+ - The full config is in `training_config.yaml`.
126
+ - **Checkpoint:** chosen by WER on 150 YouTube dev clips from the 5 dev channels. The best was update 9,804, with dev WER
127
+ 0.322 (0.510 before fine-tuning).
128
+ - **Hardware:** one NVIDIA RTX 6000 Ada 48 GB, 1.8 hours.
129
+
130
+ ## Limitations
131
+
132
+ - **Spontaneous speech is still hard.** On the YouTube test, 7.4% of the words are skipped (mostly in fast or overlapping
133
+ speech) and 16.7% are misheard.
134
+ - **No punctuation or digits** in the output.
135
+ - **Offline, not streaming:** the model needs the whole window before it writes text. Live captions need chunked decoding or
136
+ a streaming model.
137
+ - **Narrow domain:** the YouTube data covers a limited set of channels and topics. Other audio, such as phone calls or
138
+ noisy far-field recordings, is untested.
139
+
140
+ ## License and credits
141
+
142
+ - **License:** CC-BY-4.0, the license of the base model.
143
+ - **Base model:** NVIDIA's
144
+ [stt_ka_fastconformer_hybrid_large_pc](https://huggingface.co/nvidia/stt_ka_fastconformer_hybrid_large_pc), trained on
145
+ about 163 h of Common Voice 17 and FLEURS.
146
+ - **Toolkit:** [NVIDIA NeMo](https://github.com/NVIDIA/NeMo).
147
+ - **FastConformer:** Rekesh et al., 2023, [arXiv:2305.05084](https://arxiv.org/abs/2305.05084).
148
+ - **Training data:** Common Voice (CC0) and FLEURS (CC-BY-4.0) via the Peacockery collection (CC-BY-4.0), and Georgian
149
+ YouTube videos with creator-made subtitles, used for research. The audio is not redistributed.
ka-fastconformer-v2.nemo ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:93c4b07f5a636f2547bea24d1418b9c83574f079e698ada6f14abe98b9991251
3
+ size 459304960
training_config.yaml ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Training config of ka-fastconformer-v2, as recorded by the training script (merged with the command-line overrides).
2
+ # ctc_loss_weight: null keeps the base model's value, 0.3. Paths refer to the training machine.
3
+ model_name_or_path: nvidia/stt_ka_fastconformer_hybrid_large_pc
4
+ att_context_size: null
5
+ spec_augment: true
6
+ ctc_loss_weight: null
7
+ data_dir: /data/prepared/v1
8
+ data_version: prepared/v1
9
+ train_sources:
10
+ - youtube
11
+ - youtube_unverified
12
+ - youtube_ai
13
+ - commonvoice
14
+ - fleurs
15
+ min_seconds: 1.0
16
+ max_seconds: 25.0
17
+ keep_ids: /data/scores_train.jsonl
18
+ eval_rows_per_source: 150
19
+ test_rows_per_source: 3000
20
+ speed_perturb: true
21
+ group: n2-fastconformer
22
+ tags:
23
+ - fastconformer
24
+ - nvidia
25
+ - prepared-v1
26
+ - full-data
27
+ - speed-perturb
28
+ notes: NVIDIA's Georgian FastConformer (offline hybrid) fine-tuned on all of prepared/v1,
29
+ 3 epochs, speed perturbation.
30
+ log_model: true
31
+ run_name: n2-fastconformer-ka-full
32
+ output_dir: runs/n2-fastconformer-ka-full
33
+ manifest_dir: /data/nemo
34
+ num_train_epochs: 3
35
+ per_device_train_batch_size: 16
36
+ per_device_eval_batch_size: 32
37
+ gradient_accumulation_steps: 2
38
+ learning_rate: 0.0002
39
+ min_learning_rate: 1.0e-06
40
+ warmup_ratio: 0.1
41
+ weight_decay: 0.001
42
+ adam_beta1: 0.9
43
+ adam_beta2: 0.98
44
+ max_grad_norm: 1.0
45
+ precision: bf16-mixed
46
+ accelerator: gpu
47
+ eval_steps: 4000
48
+ eval_on_start: true
49
+ logging_steps: 10
50
+ dataloader_num_workers: 16
51
+ seed: 42
52
+ report_to:
53
+ - wandb