GersonHMG commited on
Commit
a0eeccb
·
verified ·
1 Parent(s): 7a22c16

Add base-short runtime models, weights and model card

Browse files
Files changed (9) hide show
  1. README.md +116 -0
  2. SHA256SUMS +7 -0
  3. decoder.int8.onnx +3 -0
  4. gate.json +28 -0
  5. model.int8.onnx +3 -0
  6. model.safetensors +3 -0
  7. tokens.txt +40 -0
  8. whisper-tokens.txt +0 -0
  9. whisper_meta.json +15 -0
README.md ADDED
@@ -0,0 +1,116 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ license: cc-by-nc-4.0
5
+ library_name: onnx
6
+ pipeline_tag: automatic-speech-recognition
7
+ base_model: openai/whisper-base
8
+ base_model_relation: finetune
9
+ datasets:
10
+ - openslr/librispeech_asr
11
+ - mispeech/speechocean762
12
+ tags:
13
+ - pronunciation-assessment
14
+ - goodness-of-pronunciation
15
+ - phoneme-recognition
16
+ - mispronunciation-detection
17
+ - arpabet
18
+ - ctc
19
+ - whisper
20
+ - onnx
21
+ - int8
22
+ ---
23
+
24
+ # base-short: pronunciation assessment from whisper-base
25
+
26
+ This is a fine-tune of [openai/whisper-base](https://huggingface.co/openai/whisper-base) for **pronunciation
27
+ assessment of English learners**. One encoder pass over a 16 kHz mono recording gives:
28
+
29
+ 1. **Phone posteriors**: `log_probs [T, 40]` at 20 ms frames (CTC: blank + 39 ARPAbet phones, no stress), for
30
+ goodness-of-pronunciation (GOP) scoring;
31
+ 2. **Cross-attention keys/values** for the stock whisper-base decoder, which gives a transcript for "did they read
32
+ the right sentence" checks only.
33
+
34
+ It is the small option. Its sibling
35
+ [GersonHMG/pronunciation-parakeet](https://huggingface.co/GersonHMG/pronunciation-parakeet) is more accurate but
36
+ four times larger.
37
+
38
+ | | |
39
+ |---|---|
40
+ | Parameters | 77.2M: encoder + phone head 28.4M, decoder 48.9M |
41
+ | Changes to the base | LoRA (rank 16, α 32) on q/v of the top 3 of 6 encoder layers, merged; new phone head |
42
+ | Phone head | softmax layer mix of 7 hidden states → LayerNorm → BiLSTM 2 × 320 → Linear 640→40 (4.7M) |
43
+ | Runtime size | 168 MB (int8 ONNX) |
44
+ | Latency, 5 s clip, 1 CPU thread | 0.32 s |
45
+ | Max input | 30 s |
46
+
47
+ ## Files
48
+
49
+ | File | What it is |
50
+ |---|---|
51
+ | `model.int8.onnx` | samples `[1,N]` → `log_probs [1,T,40]`, `n_layer_cross_k/v [6,1,1500,512]` |
52
+ | `decoder.int8.onnx` | stock whisper-base decoder (sherpa-onnx export format, self-attention KV cache) |
53
+ | `tokens.txt` | phone table |
54
+ | `whisper-tokens.txt` | Whisper vocabulary (base64 bytes → id) |
55
+ | `whisper_meta.json` | special token ids, decoder dims |
56
+ | `gate.json` | gate floor and its calibration statistics |
57
+ | `model.safetensors` | the fp32 weights of both graphs, for reference and parameter counting. Tensor names are the ONNX initializer names, prefixed `model/` or `decoder/`. The runtime does not need this file. |
58
+ | `SHA256SUMS` | checksums |
59
+
60
+ Phone ids: `<blk> 0, AA 1, AE 2, AH 3, AO 4, AW 5, AY 6, B 7, CH 8, D 9, DH 10, EH 11, ER 12, EY 13, F 14, G 15,
61
+ HH 16, IH 17, IY 18, JH 19, K 20, L 21, M 22, N 23, NG 24, OW 25, OY 26, P 27, R 28, S 29, SH 30, T 31, TH 32,
62
+ UH 33, UW 34, V 35, W 36, Y 37, Z 38, ZH 39`.
63
+
64
+ ## Architecture
65
+
66
+ ```
67
+ samples [1,N] ─► loudness normalisation ─► Whisper log-mel, 80 bins, at the real length (no 30 s padding)
68
+ ─► whisper-base encoder (2 conv + 6 transformer layers, d 512, 20 ms frames)
69
+ ├─ 7 hidden states ─► softmax-weighted sum ─► LayerNorm ─► BiLSTM 2×320 ─► Linear ─► log_probs
70
+ └─ last state + constant 30 s "silence tail" to 1500 frames ─► cross k/v for the decoder
71
+ ```
72
+
73
+ Whisper's decoder was trained only on 30 s windows, so the graph appends the encoder output of silence after the
74
+ real frames. Without it the decoder never stops and repeats the sentence.
75
+
76
+ ## Usage notes
77
+
78
+ - Input: float32 `[1, N]`, 16 kHz mono, range [−1, 1]. Loudness and mel features are computed inside the graph.
79
+ - Requires onnxruntime ≥ 1.20. Tested with 1.23 and 1.28, CPU.
80
+ - Text decoding: greedy Whisper with prompt `[50258, 50259, 50359, 50363]`. Suppress `no_timestamps`, `sot`,
81
+ `no_speech`, `translate` (and `eot` and token 220 at step 0). Stop at `<|endoftext|>`, when the output starts
82
+ repeating a block, or at `max(8, 6·seconds) + 8` tokens.
83
+ - Gate: reject an attempt when the CTC log-likelihood of the target phones per frame, `L(c)/T`, is below
84
+ **−0.374** (`gate.json`). It was fitted to accept 2.3% of wrong-sentence attempts.
85
+ - **GOP colour thresholds are not calibrated.** Only the gate and word ranking (which word is worst) were validated.
86
+
87
+ ## Results
88
+
89
+ Speaker-disjoint split; the numbers are on the held-out half. "L2-B" is an L2-ARCTIC sentence group no model trained
90
+ on.
91
+
92
+ | Metric | base-short |
93
+ |---|---|
94
+ | Phone error rate, L2-ARCTIC B / all | 20.7% / 19.1% |
95
+ | Mispronunciation detection F1 (P / R) | 0.505 (0.49 / 0.52) |
96
+ | GOP phone AUC, L2-B | 0.826 |
97
+ | Correlation with expert scores (speechocean762), phone / word | 0.493 / 0.410 |
98
+ | Word ranking AUC, speechocean762 / L2-B | 0.912 / 0.764 |
99
+ | Phone error rate, native read speech (LibriSpeech) | 4.9% |
100
+ | Text WER LibriSpeech / speechocean762 / L2-ARCTIC | 6.2% / 35.0% / 16.2% |
101
+
102
+ The int8 ONNX file scores within about 1 point of the PyTorch model on phone error rate and WER.
103
+
104
+ ## Training data
105
+
106
+ - LibriSpeech train-clean-100 (CC BY 4.0)
107
+ - L2-ARCTIC (CC BY-NC 4.0): Arabic, Mandarin, Hindi, Korean, Spanish and Vietnamese first languages
108
+ - speechocean762 (CC BY 4.0): Mandarin first language, partly children
109
+
110
+ Read speech only. Expect weaker results on spontaneous speech, other accents, noise and far-field audio.
111
+
112
+ ## Licence and attribution
113
+
114
+ - **Non-commercial: CC BY-NC 4.0.** The phone head and LoRA were trained on L2-ARCTIC, which is CC BY-NC 4.0.
115
+ Get legal advice before any commercial use.
116
+ - Built on OpenAI's [whisper-base](https://huggingface.co/openai/whisper-base) (MIT).
SHA256SUMS ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ 231a81a6646b0971fa6f2376cb375e38ef047c350f912a5d4c91837f39e06c84 *decoder.int8.onnx
2
+ 54e89942b1bdbf22984ebfb5089ff48bb179eaada020cbb8e7630e93eefdf498 *gate.json
3
+ a8fbb75f2dfc0a8578c6cfdee1ce99286ba21ab100a646440ffcc40e076ef5a3 *model.int8.onnx
4
+ 9c3c66aefd4df716adedff0d08ce9967a3469e72e4e2f00d4ff3a49dd3c983ac *tokens.txt
5
+ b34b360dbb493e781e479794586d661700670d65564001f23024971d1f2fa126 *whisper-tokens.txt
6
+ 20342b8dc31a77da5ff398ab47f78819758c9c798763ad3cedb1d4119ff2864a *whisper_meta.json
7
+ 52326ef644a2a9a083652d4f69ca0fdf82c4b89c5757e6bcb179c91a3bdaef0b *model.safetensors
decoder.int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:231a81a6646b0971fa6f2376cb375e38ef047c350f912a5d4c91837f39e06c84
3
+ size 130659024
gate.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "bs3c",
3
+ "floor": -0.37440954125091597,
4
+ "wrong_accepted_target": 0.023,
5
+ "wrong_accepted": 0.02315886984715146,
6
+ "genuine_refused_so762": 0.011111111111111112,
7
+ "genuine_q01_q05_median_so762": [
8
+ -0.39143950194824345,
9
+ -0.20738314454544318,
10
+ -0.07671881881977066
11
+ ],
12
+ "wrong_q50_q95_q99_so762": [
13
+ -0.9105667563230115,
14
+ -0.4072960283186184,
15
+ -0.28927623283639387
16
+ ],
17
+ "genuine_refused_l2arctic": 0.008898776418242492,
18
+ "genuine_q01_q05_median_l2arctic": [
19
+ -0.36474409736742813,
20
+ -0.25954746352806635,
21
+ -0.08572272415999528
22
+ ],
23
+ "wrong_q50_q95_q99_l2arctic": [
24
+ -1.5960055396670387,
25
+ -0.9300887775372075,
26
+ -0.718967869081176
27
+ ]
28
+ }
model.int8.onnx ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a8fbb75f2dfc0a8578c6cfdee1ce99286ba21ab100a646440ffcc40e076ef5a3
3
+ size 37736054
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52326ef644a2a9a083652d4f69ca0fdf82c4b89c5757e6bcb179c91a3bdaef0b
3
+ size 308899204
tokens.txt ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <blk> 0
2
+ AA 1
3
+ AE 2
4
+ AH 3
5
+ AO 4
6
+ AW 5
7
+ AY 6
8
+ B 7
9
+ CH 8
10
+ D 9
11
+ DH 10
12
+ EH 11
13
+ ER 12
14
+ EY 13
15
+ F 14
16
+ G 15
17
+ HH 16
18
+ IH 17
19
+ IY 18
20
+ JH 19
21
+ K 20
22
+ L 21
23
+ M 22
24
+ N 23
25
+ NG 24
26
+ OW 25
27
+ OY 26
28
+ P 27
29
+ R 28
30
+ S 29
31
+ SH 30
32
+ T 31
33
+ TH 32
34
+ UH 33
35
+ UW 34
36
+ V 35
37
+ W 36
38
+ Y 37
39
+ Z 38
40
+ ZH 39
whisper-tokens.txt ADDED
The diff for this file is too large to render. See raw diff
 
whisper_meta.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "n_text_layer": 6,
3
+ "n_text_state": 512,
4
+ "n_text_ctx": 448,
5
+ "n_text_head": 8,
6
+ "sot": 50258,
7
+ "eot": 50257,
8
+ "blank_id": 220,
9
+ "no_speech": 50362,
10
+ "transcribe": 50359,
11
+ "translate": 50358,
12
+ "no_timestamps": 50363,
13
+ "n_vocab": 51865,
14
+ "en": 50259
15
+ }