Training in progress, step 200
Browse files- .gitignore +1 -0
- .ipynb_checkpoints/fine-tune-whisper-non-streaming-zh-checkpoint.ipynb +1701 -0
- added_tokens.json +109 -0
- config.json +42 -0
- fine-tune-whisper-non-streaming-zh.ipynb +1371 -0
- merges.txt +0 -0
- normalizer.json +1742 -0
- preprocessor_config.json +0 -0
- pytorch_model.bin +3 -0
- runs/Dec20_16-48-49_DANDAN/1671526137.5930755/events.out.tfevents.1671526137.DANDAN.29004.1 +3 -0
- runs/Dec20_16-48-49_DANDAN/events.out.tfevents.1671526137.DANDAN.29004.0 +3 -0
- special_tokens_map.json +133 -0
- tokenizer_config.json +36 -0
- training_args.bin +3 -0
- vocab.json +0 -0
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
checkpoint-*/
|
.ipynb_checkpoints/fine-tune-whisper-non-streaming-zh-checkpoint.ipynb
ADDED
@@ -0,0 +1,1701 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"id": "75b58048-7d14-4fc6-8085-1fc08c81b4a6",
|
6 |
+
"metadata": {
|
7 |
+
"id": "75b58048-7d14-4fc6-8085-1fc08c81b4a6"
|
8 |
+
},
|
9 |
+
"source": [
|
10 |
+
"# Fine-Tune Whisper For Multilingual ASR with 🤗 Transformers"
|
11 |
+
]
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"cell_type": "markdown",
|
15 |
+
"id": "fbfa8ad5-4cdc-4512-9058-836cbbf65e1a",
|
16 |
+
"metadata": {
|
17 |
+
"id": "fbfa8ad5-4cdc-4512-9058-836cbbf65e1a"
|
18 |
+
},
|
19 |
+
"source": [
|
20 |
+
"In this Colab, we present a step-by-step guide on how to fine-tune Whisper \n",
|
21 |
+
"for any multilingual ASR dataset using Hugging Face 🤗 Transformers. This is a \n",
|
22 |
+
"more \"hands-on\" version of the accompanying [blog post](https://huggingface.co/blog/fine-tune-whisper). \n",
|
23 |
+
"For a more in-depth explanation of Whisper, the Common Voice dataset and the theory behind fine-tuning, the reader is advised to refer to the blog post."
|
24 |
+
]
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"cell_type": "markdown",
|
28 |
+
"id": "afe0d503-ae4e-4aa7-9af4-dbcba52db41e",
|
29 |
+
"metadata": {
|
30 |
+
"id": "afe0d503-ae4e-4aa7-9af4-dbcba52db41e"
|
31 |
+
},
|
32 |
+
"source": [
|
33 |
+
"## Introduction"
|
34 |
+
]
|
35 |
+
},
|
36 |
+
{
|
37 |
+
"cell_type": "markdown",
|
38 |
+
"id": "9ae91ed4-9c3e-4ade-938e-f4c2dcfbfdc0",
|
39 |
+
"metadata": {
|
40 |
+
"id": "9ae91ed4-9c3e-4ade-938e-f4c2dcfbfdc0"
|
41 |
+
},
|
42 |
+
"source": [
|
43 |
+
"Whisper is a pre-trained model for automatic speech recognition (ASR) \n",
|
44 |
+
"published in [September 2022](https://openai.com/blog/whisper/) by the authors \n",
|
45 |
+
"Alec Radford et al. from OpenAI. Unlike many of its predecessors, such as \n",
|
46 |
+
"[Wav2Vec 2.0](https://arxiv.org/abs/2006.11477), which are pre-trained \n",
|
47 |
+
"on un-labelled audio data, Whisper is pre-trained on a vast quantity of \n",
|
48 |
+
"**labelled** audio-transcription data, 680,000 hours to be precise. \n",
|
49 |
+
"This is an order of magnitude more data than the un-labelled audio data used \n",
|
50 |
+
"to train Wav2Vec 2.0 (60,000 hours). What is more, 117,000 hours of this \n",
|
51 |
+
"pre-training data is multilingual ASR data. This results in checkpoints \n",
|
52 |
+
"that can be applied to over 96 languages, many of which are considered \n",
|
53 |
+
"_low-resource_.\n",
|
54 |
+
"\n",
|
55 |
+
"When scaled to 680,000 hours of labelled pre-training data, Whisper models \n",
|
56 |
+
"demonstrate a strong ability to generalise to many datasets and domains.\n",
|
57 |
+
"The pre-trained checkpoints achieve competitive results to state-of-the-art \n",
|
58 |
+
"ASR systems, with near 3% word error rate (WER) on the test-clean subset of \n",
|
59 |
+
"LibriSpeech ASR and a new state-of-the-art on TED-LIUM with 4.7% WER (_c.f._ \n",
|
60 |
+
"Table 8 of the [Whisper paper](https://cdn.openai.com/papers/whisper.pdf)).\n",
|
61 |
+
"The extensive multilingual ASR knowledge acquired by Whisper during pre-training \n",
|
62 |
+
"can be leveraged for other low-resource languages; through fine-tuning, the \n",
|
63 |
+
"pre-trained checkpoints can be adapted for specific datasets and languages \n",
|
64 |
+
"to further improve upon these results. We'll show just how Whisper can be fine-tuned \n",
|
65 |
+
"for low-resource languages in this Colab."
|
66 |
+
]
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"cell_type": "markdown",
|
70 |
+
"id": "e59b91d6-be24-4b5e-bb38-4977ea143a72",
|
71 |
+
"metadata": {
|
72 |
+
"id": "e59b91d6-be24-4b5e-bb38-4977ea143a72"
|
73 |
+
},
|
74 |
+
"source": [
|
75 |
+
"<figure>\n",
|
76 |
+
"<img src=\"https://raw.githubusercontent.com/sanchit-gandhi/notebooks/main/whisper_architecture.svg\" alt=\"Trulli\" style=\"width:100%\">\n",
|
77 |
+
"<figcaption align = \"center\"><b>Figure 1:</b> Whisper model. The architecture \n",
|
78 |
+
"follows the standard Transformer-based encoder-decoder model. A \n",
|
79 |
+
"log-Mel spectrogram is input to the encoder. The last encoder \n",
|
80 |
+
"hidden states are input to the decoder via cross-attention mechanisms. The \n",
|
81 |
+
"decoder autoregressively predicts text tokens, jointly conditional on the \n",
|
82 |
+
"encoder hidden states and previously predicted tokens. Figure source: \n",
|
83 |
+
"<a href=\"https://openai.com/blog/whisper/\">OpenAI Whisper Blog</a>.</figcaption>\n",
|
84 |
+
"</figure>"
|
85 |
+
]
|
86 |
+
},
|
87 |
+
{
|
88 |
+
"cell_type": "markdown",
|
89 |
+
"id": "21b6316e-8a55-4549-a154-66d3da2ab74a",
|
90 |
+
"metadata": {
|
91 |
+
"id": "21b6316e-8a55-4549-a154-66d3da2ab74a"
|
92 |
+
},
|
93 |
+
"source": [
|
94 |
+
"The Whisper checkpoints come in five configurations of varying model sizes.\n",
|
95 |
+
"The smallest four are trained on either English-only or multilingual data.\n",
|
96 |
+
"The largest checkpoint is multilingual only. All nine of the pre-trained checkpoints \n",
|
97 |
+
"are available on the [Hugging Face Hub](https://huggingface.co/models?search=openai/whisper). The \n",
|
98 |
+
"checkpoints are summarised in the following table with links to the models on the Hub:\n",
|
99 |
+
"\n",
|
100 |
+
"| Size | Layers | Width | Heads | Parameters | English-only | Multilingual |\n",
|
101 |
+
"|--------|--------|-------|-------|------------|------------------------------------------------------|---------------------------------------------------|\n",
|
102 |
+
"| tiny | 4 | 384 | 6 | 39 M | [✓](https://huggingface.co/openai/whisper-tiny.en) | [✓](https://huggingface.co/openai/whisper-tiny.) |\n",
|
103 |
+
"| base | 6 | 512 | 8 | 74 M | [✓](https://huggingface.co/openai/whisper-base.en) | [✓](https://huggingface.co/openai/whisper-base) |\n",
|
104 |
+
"| small | 12 | 768 | 12 | 244 M | [✓](https://huggingface.co/openai/whisper-small.en) | [✓](https://huggingface.co/openai/whisper-small) |\n",
|
105 |
+
"| medium | 24 | 1024 | 16 | 769 M | [✓](https://huggingface.co/openai/whisper-medium.en) | [✓](https://huggingface.co/openai/whisper-medium) |\n",
|
106 |
+
"| large | 32 | 1280 | 20 | 1550 M | x | [✓](https://huggingface.co/openai/whisper-large) |\n",
|
107 |
+
"\n",
|
108 |
+
"For demonstration purposes, we'll fine-tune the multilingual version of the \n",
|
109 |
+
"[`\"small\"`](https://huggingface.co/openai/whisper-small) checkpoint with 244M params (~= 1GB). \n",
|
110 |
+
"As for our data, we'll train and evaluate our system on a low-resource language \n",
|
111 |
+
"taken from the [Common Voice](https://huggingface.co/datasets/mozilla-foundation/fleurs_11_0)\n",
|
112 |
+
"dataset. We'll show that with as little as 8 hours of fine-tuning data, we can achieve \n",
|
113 |
+
"strong performance in this language."
|
114 |
+
]
|
115 |
+
},
|
116 |
+
{
|
117 |
+
"cell_type": "markdown",
|
118 |
+
"id": "3a680dfc-cbba-4f6c-8a1f-e1a5ff3f123a",
|
119 |
+
"metadata": {
|
120 |
+
"id": "3a680dfc-cbba-4f6c-8a1f-e1a5ff3f123a"
|
121 |
+
},
|
122 |
+
"source": [
|
123 |
+
"------------------------------------------------------------------------\n",
|
124 |
+
"\n",
|
125 |
+
"\\\\({}^1\\\\) The name Whisper follows from the acronym “WSPSR”, which stands for “Web-scale Supervised Pre-training for Speech Recognition”."
|
126 |
+
]
|
127 |
+
},
|
128 |
+
{
|
129 |
+
"cell_type": "markdown",
|
130 |
+
"id": "b219c9dd-39b6-4a95-b2a1-3f547a1e7bc0",
|
131 |
+
"metadata": {
|
132 |
+
"id": "b219c9dd-39b6-4a95-b2a1-3f547a1e7bc0"
|
133 |
+
},
|
134 |
+
"source": [
|
135 |
+
"## Load Dataset\n",
|
136 |
+
"Loading MS-MY Dataset from FLEURS.\n",
|
137 |
+
"Combine train and validation set."
|
138 |
+
]
|
139 |
+
},
|
140 |
+
{
|
141 |
+
"cell_type": "code",
|
142 |
+
"execution_count": 1,
|
143 |
+
"id": "a2787582-554f-44ce-9f38-4180a5ed6b44",
|
144 |
+
"metadata": {
|
145 |
+
"id": "a2787582-554f-44ce-9f38-4180a5ed6b44"
|
146 |
+
},
|
147 |
+
"outputs": [
|
148 |
+
{
|
149 |
+
"name": "stdout",
|
150 |
+
"output_type": "stream",
|
151 |
+
"text": [
|
152 |
+
"Downloading and preparing dataset common_voice_11_0/zh-TW to /home/daniel/.cache/huggingface/datasets/mozilla-foundation___common_voice_11_0/zh-TW/11.0.0/f8e47235d9b4e68fa24ed71d63266a02018ccf7194b2a8c9c598a5f3ab304d9f...\n"
|
153 |
+
]
|
154 |
+
},
|
155 |
+
{
|
156 |
+
"data": {
|
157 |
+
"application/vnd.jupyter.widget-view+json": {
|
158 |
+
"model_id": "2b102b9d1660420cabb06bfe54c35c25",
|
159 |
+
"version_major": 2,
|
160 |
+
"version_minor": 0
|
161 |
+
},
|
162 |
+
"text/plain": [
|
163 |
+
"Downloading data files: 0%| | 0/5 [00:00<?, ?it/s]"
|
164 |
+
]
|
165 |
+
},
|
166 |
+
"metadata": {},
|
167 |
+
"output_type": "display_data"
|
168 |
+
},
|
169 |
+
{
|
170 |
+
"data": {
|
171 |
+
"application/vnd.jupyter.widget-view+json": {
|
172 |
+
"model_id": "bfd9db96bd5c47fbb8847a7211b71c1b",
|
173 |
+
"version_major": 2,
|
174 |
+
"version_minor": 0
|
175 |
+
},
|
176 |
+
"text/plain": [
|
177 |
+
"Downloading data: 0%| | 0.00/152M [00:00<?, ?B/s]"
|
178 |
+
]
|
179 |
+
},
|
180 |
+
"metadata": {},
|
181 |
+
"output_type": "display_data"
|
182 |
+
},
|
183 |
+
{
|
184 |
+
"data": {
|
185 |
+
"application/vnd.jupyter.widget-view+json": {
|
186 |
+
"model_id": "0f0161d0a1d04428bf295e1ce0bfc7d8",
|
187 |
+
"version_major": 2,
|
188 |
+
"version_minor": 0
|
189 |
+
},
|
190 |
+
"text/plain": [
|
191 |
+
"Downloading data: 0%| | 0.00/120M [00:00<?, ?B/s]"
|
192 |
+
]
|
193 |
+
},
|
194 |
+
"metadata": {},
|
195 |
+
"output_type": "display_data"
|
196 |
+
},
|
197 |
+
{
|
198 |
+
"data": {
|
199 |
+
"application/vnd.jupyter.widget-view+json": {
|
200 |
+
"model_id": "d85a133c5b5c4f8883faada1fcee9ddf",
|
201 |
+
"version_major": 2,
|
202 |
+
"version_minor": 0
|
203 |
+
},
|
204 |
+
"text/plain": [
|
205 |
+
"Downloading data: 0%| | 0.00/134M [00:00<?, ?B/s]"
|
206 |
+
]
|
207 |
+
},
|
208 |
+
"metadata": {},
|
209 |
+
"output_type": "display_data"
|
210 |
+
},
|
211 |
+
{
|
212 |
+
"data": {
|
213 |
+
"application/vnd.jupyter.widget-view+json": {
|
214 |
+
"model_id": "b2b0ecba08154555a3f1940c2d7e3f18",
|
215 |
+
"version_major": 2,
|
216 |
+
"version_minor": 0
|
217 |
+
},
|
218 |
+
"text/plain": [
|
219 |
+
"Downloading data: 0%| | 0.00/995M [00:00<?, ?B/s]"
|
220 |
+
]
|
221 |
+
},
|
222 |
+
"metadata": {},
|
223 |
+
"output_type": "display_data"
|
224 |
+
},
|
225 |
+
{
|
226 |
+
"data": {
|
227 |
+
"application/vnd.jupyter.widget-view+json": {
|
228 |
+
"model_id": "689229ba2edf47bea236f231fdd845b8",
|
229 |
+
"version_major": 2,
|
230 |
+
"version_minor": 0
|
231 |
+
},
|
232 |
+
"text/plain": [
|
233 |
+
"Downloading data: 0%| | 0.00/18.6M [00:00<?, ?B/s]"
|
234 |
+
]
|
235 |
+
},
|
236 |
+
"metadata": {},
|
237 |
+
"output_type": "display_data"
|
238 |
+
},
|
239 |
+
{
|
240 |
+
"data": {
|
241 |
+
"application/vnd.jupyter.widget-view+json": {
|
242 |
+
"model_id": "728521ae7d68422c92c2c29cc9aaff7a",
|
243 |
+
"version_major": 2,
|
244 |
+
"version_minor": 0
|
245 |
+
},
|
246 |
+
"text/plain": [
|
247 |
+
"Downloading data: 0%| | 0.00/128M [00:00<?, ?B/s]"
|
248 |
+
]
|
249 |
+
},
|
250 |
+
"metadata": {},
|
251 |
+
"output_type": "display_data"
|
252 |
+
},
|
253 |
+
{
|
254 |
+
"data": {
|
255 |
+
"application/vnd.jupyter.widget-view+json": {
|
256 |
+
"model_id": "e6c78710e8dd4f00a856ba8c17325ca9",
|
257 |
+
"version_major": 2,
|
258 |
+
"version_minor": 0
|
259 |
+
},
|
260 |
+
"text/plain": [
|
261 |
+
"Extracting data files: 0%| | 0/5 [00:00<?, ?it/s]"
|
262 |
+
]
|
263 |
+
},
|
264 |
+
"metadata": {},
|
265 |
+
"output_type": "display_data"
|
266 |
+
},
|
267 |
+
{
|
268 |
+
"data": {
|
269 |
+
"application/vnd.jupyter.widget-view+json": {
|
270 |
+
"model_id": "cc7cdaf4c35b4784990b949d05f43b47",
|
271 |
+
"version_major": 2,
|
272 |
+
"version_minor": 0
|
273 |
+
},
|
274 |
+
"text/plain": [
|
275 |
+
"Downloading data files: 0%| | 0/5 [00:00<?, ?it/s]"
|
276 |
+
]
|
277 |
+
},
|
278 |
+
"metadata": {},
|
279 |
+
"output_type": "display_data"
|
280 |
+
},
|
281 |
+
{
|
282 |
+
"data": {
|
283 |
+
"application/vnd.jupyter.widget-view+json": {
|
284 |
+
"model_id": "628b00ae5c7a4ac082453b11bd3fb68a",
|
285 |
+
"version_major": 2,
|
286 |
+
"version_minor": 0
|
287 |
+
},
|
288 |
+
"text/plain": [
|
289 |
+
"Downloading data: 0%| | 0.00/1.49M [00:00<?, ?B/s]"
|
290 |
+
]
|
291 |
+
},
|
292 |
+
"metadata": {},
|
293 |
+
"output_type": "display_data"
|
294 |
+
},
|
295 |
+
{
|
296 |
+
"data": {
|
297 |
+
"application/vnd.jupyter.widget-view+json": {
|
298 |
+
"model_id": "34941d3d98554e4dbac5e27e20cc84df",
|
299 |
+
"version_major": 2,
|
300 |
+
"version_minor": 0
|
301 |
+
},
|
302 |
+
"text/plain": [
|
303 |
+
"Downloading data: 0%| | 0.00/1.02M [00:00<?, ?B/s]"
|
304 |
+
]
|
305 |
+
},
|
306 |
+
"metadata": {},
|
307 |
+
"output_type": "display_data"
|
308 |
+
},
|
309 |
+
{
|
310 |
+
"data": {
|
311 |
+
"application/vnd.jupyter.widget-view+json": {
|
312 |
+
"model_id": "5e5886ccc15a497380aae6559f11abd1",
|
313 |
+
"version_major": 2,
|
314 |
+
"version_minor": 0
|
315 |
+
},
|
316 |
+
"text/plain": [
|
317 |
+
"Downloading data: 0%| | 0.00/983k [00:00<?, ?B/s]"
|
318 |
+
]
|
319 |
+
},
|
320 |
+
"metadata": {},
|
321 |
+
"output_type": "display_data"
|
322 |
+
},
|
323 |
+
{
|
324 |
+
"data": {
|
325 |
+
"application/vnd.jupyter.widget-view+json": {
|
326 |
+
"model_id": "830007d441bd44109a015d89d27e0ba9",
|
327 |
+
"version_major": 2,
|
328 |
+
"version_minor": 0
|
329 |
+
},
|
330 |
+
"text/plain": [
|
331 |
+
"Downloading data: 0%| | 0.00/8.75M [00:00<?, ?B/s]"
|
332 |
+
]
|
333 |
+
},
|
334 |
+
"metadata": {},
|
335 |
+
"output_type": "display_data"
|
336 |
+
},
|
337 |
+
{
|
338 |
+
"data": {
|
339 |
+
"application/vnd.jupyter.widget-view+json": {
|
340 |
+
"model_id": "8df8ab2f3cdd4f51bc4f7bdc31f9d2a7",
|
341 |
+
"version_major": 2,
|
342 |
+
"version_minor": 0
|
343 |
+
},
|
344 |
+
"text/plain": [
|
345 |
+
"Downloading data: 0%| | 0.00/995k [00:00<?, ?B/s]"
|
346 |
+
]
|
347 |
+
},
|
348 |
+
"metadata": {},
|
349 |
+
"output_type": "display_data"
|
350 |
+
},
|
351 |
+
{
|
352 |
+
"data": {
|
353 |
+
"application/vnd.jupyter.widget-view+json": {
|
354 |
+
"model_id": "fa78caff99dc442b9612c266eda880f3",
|
355 |
+
"version_major": 2,
|
356 |
+
"version_minor": 0
|
357 |
+
},
|
358 |
+
"text/plain": [
|
359 |
+
"Extracting data files: 0%| | 0/5 [00:00<?, ?it/s]"
|
360 |
+
]
|
361 |
+
},
|
362 |
+
"metadata": {},
|
363 |
+
"output_type": "display_data"
|
364 |
+
},
|
365 |
+
{
|
366 |
+
"data": {
|
367 |
+
"application/vnd.jupyter.widget-view+json": {
|
368 |
+
"model_id": "",
|
369 |
+
"version_major": 2,
|
370 |
+
"version_minor": 0
|
371 |
+
},
|
372 |
+
"text/plain": [
|
373 |
+
"Generating train split: 0 examples [00:00, ? examples/s]"
|
374 |
+
]
|
375 |
+
},
|
376 |
+
"metadata": {},
|
377 |
+
"output_type": "display_data"
|
378 |
+
},
|
379 |
+
{
|
380 |
+
"name": "stderr",
|
381 |
+
"output_type": "stream",
|
382 |
+
"text": [
|
383 |
+
"\n",
|
384 |
+
"Reading metadata...: 6568it [00:00, 242101.00it/s]\n"
|
385 |
+
]
|
386 |
+
},
|
387 |
+
{
|
388 |
+
"data": {
|
389 |
+
"application/vnd.jupyter.widget-view+json": {
|
390 |
+
"model_id": "",
|
391 |
+
"version_major": 2,
|
392 |
+
"version_minor": 0
|
393 |
+
},
|
394 |
+
"text/plain": [
|
395 |
+
"Generating validation split: 0 examples [00:00, ? examples/s]"
|
396 |
+
]
|
397 |
+
},
|
398 |
+
"metadata": {},
|
399 |
+
"output_type": "display_data"
|
400 |
+
},
|
401 |
+
{
|
402 |
+
"name": "stderr",
|
403 |
+
"output_type": "stream",
|
404 |
+
"text": [
|
405 |
+
"\n",
|
406 |
+
"\n",
|
407 |
+
"Reading metadata...: 4709it [00:00, 244282.56it/s]\n"
|
408 |
+
]
|
409 |
+
},
|
410 |
+
{
|
411 |
+
"data": {
|
412 |
+
"application/vnd.jupyter.widget-view+json": {
|
413 |
+
"model_id": "",
|
414 |
+
"version_major": 2,
|
415 |
+
"version_minor": 0
|
416 |
+
},
|
417 |
+
"text/plain": [
|
418 |
+
"Generating test split: 0 examples [00:00, ? examples/s]"
|
419 |
+
]
|
420 |
+
},
|
421 |
+
"metadata": {},
|
422 |
+
"output_type": "display_data"
|
423 |
+
},
|
424 |
+
{
|
425 |
+
"name": "stderr",
|
426 |
+
"output_type": "stream",
|
427 |
+
"text": [
|
428 |
+
"\n",
|
429 |
+
"\n",
|
430 |
+
"\n",
|
431 |
+
"Reading metadata...: 4709it [00:00, 253653.42it/s]\n"
|
432 |
+
]
|
433 |
+
},
|
434 |
+
{
|
435 |
+
"data": {
|
436 |
+
"application/vnd.jupyter.widget-view+json": {
|
437 |
+
"model_id": "",
|
438 |
+
"version_major": 2,
|
439 |
+
"version_minor": 0
|
440 |
+
},
|
441 |
+
"text/plain": [
|
442 |
+
"Generating other split: 0 examples [00:00, ? examples/s]"
|
443 |
+
]
|
444 |
+
},
|
445 |
+
"metadata": {},
|
446 |
+
"output_type": "display_data"
|
447 |
+
},
|
448 |
+
{
|
449 |
+
"name": "stderr",
|
450 |
+
"output_type": "stream",
|
451 |
+
"text": [
|
452 |
+
"\n",
|
453 |
+
"\n",
|
454 |
+
"\n",
|
455 |
+
"\n",
|
456 |
+
"Reading metadata...: 0it [00:00, ?it/s]\u001b[A\u001b[A\u001b[A\u001b[A\n",
|
457 |
+
"\n",
|
458 |
+
"\n",
|
459 |
+
"\n",
|
460 |
+
"Reading metadata...: 40630it [00:00, 258238.72it/s]\u001b[A\u001b[A\u001b[A\u001b[A\n"
|
461 |
+
]
|
462 |
+
},
|
463 |
+
{
|
464 |
+
"data": {
|
465 |
+
"application/vnd.jupyter.widget-view+json": {
|
466 |
+
"model_id": "",
|
467 |
+
"version_major": 2,
|
468 |
+
"version_minor": 0
|
469 |
+
},
|
470 |
+
"text/plain": [
|
471 |
+
"Generating invalidated split: 0 examples [00:00, ? examples/s]"
|
472 |
+
]
|
473 |
+
},
|
474 |
+
"metadata": {},
|
475 |
+
"output_type": "display_data"
|
476 |
+
},
|
477 |
+
{
|
478 |
+
"name": "stderr",
|
479 |
+
"output_type": "stream",
|
480 |
+
"text": [
|
481 |
+
"\n",
|
482 |
+
"Reading metadata...: 4596it [00:00, 253281.76it/s]\n"
|
483 |
+
]
|
484 |
+
},
|
485 |
+
{
|
486 |
+
"name": "stdout",
|
487 |
+
"output_type": "stream",
|
488 |
+
"text": [
|
489 |
+
"Dataset common_voice_11_0 downloaded and prepared to /home/daniel/.cache/huggingface/datasets/mozilla-foundation___common_voice_11_0/zh-TW/11.0.0/f8e47235d9b4e68fa24ed71d63266a02018ccf7194b2a8c9c598a5f3ab304d9f. Subsequent calls will reuse this data.\n"
|
490 |
+
]
|
491 |
+
},
|
492 |
+
{
|
493 |
+
"name": "stderr",
|
494 |
+
"output_type": "stream",
|
495 |
+
"text": [
|
496 |
+
"Found cached dataset common_voice_11_0 (/home/daniel/.cache/huggingface/datasets/mozilla-foundation___common_voice_11_0/zh-TW/11.0.0/f8e47235d9b4e68fa24ed71d63266a02018ccf7194b2a8c9c598a5f3ab304d9f)\n"
|
497 |
+
]
|
498 |
+
},
|
499 |
+
{
|
500 |
+
"name": "stdout",
|
501 |
+
"output_type": "stream",
|
502 |
+
"text": [
|
503 |
+
"DatasetDict({\n",
|
504 |
+
" train: Dataset({\n",
|
505 |
+
" features: ['audio', 'sentence'],\n",
|
506 |
+
" num_rows: 11277\n",
|
507 |
+
" })\n",
|
508 |
+
" test: Dataset({\n",
|
509 |
+
" features: ['audio', 'sentence'],\n",
|
510 |
+
" num_rows: 4709\n",
|
511 |
+
" })\n",
|
512 |
+
"})\n"
|
513 |
+
]
|
514 |
+
}
|
515 |
+
],
|
516 |
+
"source": [
|
517 |
+
"from datasets import load_dataset, DatasetDict\n",
|
518 |
+
"\n",
|
519 |
+
"cv = DatasetDict()\n",
|
520 |
+
"cv[\"train\"] = load_dataset(\"mozilla-foundation/common_voice_11_0\", \"zh-TW\", split=\"train+validation\", use_auth_token=True)\n",
|
521 |
+
"cv[\"test\"] = load_dataset(\"mozilla-foundation/common_voice_11_0\", \"zh-TW\", split=\"test\", use_auth_token=True)\n",
|
522 |
+
"\n",
|
523 |
+
"cv = cv.remove_columns([\"client_id\", \"path\", \"up_votes\", \"down_votes\", \"age\", \"gender\", \"accent\", \"locale\", \"segment\"])\n",
|
524 |
+
"print(cv)"
|
525 |
+
]
|
526 |
+
},
|
527 |
+
{
|
528 |
+
"cell_type": "code",
|
529 |
+
"execution_count": 20,
|
530 |
+
"id": "79731fc3",
|
531 |
+
"metadata": {},
|
532 |
+
"outputs": [
|
533 |
+
{
|
534 |
+
"data": {
|
535 |
+
"text/plain": [
|
536 |
+
"{'audio': {'path': None,\n",
|
537 |
+
" 'array': array([0., 0., 0., ..., 0., 0., 0.]),\n",
|
538 |
+
" 'sampling_rate': 16000},\n",
|
539 |
+
" 'sentence': '爸爸們父親節快樂!'}"
|
540 |
+
]
|
541 |
+
},
|
542 |
+
"execution_count": 20,
|
543 |
+
"metadata": {},
|
544 |
+
"output_type": "execute_result"
|
545 |
+
}
|
546 |
+
],
|
547 |
+
"source": [
|
548 |
+
"cv['train'][18]"
|
549 |
+
]
|
550 |
+
},
|
551 |
+
{
|
552 |
+
"cell_type": "markdown",
|
553 |
+
"id": "2d63b2d2-f68a-4d74-b7f1-5127f6d16605",
|
554 |
+
"metadata": {
|
555 |
+
"id": "2d63b2d2-f68a-4d74-b7f1-5127f6d16605"
|
556 |
+
},
|
557 |
+
"source": [
|
558 |
+
"## Prepare Feature Extractor, Tokenizer and Data"
|
559 |
+
]
|
560 |
+
},
|
561 |
+
{
|
562 |
+
"cell_type": "markdown",
|
563 |
+
"id": "601c3099-1026-439e-93e2-5635b3ba5a73",
|
564 |
+
"metadata": {
|
565 |
+
"id": "601c3099-1026-439e-93e2-5635b3ba5a73"
|
566 |
+
},
|
567 |
+
"source": [
|
568 |
+
"The ASR pipeline can be de-composed into three stages: \n",
|
569 |
+
"1) A feature extractor which pre-processes the raw audio-inputs\n",
|
570 |
+
"2) The model which performs the sequence-to-sequence mapping \n",
|
571 |
+
"3) A tokenizer which post-processes the model outputs to text format\n",
|
572 |
+
"\n",
|
573 |
+
"In 🤗 Transformers, the Whisper model has an associated feature extractor and tokenizer, \n",
|
574 |
+
"called [WhisperFeatureExtractor](https://huggingface.co/docs/transformers/main/model_doc/whisper#transformers.WhisperFeatureExtractor)\n",
|
575 |
+
"and [WhisperTokenizer](https://huggingface.co/docs/transformers/main/model_doc/whisper#transformers.WhisperTokenizer) \n",
|
576 |
+
"respectively.\n",
|
577 |
+
"\n",
|
578 |
+
"We'll go through details for setting-up the feature extractor and tokenizer one-by-one!"
|
579 |
+
]
|
580 |
+
},
|
581 |
+
{
|
582 |
+
"cell_type": "markdown",
|
583 |
+
"id": "560332eb-3558-41a1-b500-e83a9f695f84",
|
584 |
+
"metadata": {
|
585 |
+
"id": "560332eb-3558-41a1-b500-e83a9f695f84"
|
586 |
+
},
|
587 |
+
"source": [
|
588 |
+
"### Load WhisperFeatureExtractor"
|
589 |
+
]
|
590 |
+
},
|
591 |
+
{
|
592 |
+
"cell_type": "markdown",
|
593 |
+
"id": "32ec8068-0bd7-412d-b662-0edb9d1e7365",
|
594 |
+
"metadata": {
|
595 |
+
"id": "32ec8068-0bd7-412d-b662-0edb9d1e7365"
|
596 |
+
},
|
597 |
+
"source": [
|
598 |
+
"The Whisper feature extractor performs two operations:\n",
|
599 |
+
"1. Pads / truncates the audio inputs to 30s: any audio inputs shorter than 30s are padded to 30s with silence (zeros), and those longer that 30s are truncated to 30s\n",
|
600 |
+
"2. Converts the audio inputs to _log-Mel spectrogram_ input features, a visual representation of the audio and the form of the input expected by the Whisper model"
|
601 |
+
]
|
602 |
+
},
|
603 |
+
{
|
604 |
+
"cell_type": "markdown",
|
605 |
+
"id": "589d9ec1-d12b-4b64-93f7-04c63997da19",
|
606 |
+
"metadata": {
|
607 |
+
"id": "589d9ec1-d12b-4b64-93f7-04c63997da19"
|
608 |
+
},
|
609 |
+
"source": [
|
610 |
+
"<figure>\n",
|
611 |
+
"<img src=\"https://raw.githubusercontent.com/sanchit-gandhi/notebooks/main/spectrogram.jpg\" alt=\"Trulli\" style=\"width:100%\">\n",
|
612 |
+
"<figcaption align = \"center\"><b>Figure 2:</b> Conversion of sampled audio array to log-Mel spectrogram.\n",
|
613 |
+
"Left: sampled 1-dimensional audio signal. Right: corresponding log-Mel spectrogram. Figure source:\n",
|
614 |
+
"<a href=\"https://ai.googleblog.com/2019/04/specaugment-new-data-augmentation.html\">Google SpecAugment Blog</a>.\n",
|
615 |
+
"</figcaption>"
|
616 |
+
]
|
617 |
+
},
|
618 |
+
{
|
619 |
+
"cell_type": "markdown",
|
620 |
+
"id": "b2ef54d5-b946-4c1d-9fdc-adc5d01b46aa",
|
621 |
+
"metadata": {
|
622 |
+
"id": "b2ef54d5-b946-4c1d-9fdc-adc5d01b46aa"
|
623 |
+
},
|
624 |
+
"source": [
|
625 |
+
"We'll load the feature extractor from the pre-trained checkpoint with the default values:"
|
626 |
+
]
|
627 |
+
},
|
628 |
+
{
|
629 |
+
"cell_type": "code",
|
630 |
+
"execution_count": 2,
|
631 |
+
"id": "bc77d7bb-f9e2-47f5-b663-30f7a4321ce5",
|
632 |
+
"metadata": {
|
633 |
+
"id": "bc77d7bb-f9e2-47f5-b663-30f7a4321ce5"
|
634 |
+
},
|
635 |
+
"outputs": [],
|
636 |
+
"source": [
|
637 |
+
"from transformers import WhisperFeatureExtractor\n",
|
638 |
+
"\n",
|
639 |
+
"feature_extractor = WhisperFeatureExtractor.from_pretrained(\"openai/whisper-medium\")"
|
640 |
+
]
|
641 |
+
},
|
642 |
+
{
|
643 |
+
"cell_type": "markdown",
|
644 |
+
"id": "93748af7-b917-4ecf-a0c8-7d89077ff9cb",
|
645 |
+
"metadata": {
|
646 |
+
"id": "93748af7-b917-4ecf-a0c8-7d89077ff9cb"
|
647 |
+
},
|
648 |
+
"source": [
|
649 |
+
"### Load WhisperTokenizer"
|
650 |
+
]
|
651 |
+
},
|
652 |
+
{
|
653 |
+
"cell_type": "markdown",
|
654 |
+
"id": "2bc82609-a9fb-447a-a2af-99597c864029",
|
655 |
+
"metadata": {
|
656 |
+
"id": "2bc82609-a9fb-447a-a2af-99597c864029"
|
657 |
+
},
|
658 |
+
"source": [
|
659 |
+
"The Whisper model outputs a sequence of _token ids_. The tokenizer maps each of these token ids to their corresponding text string. For Hindi, we can load the pre-trained tokenizer and use it for fine-tuning without any further modifications. We simply have to \n",
|
660 |
+
"specify the target language and the task. These arguments inform the \n",
|
661 |
+
"tokenizer to prefix the language and task tokens to the start of encoded \n",
|
662 |
+
"label sequences:"
|
663 |
+
]
|
664 |
+
},
|
665 |
+
{
|
666 |
+
"cell_type": "code",
|
667 |
+
"execution_count": 3,
|
668 |
+
"id": "c7b07f9b-ae0e-4f89-98f0-0c50d432eab6",
|
669 |
+
"metadata": {
|
670 |
+
"id": "c7b07f9b-ae0e-4f89-98f0-0c50d432eab6",
|
671 |
+
"outputId": "5c004b44-86e7-4e00-88be-39e0af5eed69"
|
672 |
+
},
|
673 |
+
"outputs": [],
|
674 |
+
"source": [
|
675 |
+
"from transformers import WhisperTokenizer\n",
|
676 |
+
"\n",
|
677 |
+
"tokenizer = WhisperTokenizer.from_pretrained(\"openai/whisper-medium\", language=\"Chinese\", task=\"transcribe\")"
|
678 |
+
]
|
679 |
+
},
|
680 |
+
{
|
681 |
+
"cell_type": "markdown",
|
682 |
+
"id": "d2ef23f3-f4a8-483a-a2dc-080a7496cb1b",
|
683 |
+
"metadata": {
|
684 |
+
"id": "d2ef23f3-f4a8-483a-a2dc-080a7496cb1b"
|
685 |
+
},
|
686 |
+
"source": [
|
687 |
+
"### Combine To Create A WhisperProcessor"
|
688 |
+
]
|
689 |
+
},
|
690 |
+
{
|
691 |
+
"cell_type": "markdown",
|
692 |
+
"id": "5ff67654-5a29-4bb8-a69d-0228946c6f8d",
|
693 |
+
"metadata": {
|
694 |
+
"id": "5ff67654-5a29-4bb8-a69d-0228946c6f8d"
|
695 |
+
},
|
696 |
+
"source": [
|
697 |
+
"To simplify using the feature extractor and tokenizer, we can _wrap_ \n",
|
698 |
+
"both into a single `WhisperProcessor` class. This processor object \n",
|
699 |
+
"inherits from the `WhisperFeatureExtractor` and `WhisperProcessor`, \n",
|
700 |
+
"and can be used on the audio inputs and model predictions as required. \n",
|
701 |
+
"In doing so, we only need to keep track of two objects during training: \n",
|
702 |
+
"the `processor` and the `model`:"
|
703 |
+
]
|
704 |
+
},
|
705 |
+
{
|
706 |
+
"cell_type": "code",
|
707 |
+
"execution_count": 4,
|
708 |
+
"id": "77d9f0c5-8607-4642-a8ac-c3ab2e223ea6",
|
709 |
+
"metadata": {
|
710 |
+
"id": "77d9f0c5-8607-4642-a8ac-c3ab2e223ea6"
|
711 |
+
},
|
712 |
+
"outputs": [],
|
713 |
+
"source": [
|
714 |
+
"from transformers import WhisperProcessor\n",
|
715 |
+
"\n",
|
716 |
+
"processor = WhisperProcessor.from_pretrained(\"openai/whisper-medium\", language=\"Chinese\", task=\"transcribe\")"
|
717 |
+
]
|
718 |
+
},
|
719 |
+
{
|
720 |
+
"cell_type": "markdown",
|
721 |
+
"id": "381acd09-0b0f-4d04-9eb3-f028ac0e5f2c",
|
722 |
+
"metadata": {
|
723 |
+
"id": "381acd09-0b0f-4d04-9eb3-f028ac0e5f2c"
|
724 |
+
},
|
725 |
+
"source": [
|
726 |
+
"### Prepare Data"
|
727 |
+
]
|
728 |
+
},
|
729 |
+
{
|
730 |
+
"cell_type": "code",
|
731 |
+
"execution_count": 5,
|
732 |
+
"id": "c69246a2",
|
733 |
+
"metadata": {},
|
734 |
+
"outputs": [],
|
735 |
+
"source": [
|
736 |
+
"from datasets import Audio\n",
|
737 |
+
"cv = cv.cast_column(\"audio\", Audio(sampling_rate=16000))"
|
738 |
+
]
|
739 |
+
},
|
740 |
+
{
|
741 |
+
"cell_type": "markdown",
|
742 |
+
"id": "3df7378a-a4c0-45d7-8d07-defbd1062ab6",
|
743 |
+
"metadata": {},
|
744 |
+
"source": [
|
745 |
+
"We'll define our pre-processing strategy. We advise that you **do not** lower-case the transcriptions or remove punctuation unless mixing different datasets. This will enable you to fine-tune Whisper models that can predict punctuation and casing. Later, you will see how we can evaluate the predictions without punctuation or casing, so that the models benefit from the WER improvement obtained by normalising the transcriptions while still predicting fully formatted transcriptions."
|
746 |
+
]
|
747 |
+
},
|
748 |
+
{
|
749 |
+
"cell_type": "markdown",
|
750 |
+
"id": "89e12c2e-2f14-479b-987b-f0c75c881095",
|
751 |
+
"metadata": {},
|
752 |
+
"source": [
|
753 |
+
"Now we can write a function to prepare our data ready for the model:\n",
|
754 |
+
"1. We load and resample the audio data by calling `batch[\"audio\"]`. As explained above, 🤗 Datasets performs any necessary resampling operations on the fly.\n",
|
755 |
+
"2. We use the feature extractor to compute the log-Mel spectrogram input features from our 1-dimensional audio array.\n",
|
756 |
+
"3. We perform any optional pre-processing (lower-case or remove punctuation).\n",
|
757 |
+
"4. We encode the transcriptions to label ids through the use of the tokenizer."
|
758 |
+
]
|
759 |
+
},
|
760 |
+
{
|
761 |
+
"cell_type": "code",
|
762 |
+
"execution_count": 17,
|
763 |
+
"id": "b27e4720",
|
764 |
+
"metadata": {},
|
765 |
+
"outputs": [],
|
766 |
+
"source": [
|
767 |
+
"from audiomentations import Compose, TimeStretch, PitchShift\n",
|
768 |
+
"\n",
|
769 |
+
"augment_waveform = Compose([\n",
|
770 |
+
" TimeStretch(min_rate=0.8, max_rate=1.25, p=0.3, leave_length_unchanged=False),\n",
|
771 |
+
" PitchShift(min_semitones=-4, max_semitones=4, p=0.3),\n",
|
772 |
+
" ])\n",
|
773 |
+
"\n",
|
774 |
+
"def augment_dataset(batch):\n",
|
775 |
+
"\n",
|
776 |
+
" audio = batch[\"audio\"][\"array\"]\n",
|
777 |
+
" # apply augmentation\n",
|
778 |
+
" augmented_audio = augment_waveform(samples=audio, sample_rate=16000)\n",
|
779 |
+
"\n",
|
780 |
+
" batch[\"audio\"][\"array\"] = augmented_audio\n",
|
781 |
+
"\n",
|
782 |
+
" return batch"
|
783 |
+
]
|
784 |
+
},
|
785 |
+
{
|
786 |
+
"cell_type": "code",
|
787 |
+
"execution_count": 18,
|
788 |
+
"id": "b459b0c5",
|
789 |
+
"metadata": {},
|
790 |
+
"outputs": [
|
791 |
+
{
|
792 |
+
"name": "stdout",
|
793 |
+
"output_type": "stream",
|
794 |
+
"text": [
|
795 |
+
"Augment train set:\n"
|
796 |
+
]
|
797 |
+
},
|
798 |
+
{
|
799 |
+
"data": {
|
800 |
+
"application/vnd.jupyter.widget-view+json": {
|
801 |
+
"model_id": "2db072c14c9a419d87f37e6747e62703",
|
802 |
+
"version_major": 2,
|
803 |
+
"version_minor": 0
|
804 |
+
},
|
805 |
+
"text/plain": [
|
806 |
+
" 0%| | 0/11277 [00:00<?, ?ex/s]"
|
807 |
+
]
|
808 |
+
},
|
809 |
+
"metadata": {},
|
810 |
+
"output_type": "display_data"
|
811 |
+
}
|
812 |
+
],
|
813 |
+
"source": [
|
814 |
+
"print('Augment train set:')\n",
|
815 |
+
"cv['train'] = cv['train'].map(augment_dataset, num_proc=1)"
|
816 |
+
]
|
817 |
+
},
|
818 |
+
{
|
819 |
+
"cell_type": "markdown",
|
820 |
+
"id": "8c960965-9fb6-466f-9dbd-c9d43e71d9d0",
|
821 |
+
"metadata": {
|
822 |
+
"id": "70b319fb-2439-4ef6-a70d-a47bf41c4a13"
|
823 |
+
},
|
824 |
+
"source": [
|
825 |
+
"We can apply the data preparation function to all of our training examples using dataset's `.map` method. The argument `num_proc` specifies how many CPU cores to use. Setting `num_proc` > 1 will enable multiprocessing. If the `.map` method hangs with multiprocessing, set `num_proc=1` and process the dataset sequentially."
|
826 |
+
]
|
827 |
+
},
|
828 |
+
{
|
829 |
+
"cell_type": "code",
|
830 |
+
"execution_count": 21,
|
831 |
+
"id": "d041650e-1c48-4439-87b3-5b6f4a514107",
|
832 |
+
"metadata": {},
|
833 |
+
"outputs": [],
|
834 |
+
"source": [
|
835 |
+
"from transformers.models.whisper.english_normalizer import BasicTextNormalizer\n",
|
836 |
+
"normalizer = BasicTextNormalizer()"
|
837 |
+
]
|
838 |
+
},
|
839 |
+
{
|
840 |
+
"cell_type": "code",
|
841 |
+
"execution_count": 24,
|
842 |
+
"id": "c085911c-a10a-41ef-8874-306e0503e9bb",
|
843 |
+
"metadata": {},
|
844 |
+
"outputs": [],
|
845 |
+
"source": [
|
846 |
+
"def prepare_dataset(batch):\n",
|
847 |
+
" # load and (possibly) resample audio data to 16kHz\n",
|
848 |
+
" audio = batch[\"audio\"]\n",
|
849 |
+
"\n",
|
850 |
+
" # compute log-Mel input features from input audio array \n",
|
851 |
+
" batch[\"input_features\"] = processor.feature_extractor(audio[\"array\"], sampling_rate=audio[\"sampling_rate\"]).input_features[0]\n",
|
852 |
+
" # compute input length of audio sample in seconds\n",
|
853 |
+
" batch[\"input_length\"] = len(audio[\"array\"]) / audio[\"sampling_rate\"]\n",
|
854 |
+
" \n",
|
855 |
+
" # split chinese characters by space, as stated in the paper\n",
|
856 |
+
" sentence = batch[\"sentence\"]\n",
|
857 |
+
" sentence = \" \".join(sentence)\n",
|
858 |
+
" # normalize\n",
|
859 |
+
" sentence = normalizer(sentence)\n",
|
860 |
+
" \n",
|
861 |
+
" # encode target text to label ids\n",
|
862 |
+
" batch[\"labels\"] = processor.tokenizer(sentence).input_ids\n",
|
863 |
+
" return batch"
|
864 |
+
]
|
865 |
+
},
|
866 |
+
{
|
867 |
+
"cell_type": "code",
|
868 |
+
"execution_count": 25,
|
869 |
+
"id": "90965caa",
|
870 |
+
"metadata": {},
|
871 |
+
"outputs": [
|
872 |
+
{
|
873 |
+
"name": "stdout",
|
874 |
+
"output_type": "stream",
|
875 |
+
"text": [
|
876 |
+
"Extract features and normalize data:\n"
|
877 |
+
]
|
878 |
+
},
|
879 |
+
{
|
880 |
+
"data": {
|
881 |
+
"application/vnd.jupyter.widget-view+json": {
|
882 |
+
"model_id": "ee8d88c2e3ef46039c2db32818ab08d7",
|
883 |
+
"version_major": 2,
|
884 |
+
"version_minor": 0
|
885 |
+
},
|
886 |
+
"text/plain": [
|
887 |
+
" 0%| | 0/11277 [00:00<?, ?ex/s]"
|
888 |
+
]
|
889 |
+
},
|
890 |
+
"metadata": {},
|
891 |
+
"output_type": "display_data"
|
892 |
+
},
|
893 |
+
{
|
894 |
+
"data": {
|
895 |
+
"application/vnd.jupyter.widget-view+json": {
|
896 |
+
"model_id": "48fce3473f7a42a29723b4148fb549c4",
|
897 |
+
"version_major": 2,
|
898 |
+
"version_minor": 0
|
899 |
+
},
|
900 |
+
"text/plain": [
|
901 |
+
" 0%| | 0/4709 [00:00<?, ?ex/s]"
|
902 |
+
]
|
903 |
+
},
|
904 |
+
"metadata": {},
|
905 |
+
"output_type": "display_data"
|
906 |
+
}
|
907 |
+
],
|
908 |
+
"source": [
|
909 |
+
"print('Extract features and normalize data:')\n",
|
910 |
+
"cv = cv.map(prepare_dataset, remove_columns=cv.column_names['train'], num_proc=1).with_format('torch')"
|
911 |
+
]
|
912 |
+
},
|
913 |
+
{
|
914 |
+
"cell_type": "code",
|
915 |
+
"execution_count": 26,
|
916 |
+
"id": "bde2118b",
|
917 |
+
"metadata": {},
|
918 |
+
"outputs": [
|
919 |
+
{
|
920 |
+
"data": {
|
921 |
+
"text/plain": [
|
922 |
+
"{'input_features': tensor([[-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
923 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
924 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
925 |
+
" ...,\n",
|
926 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
927 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
928 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590]]),\n",
|
929 |
+
" 'input_length': tensor(2.6400),\n",
|
930 |
+
" 'labels': tensor([50258, 50260, 50359, 50363, 23855, 220, 23855, 220, 4623, 220,\n",
|
931 |
+
" 34131, 220, 42117, 220, 27694, 42598, 220, 34043, 220, 50257])}"
|
932 |
+
]
|
933 |
+
},
|
934 |
+
"execution_count": 26,
|
935 |
+
"metadata": {},
|
936 |
+
"output_type": "execute_result"
|
937 |
+
}
|
938 |
+
],
|
939 |
+
"source": [
|
940 |
+
"cv['train'][18]"
|
941 |
+
]
|
942 |
+
},
|
943 |
+
{
|
944 |
+
"cell_type": "markdown",
|
945 |
+
"id": "54ce0fdb-7218-4a4d-b175-383980fec0df",
|
946 |
+
"metadata": {},
|
947 |
+
"source": [
|
948 |
+
"Finally, we filter any training data with audio samples longer than 30s. These samples would otherwise be truncated by the Whisper feature-extractor which could affect the stability of training. We define a function that returns `True` for samples that are less than 30s, and `False` for those that are longer:"
|
949 |
+
]
|
950 |
+
},
|
951 |
+
{
|
952 |
+
"cell_type": "code",
|
953 |
+
"execution_count": 27,
|
954 |
+
"id": "01cb25ef-4bb0-4325-9461-f59198acadf6",
|
955 |
+
"metadata": {},
|
956 |
+
"outputs": [],
|
957 |
+
"source": [
|
958 |
+
"max_input_length = 30.0\n",
|
959 |
+
"\n",
|
960 |
+
"def is_audio_in_length_range(length):\n",
|
961 |
+
" return length < max_input_length"
|
962 |
+
]
|
963 |
+
},
|
964 |
+
{
|
965 |
+
"cell_type": "markdown",
|
966 |
+
"id": "30e676a8-7ca8-4850-8c5d-5b2b00d13fba",
|
967 |
+
"metadata": {},
|
968 |
+
"source": [
|
969 |
+
"We apply our filter function to all samples of our training dataset through 🤗 Datasets' `.filter` method:"
|
970 |
+
]
|
971 |
+
},
|
972 |
+
{
|
973 |
+
"cell_type": "code",
|
974 |
+
"execution_count": 28,
|
975 |
+
"id": "333f7f6e-6053-4d3b-8924-c733c79b82ac",
|
976 |
+
"metadata": {},
|
977 |
+
"outputs": [
|
978 |
+
{
|
979 |
+
"data": {
|
980 |
+
"application/vnd.jupyter.widget-view+json": {
|
981 |
+
"model_id": "cbb3a2b5bb1a43a6a9acf13fa6ddf6b9",
|
982 |
+
"version_major": 2,
|
983 |
+
"version_minor": 0
|
984 |
+
},
|
985 |
+
"text/plain": [
|
986 |
+
" 0%| | 0/12 [00:00<?, ?ba/s]"
|
987 |
+
]
|
988 |
+
},
|
989 |
+
"metadata": {},
|
990 |
+
"output_type": "display_data"
|
991 |
+
}
|
992 |
+
],
|
993 |
+
"source": [
|
994 |
+
"cv['train'] = cv['train'].filter(\n",
|
995 |
+
" is_audio_in_length_range,\n",
|
996 |
+
" input_columns=[\"input_length\"],\n",
|
997 |
+
")"
|
998 |
+
]
|
999 |
+
},
|
1000 |
+
{
|
1001 |
+
"cell_type": "code",
|
1002 |
+
"execution_count": 29,
|
1003 |
+
"id": "53945dcb",
|
1004 |
+
"metadata": {},
|
1005 |
+
"outputs": [],
|
1006 |
+
"source": [
|
1007 |
+
"cv[\"train\"] = cv[\"train\"].shuffle(seed=42, writer_batch_size=100)"
|
1008 |
+
]
|
1009 |
+
},
|
1010 |
+
{
|
1011 |
+
"cell_type": "markdown",
|
1012 |
+
"id": "263a5a58-0239-4a25-b0df-c625fc9c5810",
|
1013 |
+
"metadata": {
|
1014 |
+
"id": "263a5a58-0239-4a25-b0df-c625fc9c5810"
|
1015 |
+
},
|
1016 |
+
"source": [
|
1017 |
+
"## Training and Evaluation"
|
1018 |
+
]
|
1019 |
+
},
|
1020 |
+
{
|
1021 |
+
"cell_type": "markdown",
|
1022 |
+
"id": "a693e768-c5a6-453f-89a1-b601dcf7daf7",
|
1023 |
+
"metadata": {
|
1024 |
+
"id": "a693e768-c5a6-453f-89a1-b601dcf7daf7"
|
1025 |
+
},
|
1026 |
+
"source": [
|
1027 |
+
"Now that we've prepared our data, we're ready to dive into the training pipeline. \n",
|
1028 |
+
"The [🤗 Trainer](https://huggingface.co/transformers/master/main_classes/trainer.html?highlight=trainer)\n",
|
1029 |
+
"will do much of the heavy lifting for us. All we have to do is:\n",
|
1030 |
+
"\n",
|
1031 |
+
"- Define a data collator: the data collator takes our pre-processed data and prepares PyTorch tensors ready for the model.\n",
|
1032 |
+
"\n",
|
1033 |
+
"- Evaluation metrics: during evaluation, we want to evaluate the model using the [word error rate (WER)](https://huggingface.co/metrics/wer) metric. We need to define a `compute_metrics` function that handles this computation.\n",
|
1034 |
+
"\n",
|
1035 |
+
"- Load a pre-trained checkpoint: we need to load a pre-trained checkpoint and configure it correctly for training.\n",
|
1036 |
+
"\n",
|
1037 |
+
"- Define the training configuration: this will be used by the 🤗 Trainer to define the training schedule.\n",
|
1038 |
+
"\n",
|
1039 |
+
"Once we've fine-tuned the model, we will evaluate it on the test data to verify that we have correctly trained it \n",
|
1040 |
+
"to transcribe speech in Hindi."
|
1041 |
+
]
|
1042 |
+
},
|
1043 |
+
{
|
1044 |
+
"cell_type": "markdown",
|
1045 |
+
"id": "8d230e6d-624c-400a-bbf5-fa660881df25",
|
1046 |
+
"metadata": {
|
1047 |
+
"id": "8d230e6d-624c-400a-bbf5-fa660881df25"
|
1048 |
+
},
|
1049 |
+
"source": [
|
1050 |
+
"### Define a Data Collator"
|
1051 |
+
]
|
1052 |
+
},
|
1053 |
+
{
|
1054 |
+
"cell_type": "markdown",
|
1055 |
+
"id": "04def221-0637-4a69-b242-d3f0c1d0ee78",
|
1056 |
+
"metadata": {
|
1057 |
+
"id": "04def221-0637-4a69-b242-d3f0c1d0ee78"
|
1058 |
+
},
|
1059 |
+
"source": [
|
1060 |
+
"The data collator for a sequence-to-sequence speech model is unique in the sense that it \n",
|
1061 |
+
"treats the `input_features` and `labels` independently: the `input_features` must be \n",
|
1062 |
+
"handled by the feature extractor and the `labels` by the tokenizer.\n",
|
1063 |
+
"\n",
|
1064 |
+
"The `input_features` are already padded to 30s and converted to a log-Mel spectrogram \n",
|
1065 |
+
"of fixed dimension by action of the feature extractor, so all we have to do is convert the `input_features`\n",
|
1066 |
+
"to batched PyTorch tensors. We do this using the feature extractor's `.pad` method with `return_tensors=pt`.\n",
|
1067 |
+
"\n",
|
1068 |
+
"The `labels` on the other hand are un-padded. We first pad the sequences\n",
|
1069 |
+
"to the maximum length in the batch using the tokenizer's `.pad` method. The padding tokens \n",
|
1070 |
+
"are then replaced by `-100` so that these tokens are **not** taken into account when \n",
|
1071 |
+
"computing the loss. We then cut the BOS token from the start of the label sequence as we \n",
|
1072 |
+
"append it later during training.\n",
|
1073 |
+
"\n",
|
1074 |
+
"We can leverage the `WhisperProcessor` we defined earlier to perform both the \n",
|
1075 |
+
"feature extractor and the tokenizer operations:"
|
1076 |
+
]
|
1077 |
+
},
|
1078 |
+
{
|
1079 |
+
"cell_type": "code",
|
1080 |
+
"execution_count": 30,
|
1081 |
+
"id": "8326221e-ec13-4731-bb4e-51e5fc1486c5",
|
1082 |
+
"metadata": {
|
1083 |
+
"id": "8326221e-ec13-4731-bb4e-51e5fc1486c5"
|
1084 |
+
},
|
1085 |
+
"outputs": [],
|
1086 |
+
"source": [
|
1087 |
+
"import torch\n",
|
1088 |
+
"\n",
|
1089 |
+
"from dataclasses import dataclass\n",
|
1090 |
+
"from typing import Any, Dict, List, Union\n",
|
1091 |
+
"\n",
|
1092 |
+
"@dataclass\n",
|
1093 |
+
"class DataCollatorSpeechSeq2SeqWithPadding:\n",
|
1094 |
+
" processor: Any\n",
|
1095 |
+
"\n",
|
1096 |
+
" def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) -> Dict[str, torch.Tensor]:\n",
|
1097 |
+
" # split inputs and labels since they have to be of different lengths and need different padding methods\n",
|
1098 |
+
" # first treat the audio inputs by simply returning torch tensors\n",
|
1099 |
+
" input_features = [{\"input_features\": feature[\"input_features\"]} for feature in features]\n",
|
1100 |
+
" batch = self.processor.feature_extractor.pad(input_features, return_tensors=\"pt\")\n",
|
1101 |
+
"\n",
|
1102 |
+
" # get the tokenized label sequences\n",
|
1103 |
+
" label_features = [{\"input_ids\": feature[\"labels\"]} for feature in features]\n",
|
1104 |
+
" # pad the labels to max length\n",
|
1105 |
+
" labels_batch = self.processor.tokenizer.pad(label_features, return_tensors=\"pt\")\n",
|
1106 |
+
"\n",
|
1107 |
+
" # replace padding with -100 to ignore loss correctly\n",
|
1108 |
+
" labels = labels_batch[\"input_ids\"].masked_fill(labels_batch.attention_mask.ne(1), -100)\n",
|
1109 |
+
"\n",
|
1110 |
+
" # if bos token is appended in previous tokenization step,\n",
|
1111 |
+
" # cut bos token here as it's append later anyways\n",
|
1112 |
+
" if (labels[:, 0] == self.processor.tokenizer.bos_token_id).all().cpu().item():\n",
|
1113 |
+
" labels = labels[:, 1:]\n",
|
1114 |
+
"\n",
|
1115 |
+
" batch[\"labels\"] = labels\n",
|
1116 |
+
"\n",
|
1117 |
+
" return batch"
|
1118 |
+
]
|
1119 |
+
},
|
1120 |
+
{
|
1121 |
+
"cell_type": "markdown",
|
1122 |
+
"id": "3cae7dbf-8a50-456e-a3a8-7fd005390f86",
|
1123 |
+
"metadata": {
|
1124 |
+
"id": "3cae7dbf-8a50-456e-a3a8-7fd005390f86"
|
1125 |
+
},
|
1126 |
+
"source": [
|
1127 |
+
"Let's initialise the data collator we've just defined:"
|
1128 |
+
]
|
1129 |
+
},
|
1130 |
+
{
|
1131 |
+
"cell_type": "code",
|
1132 |
+
"execution_count": 31,
|
1133 |
+
"id": "fc834702-c0d3-4a96-b101-7b87be32bf42",
|
1134 |
+
"metadata": {
|
1135 |
+
"id": "fc834702-c0d3-4a96-b101-7b87be32bf42"
|
1136 |
+
},
|
1137 |
+
"outputs": [],
|
1138 |
+
"source": [
|
1139 |
+
"data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=processor)"
|
1140 |
+
]
|
1141 |
+
},
|
1142 |
+
{
|
1143 |
+
"cell_type": "markdown",
|
1144 |
+
"id": "d62bb2ab-750a-45e7-82e9-61d6f4805698",
|
1145 |
+
"metadata": {
|
1146 |
+
"id": "d62bb2ab-750a-45e7-82e9-61d6f4805698"
|
1147 |
+
},
|
1148 |
+
"source": [
|
1149 |
+
"### Evaluation Metrics"
|
1150 |
+
]
|
1151 |
+
},
|
1152 |
+
{
|
1153 |
+
"cell_type": "markdown",
|
1154 |
+
"id": "66fee1a7-a44c-461e-b047-c3917221572e",
|
1155 |
+
"metadata": {
|
1156 |
+
"id": "66fee1a7-a44c-461e-b047-c3917221572e"
|
1157 |
+
},
|
1158 |
+
"source": [
|
1159 |
+
"We'll use the word error rate (WER) metric, the 'de-facto' metric for assessing \n",
|
1160 |
+
"ASR systems. For more information, refer to the WER [docs](https://huggingface.co/metrics/wer). We'll load the WER metric from 🤗 Evaluate:"
|
1161 |
+
]
|
1162 |
+
},
|
1163 |
+
{
|
1164 |
+
"cell_type": "code",
|
1165 |
+
"execution_count": 32,
|
1166 |
+
"id": "b22b4011-f31f-4b57-b684-c52332f92890",
|
1167 |
+
"metadata": {
|
1168 |
+
"id": "b22b4011-f31f-4b57-b684-c52332f92890"
|
1169 |
+
},
|
1170 |
+
"outputs": [],
|
1171 |
+
"source": [
|
1172 |
+
"import evaluate\n",
|
1173 |
+
"\n",
|
1174 |
+
"wer_metric = evaluate.load(\"wer\")"
|
1175 |
+
]
|
1176 |
+
},
|
1177 |
+
{
|
1178 |
+
"cell_type": "markdown",
|
1179 |
+
"id": "4f32cab6-31f0-4cb9-af4c-40ba0f5fc508",
|
1180 |
+
"metadata": {
|
1181 |
+
"id": "4f32cab6-31f0-4cb9-af4c-40ba0f5fc508"
|
1182 |
+
},
|
1183 |
+
"source": [
|
1184 |
+
"We then simply have to define a function that takes our model \n",
|
1185 |
+
"predictions and returns the WER metric. This function, called\n",
|
1186 |
+
"`compute_metrics`, first replaces `-100` with the `pad_token_id`\n",
|
1187 |
+
"in the `label_ids` (undoing the step we applied in the \n",
|
1188 |
+
"data collator to ignore padded tokens correctly in the loss).\n",
|
1189 |
+
"It then decodes the predicted and label ids to strings. Finally,\n",
|
1190 |
+
"it computes the WER between the predictions and reference labels. \n",
|
1191 |
+
"Here, we have the option of evaluating with the 'normalised' transcriptions \n",
|
1192 |
+
"and predictions. We recommend you set this to `True` to benefit from the WER \n",
|
1193 |
+
"improvement obtained by normalising the transcriptions."
|
1194 |
+
]
|
1195 |
+
},
|
1196 |
+
{
|
1197 |
+
"cell_type": "code",
|
1198 |
+
"execution_count": 33,
|
1199 |
+
"id": "23959a70-22d0-4ffe-9fa1-72b61e75bb52",
|
1200 |
+
"metadata": {
|
1201 |
+
"id": "23959a70-22d0-4ffe-9fa1-72b61e75bb52"
|
1202 |
+
},
|
1203 |
+
"outputs": [],
|
1204 |
+
"source": [
|
1205 |
+
"# evaluate with the 'normalised' WER\n",
|
1206 |
+
"do_normalize_eval = True\n",
|
1207 |
+
"\n",
|
1208 |
+
"def compute_metrics(pred):\n",
|
1209 |
+
" pred_ids = pred.predictions\n",
|
1210 |
+
" label_ids = pred.label_ids\n",
|
1211 |
+
"\n",
|
1212 |
+
" # replace -100 with the pad_token_id\n",
|
1213 |
+
" label_ids[label_ids == -100] = processor.tokenizer.pad_token_id\n",
|
1214 |
+
"\n",
|
1215 |
+
" # we do not want to group tokens when computing the metrics\n",
|
1216 |
+
" pred_str = processor.tokenizer.batch_decode(pred_ids, skip_special_tokens=True)\n",
|
1217 |
+
" label_str = processor.tokenizer.batch_decode(label_ids, skip_special_tokens=True)\n",
|
1218 |
+
"\n",
|
1219 |
+
" if do_normalize_eval:\n",
|
1220 |
+
" pred_str = [normalizer(pred) for pred in pred_str]\n",
|
1221 |
+
" label_str = [normalizer(label) for label in label_str]\n",
|
1222 |
+
"\n",
|
1223 |
+
" wer = 100 * wer_metric.compute(predictions=pred_str, references=label_str)\n",
|
1224 |
+
" \n",
|
1225 |
+
" return {\"wer\": wer}"
|
1226 |
+
]
|
1227 |
+
},
|
1228 |
+
{
|
1229 |
+
"cell_type": "markdown",
|
1230 |
+
"id": "daf2a825-6d9f-4a23-b145-c37c0039075b",
|
1231 |
+
"metadata": {
|
1232 |
+
"id": "daf2a825-6d9f-4a23-b145-c37c0039075b"
|
1233 |
+
},
|
1234 |
+
"source": [
|
1235 |
+
"### Load a Pre-Trained Checkpoint"
|
1236 |
+
]
|
1237 |
+
},
|
1238 |
+
{
|
1239 |
+
"cell_type": "markdown",
|
1240 |
+
"id": "437a97fa-4864-476b-8abc-f28b8166cfa5",
|
1241 |
+
"metadata": {
|
1242 |
+
"id": "437a97fa-4864-476b-8abc-f28b8166cfa5"
|
1243 |
+
},
|
1244 |
+
"source": [
|
1245 |
+
"Now let's load the pre-trained Whisper `small` checkpoint. Again, this \n",
|
1246 |
+
"is trivial through use of 🤗 Transformers!"
|
1247 |
+
]
|
1248 |
+
},
|
1249 |
+
{
|
1250 |
+
"cell_type": "code",
|
1251 |
+
"execution_count": 34,
|
1252 |
+
"id": "5a10cc4b-07ec-4ebd-ac1d-7c601023594f",
|
1253 |
+
"metadata": {
|
1254 |
+
"id": "5a10cc4b-07ec-4ebd-ac1d-7c601023594f"
|
1255 |
+
},
|
1256 |
+
"outputs": [],
|
1257 |
+
"source": [
|
1258 |
+
"from transformers import WhisperForConditionalGeneration\n",
|
1259 |
+
"\n",
|
1260 |
+
"model = WhisperForConditionalGeneration.from_pretrained(\"openai/whisper-medium\")"
|
1261 |
+
]
|
1262 |
+
},
|
1263 |
+
{
|
1264 |
+
"cell_type": "markdown",
|
1265 |
+
"id": "a15ead5f-2277-4a39-937b-585c2497b2df",
|
1266 |
+
"metadata": {
|
1267 |
+
"id": "a15ead5f-2277-4a39-937b-585c2497b2df"
|
1268 |
+
},
|
1269 |
+
"source": [
|
1270 |
+
"Override generation arguments - no tokens are forced as decoder outputs (see [`forced_decoder_ids`](https://huggingface.co/docs/transformers/main_classes/text_generation#transformers.generation_utils.GenerationMixin.generate.forced_decoder_ids)), no tokens are suppressed during generation (see [`suppress_tokens`](https://huggingface.co/docs/transformers/main_classes/text_generation#transformers.generation_utils.GenerationMixin.generate.suppress_tokens)). Set `use_cache` to False since we're using gradient checkpointing, and the two are incompatible:"
|
1271 |
+
]
|
1272 |
+
},
|
1273 |
+
{
|
1274 |
+
"cell_type": "code",
|
1275 |
+
"execution_count": 35,
|
1276 |
+
"id": "62038ba3-88ed-4fce-84db-338f50dcd04f",
|
1277 |
+
"metadata": {
|
1278 |
+
"id": "62038ba3-88ed-4fce-84db-338f50dcd04f"
|
1279 |
+
},
|
1280 |
+
"outputs": [],
|
1281 |
+
"source": [
|
1282 |
+
"model.config.forced_decoder_ids = None\n",
|
1283 |
+
"model.config.suppress_tokens = []\n",
|
1284 |
+
"model.config.use_cache = False"
|
1285 |
+
]
|
1286 |
+
},
|
1287 |
+
{
|
1288 |
+
"cell_type": "markdown",
|
1289 |
+
"id": "2178dea4-80ca-47b6-b6ea-ba1915c90c06",
|
1290 |
+
"metadata": {
|
1291 |
+
"id": "2178dea4-80ca-47b6-b6ea-ba1915c90c06"
|
1292 |
+
},
|
1293 |
+
"source": [
|
1294 |
+
"### Define the Training Configuration"
|
1295 |
+
]
|
1296 |
+
},
|
1297 |
+
{
|
1298 |
+
"cell_type": "markdown",
|
1299 |
+
"id": "c21af1e9-0188-4134-ac82-defc7bdcc436",
|
1300 |
+
"metadata": {
|
1301 |
+
"id": "c21af1e9-0188-4134-ac82-defc7bdcc436"
|
1302 |
+
},
|
1303 |
+
"source": [
|
1304 |
+
"In the final step, we define all the parameters related to training. For more detail on the training arguments, refer to the Seq2SeqTrainingArguments [docs](https://huggingface.co/docs/transformers/main_classes/trainer#transformers.Seq2SeqTrainingArguments)."
|
1305 |
+
]
|
1306 |
+
},
|
1307 |
+
{
|
1308 |
+
"cell_type": "code",
|
1309 |
+
"execution_count": 36,
|
1310 |
+
"id": "0ae3e9af-97b7-4aa0-ae85-20b23b5bcb3a",
|
1311 |
+
"metadata": {
|
1312 |
+
"id": "0ae3e9af-97b7-4aa0-ae85-20b23b5bcb3a"
|
1313 |
+
},
|
1314 |
+
"outputs": [],
|
1315 |
+
"source": [
|
1316 |
+
"from transformers import Seq2SeqTrainingArguments\n",
|
1317 |
+
"\n",
|
1318 |
+
"training_args = Seq2SeqTrainingArguments(\n",
|
1319 |
+
" output_dir=\"./\",\n",
|
1320 |
+
" per_device_train_batch_size=2,\n",
|
1321 |
+
" gradient_accumulation_steps=16, # increase by 2x for every 2x decrease in batch size\n",
|
1322 |
+
" learning_rate=1e-5,\n",
|
1323 |
+
" warmup_steps=100,\n",
|
1324 |
+
" max_steps=1000,\n",
|
1325 |
+
" gradient_checkpointing=True,\n",
|
1326 |
+
" fp16=True,\n",
|
1327 |
+
" evaluation_strategy=\"steps\",\n",
|
1328 |
+
" per_device_eval_batch_size=2,\n",
|
1329 |
+
" predict_with_generate=True,\n",
|
1330 |
+
" generation_max_length=225,\n",
|
1331 |
+
" save_steps=200,\n",
|
1332 |
+
" eval_steps=200,\n",
|
1333 |
+
" logging_steps=25,\n",
|
1334 |
+
" report_to=[\"tensorboard\"],\n",
|
1335 |
+
" load_best_model_at_end=True,\n",
|
1336 |
+
" metric_for_best_model=\"wer\",\n",
|
1337 |
+
" greater_is_better=False,\n",
|
1338 |
+
" push_to_hub=True,\n",
|
1339 |
+
" optim='adamw_bnb_8bit'\n",
|
1340 |
+
")"
|
1341 |
+
]
|
1342 |
+
},
|
1343 |
+
{
|
1344 |
+
"cell_type": "markdown",
|
1345 |
+
"id": "b3a944d8-3112-4552-82a0-be25988b3857",
|
1346 |
+
"metadata": {
|
1347 |
+
"id": "b3a944d8-3112-4552-82a0-be25988b3857"
|
1348 |
+
},
|
1349 |
+
"source": [
|
1350 |
+
"**Note**: if one does not want to upload the model checkpoints to the Hub, \n",
|
1351 |
+
"set `push_to_hub=False`."
|
1352 |
+
]
|
1353 |
+
},
|
1354 |
+
{
|
1355 |
+
"cell_type": "markdown",
|
1356 |
+
"id": "bac29114-d226-4f54-97cf-8718c9f94e1e",
|
1357 |
+
"metadata": {
|
1358 |
+
"id": "bac29114-d226-4f54-97cf-8718c9f94e1e"
|
1359 |
+
},
|
1360 |
+
"source": [
|
1361 |
+
"We can forward the training arguments to the 🤗 Trainer along with our model,\n",
|
1362 |
+
"dataset, data collator and `compute_metrics` function:"
|
1363 |
+
]
|
1364 |
+
},
|
1365 |
+
{
|
1366 |
+
"cell_type": "code",
|
1367 |
+
"execution_count": 37,
|
1368 |
+
"id": "d546d7fe-0543-479a-b708-2ebabec19493",
|
1369 |
+
"metadata": {
|
1370 |
+
"id": "d546d7fe-0543-479a-b708-2ebabec19493",
|
1371 |
+
"scrolled": false
|
1372 |
+
},
|
1373 |
+
"outputs": [
|
1374 |
+
{
|
1375 |
+
"name": "stderr",
|
1376 |
+
"output_type": "stream",
|
1377 |
+
"text": [
|
1378 |
+
"/mnt/c/projects/asr/whisper-medium-zh-TW-augmented/./ is already a clone of https://huggingface.co/Scrya/whisper-medium-zh-TW-augmented. Make sure you pull the latest changes with `repo.git_pull()`.\n",
|
1379 |
+
"max_steps is given, it will override any value given in num_train_epochs\n",
|
1380 |
+
"Using cuda_amp half precision backend\n"
|
1381 |
+
]
|
1382 |
+
}
|
1383 |
+
],
|
1384 |
+
"source": [
|
1385 |
+
"from transformers import Seq2SeqTrainer\n",
|
1386 |
+
"\n",
|
1387 |
+
"trainer = Seq2SeqTrainer(\n",
|
1388 |
+
" args=training_args,\n",
|
1389 |
+
" model=model,\n",
|
1390 |
+
" train_dataset=cv['train'],\n",
|
1391 |
+
" eval_dataset=cv['test'],\n",
|
1392 |
+
" data_collator=data_collator,\n",
|
1393 |
+
" compute_metrics=compute_metrics,\n",
|
1394 |
+
" tokenizer=processor.feature_extractor,\n",
|
1395 |
+
")"
|
1396 |
+
]
|
1397 |
+
},
|
1398 |
+
{
|
1399 |
+
"cell_type": "markdown",
|
1400 |
+
"id": "uOrRhDGtN5S4",
|
1401 |
+
"metadata": {
|
1402 |
+
"id": "uOrRhDGtN5S4"
|
1403 |
+
},
|
1404 |
+
"source": [
|
1405 |
+
"We'll save the processor object once before starting training. Since the processor is not trainable, it won't change over the course of training:"
|
1406 |
+
]
|
1407 |
+
},
|
1408 |
+
{
|
1409 |
+
"cell_type": "code",
|
1410 |
+
"execution_count": 38,
|
1411 |
+
"id": "-2zQwMfEOBJq",
|
1412 |
+
"metadata": {
|
1413 |
+
"id": "-2zQwMfEOBJq"
|
1414 |
+
},
|
1415 |
+
"outputs": [
|
1416 |
+
{
|
1417 |
+
"name": "stderr",
|
1418 |
+
"output_type": "stream",
|
1419 |
+
"text": [
|
1420 |
+
"Feature extractor saved in ./preprocessor_config.json\n",
|
1421 |
+
"tokenizer config file saved in ./tokenizer_config.json\n",
|
1422 |
+
"Special tokens file saved in ./special_tokens_map.json\n",
|
1423 |
+
"added tokens file saved in ./added_tokens.json\n"
|
1424 |
+
]
|
1425 |
+
}
|
1426 |
+
],
|
1427 |
+
"source": [
|
1428 |
+
"processor.save_pretrained(training_args.output_dir)"
|
1429 |
+
]
|
1430 |
+
},
|
1431 |
+
{
|
1432 |
+
"cell_type": "markdown",
|
1433 |
+
"id": "7f404cf9-4345-468c-8196-4bd101d9bd51",
|
1434 |
+
"metadata": {
|
1435 |
+
"id": "7f404cf9-4345-468c-8196-4bd101d9bd51"
|
1436 |
+
},
|
1437 |
+
"source": [
|
1438 |
+
"### Training"
|
1439 |
+
]
|
1440 |
+
},
|
1441 |
+
{
|
1442 |
+
"cell_type": "markdown",
|
1443 |
+
"id": "5e8b8d56-5a70-4f68-bd2e-f0752d0bd112",
|
1444 |
+
"metadata": {
|
1445 |
+
"id": "5e8b8d56-5a70-4f68-bd2e-f0752d0bd112"
|
1446 |
+
},
|
1447 |
+
"source": [
|
1448 |
+
"Training will take approximately 5-10 hours depending on your GPU. The peak GPU memory for the given training configuration is approximately 36GB. \n",
|
1449 |
+
"Depending on your GPU, it is possible that you will encounter a CUDA `\"out-of-memory\"` error when you launch training. \n",
|
1450 |
+
"In this case, you can reduce the `per_device_train_batch_size` incrementally by factors of 2 \n",
|
1451 |
+
"and employ [`gradient_accumulation_steps`](https://huggingface.co/docs/transformers/main_classes/trainer#transformers.Seq2SeqTrainingArguments.gradient_accumulation_steps)\n",
|
1452 |
+
"to compensate.\n",
|
1453 |
+
"\n",
|
1454 |
+
"To launch training, simply execute:"
|
1455 |
+
]
|
1456 |
+
},
|
1457 |
+
{
|
1458 |
+
"cell_type": "code",
|
1459 |
+
"execution_count": 39,
|
1460 |
+
"id": "ee8b7b8e-1c9a-4d77-9137-1778a629e6de",
|
1461 |
+
"metadata": {
|
1462 |
+
"id": "ee8b7b8e-1c9a-4d77-9137-1778a629e6de",
|
1463 |
+
"scrolled": false
|
1464 |
+
},
|
1465 |
+
"outputs": [
|
1466 |
+
{
|
1467 |
+
"name": "stderr",
|
1468 |
+
"output_type": "stream",
|
1469 |
+
"text": [
|
1470 |
+
"The following columns in the training set don't have a corresponding argument in `WhisperForConditionalGeneration.forward` and have been ignored: input_length. If input_length are not expected by `WhisperForConditionalGeneration.forward`, you can safely ignore this message.\n",
|
1471 |
+
"/home/daniel/whisper/lib/python3.8/site-packages/bitsandbytes/cextension.py:127: UserWarning: The installed version of bitsandbytes was compiled without GPU support. 8-bit optimizers and GPU quantization are unavailable.\n",
|
1472 |
+
" warn(\"The installed version of bitsandbytes was compiled without GPU support. \"\n",
|
1473 |
+
"***** Running training *****\n",
|
1474 |
+
" Num examples = 11277\n",
|
1475 |
+
" Num Epochs = 3\n",
|
1476 |
+
" Instantaneous batch size per device = 2\n",
|
1477 |
+
" Total train batch size (w. parallel, distributed & accumulation) = 32\n",
|
1478 |
+
" Gradient Accumulation steps = 16\n",
|
1479 |
+
" Total optimization steps = 1000\n",
|
1480 |
+
" Number of trainable parameters = 763857920\n"
|
1481 |
+
]
|
1482 |
+
},
|
1483 |
+
{
|
1484 |
+
"ename": "NameError",
|
1485 |
+
"evalue": "name 'str2optimizer8bit_blockwise' is not defined",
|
1486 |
+
"output_type": "error",
|
1487 |
+
"traceback": [
|
1488 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
1489 |
+
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
|
1490 |
+
"Cell \u001b[0;32mIn[39], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mtrainer\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mtrain\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
|
1491 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/transformers/trainer.py:1535\u001b[0m, in \u001b[0;36mTrainer.train\u001b[0;34m(self, resume_from_checkpoint, trial, ignore_keys_for_eval, **kwargs)\u001b[0m\n\u001b[1;32m 1530\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmodel_wrapped \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mmodel\n\u001b[1;32m 1532\u001b[0m inner_training_loop \u001b[38;5;241m=\u001b[39m find_executable_batch_size(\n\u001b[1;32m 1533\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_inner_training_loop, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_train_batch_size, args\u001b[38;5;241m.\u001b[39mauto_find_batch_size\n\u001b[1;32m 1534\u001b[0m )\n\u001b[0;32m-> 1535\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43minner_training_loop\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 1536\u001b[0m \u001b[43m \u001b[49m\u001b[43margs\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1537\u001b[0m \u001b[43m \u001b[49m\u001b[43mresume_from_checkpoint\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mresume_from_checkpoint\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1538\u001b[0m \u001b[43m \u001b[49m\u001b[43mtrial\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mtrial\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1539\u001b[0m \u001b[43m \u001b[49m\u001b[43mignore_keys_for_eval\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mignore_keys_for_eval\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 1540\u001b[0m \u001b[43m\u001b[49m\u001b[43m)\u001b[49m\n",
|
1492 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/transformers/trainer.py:1845\u001b[0m, in \u001b[0;36mTrainer._inner_training_loop\u001b[0;34m(self, batch_size, args, resume_from_checkpoint, trial, ignore_keys_for_eval)\u001b[0m\n\u001b[1;32m 1843\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdo_grad_scaling:\n\u001b[1;32m 1844\u001b[0m scale_before \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mscaler\u001b[38;5;241m.\u001b[39mget_scale()\n\u001b[0;32m-> 1845\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mscaler\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptimizer\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1846\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mscaler\u001b[38;5;241m.\u001b[39mupdate()\n\u001b[1;32m 1847\u001b[0m scale_after \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mscaler\u001b[38;5;241m.\u001b[39mget_scale()\n",
|
1493 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/torch/cuda/amp/grad_scaler.py:341\u001b[0m, in \u001b[0;36mGradScaler.step\u001b[0;34m(self, optimizer, *args, **kwargs)\u001b[0m\n\u001b[1;32m 337\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39munscale_(optimizer)\n\u001b[1;32m 339\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(optimizer_state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfound_inf_per_device\u001b[39m\u001b[38;5;124m\"\u001b[39m]) \u001b[38;5;241m>\u001b[39m \u001b[38;5;241m0\u001b[39m, \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mNo inf checks were recorded for this optimizer.\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m--> 341\u001b[0m retval \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_maybe_opt_step\u001b[49m\u001b[43m(\u001b[49m\u001b[43moptimizer\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43moptimizer_state\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 343\u001b[0m optimizer_state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstage\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m OptState\u001b[38;5;241m.\u001b[39mSTEPPED\n\u001b[1;32m 345\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m retval\n",
|
1494 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/torch/cuda/amp/grad_scaler.py:288\u001b[0m, in \u001b[0;36mGradScaler._maybe_opt_step\u001b[0;34m(self, optimizer, optimizer_state, *args, **kwargs)\u001b[0m\n\u001b[1;32m 286\u001b[0m retval \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 287\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28msum\u001b[39m(v\u001b[38;5;241m.\u001b[39mitem() \u001b[38;5;28;01mfor\u001b[39;00m v \u001b[38;5;129;01min\u001b[39;00m optimizer_state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfound_inf_per_device\u001b[39m\u001b[38;5;124m\"\u001b[39m]\u001b[38;5;241m.\u001b[39mvalues()):\n\u001b[0;32m--> 288\u001b[0m retval \u001b[38;5;241m=\u001b[39m \u001b[43moptimizer\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mstep\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 289\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m retval\n",
|
1495 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/torch/optim/lr_scheduler.py:68\u001b[0m, in \u001b[0;36m_LRScheduler.__init__.<locals>.with_counter.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 66\u001b[0m instance\u001b[38;5;241m.\u001b[39m_step_count \u001b[38;5;241m+\u001b[39m\u001b[38;5;241m=\u001b[39m \u001b[38;5;241m1\u001b[39m\n\u001b[1;32m 67\u001b[0m wrapped \u001b[38;5;241m=\u001b[39m func\u001b[38;5;241m.\u001b[39m\u001b[38;5;21m__get__\u001b[39m(instance, \u001b[38;5;28mcls\u001b[39m)\n\u001b[0;32m---> 68\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mwrapped\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
1496 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/torch/optim/optimizer.py:140\u001b[0m, in \u001b[0;36mOptimizer._hook_for_profile.<locals>.profile_hook_step.<locals>.wrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 138\u001b[0m profile_name \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mOptimizer.step#\u001b[39m\u001b[38;5;132;01m{}\u001b[39;00m\u001b[38;5;124m.step\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;241m.\u001b[39mformat(obj\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__class__\u001b[39m\u001b[38;5;241m.\u001b[39m\u001b[38;5;18m__name__\u001b[39m)\n\u001b[1;32m 139\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m torch\u001b[38;5;241m.\u001b[39mautograd\u001b[38;5;241m.\u001b[39mprofiler\u001b[38;5;241m.\u001b[39mrecord_function(profile_name):\n\u001b[0;32m--> 140\u001b[0m out \u001b[38;5;241m=\u001b[39m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 141\u001b[0m obj\u001b[38;5;241m.\u001b[39m_optimizer_step_code()\n\u001b[1;32m 142\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m out\n",
|
1497 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/torch/autograd/grad_mode.py:27\u001b[0m, in \u001b[0;36m_DecoratorContextManager.__call__.<locals>.decorate_context\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(func)\n\u001b[1;32m 25\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecorate_context\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 26\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclone():\n\u001b[0;32m---> 27\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
1498 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/bitsandbytes/optim/optimizer.py:265\u001b[0m, in \u001b[0;36mOptimizer8bit.step\u001b[0;34m(self, closure)\u001b[0m\n\u001b[1;32m 262\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mlen\u001b[39m(state) \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n\u001b[1;32m 263\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39minit_state(group, p, gindex, pindex)\n\u001b[0;32m--> 265\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mupdate_step\u001b[49m\u001b[43m(\u001b[49m\u001b[43mgroup\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mp\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mgindex\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mpindex\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 267\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m loss\n",
|
1499 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/torch/autograd/grad_mode.py:27\u001b[0m, in \u001b[0;36m_DecoratorContextManager.__call__.<locals>.decorate_context\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;129m@functools\u001b[39m\u001b[38;5;241m.\u001b[39mwraps(func)\n\u001b[1;32m 25\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mdecorate_context\u001b[39m(\u001b[38;5;241m*\u001b[39margs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs):\n\u001b[1;32m 26\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclone():\n\u001b[0;32m---> 27\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mfunc\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43margs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwargs\u001b[49m\u001b[43m)\u001b[49m\n",
|
1500 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/bitsandbytes/optim/optimizer.py:506\u001b[0m, in \u001b[0;36mOptimizer2State.update_step\u001b[0;34m(self, group, p, gindex, pindex)\u001b[0m\n\u001b[1;32m 504\u001b[0m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmax2\u001b[39m\u001b[38;5;124m\"\u001b[39m], state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnew_max2\u001b[39m\u001b[38;5;124m\"\u001b[39m] \u001b[38;5;241m=\u001b[39m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mnew_max2\u001b[39m\u001b[38;5;124m\"\u001b[39m], state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmax2\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m 505\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m state[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstate1\u001b[39m\u001b[38;5;124m\"\u001b[39m]\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m==\u001b[39m torch\u001b[38;5;241m.\u001b[39muint8 \u001b[38;5;129;01mand\u001b[39;00m config[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mblock_wise\u001b[39m\u001b[38;5;124m\"\u001b[39m]:\n\u001b[0;32m--> 506\u001b[0m \u001b[43mF\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptimizer_update_8bit_blockwise\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 507\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43moptimizer_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 508\u001b[0m \u001b[43m \u001b[49m\u001b[43mgrad\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 509\u001b[0m \u001b[43m \u001b[49m\u001b[43mp\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 510\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstate1\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 511\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mstate2\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 512\u001b[0m \u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mbetas\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m0\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 513\u001b[0m \u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mbetas\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 514\u001b[0m \u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43meps\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 515\u001b[0m \u001b[43m \u001b[49m\u001b[43mstep\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 516\u001b[0m \u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mlr\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 517\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mqmap1\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 518\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mqmap2\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 519\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mabsmax1\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 520\u001b[0m \u001b[43m \u001b[49m\u001b[43mstate\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mabsmax2\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 521\u001b[0m \u001b[43m \u001b[49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mweight_decay\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 522\u001b[0m \u001b[43m \u001b[49m\u001b[43mgnorm_scale\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mgnorm_scale\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 523\u001b[0m \u001b[43m \u001b[49m\u001b[43mskip_zeros\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconfig\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mskip_zeros\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m]\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m 524\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n",
|
1501 |
+
"File \u001b[0;32m~/whisper/lib/python3.8/site-packages/bitsandbytes/functional.py:858\u001b[0m, in \u001b[0;36moptimizer_update_8bit_blockwise\u001b[0;34m(optimizer_name, g, p, state1, state2, beta1, beta2, eps, step, lr, qmap1, qmap2, absmax1, absmax2, weight_decay, gnorm_scale, skip_zeros)\u001b[0m\n\u001b[1;32m 837\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21moptimizer_update_8bit_blockwise\u001b[39m(\n\u001b[1;32m 838\u001b[0m optimizer_name: \u001b[38;5;28mstr\u001b[39m,\n\u001b[1;32m 839\u001b[0m g: Tensor,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 854\u001b[0m skip_zeros\u001b[38;5;241m=\u001b[39m\u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[1;32m 855\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 857\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m g\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m==\u001b[39m torch\u001b[38;5;241m.\u001b[39mfloat32 \u001b[38;5;129;01mand\u001b[39;00m state1\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m==\u001b[39m torch\u001b[38;5;241m.\u001b[39muint8:\n\u001b[0;32m--> 858\u001b[0m \u001b[43mstr2optimizer8bit_blockwise\u001b[49m[optimizer_name][\u001b[38;5;241m0\u001b[39m](\n\u001b[1;32m 859\u001b[0m get_ptr(p),\n\u001b[1;32m 860\u001b[0m get_ptr(g),\n\u001b[1;32m 861\u001b[0m get_ptr(state1),\n\u001b[1;32m 862\u001b[0m get_ptr(state2),\n\u001b[1;32m 863\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_float(beta1),\n\u001b[1;32m 864\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_float(beta2),\n\u001b[1;32m 865\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_float(eps),\n\u001b[1;32m 866\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_int32(step),\n\u001b[1;32m 867\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_float(lr),\n\u001b[1;32m 868\u001b[0m get_ptr(qmap1),\n\u001b[1;32m 869\u001b[0m get_ptr(qmap2),\n\u001b[1;32m 870\u001b[0m get_ptr(absmax1),\n\u001b[1;32m 871\u001b[0m get_ptr(absmax2),\n\u001b[1;32m 872\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_float(weight_decay),\n\u001b[1;32m 873\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_float(gnorm_scale),\n\u001b[1;32m 874\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_bool(skip_zeros),\n\u001b[1;32m 875\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_int32(g\u001b[38;5;241m.\u001b[39mnumel()),\n\u001b[1;32m 876\u001b[0m )\n\u001b[1;32m 877\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m g\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m==\u001b[39m torch\u001b[38;5;241m.\u001b[39mfloat16 \u001b[38;5;129;01mand\u001b[39;00m state1\u001b[38;5;241m.\u001b[39mdtype \u001b[38;5;241m==\u001b[39m torch\u001b[38;5;241m.\u001b[39muint8:\n\u001b[1;32m 878\u001b[0m str2optimizer8bit_blockwise[optimizer_name][\u001b[38;5;241m1\u001b[39m](\n\u001b[1;32m 879\u001b[0m get_ptr(p),\n\u001b[1;32m 880\u001b[0m get_ptr(g),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 895\u001b[0m ct\u001b[38;5;241m.\u001b[39mc_int32(g\u001b[38;5;241m.\u001b[39mnumel()),\n\u001b[1;32m 896\u001b[0m )\n",
|
1502 |
+
"\u001b[0;31mNameError\u001b[0m: name 'str2optimizer8bit_blockwise' is not defined"
|
1503 |
+
]
|
1504 |
+
}
|
1505 |
+
],
|
1506 |
+
"source": [
|
1507 |
+
"trainer.train()"
|
1508 |
+
]
|
1509 |
+
},
|
1510 |
+
{
|
1511 |
+
"cell_type": "markdown",
|
1512 |
+
"id": "810ced54-7187-4a06-b2fe-ba6dcca94dc3",
|
1513 |
+
"metadata": {
|
1514 |
+
"id": "810ced54-7187-4a06-b2fe-ba6dcca94dc3"
|
1515 |
+
},
|
1516 |
+
"source": [
|
1517 |
+
"We can label our checkpoint with the `whisper-event` tag on push by setting the appropriate key-word arguments (kwargs):"
|
1518 |
+
]
|
1519 |
+
},
|
1520 |
+
{
|
1521 |
+
"cell_type": "code",
|
1522 |
+
"execution_count": 28,
|
1523 |
+
"id": "c704f91e-241b-48c9-b8e0-f0da396a9663",
|
1524 |
+
"metadata": {
|
1525 |
+
"id": "c704f91e-241b-48c9-b8e0-f0da396a9663"
|
1526 |
+
},
|
1527 |
+
"outputs": [],
|
1528 |
+
"source": [
|
1529 |
+
"kwargs = {\n",
|
1530 |
+
" \"dataset_tags\": \"mozilla-foundation/common_voice_11_0\",\n",
|
1531 |
+
" \"dataset\": \"mozilla-foundation/common_voice_11_0\", # a 'pretty' name for the training dataset\n",
|
1532 |
+
" \"language\": \"zh-TW\",\n",
|
1533 |
+
" \"model_name\": \"Whisper Medium MS - Augmented\", # a 'pretty' name for your model\n",
|
1534 |
+
" \"finetuned_from\": \"openai/whisper-medium\",\n",
|
1535 |
+
" \"tasks\": \"automatic-speech-recognition\",\n",
|
1536 |
+
" \"tags\": \"whisper-event\",\n",
|
1537 |
+
"}"
|
1538 |
+
]
|
1539 |
+
},
|
1540 |
+
{
|
1541 |
+
"cell_type": "markdown",
|
1542 |
+
"id": "090d676a-f944-4297-a938-a40eda0b2b68",
|
1543 |
+
"metadata": {
|
1544 |
+
"id": "090d676a-f944-4297-a938-a40eda0b2b68"
|
1545 |
+
},
|
1546 |
+
"source": [
|
1547 |
+
"The training results can now be uploaded to the Hub. To do so, execute the `push_to_hub` command and save the preprocessor object we created:"
|
1548 |
+
]
|
1549 |
+
},
|
1550 |
+
{
|
1551 |
+
"cell_type": "code",
|
1552 |
+
"execution_count": 29,
|
1553 |
+
"id": "d7030622-caf7-4039-939b-6195cdaa2585",
|
1554 |
+
"metadata": {
|
1555 |
+
"id": "d7030622-caf7-4039-939b-6195cdaa2585"
|
1556 |
+
},
|
1557 |
+
"outputs": [
|
1558 |
+
{
|
1559 |
+
"name": "stderr",
|
1560 |
+
"output_type": "stream",
|
1561 |
+
"text": [
|
1562 |
+
"Saving model checkpoint to ./\n",
|
1563 |
+
"Configuration saved in ./config.json\n",
|
1564 |
+
"Model weights saved in ./pytorch_model.bin\n",
|
1565 |
+
"Feature extractor saved in ./preprocessor_config.json\n",
|
1566 |
+
"Several commits (3) will be pushed upstream.\n",
|
1567 |
+
"The progress bars may be unreliable.\n",
|
1568 |
+
"To https://huggingface.co/Scrya/whisper-medium-ms-augmented\n",
|
1569 |
+
" 1684a4c..b46b3bd main -> main\n",
|
1570 |
+
"\n"
|
1571 |
+
]
|
1572 |
+
}
|
1573 |
+
],
|
1574 |
+
"source": [
|
1575 |
+
"trainer.push_to_hub(**kwargs)"
|
1576 |
+
]
|
1577 |
+
},
|
1578 |
+
{
|
1579 |
+
"cell_type": "code",
|
1580 |
+
"execution_count": 35,
|
1581 |
+
"id": "9659fee2",
|
1582 |
+
"metadata": {},
|
1583 |
+
"outputs": [
|
1584 |
+
{
|
1585 |
+
"data": {
|
1586 |
+
"text/plain": [
|
1587 |
+
"{'eval_loss': 0.20663268864154816,\n",
|
1588 |
+
" 'eval_wer': 9.578362255965294,\n",
|
1589 |
+
" 'eval_cer': 2.8109053797929726,\n",
|
1590 |
+
" 'eval_runtime': 873.5198,\n",
|
1591 |
+
" 'eval_samples_per_second': 0.857,\n",
|
1592 |
+
" 'eval_steps_per_second': 0.429,\n",
|
1593 |
+
" 'epoch': 10.75,\n",
|
1594 |
+
" 'step': 1000}"
|
1595 |
+
]
|
1596 |
+
},
|
1597 |
+
"execution_count": 35,
|
1598 |
+
"metadata": {},
|
1599 |
+
"output_type": "execute_result"
|
1600 |
+
}
|
1601 |
+
],
|
1602 |
+
"source": [
|
1603 |
+
"trainer.state.log_history[-2]['eval_wer']"
|
1604 |
+
]
|
1605 |
+
},
|
1606 |
+
{
|
1607 |
+
"cell_type": "code",
|
1608 |
+
"execution_count": 36,
|
1609 |
+
"id": "25703cb1",
|
1610 |
+
"metadata": {},
|
1611 |
+
"outputs": [
|
1612 |
+
{
|
1613 |
+
"data": {
|
1614 |
+
"application/vnd.jupyter.widget-view+json": {
|
1615 |
+
"model_id": "4ea15f06fd6643ae94ab2a23ee1a1a71",
|
1616 |
+
"version_major": 2,
|
1617 |
+
"version_minor": 0
|
1618 |
+
},
|
1619 |
+
"text/plain": [
|
1620 |
+
"Downloading: 0%| | 0.00/2.15k [00:00<?, ?B/s]"
|
1621 |
+
]
|
1622 |
+
},
|
1623 |
+
"metadata": {},
|
1624 |
+
"output_type": "display_data"
|
1625 |
+
},
|
1626 |
+
{
|
1627 |
+
"data": {
|
1628 |
+
"text/plain": [
|
1629 |
+
"'https://huggingface.co/Scrya/whisper-medium-ms-augmented/blob/main/README.md'"
|
1630 |
+
]
|
1631 |
+
},
|
1632 |
+
"execution_count": 36,
|
1633 |
+
"metadata": {},
|
1634 |
+
"output_type": "execute_result"
|
1635 |
+
}
|
1636 |
+
],
|
1637 |
+
"source": [
|
1638 |
+
"evaluate.push_to_hub(\n",
|
1639 |
+
" model_id='Scrya/whisper-medium-zh-TW-augmented',\n",
|
1640 |
+
" metric_value=trainer.state.log_history[-2]['eval_wer'],\n",
|
1641 |
+
" metric_type=\"wer\",\n",
|
1642 |
+
" metric_name=\"WER\",\n",
|
1643 |
+
" dataset_name='mozilla-foundation/common_voice_11_0',\n",
|
1644 |
+
" dataset_type='mozilla-foundation/common_voice_11_0',\n",
|
1645 |
+
" dataset_split='test',\n",
|
1646 |
+
" dataset_config='zh-TW',\n",
|
1647 |
+
" task_type=\"automatic-speech-recognition\",\n",
|
1648 |
+
" task_name=\"Automatic Speech Recognition\"\n",
|
1649 |
+
")"
|
1650 |
+
]
|
1651 |
+
},
|
1652 |
+
{
|
1653 |
+
"cell_type": "markdown",
|
1654 |
+
"id": "ca743fbd-602c-48d4-ba8d-a2fe60af64ba",
|
1655 |
+
"metadata": {
|
1656 |
+
"id": "ca743fbd-602c-48d4-ba8d-a2fe60af64ba"
|
1657 |
+
},
|
1658 |
+
"source": [
|
1659 |
+
"## Closing Remarks"
|
1660 |
+
]
|
1661 |
+
},
|
1662 |
+
{
|
1663 |
+
"cell_type": "markdown",
|
1664 |
+
"id": "7f737783-2870-4e35-aa11-86a42d7d997a",
|
1665 |
+
"metadata": {
|
1666 |
+
"id": "7f737783-2870-4e35-aa11-86a42d7d997a"
|
1667 |
+
},
|
1668 |
+
"source": [
|
1669 |
+
"In this blog, we covered a step-by-step guide on fine-tuning Whisper for multilingual ASR \n",
|
1670 |
+
"using 🤗 Datasets, Transformers and the Hugging Face Hub. For more details on the Whisper model, the Common Voice dataset and the theory behind fine-tuning, refere to the accompanying [blog post](https://huggingface.co/blog/fine-tune-whisper). If you're interested in fine-tuning other \n",
|
1671 |
+
"Transformers models, both for English and multilingual ASR, be sure to check out the \n",
|
1672 |
+
"examples scripts at [examples/pytorch/speech-recognition](https://github.com/huggingface/transformers/tree/main/examples/pytorch/speech-recognition)."
|
1673 |
+
]
|
1674 |
+
}
|
1675 |
+
],
|
1676 |
+
"metadata": {
|
1677 |
+
"colab": {
|
1678 |
+
"include_colab_link": true,
|
1679 |
+
"provenance": []
|
1680 |
+
},
|
1681 |
+
"kernelspec": {
|
1682 |
+
"display_name": "Python 3 (ipykernel)",
|
1683 |
+
"language": "python",
|
1684 |
+
"name": "python3"
|
1685 |
+
},
|
1686 |
+
"language_info": {
|
1687 |
+
"codemirror_mode": {
|
1688 |
+
"name": "ipython",
|
1689 |
+
"version": 3
|
1690 |
+
},
|
1691 |
+
"file_extension": ".py",
|
1692 |
+
"mimetype": "text/x-python",
|
1693 |
+
"name": "python",
|
1694 |
+
"nbconvert_exporter": "python",
|
1695 |
+
"pygments_lexer": "ipython3",
|
1696 |
+
"version": "3.8.10"
|
1697 |
+
}
|
1698 |
+
},
|
1699 |
+
"nbformat": 4,
|
1700 |
+
"nbformat_minor": 5
|
1701 |
+
}
|
added_tokens.json
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"<|af|>": 50327,
|
3 |
+
"<|am|>": 50334,
|
4 |
+
"<|ar|>": 50272,
|
5 |
+
"<|as|>": 50350,
|
6 |
+
"<|az|>": 50304,
|
7 |
+
"<|ba|>": 50355,
|
8 |
+
"<|be|>": 50330,
|
9 |
+
"<|bg|>": 50292,
|
10 |
+
"<|bn|>": 50302,
|
11 |
+
"<|bo|>": 50347,
|
12 |
+
"<|br|>": 50309,
|
13 |
+
"<|bs|>": 50315,
|
14 |
+
"<|ca|>": 50270,
|
15 |
+
"<|cs|>": 50283,
|
16 |
+
"<|cy|>": 50297,
|
17 |
+
"<|da|>": 50285,
|
18 |
+
"<|de|>": 50261,
|
19 |
+
"<|el|>": 50281,
|
20 |
+
"<|endoftext|>": 50257,
|
21 |
+
"<|en|>": 50259,
|
22 |
+
"<|es|>": 50262,
|
23 |
+
"<|et|>": 50307,
|
24 |
+
"<|eu|>": 50310,
|
25 |
+
"<|fa|>": 50300,
|
26 |
+
"<|fi|>": 50277,
|
27 |
+
"<|fo|>": 50338,
|
28 |
+
"<|fr|>": 50265,
|
29 |
+
"<|gl|>": 50319,
|
30 |
+
"<|gu|>": 50333,
|
31 |
+
"<|haw|>": 50352,
|
32 |
+
"<|ha|>": 50354,
|
33 |
+
"<|hi|>": 50276,
|
34 |
+
"<|hr|>": 50291,
|
35 |
+
"<|ht|>": 50339,
|
36 |
+
"<|hu|>": 50286,
|
37 |
+
"<|hy|>": 50312,
|
38 |
+
"<|id|>": 50275,
|
39 |
+
"<|is|>": 50311,
|
40 |
+
"<|it|>": 50274,
|
41 |
+
"<|iw|>": 50279,
|
42 |
+
"<|ja|>": 50266,
|
43 |
+
"<|jw|>": 50356,
|
44 |
+
"<|ka|>": 50329,
|
45 |
+
"<|kk|>": 50316,
|
46 |
+
"<|km|>": 50323,
|
47 |
+
"<|kn|>": 50306,
|
48 |
+
"<|ko|>": 50264,
|
49 |
+
"<|la|>": 50294,
|
50 |
+
"<|lb|>": 50345,
|
51 |
+
"<|ln|>": 50353,
|
52 |
+
"<|lo|>": 50336,
|
53 |
+
"<|lt|>": 50293,
|
54 |
+
"<|lv|>": 50301,
|
55 |
+
"<|mg|>": 50349,
|
56 |
+
"<|mi|>": 50295,
|
57 |
+
"<|mk|>": 50308,
|
58 |
+
"<|ml|>": 50296,
|
59 |
+
"<|mn|>": 50314,
|
60 |
+
"<|mr|>": 50320,
|
61 |
+
"<|ms|>": 50282,
|
62 |
+
"<|mt|>": 50343,
|
63 |
+
"<|my|>": 50346,
|
64 |
+
"<|ne|>": 50313,
|
65 |
+
"<|nl|>": 50271,
|
66 |
+
"<|nn|>": 50342,
|
67 |
+
"<|nocaptions|>": 50362,
|
68 |
+
"<|notimestamps|>": 50363,
|
69 |
+
"<|no|>": 50288,
|
70 |
+
"<|oc|>": 50328,
|
71 |
+
"<|pa|>": 50321,
|
72 |
+
"<|pl|>": 50269,
|
73 |
+
"<|ps|>": 50340,
|
74 |
+
"<|pt|>": 50267,
|
75 |
+
"<|ro|>": 50284,
|
76 |
+
"<|ru|>": 50263,
|
77 |
+
"<|sa|>": 50344,
|
78 |
+
"<|sd|>": 50332,
|
79 |
+
"<|si|>": 50322,
|
80 |
+
"<|sk|>": 50298,
|
81 |
+
"<|sl|>": 50305,
|
82 |
+
"<|sn|>": 50324,
|
83 |
+
"<|so|>": 50326,
|
84 |
+
"<|sq|>": 50317,
|
85 |
+
"<|sr|>": 50303,
|
86 |
+
"<|startoflm|>": 50360,
|
87 |
+
"<|startofprev|>": 50361,
|
88 |
+
"<|startoftranscript|>": 50258,
|
89 |
+
"<|su|>": 50357,
|
90 |
+
"<|sv|>": 50273,
|
91 |
+
"<|sw|>": 50318,
|
92 |
+
"<|ta|>": 50287,
|
93 |
+
"<|te|>": 50299,
|
94 |
+
"<|tg|>": 50331,
|
95 |
+
"<|th|>": 50289,
|
96 |
+
"<|tk|>": 50341,
|
97 |
+
"<|tl|>": 50348,
|
98 |
+
"<|transcribe|>": 50359,
|
99 |
+
"<|translate|>": 50358,
|
100 |
+
"<|tr|>": 50268,
|
101 |
+
"<|tt|>": 50351,
|
102 |
+
"<|uk|>": 50280,
|
103 |
+
"<|ur|>": 50290,
|
104 |
+
"<|uz|>": 50337,
|
105 |
+
"<|vi|>": 50278,
|
106 |
+
"<|yi|>": 50335,
|
107 |
+
"<|yo|>": 50325,
|
108 |
+
"<|zh|>": 50260
|
109 |
+
}
|
config.json
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "openai/whisper-medium",
|
3 |
+
"activation_dropout": 0.0,
|
4 |
+
"activation_function": "gelu",
|
5 |
+
"architectures": [
|
6 |
+
"WhisperForConditionalGeneration"
|
7 |
+
],
|
8 |
+
"attention_dropout": 0.0,
|
9 |
+
"begin_suppress_tokens": [
|
10 |
+
220,
|
11 |
+
50257
|
12 |
+
],
|
13 |
+
"bos_token_id": 50257,
|
14 |
+
"d_model": 1024,
|
15 |
+
"decoder_attention_heads": 16,
|
16 |
+
"decoder_ffn_dim": 4096,
|
17 |
+
"decoder_layerdrop": 0.0,
|
18 |
+
"decoder_layers": 24,
|
19 |
+
"decoder_start_token_id": 50258,
|
20 |
+
"dropout": 0.0,
|
21 |
+
"encoder_attention_heads": 16,
|
22 |
+
"encoder_ffn_dim": 4096,
|
23 |
+
"encoder_layerdrop": 0.0,
|
24 |
+
"encoder_layers": 24,
|
25 |
+
"eos_token_id": 50257,
|
26 |
+
"forced_decoder_ids": null,
|
27 |
+
"init_std": 0.02,
|
28 |
+
"is_encoder_decoder": true,
|
29 |
+
"max_length": 448,
|
30 |
+
"max_source_positions": 1500,
|
31 |
+
"max_target_positions": 448,
|
32 |
+
"model_type": "whisper",
|
33 |
+
"num_hidden_layers": 24,
|
34 |
+
"num_mel_bins": 80,
|
35 |
+
"pad_token_id": 50257,
|
36 |
+
"scale_embedding": false,
|
37 |
+
"suppress_tokens": [],
|
38 |
+
"torch_dtype": "float32",
|
39 |
+
"transformers_version": "4.26.0.dev0",
|
40 |
+
"use_cache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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "markdown",
|
5 |
+
"id": "75b58048-7d14-4fc6-8085-1fc08c81b4a6",
|
6 |
+
"metadata": {
|
7 |
+
"id": "75b58048-7d14-4fc6-8085-1fc08c81b4a6"
|
8 |
+
},
|
9 |
+
"source": [
|
10 |
+
"# Fine-Tune Whisper For Multilingual ASR with 🤗 Transformers"
|
11 |
+
]
|
12 |
+
},
|
13 |
+
{
|
14 |
+
"cell_type": "markdown",
|
15 |
+
"id": "fbfa8ad5-4cdc-4512-9058-836cbbf65e1a",
|
16 |
+
"metadata": {
|
17 |
+
"id": "fbfa8ad5-4cdc-4512-9058-836cbbf65e1a"
|
18 |
+
},
|
19 |
+
"source": [
|
20 |
+
"In this Colab, we present a step-by-step guide on how to fine-tune Whisper \n",
|
21 |
+
"for any multilingual ASR dataset using Hugging Face 🤗 Transformers. This is a \n",
|
22 |
+
"more \"hands-on\" version of the accompanying [blog post](https://huggingface.co/blog/fine-tune-whisper). \n",
|
23 |
+
"For a more in-depth explanation of Whisper, the Common Voice dataset and the theory behind fine-tuning, the reader is advised to refer to the blog post."
|
24 |
+
]
|
25 |
+
},
|
26 |
+
{
|
27 |
+
"cell_type": "markdown",
|
28 |
+
"id": "afe0d503-ae4e-4aa7-9af4-dbcba52db41e",
|
29 |
+
"metadata": {
|
30 |
+
"id": "afe0d503-ae4e-4aa7-9af4-dbcba52db41e"
|
31 |
+
},
|
32 |
+
"source": [
|
33 |
+
"## Introduction"
|
34 |
+
]
|
35 |
+
},
|
36 |
+
{
|
37 |
+
"cell_type": "markdown",
|
38 |
+
"id": "9ae91ed4-9c3e-4ade-938e-f4c2dcfbfdc0",
|
39 |
+
"metadata": {
|
40 |
+
"id": "9ae91ed4-9c3e-4ade-938e-f4c2dcfbfdc0"
|
41 |
+
},
|
42 |
+
"source": [
|
43 |
+
"Whisper is a pre-trained model for automatic speech recognition (ASR) \n",
|
44 |
+
"published in [September 2022](https://openai.com/blog/whisper/) by the authors \n",
|
45 |
+
"Alec Radford et al. from OpenAI. Unlike many of its predecessors, such as \n",
|
46 |
+
"[Wav2Vec 2.0](https://arxiv.org/abs/2006.11477), which are pre-trained \n",
|
47 |
+
"on un-labelled audio data, Whisper is pre-trained on a vast quantity of \n",
|
48 |
+
"**labelled** audio-transcription data, 680,000 hours to be precise. \n",
|
49 |
+
"This is an order of magnitude more data than the un-labelled audio data used \n",
|
50 |
+
"to train Wav2Vec 2.0 (60,000 hours). What is more, 117,000 hours of this \n",
|
51 |
+
"pre-training data is multilingual ASR data. This results in checkpoints \n",
|
52 |
+
"that can be applied to over 96 languages, many of which are considered \n",
|
53 |
+
"_low-resource_.\n",
|
54 |
+
"\n",
|
55 |
+
"When scaled to 680,000 hours of labelled pre-training data, Whisper models \n",
|
56 |
+
"demonstrate a strong ability to generalise to many datasets and domains.\n",
|
57 |
+
"The pre-trained checkpoints achieve competitive results to state-of-the-art \n",
|
58 |
+
"ASR systems, with near 3% word error rate (WER) on the test-clean subset of \n",
|
59 |
+
"LibriSpeech ASR and a new state-of-the-art on TED-LIUM with 4.7% WER (_c.f._ \n",
|
60 |
+
"Table 8 of the [Whisper paper](https://cdn.openai.com/papers/whisper.pdf)).\n",
|
61 |
+
"The extensive multilingual ASR knowledge acquired by Whisper during pre-training \n",
|
62 |
+
"can be leveraged for other low-resource languages; through fine-tuning, the \n",
|
63 |
+
"pre-trained checkpoints can be adapted for specific datasets and languages \n",
|
64 |
+
"to further improve upon these results. We'll show just how Whisper can be fine-tuned \n",
|
65 |
+
"for low-resource languages in this Colab."
|
66 |
+
]
|
67 |
+
},
|
68 |
+
{
|
69 |
+
"cell_type": "markdown",
|
70 |
+
"id": "e59b91d6-be24-4b5e-bb38-4977ea143a72",
|
71 |
+
"metadata": {
|
72 |
+
"id": "e59b91d6-be24-4b5e-bb38-4977ea143a72"
|
73 |
+
},
|
74 |
+
"source": [
|
75 |
+
"<figure>\n",
|
76 |
+
"<img src=\"https://raw.githubusercontent.com/sanchit-gandhi/notebooks/main/whisper_architecture.svg\" alt=\"Trulli\" style=\"width:100%\">\n",
|
77 |
+
"<figcaption align = \"center\"><b>Figure 1:</b> Whisper model. The architecture \n",
|
78 |
+
"follows the standard Transformer-based encoder-decoder model. A \n",
|
79 |
+
"log-Mel spectrogram is input to the encoder. The last encoder \n",
|
80 |
+
"hidden states are input to the decoder via cross-attention mechanisms. The \n",
|
81 |
+
"decoder autoregressively predicts text tokens, jointly conditional on the \n",
|
82 |
+
"encoder hidden states and previously predicted tokens. Figure source: \n",
|
83 |
+
"<a href=\"https://openai.com/blog/whisper/\">OpenAI Whisper Blog</a>.</figcaption>\n",
|
84 |
+
"</figure>"
|
85 |
+
]
|
86 |
+
},
|
87 |
+
{
|
88 |
+
"cell_type": "markdown",
|
89 |
+
"id": "21b6316e-8a55-4549-a154-66d3da2ab74a",
|
90 |
+
"metadata": {
|
91 |
+
"id": "21b6316e-8a55-4549-a154-66d3da2ab74a"
|
92 |
+
},
|
93 |
+
"source": [
|
94 |
+
"The Whisper checkpoints come in five configurations of varying model sizes.\n",
|
95 |
+
"The smallest four are trained on either English-only or multilingual data.\n",
|
96 |
+
"The largest checkpoint is multilingual only. All nine of the pre-trained checkpoints \n",
|
97 |
+
"are available on the [Hugging Face Hub](https://huggingface.co/models?search=openai/whisper). The \n",
|
98 |
+
"checkpoints are summarised in the following table with links to the models on the Hub:\n",
|
99 |
+
"\n",
|
100 |
+
"| Size | Layers | Width | Heads | Parameters | English-only | Multilingual |\n",
|
101 |
+
"|--------|--------|-------|-------|------------|------------------------------------------------------|---------------------------------------------------|\n",
|
102 |
+
"| tiny | 4 | 384 | 6 | 39 M | [✓](https://huggingface.co/openai/whisper-tiny.en) | [✓](https://huggingface.co/openai/whisper-tiny.) |\n",
|
103 |
+
"| base | 6 | 512 | 8 | 74 M | [✓](https://huggingface.co/openai/whisper-base.en) | [✓](https://huggingface.co/openai/whisper-base) |\n",
|
104 |
+
"| small | 12 | 768 | 12 | 244 M | [✓](https://huggingface.co/openai/whisper-small.en) | [✓](https://huggingface.co/openai/whisper-small) |\n",
|
105 |
+
"| medium | 24 | 1024 | 16 | 769 M | [✓](https://huggingface.co/openai/whisper-medium.en) | [✓](https://huggingface.co/openai/whisper-medium) |\n",
|
106 |
+
"| large | 32 | 1280 | 20 | 1550 M | x | [✓](https://huggingface.co/openai/whisper-large) |\n",
|
107 |
+
"\n",
|
108 |
+
"For demonstration purposes, we'll fine-tune the multilingual version of the \n",
|
109 |
+
"[`\"small\"`](https://huggingface.co/openai/whisper-small) checkpoint with 244M params (~= 1GB). \n",
|
110 |
+
"As for our data, we'll train and evaluate our system on a low-resource language \n",
|
111 |
+
"taken from the [Common Voice](https://huggingface.co/datasets/mozilla-foundation/fleurs_11_0)\n",
|
112 |
+
"dataset. We'll show that with as little as 8 hours of fine-tuning data, we can achieve \n",
|
113 |
+
"strong performance in this language."
|
114 |
+
]
|
115 |
+
},
|
116 |
+
{
|
117 |
+
"cell_type": "markdown",
|
118 |
+
"id": "3a680dfc-cbba-4f6c-8a1f-e1a5ff3f123a",
|
119 |
+
"metadata": {
|
120 |
+
"id": "3a680dfc-cbba-4f6c-8a1f-e1a5ff3f123a"
|
121 |
+
},
|
122 |
+
"source": [
|
123 |
+
"------------------------------------------------------------------------\n",
|
124 |
+
"\n",
|
125 |
+
"\\\\({}^1\\\\) The name Whisper follows from the acronym “WSPSR”, which stands for “Web-scale Supervised Pre-training for Speech Recognition”."
|
126 |
+
]
|
127 |
+
},
|
128 |
+
{
|
129 |
+
"cell_type": "markdown",
|
130 |
+
"id": "b219c9dd-39b6-4a95-b2a1-3f547a1e7bc0",
|
131 |
+
"metadata": {
|
132 |
+
"id": "b219c9dd-39b6-4a95-b2a1-3f547a1e7bc0"
|
133 |
+
},
|
134 |
+
"source": [
|
135 |
+
"## Load Dataset\n",
|
136 |
+
"Loading MS-MY Dataset from FLEURS.\n",
|
137 |
+
"Combine train and validation set."
|
138 |
+
]
|
139 |
+
},
|
140 |
+
{
|
141 |
+
"cell_type": "code",
|
142 |
+
"execution_count": 1,
|
143 |
+
"id": "a2787582-554f-44ce-9f38-4180a5ed6b44",
|
144 |
+
"metadata": {
|
145 |
+
"id": "a2787582-554f-44ce-9f38-4180a5ed6b44"
|
146 |
+
},
|
147 |
+
"outputs": [
|
148 |
+
{
|
149 |
+
"name": "stderr",
|
150 |
+
"output_type": "stream",
|
151 |
+
"text": [
|
152 |
+
"Found cached dataset common_voice_11_0 (/home/daniel/.cache/huggingface/datasets/mozilla-foundation___common_voice_11_0/zh-TW/11.0.0/f8e47235d9b4e68fa24ed71d63266a02018ccf7194b2a8c9c598a5f3ab304d9f)\n",
|
153 |
+
"Found cached dataset common_voice_11_0 (/home/daniel/.cache/huggingface/datasets/mozilla-foundation___common_voice_11_0/zh-TW/11.0.0/f8e47235d9b4e68fa24ed71d63266a02018ccf7194b2a8c9c598a5f3ab304d9f)\n"
|
154 |
+
]
|
155 |
+
},
|
156 |
+
{
|
157 |
+
"name": "stdout",
|
158 |
+
"output_type": "stream",
|
159 |
+
"text": [
|
160 |
+
"DatasetDict({\n",
|
161 |
+
" train: Dataset({\n",
|
162 |
+
" features: ['audio', 'sentence'],\n",
|
163 |
+
" num_rows: 11277\n",
|
164 |
+
" })\n",
|
165 |
+
" test: Dataset({\n",
|
166 |
+
" features: ['audio', 'sentence'],\n",
|
167 |
+
" num_rows: 4709\n",
|
168 |
+
" })\n",
|
169 |
+
"})\n"
|
170 |
+
]
|
171 |
+
}
|
172 |
+
],
|
173 |
+
"source": [
|
174 |
+
"from datasets import load_dataset, DatasetDict\n",
|
175 |
+
"\n",
|
176 |
+
"cv = DatasetDict()\n",
|
177 |
+
"cv[\"train\"] = load_dataset(\"mozilla-foundation/common_voice_11_0\", \"zh-TW\", split=\"train+validation\", use_auth_token=True)\n",
|
178 |
+
"cv[\"test\"] = load_dataset(\"mozilla-foundation/common_voice_11_0\", \"zh-TW\", split=\"test\", use_auth_token=True)\n",
|
179 |
+
"\n",
|
180 |
+
"cv = cv.remove_columns([\"client_id\", \"path\", \"up_votes\", \"down_votes\", \"age\", \"gender\", \"accent\", \"locale\", \"segment\"])\n",
|
181 |
+
"print(cv)"
|
182 |
+
]
|
183 |
+
},
|
184 |
+
{
|
185 |
+
"cell_type": "code",
|
186 |
+
"execution_count": 2,
|
187 |
+
"id": "79731fc3",
|
188 |
+
"metadata": {},
|
189 |
+
"outputs": [
|
190 |
+
{
|
191 |
+
"data": {
|
192 |
+
"text/plain": [
|
193 |
+
"{'audio': {'path': '/home/daniel/.cache/huggingface/datasets/downloads/extracted/8d1722ebe07713de78ba2ed06286baa9fb33c24f19cb47ef1a3d6cb0774ad391/common_voice_zh-TW_18013265.mp3',\n",
|
194 |
+
" 'array': array([0., 0., 0., ..., 0., 0., 0.], dtype=float32),\n",
|
195 |
+
" 'sampling_rate': 48000},\n",
|
196 |
+
" 'sentence': '爸爸們父親節快樂!'}"
|
197 |
+
]
|
198 |
+
},
|
199 |
+
"execution_count": 2,
|
200 |
+
"metadata": {},
|
201 |
+
"output_type": "execute_result"
|
202 |
+
}
|
203 |
+
],
|
204 |
+
"source": [
|
205 |
+
"cv['train'][18]"
|
206 |
+
]
|
207 |
+
},
|
208 |
+
{
|
209 |
+
"cell_type": "markdown",
|
210 |
+
"id": "2d63b2d2-f68a-4d74-b7f1-5127f6d16605",
|
211 |
+
"metadata": {
|
212 |
+
"id": "2d63b2d2-f68a-4d74-b7f1-5127f6d16605"
|
213 |
+
},
|
214 |
+
"source": [
|
215 |
+
"## Prepare Feature Extractor, Tokenizer and Data"
|
216 |
+
]
|
217 |
+
},
|
218 |
+
{
|
219 |
+
"cell_type": "markdown",
|
220 |
+
"id": "601c3099-1026-439e-93e2-5635b3ba5a73",
|
221 |
+
"metadata": {
|
222 |
+
"id": "601c3099-1026-439e-93e2-5635b3ba5a73"
|
223 |
+
},
|
224 |
+
"source": [
|
225 |
+
"The ASR pipeline can be de-composed into three stages: \n",
|
226 |
+
"1) A feature extractor which pre-processes the raw audio-inputs\n",
|
227 |
+
"2) The model which performs the sequence-to-sequence mapping \n",
|
228 |
+
"3) A tokenizer which post-processes the model outputs to text format\n",
|
229 |
+
"\n",
|
230 |
+
"In 🤗 Transformers, the Whisper model has an associated feature extractor and tokenizer, \n",
|
231 |
+
"called [WhisperFeatureExtractor](https://huggingface.co/docs/transformers/main/model_doc/whisper#transformers.WhisperFeatureExtractor)\n",
|
232 |
+
"and [WhisperTokenizer](https://huggingface.co/docs/transformers/main/model_doc/whisper#transformers.WhisperTokenizer) \n",
|
233 |
+
"respectively.\n",
|
234 |
+
"\n",
|
235 |
+
"We'll go through details for setting-up the feature extractor and tokenizer one-by-one!"
|
236 |
+
]
|
237 |
+
},
|
238 |
+
{
|
239 |
+
"cell_type": "markdown",
|
240 |
+
"id": "560332eb-3558-41a1-b500-e83a9f695f84",
|
241 |
+
"metadata": {
|
242 |
+
"id": "560332eb-3558-41a1-b500-e83a9f695f84"
|
243 |
+
},
|
244 |
+
"source": [
|
245 |
+
"### Load WhisperFeatureExtractor"
|
246 |
+
]
|
247 |
+
},
|
248 |
+
{
|
249 |
+
"cell_type": "markdown",
|
250 |
+
"id": "32ec8068-0bd7-412d-b662-0edb9d1e7365",
|
251 |
+
"metadata": {
|
252 |
+
"id": "32ec8068-0bd7-412d-b662-0edb9d1e7365"
|
253 |
+
},
|
254 |
+
"source": [
|
255 |
+
"The Whisper feature extractor performs two operations:\n",
|
256 |
+
"1. Pads / truncates the audio inputs to 30s: any audio inputs shorter than 30s are padded to 30s with silence (zeros), and those longer that 30s are truncated to 30s\n",
|
257 |
+
"2. Converts the audio inputs to _log-Mel spectrogram_ input features, a visual representation of the audio and the form of the input expected by the Whisper model"
|
258 |
+
]
|
259 |
+
},
|
260 |
+
{
|
261 |
+
"cell_type": "markdown",
|
262 |
+
"id": "589d9ec1-d12b-4b64-93f7-04c63997da19",
|
263 |
+
"metadata": {
|
264 |
+
"id": "589d9ec1-d12b-4b64-93f7-04c63997da19"
|
265 |
+
},
|
266 |
+
"source": [
|
267 |
+
"<figure>\n",
|
268 |
+
"<img src=\"https://raw.githubusercontent.com/sanchit-gandhi/notebooks/main/spectrogram.jpg\" alt=\"Trulli\" style=\"width:100%\">\n",
|
269 |
+
"<figcaption align = \"center\"><b>Figure 2:</b> Conversion of sampled audio array to log-Mel spectrogram.\n",
|
270 |
+
"Left: sampled 1-dimensional audio signal. Right: corresponding log-Mel spectrogram. Figure source:\n",
|
271 |
+
"<a href=\"https://ai.googleblog.com/2019/04/specaugment-new-data-augmentation.html\">Google SpecAugment Blog</a>.\n",
|
272 |
+
"</figcaption>"
|
273 |
+
]
|
274 |
+
},
|
275 |
+
{
|
276 |
+
"cell_type": "markdown",
|
277 |
+
"id": "b2ef54d5-b946-4c1d-9fdc-adc5d01b46aa",
|
278 |
+
"metadata": {
|
279 |
+
"id": "b2ef54d5-b946-4c1d-9fdc-adc5d01b46aa"
|
280 |
+
},
|
281 |
+
"source": [
|
282 |
+
"We'll load the feature extractor from the pre-trained checkpoint with the default values:"
|
283 |
+
]
|
284 |
+
},
|
285 |
+
{
|
286 |
+
"cell_type": "code",
|
287 |
+
"execution_count": 2,
|
288 |
+
"id": "bc77d7bb-f9e2-47f5-b663-30f7a4321ce5",
|
289 |
+
"metadata": {
|
290 |
+
"id": "bc77d7bb-f9e2-47f5-b663-30f7a4321ce5"
|
291 |
+
},
|
292 |
+
"outputs": [],
|
293 |
+
"source": [
|
294 |
+
"from transformers import WhisperFeatureExtractor\n",
|
295 |
+
"\n",
|
296 |
+
"feature_extractor = WhisperFeatureExtractor.from_pretrained(\"openai/whisper-medium\")"
|
297 |
+
]
|
298 |
+
},
|
299 |
+
{
|
300 |
+
"cell_type": "markdown",
|
301 |
+
"id": "93748af7-b917-4ecf-a0c8-7d89077ff9cb",
|
302 |
+
"metadata": {
|
303 |
+
"id": "93748af7-b917-4ecf-a0c8-7d89077ff9cb"
|
304 |
+
},
|
305 |
+
"source": [
|
306 |
+
"### Load WhisperTokenizer"
|
307 |
+
]
|
308 |
+
},
|
309 |
+
{
|
310 |
+
"cell_type": "markdown",
|
311 |
+
"id": "2bc82609-a9fb-447a-a2af-99597c864029",
|
312 |
+
"metadata": {
|
313 |
+
"id": "2bc82609-a9fb-447a-a2af-99597c864029"
|
314 |
+
},
|
315 |
+
"source": [
|
316 |
+
"The Whisper model outputs a sequence of _token ids_. The tokenizer maps each of these token ids to their corresponding text string. For Hindi, we can load the pre-trained tokenizer and use it for fine-tuning without any further modifications. We simply have to \n",
|
317 |
+
"specify the target language and the task. These arguments inform the \n",
|
318 |
+
"tokenizer to prefix the language and task tokens to the start of encoded \n",
|
319 |
+
"label sequences:"
|
320 |
+
]
|
321 |
+
},
|
322 |
+
{
|
323 |
+
"cell_type": "code",
|
324 |
+
"execution_count": 3,
|
325 |
+
"id": "c7b07f9b-ae0e-4f89-98f0-0c50d432eab6",
|
326 |
+
"metadata": {
|
327 |
+
"id": "c7b07f9b-ae0e-4f89-98f0-0c50d432eab6",
|
328 |
+
"outputId": "5c004b44-86e7-4e00-88be-39e0af5eed69"
|
329 |
+
},
|
330 |
+
"outputs": [],
|
331 |
+
"source": [
|
332 |
+
"from transformers import WhisperTokenizer\n",
|
333 |
+
"\n",
|
334 |
+
"tokenizer = WhisperTokenizer.from_pretrained(\"openai/whisper-medium\", language=\"Chinese\", task=\"transcribe\")"
|
335 |
+
]
|
336 |
+
},
|
337 |
+
{
|
338 |
+
"cell_type": "markdown",
|
339 |
+
"id": "d2ef23f3-f4a8-483a-a2dc-080a7496cb1b",
|
340 |
+
"metadata": {
|
341 |
+
"id": "d2ef23f3-f4a8-483a-a2dc-080a7496cb1b"
|
342 |
+
},
|
343 |
+
"source": [
|
344 |
+
"### Combine To Create A WhisperProcessor"
|
345 |
+
]
|
346 |
+
},
|
347 |
+
{
|
348 |
+
"cell_type": "markdown",
|
349 |
+
"id": "5ff67654-5a29-4bb8-a69d-0228946c6f8d",
|
350 |
+
"metadata": {
|
351 |
+
"id": "5ff67654-5a29-4bb8-a69d-0228946c6f8d"
|
352 |
+
},
|
353 |
+
"source": [
|
354 |
+
"To simplify using the feature extractor and tokenizer, we can _wrap_ \n",
|
355 |
+
"both into a single `WhisperProcessor` class. This processor object \n",
|
356 |
+
"inherits from the `WhisperFeatureExtractor` and `WhisperProcessor`, \n",
|
357 |
+
"and can be used on the audio inputs and model predictions as required. \n",
|
358 |
+
"In doing so, we only need to keep track of two objects during training: \n",
|
359 |
+
"the `processor` and the `model`:"
|
360 |
+
]
|
361 |
+
},
|
362 |
+
{
|
363 |
+
"cell_type": "code",
|
364 |
+
"execution_count": 4,
|
365 |
+
"id": "77d9f0c5-8607-4642-a8ac-c3ab2e223ea6",
|
366 |
+
"metadata": {
|
367 |
+
"id": "77d9f0c5-8607-4642-a8ac-c3ab2e223ea6"
|
368 |
+
},
|
369 |
+
"outputs": [],
|
370 |
+
"source": [
|
371 |
+
"from transformers import WhisperProcessor\n",
|
372 |
+
"\n",
|
373 |
+
"processor = WhisperProcessor.from_pretrained(\"openai/whisper-medium\", language=\"Chinese\", task=\"transcribe\")"
|
374 |
+
]
|
375 |
+
},
|
376 |
+
{
|
377 |
+
"cell_type": "markdown",
|
378 |
+
"id": "381acd09-0b0f-4d04-9eb3-f028ac0e5f2c",
|
379 |
+
"metadata": {
|
380 |
+
"id": "381acd09-0b0f-4d04-9eb3-f028ac0e5f2c"
|
381 |
+
},
|
382 |
+
"source": [
|
383 |
+
"### Prepare Data"
|
384 |
+
]
|
385 |
+
},
|
386 |
+
{
|
387 |
+
"cell_type": "code",
|
388 |
+
"execution_count": 5,
|
389 |
+
"id": "c69246a2",
|
390 |
+
"metadata": {},
|
391 |
+
"outputs": [],
|
392 |
+
"source": [
|
393 |
+
"from datasets import Audio\n",
|
394 |
+
"cv = cv.cast_column(\"audio\", Audio(sampling_rate=16000))"
|
395 |
+
]
|
396 |
+
},
|
397 |
+
{
|
398 |
+
"cell_type": "markdown",
|
399 |
+
"id": "3df7378a-a4c0-45d7-8d07-defbd1062ab6",
|
400 |
+
"metadata": {},
|
401 |
+
"source": [
|
402 |
+
"We'll define our pre-processing strategy. We advise that you **do not** lower-case the transcriptions or remove punctuation unless mixing different datasets. This will enable you to fine-tune Whisper models that can predict punctuation and casing. Later, you will see how we can evaluate the predictions without punctuation or casing, so that the models benefit from the WER improvement obtained by normalising the transcriptions while still predicting fully formatted transcriptions."
|
403 |
+
]
|
404 |
+
},
|
405 |
+
{
|
406 |
+
"cell_type": "markdown",
|
407 |
+
"id": "89e12c2e-2f14-479b-987b-f0c75c881095",
|
408 |
+
"metadata": {},
|
409 |
+
"source": [
|
410 |
+
"Now we can write a function to prepare our data ready for the model:\n",
|
411 |
+
"1. We load and resample the audio data by calling `batch[\"audio\"]`. As explained above, 🤗 Datasets performs any necessary resampling operations on the fly.\n",
|
412 |
+
"2. We use the feature extractor to compute the log-Mel spectrogram input features from our 1-dimensional audio array.\n",
|
413 |
+
"3. We perform any optional pre-processing (lower-case or remove punctuation).\n",
|
414 |
+
"4. We encode the transcriptions to label ids through the use of the tokenizer."
|
415 |
+
]
|
416 |
+
},
|
417 |
+
{
|
418 |
+
"cell_type": "code",
|
419 |
+
"execution_count": 6,
|
420 |
+
"id": "b27e4720",
|
421 |
+
"metadata": {},
|
422 |
+
"outputs": [],
|
423 |
+
"source": [
|
424 |
+
"from audiomentations import Compose, TimeStretch, PitchShift\n",
|
425 |
+
"\n",
|
426 |
+
"augment_waveform = Compose([\n",
|
427 |
+
" TimeStretch(min_rate=0.8, max_rate=1.25, p=0.3, leave_length_unchanged=False),\n",
|
428 |
+
" PitchShift(min_semitones=-4, max_semitones=4, p=0.3),\n",
|
429 |
+
" ])\n",
|
430 |
+
"\n",
|
431 |
+
"def augment_dataset(batch):\n",
|
432 |
+
"\n",
|
433 |
+
" audio = batch[\"audio\"][\"array\"]\n",
|
434 |
+
" # apply augmentation\n",
|
435 |
+
" augmented_audio = augment_waveform(samples=audio, sample_rate=16000)\n",
|
436 |
+
"\n",
|
437 |
+
" batch[\"audio\"][\"array\"] = augmented_audio\n",
|
438 |
+
"\n",
|
439 |
+
" return batch"
|
440 |
+
]
|
441 |
+
},
|
442 |
+
{
|
443 |
+
"cell_type": "code",
|
444 |
+
"execution_count": 7,
|
445 |
+
"id": "b459b0c5",
|
446 |
+
"metadata": {},
|
447 |
+
"outputs": [
|
448 |
+
{
|
449 |
+
"name": "stdout",
|
450 |
+
"output_type": "stream",
|
451 |
+
"text": [
|
452 |
+
"Augment train set:\n"
|
453 |
+
]
|
454 |
+
},
|
455 |
+
{
|
456 |
+
"data": {
|
457 |
+
"application/vnd.jupyter.widget-view+json": {
|
458 |
+
"model_id": "e7f849f56879427995d5de3d75585606",
|
459 |
+
"version_major": 2,
|
460 |
+
"version_minor": 0
|
461 |
+
},
|
462 |
+
"text/plain": [
|
463 |
+
" 0%| | 0/11277 [00:00<?, ?ex/s]"
|
464 |
+
]
|
465 |
+
},
|
466 |
+
"metadata": {},
|
467 |
+
"output_type": "display_data"
|
468 |
+
}
|
469 |
+
],
|
470 |
+
"source": [
|
471 |
+
"print('Augment train set:')\n",
|
472 |
+
"cv['train'] = cv['train'].map(augment_dataset, num_proc=1)"
|
473 |
+
]
|
474 |
+
},
|
475 |
+
{
|
476 |
+
"cell_type": "markdown",
|
477 |
+
"id": "8c960965-9fb6-466f-9dbd-c9d43e71d9d0",
|
478 |
+
"metadata": {
|
479 |
+
"id": "70b319fb-2439-4ef6-a70d-a47bf41c4a13"
|
480 |
+
},
|
481 |
+
"source": [
|
482 |
+
"We can apply the data preparation function to all of our training examples using dataset's `.map` method. The argument `num_proc` specifies how many CPU cores to use. Setting `num_proc` > 1 will enable multiprocessing. If the `.map` method hangs with multiprocessing, set `num_proc=1` and process the dataset sequentially."
|
483 |
+
]
|
484 |
+
},
|
485 |
+
{
|
486 |
+
"cell_type": "code",
|
487 |
+
"execution_count": 8,
|
488 |
+
"id": "d041650e-1c48-4439-87b3-5b6f4a514107",
|
489 |
+
"metadata": {},
|
490 |
+
"outputs": [],
|
491 |
+
"source": [
|
492 |
+
"from transformers.models.whisper.english_normalizer import BasicTextNormalizer\n",
|
493 |
+
"normalizer = BasicTextNormalizer()"
|
494 |
+
]
|
495 |
+
},
|
496 |
+
{
|
497 |
+
"cell_type": "code",
|
498 |
+
"execution_count": 9,
|
499 |
+
"id": "c085911c-a10a-41ef-8874-306e0503e9bb",
|
500 |
+
"metadata": {},
|
501 |
+
"outputs": [],
|
502 |
+
"source": [
|
503 |
+
"def prepare_dataset(batch):\n",
|
504 |
+
" # load and (possibly) resample audio data to 16kHz\n",
|
505 |
+
" audio = batch[\"audio\"]\n",
|
506 |
+
"\n",
|
507 |
+
" # compute log-Mel input features from input audio array \n",
|
508 |
+
" batch[\"input_features\"] = processor.feature_extractor(audio[\"array\"], sampling_rate=audio[\"sampling_rate\"]).input_features[0]\n",
|
509 |
+
" # compute input length of audio sample in seconds\n",
|
510 |
+
" batch[\"input_length\"] = len(audio[\"array\"]) / audio[\"sampling_rate\"]\n",
|
511 |
+
" \n",
|
512 |
+
" # split chinese characters by space, as stated in the paper\n",
|
513 |
+
" sentence = batch[\"sentence\"]\n",
|
514 |
+
" sentence = \" \".join(sentence)\n",
|
515 |
+
" # normalize\n",
|
516 |
+
" sentence = normalizer(sentence)\n",
|
517 |
+
" \n",
|
518 |
+
" # encode target text to label ids\n",
|
519 |
+
" batch[\"labels\"] = processor.tokenizer(sentence).input_ids\n",
|
520 |
+
" return batch"
|
521 |
+
]
|
522 |
+
},
|
523 |
+
{
|
524 |
+
"cell_type": "code",
|
525 |
+
"execution_count": 10,
|
526 |
+
"id": "90965caa",
|
527 |
+
"metadata": {},
|
528 |
+
"outputs": [
|
529 |
+
{
|
530 |
+
"name": "stdout",
|
531 |
+
"output_type": "stream",
|
532 |
+
"text": [
|
533 |
+
"Extract features and normalize data:\n"
|
534 |
+
]
|
535 |
+
},
|
536 |
+
{
|
537 |
+
"data": {
|
538 |
+
"application/vnd.jupyter.widget-view+json": {
|
539 |
+
"model_id": "91de26e5528241e895f883a394bdab2a",
|
540 |
+
"version_major": 2,
|
541 |
+
"version_minor": 0
|
542 |
+
},
|
543 |
+
"text/plain": [
|
544 |
+
" 0%| | 0/11277 [00:00<?, ?ex/s]"
|
545 |
+
]
|
546 |
+
},
|
547 |
+
"metadata": {},
|
548 |
+
"output_type": "display_data"
|
549 |
+
},
|
550 |
+
{
|
551 |
+
"name": "stderr",
|
552 |
+
"output_type": "stream",
|
553 |
+
"text": [
|
554 |
+
"Loading cached processed dataset at /home/daniel/.cache/huggingface/datasets/mozilla-foundation___common_voice_11_0/zh-TW/11.0.0/f8e47235d9b4e68fa24ed71d63266a02018ccf7194b2a8c9c598a5f3ab304d9f/cache-e493134b08029cc3.arrow\n"
|
555 |
+
]
|
556 |
+
}
|
557 |
+
],
|
558 |
+
"source": [
|
559 |
+
"print('Extract features and normalize data:')\n",
|
560 |
+
"cv = cv.map(prepare_dataset, remove_columns=cv.column_names['train'], num_proc=1).with_format('torch')"
|
561 |
+
]
|
562 |
+
},
|
563 |
+
{
|
564 |
+
"cell_type": "code",
|
565 |
+
"execution_count": 11,
|
566 |
+
"id": "bde2118b",
|
567 |
+
"metadata": {},
|
568 |
+
"outputs": [
|
569 |
+
{
|
570 |
+
"data": {
|
571 |
+
"text/plain": [
|
572 |
+
"{'input_features': tensor([[-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
573 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
574 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
575 |
+
" ...,\n",
|
576 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
577 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590],\n",
|
578 |
+
" [-0.9590, -0.9590, -0.9590, ..., -0.9590, -0.9590, -0.9590]]),\n",
|
579 |
+
" 'input_length': tensor(2.6400),\n",
|
580 |
+
" 'labels': tensor([50258, 50260, 50359, 50363, 23855, 220, 23855, 220, 4623, 220,\n",
|
581 |
+
" 34131, 220, 42117, 220, 27694, 42598, 220, 34043, 220, 50257])}"
|
582 |
+
]
|
583 |
+
},
|
584 |
+
"execution_count": 11,
|
585 |
+
"metadata": {},
|
586 |
+
"output_type": "execute_result"
|
587 |
+
}
|
588 |
+
],
|
589 |
+
"source": [
|
590 |
+
"cv['train'][18]"
|
591 |
+
]
|
592 |
+
},
|
593 |
+
{
|
594 |
+
"cell_type": "markdown",
|
595 |
+
"id": "54ce0fdb-7218-4a4d-b175-383980fec0df",
|
596 |
+
"metadata": {},
|
597 |
+
"source": [
|
598 |
+
"Finally, we filter any training data with audio samples longer than 30s. These samples would otherwise be truncated by the Whisper feature-extractor which could affect the stability of training. We define a function that returns `True` for samples that are less than 30s, and `False` for those that are longer:"
|
599 |
+
]
|
600 |
+
},
|
601 |
+
{
|
602 |
+
"cell_type": "code",
|
603 |
+
"execution_count": 12,
|
604 |
+
"id": "01cb25ef-4bb0-4325-9461-f59198acadf6",
|
605 |
+
"metadata": {},
|
606 |
+
"outputs": [],
|
607 |
+
"source": [
|
608 |
+
"max_input_length = 30.0\n",
|
609 |
+
"\n",
|
610 |
+
"def is_audio_in_length_range(length):\n",
|
611 |
+
" return length < max_input_length"
|
612 |
+
]
|
613 |
+
},
|
614 |
+
{
|
615 |
+
"cell_type": "markdown",
|
616 |
+
"id": "30e676a8-7ca8-4850-8c5d-5b2b00d13fba",
|
617 |
+
"metadata": {},
|
618 |
+
"source": [
|
619 |
+
"We apply our filter function to all samples of our training dataset through 🤗 Datasets' `.filter` method:"
|
620 |
+
]
|
621 |
+
},
|
622 |
+
{
|
623 |
+
"cell_type": "code",
|
624 |
+
"execution_count": 13,
|
625 |
+
"id": "333f7f6e-6053-4d3b-8924-c733c79b82ac",
|
626 |
+
"metadata": {},
|
627 |
+
"outputs": [
|
628 |
+
{
|
629 |
+
"data": {
|
630 |
+
"application/vnd.jupyter.widget-view+json": {
|
631 |
+
"model_id": "bcef97571c7548c081de85f242931b21",
|
632 |
+
"version_major": 2,
|
633 |
+
"version_minor": 0
|
634 |
+
},
|
635 |
+
"text/plain": [
|
636 |
+
" 0%| | 0/12 [00:00<?, ?ba/s]"
|
637 |
+
]
|
638 |
+
},
|
639 |
+
"metadata": {},
|
640 |
+
"output_type": "display_data"
|
641 |
+
}
|
642 |
+
],
|
643 |
+
"source": [
|
644 |
+
"cv['train'] = cv['train'].filter(\n",
|
645 |
+
" is_audio_in_length_range,\n",
|
646 |
+
" input_columns=[\"input_length\"],\n",
|
647 |
+
")"
|
648 |
+
]
|
649 |
+
},
|
650 |
+
{
|
651 |
+
"cell_type": "code",
|
652 |
+
"execution_count": 14,
|
653 |
+
"id": "53945dcb",
|
654 |
+
"metadata": {},
|
655 |
+
"outputs": [],
|
656 |
+
"source": [
|
657 |
+
"cv[\"train\"] = cv[\"train\"].shuffle(seed=42, writer_batch_size=100)"
|
658 |
+
]
|
659 |
+
},
|
660 |
+
{
|
661 |
+
"cell_type": "markdown",
|
662 |
+
"id": "263a5a58-0239-4a25-b0df-c625fc9c5810",
|
663 |
+
"metadata": {
|
664 |
+
"id": "263a5a58-0239-4a25-b0df-c625fc9c5810"
|
665 |
+
},
|
666 |
+
"source": [
|
667 |
+
"## Training and Evaluation"
|
668 |
+
]
|
669 |
+
},
|
670 |
+
{
|
671 |
+
"cell_type": "markdown",
|
672 |
+
"id": "a693e768-c5a6-453f-89a1-b601dcf7daf7",
|
673 |
+
"metadata": {
|
674 |
+
"id": "a693e768-c5a6-453f-89a1-b601dcf7daf7"
|
675 |
+
},
|
676 |
+
"source": [
|
677 |
+
"Now that we've prepared our data, we're ready to dive into the training pipeline. \n",
|
678 |
+
"The [🤗 Trainer](https://huggingface.co/transformers/master/main_classes/trainer.html?highlight=trainer)\n",
|
679 |
+
"will do much of the heavy lifting for us. All we have to do is:\n",
|
680 |
+
"\n",
|
681 |
+
"- Define a data collator: the data collator takes our pre-processed data and prepares PyTorch tensors ready for the model.\n",
|
682 |
+
"\n",
|
683 |
+
"- Evaluation metrics: during evaluation, we want to evaluate the model using the [word error rate (WER)](https://huggingface.co/metrics/wer) metric. We need to define a `compute_metrics` function that handles this computation.\n",
|
684 |
+
"\n",
|
685 |
+
"- Load a pre-trained checkpoint: we need to load a pre-trained checkpoint and configure it correctly for training.\n",
|
686 |
+
"\n",
|
687 |
+
"- Define the training configuration: this will be used by the 🤗 Trainer to define the training schedule.\n",
|
688 |
+
"\n",
|
689 |
+
"Once we've fine-tuned the model, we will evaluate it on the test data to verify that we have correctly trained it \n",
|
690 |
+
"to transcribe speech in Hindi."
|
691 |
+
]
|
692 |
+
},
|
693 |
+
{
|
694 |
+
"cell_type": "markdown",
|
695 |
+
"id": "8d230e6d-624c-400a-bbf5-fa660881df25",
|
696 |
+
"metadata": {
|
697 |
+
"id": "8d230e6d-624c-400a-bbf5-fa660881df25"
|
698 |
+
},
|
699 |
+
"source": [
|
700 |
+
"### Define a Data Collator"
|
701 |
+
]
|
702 |
+
},
|
703 |
+
{
|
704 |
+
"cell_type": "markdown",
|
705 |
+
"id": "04def221-0637-4a69-b242-d3f0c1d0ee78",
|
706 |
+
"metadata": {
|
707 |
+
"id": "04def221-0637-4a69-b242-d3f0c1d0ee78"
|
708 |
+
},
|
709 |
+
"source": [
|
710 |
+
"The data collator for a sequence-to-sequence speech model is unique in the sense that it \n",
|
711 |
+
"treats the `input_features` and `labels` independently: the `input_features` must be \n",
|
712 |
+
"handled by the feature extractor and the `labels` by the tokenizer.\n",
|
713 |
+
"\n",
|
714 |
+
"The `input_features` are already padded to 30s and converted to a log-Mel spectrogram \n",
|
715 |
+
"of fixed dimension by action of the feature extractor, so all we have to do is convert the `input_features`\n",
|
716 |
+
"to batched PyTorch tensors. We do this using the feature extractor's `.pad` method with `return_tensors=pt`.\n",
|
717 |
+
"\n",
|
718 |
+
"The `labels` on the other hand are un-padded. We first pad the sequences\n",
|
719 |
+
"to the maximum length in the batch using the tokenizer's `.pad` method. The padding tokens \n",
|
720 |
+
"are then replaced by `-100` so that these tokens are **not** taken into account when \n",
|
721 |
+
"computing the loss. We then cut the BOS token from the start of the label sequence as we \n",
|
722 |
+
"append it later during training.\n",
|
723 |
+
"\n",
|
724 |
+
"We can leverage the `WhisperProcessor` we defined earlier to perform both the \n",
|
725 |
+
"feature extractor and the tokenizer operations:"
|
726 |
+
]
|
727 |
+
},
|
728 |
+
{
|
729 |
+
"cell_type": "code",
|
730 |
+
"execution_count": 15,
|
731 |
+
"id": "8326221e-ec13-4731-bb4e-51e5fc1486c5",
|
732 |
+
"metadata": {
|
733 |
+
"id": "8326221e-ec13-4731-bb4e-51e5fc1486c5"
|
734 |
+
},
|
735 |
+
"outputs": [],
|
736 |
+
"source": [
|
737 |
+
"import torch\n",
|
738 |
+
"\n",
|
739 |
+
"from dataclasses import dataclass\n",
|
740 |
+
"from typing import Any, Dict, List, Union\n",
|
741 |
+
"\n",
|
742 |
+
"@dataclass\n",
|
743 |
+
"class DataCollatorSpeechSeq2SeqWithPadding:\n",
|
744 |
+
" processor: Any\n",
|
745 |
+
"\n",
|
746 |
+
" def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) -> Dict[str, torch.Tensor]:\n",
|
747 |
+
" # split inputs and labels since they have to be of different lengths and need different padding methods\n",
|
748 |
+
" # first treat the audio inputs by simply returning torch tensors\n",
|
749 |
+
" input_features = [{\"input_features\": feature[\"input_features\"]} for feature in features]\n",
|
750 |
+
" batch = self.processor.feature_extractor.pad(input_features, return_tensors=\"pt\")\n",
|
751 |
+
"\n",
|
752 |
+
" # get the tokenized label sequences\n",
|
753 |
+
" label_features = [{\"input_ids\": feature[\"labels\"]} for feature in features]\n",
|
754 |
+
" # pad the labels to max length\n",
|
755 |
+
" labels_batch = self.processor.tokenizer.pad(label_features, return_tensors=\"pt\")\n",
|
756 |
+
"\n",
|
757 |
+
" # replace padding with -100 to ignore loss correctly\n",
|
758 |
+
" labels = labels_batch[\"input_ids\"].masked_fill(labels_batch.attention_mask.ne(1), -100)\n",
|
759 |
+
"\n",
|
760 |
+
" # if bos token is appended in previous tokenization step,\n",
|
761 |
+
" # cut bos token here as it's append later anyways\n",
|
762 |
+
" if (labels[:, 0] == self.processor.tokenizer.bos_token_id).all().cpu().item():\n",
|
763 |
+
" labels = labels[:, 1:]\n",
|
764 |
+
"\n",
|
765 |
+
" batch[\"labels\"] = labels\n",
|
766 |
+
"\n",
|
767 |
+
" return batch"
|
768 |
+
]
|
769 |
+
},
|
770 |
+
{
|
771 |
+
"cell_type": "markdown",
|
772 |
+
"id": "3cae7dbf-8a50-456e-a3a8-7fd005390f86",
|
773 |
+
"metadata": {
|
774 |
+
"id": "3cae7dbf-8a50-456e-a3a8-7fd005390f86"
|
775 |
+
},
|
776 |
+
"source": [
|
777 |
+
"Let's initialise the data collator we've just defined:"
|
778 |
+
]
|
779 |
+
},
|
780 |
+
{
|
781 |
+
"cell_type": "code",
|
782 |
+
"execution_count": 16,
|
783 |
+
"id": "fc834702-c0d3-4a96-b101-7b87be32bf42",
|
784 |
+
"metadata": {
|
785 |
+
"id": "fc834702-c0d3-4a96-b101-7b87be32bf42"
|
786 |
+
},
|
787 |
+
"outputs": [],
|
788 |
+
"source": [
|
789 |
+
"data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=processor)"
|
790 |
+
]
|
791 |
+
},
|
792 |
+
{
|
793 |
+
"cell_type": "markdown",
|
794 |
+
"id": "d62bb2ab-750a-45e7-82e9-61d6f4805698",
|
795 |
+
"metadata": {
|
796 |
+
"id": "d62bb2ab-750a-45e7-82e9-61d6f4805698"
|
797 |
+
},
|
798 |
+
"source": [
|
799 |
+
"### Evaluation Metrics"
|
800 |
+
]
|
801 |
+
},
|
802 |
+
{
|
803 |
+
"cell_type": "markdown",
|
804 |
+
"id": "66fee1a7-a44c-461e-b047-c3917221572e",
|
805 |
+
"metadata": {
|
806 |
+
"id": "66fee1a7-a44c-461e-b047-c3917221572e"
|
807 |
+
},
|
808 |
+
"source": [
|
809 |
+
"We'll use the word error rate (WER) metric, the 'de-facto' metric for assessing \n",
|
810 |
+
"ASR systems. For more information, refer to the WER [docs](https://huggingface.co/metrics/wer). We'll load the WER metric from 🤗 Evaluate:"
|
811 |
+
]
|
812 |
+
},
|
813 |
+
{
|
814 |
+
"cell_type": "code",
|
815 |
+
"execution_count": 17,
|
816 |
+
"id": "b22b4011-f31f-4b57-b684-c52332f92890",
|
817 |
+
"metadata": {
|
818 |
+
"id": "b22b4011-f31f-4b57-b684-c52332f92890"
|
819 |
+
},
|
820 |
+
"outputs": [],
|
821 |
+
"source": [
|
822 |
+
"import evaluate\n",
|
823 |
+
"\n",
|
824 |
+
"wer_metric = evaluate.load(\"wer\")"
|
825 |
+
]
|
826 |
+
},
|
827 |
+
{
|
828 |
+
"cell_type": "markdown",
|
829 |
+
"id": "4f32cab6-31f0-4cb9-af4c-40ba0f5fc508",
|
830 |
+
"metadata": {
|
831 |
+
"id": "4f32cab6-31f0-4cb9-af4c-40ba0f5fc508"
|
832 |
+
},
|
833 |
+
"source": [
|
834 |
+
"We then simply have to define a function that takes our model \n",
|
835 |
+
"predictions and returns the WER metric. This function, called\n",
|
836 |
+
"`compute_metrics`, first replaces `-100` with the `pad_token_id`\n",
|
837 |
+
"in the `label_ids` (undoing the step we applied in the \n",
|
838 |
+
"data collator to ignore padded tokens correctly in the loss).\n",
|
839 |
+
"It then decodes the predicted and label ids to strings. Finally,\n",
|
840 |
+
"it computes the WER between the predictions and reference labels. \n",
|
841 |
+
"Here, we have the option of evaluating with the 'normalised' transcriptions \n",
|
842 |
+
"and predictions. We recommend you set this to `True` to benefit from the WER \n",
|
843 |
+
"improvement obtained by normalising the transcriptions."
|
844 |
+
]
|
845 |
+
},
|
846 |
+
{
|
847 |
+
"cell_type": "code",
|
848 |
+
"execution_count": 18,
|
849 |
+
"id": "23959a70-22d0-4ffe-9fa1-72b61e75bb52",
|
850 |
+
"metadata": {
|
851 |
+
"id": "23959a70-22d0-4ffe-9fa1-72b61e75bb52"
|
852 |
+
},
|
853 |
+
"outputs": [],
|
854 |
+
"source": [
|
855 |
+
"# evaluate with the 'normalised' WER\n",
|
856 |
+
"do_normalize_eval = True\n",
|
857 |
+
"\n",
|
858 |
+
"def compute_metrics(pred):\n",
|
859 |
+
" pred_ids = pred.predictions\n",
|
860 |
+
" label_ids = pred.label_ids\n",
|
861 |
+
"\n",
|
862 |
+
" # replace -100 with the pad_token_id\n",
|
863 |
+
" label_ids[label_ids == -100] = processor.tokenizer.pad_token_id\n",
|
864 |
+
"\n",
|
865 |
+
" # we do not want to group tokens when computing the metrics\n",
|
866 |
+
" pred_str = processor.tokenizer.batch_decode(pred_ids, skip_special_tokens=True)\n",
|
867 |
+
" label_str = processor.tokenizer.batch_decode(label_ids, skip_special_tokens=True)\n",
|
868 |
+
"\n",
|
869 |
+
" if do_normalize_eval:\n",
|
870 |
+
" pred_str = [normalizer(pred) for pred in pred_str]\n",
|
871 |
+
" label_str = [normalizer(label) for label in label_str]\n",
|
872 |
+
"\n",
|
873 |
+
" wer = 100 * wer_metric.compute(predictions=pred_str, references=label_str)\n",
|
874 |
+
" \n",
|
875 |
+
" return {\"wer\": wer}"
|
876 |
+
]
|
877 |
+
},
|
878 |
+
{
|
879 |
+
"cell_type": "markdown",
|
880 |
+
"id": "daf2a825-6d9f-4a23-b145-c37c0039075b",
|
881 |
+
"metadata": {
|
882 |
+
"id": "daf2a825-6d9f-4a23-b145-c37c0039075b"
|
883 |
+
},
|
884 |
+
"source": [
|
885 |
+
"### Load a Pre-Trained Checkpoint"
|
886 |
+
]
|
887 |
+
},
|
888 |
+
{
|
889 |
+
"cell_type": "markdown",
|
890 |
+
"id": "437a97fa-4864-476b-8abc-f28b8166cfa5",
|
891 |
+
"metadata": {
|
892 |
+
"id": "437a97fa-4864-476b-8abc-f28b8166cfa5"
|
893 |
+
},
|
894 |
+
"source": [
|
895 |
+
"Now let's load the pre-trained Whisper `small` checkpoint. Again, this \n",
|
896 |
+
"is trivial through use of 🤗 Transformers!"
|
897 |
+
]
|
898 |
+
},
|
899 |
+
{
|
900 |
+
"cell_type": "code",
|
901 |
+
"execution_count": 19,
|
902 |
+
"id": "5a10cc4b-07ec-4ebd-ac1d-7c601023594f",
|
903 |
+
"metadata": {
|
904 |
+
"id": "5a10cc4b-07ec-4ebd-ac1d-7c601023594f"
|
905 |
+
},
|
906 |
+
"outputs": [],
|
907 |
+
"source": [
|
908 |
+
"from transformers import WhisperForConditionalGeneration\n",
|
909 |
+
"\n",
|
910 |
+
"model = WhisperForConditionalGeneration.from_pretrained(\"openai/whisper-medium\")"
|
911 |
+
]
|
912 |
+
},
|
913 |
+
{
|
914 |
+
"cell_type": "markdown",
|
915 |
+
"id": "a15ead5f-2277-4a39-937b-585c2497b2df",
|
916 |
+
"metadata": {
|
917 |
+
"id": "a15ead5f-2277-4a39-937b-585c2497b2df"
|
918 |
+
},
|
919 |
+
"source": [
|
920 |
+
"Override generation arguments - no tokens are forced as decoder outputs (see [`forced_decoder_ids`](https://huggingface.co/docs/transformers/main_classes/text_generation#transformers.generation_utils.GenerationMixin.generate.forced_decoder_ids)), no tokens are suppressed during generation (see [`suppress_tokens`](https://huggingface.co/docs/transformers/main_classes/text_generation#transformers.generation_utils.GenerationMixin.generate.suppress_tokens)). Set `use_cache` to False since we're using gradient checkpointing, and the two are incompatible:"
|
921 |
+
]
|
922 |
+
},
|
923 |
+
{
|
924 |
+
"cell_type": "code",
|
925 |
+
"execution_count": 20,
|
926 |
+
"id": "62038ba3-88ed-4fce-84db-338f50dcd04f",
|
927 |
+
"metadata": {
|
928 |
+
"id": "62038ba3-88ed-4fce-84db-338f50dcd04f"
|
929 |
+
},
|
930 |
+
"outputs": [],
|
931 |
+
"source": [
|
932 |
+
"model.config.forced_decoder_ids = None\n",
|
933 |
+
"model.config.suppress_tokens = []\n",
|
934 |
+
"model.config.use_cache = False"
|
935 |
+
]
|
936 |
+
},
|
937 |
+
{
|
938 |
+
"cell_type": "markdown",
|
939 |
+
"id": "2178dea4-80ca-47b6-b6ea-ba1915c90c06",
|
940 |
+
"metadata": {
|
941 |
+
"id": "2178dea4-80ca-47b6-b6ea-ba1915c90c06"
|
942 |
+
},
|
943 |
+
"source": [
|
944 |
+
"### Define the Training Configuration"
|
945 |
+
]
|
946 |
+
},
|
947 |
+
{
|
948 |
+
"cell_type": "markdown",
|
949 |
+
"id": "c21af1e9-0188-4134-ac82-defc7bdcc436",
|
950 |
+
"metadata": {
|
951 |
+
"id": "c21af1e9-0188-4134-ac82-defc7bdcc436"
|
952 |
+
},
|
953 |
+
"source": [
|
954 |
+
"In the final step, we define all the parameters related to training. For more detail on the training arguments, refer to the Seq2SeqTrainingArguments [docs](https://huggingface.co/docs/transformers/main_classes/trainer#transformers.Seq2SeqTrainingArguments)."
|
955 |
+
]
|
956 |
+
},
|
957 |
+
{
|
958 |
+
"cell_type": "code",
|
959 |
+
"execution_count": 21,
|
960 |
+
"id": "0ae3e9af-97b7-4aa0-ae85-20b23b5bcb3a",
|
961 |
+
"metadata": {
|
962 |
+
"id": "0ae3e9af-97b7-4aa0-ae85-20b23b5bcb3a"
|
963 |
+
},
|
964 |
+
"outputs": [],
|
965 |
+
"source": [
|
966 |
+
"from transformers import Seq2SeqTrainingArguments\n",
|
967 |
+
"\n",
|
968 |
+
"training_args = Seq2SeqTrainingArguments(\n",
|
969 |
+
" output_dir=\"./\",\n",
|
970 |
+
" per_device_train_batch_size=2,\n",
|
971 |
+
" gradient_accumulation_steps=16, # increase by 2x for every 2x decrease in batch size\n",
|
972 |
+
" learning_rate=1e-5,\n",
|
973 |
+
" warmup_steps=100,\n",
|
974 |
+
" max_steps=1000,\n",
|
975 |
+
" gradient_checkpointing=True,\n",
|
976 |
+
" fp16=True,\n",
|
977 |
+
" evaluation_strategy=\"steps\",\n",
|
978 |
+
" per_device_eval_batch_size=2,\n",
|
979 |
+
" predict_with_generate=True,\n",
|
980 |
+
" generation_max_length=225,\n",
|
981 |
+
" save_steps=200,\n",
|
982 |
+
" eval_steps=200,\n",
|
983 |
+
" logging_steps=25,\n",
|
984 |
+
" report_to=[\"tensorboard\"],\n",
|
985 |
+
" load_best_model_at_end=True,\n",
|
986 |
+
" metric_for_best_model=\"wer\",\n",
|
987 |
+
" greater_is_better=False,\n",
|
988 |
+
" push_to_hub=True,\n",
|
989 |
+
" optim='adamw_bnb_8bit'\n",
|
990 |
+
")"
|
991 |
+
]
|
992 |
+
},
|
993 |
+
{
|
994 |
+
"cell_type": "markdown",
|
995 |
+
"id": "b3a944d8-3112-4552-82a0-be25988b3857",
|
996 |
+
"metadata": {
|
997 |
+
"id": "b3a944d8-3112-4552-82a0-be25988b3857"
|
998 |
+
},
|
999 |
+
"source": [
|
1000 |
+
"**Note**: if one does not want to upload the model checkpoints to the Hub, \n",
|
1001 |
+
"set `push_to_hub=False`."
|
1002 |
+
]
|
1003 |
+
},
|
1004 |
+
{
|
1005 |
+
"cell_type": "markdown",
|
1006 |
+
"id": "bac29114-d226-4f54-97cf-8718c9f94e1e",
|
1007 |
+
"metadata": {
|
1008 |
+
"id": "bac29114-d226-4f54-97cf-8718c9f94e1e"
|
1009 |
+
},
|
1010 |
+
"source": [
|
1011 |
+
"We can forward the training arguments to the 🤗 Trainer along with our model,\n",
|
1012 |
+
"dataset, data collator and `compute_metrics` function:"
|
1013 |
+
]
|
1014 |
+
},
|
1015 |
+
{
|
1016 |
+
"cell_type": "code",
|
1017 |
+
"execution_count": 22,
|
1018 |
+
"id": "d546d7fe-0543-479a-b708-2ebabec19493",
|
1019 |
+
"metadata": {
|
1020 |
+
"id": "d546d7fe-0543-479a-b708-2ebabec19493",
|
1021 |
+
"scrolled": false
|
1022 |
+
},
|
1023 |
+
"outputs": [
|
1024 |
+
{
|
1025 |
+
"name": "stderr",
|
1026 |
+
"output_type": "stream",
|
1027 |
+
"text": [
|
1028 |
+
"/mnt/c/projects/asr/whisper-medium-zh-TW-augmented/./ is already a clone of https://huggingface.co/Scrya/whisper-medium-zh-TW-augmented. Make sure you pull the latest changes with `repo.git_pull()`.\n",
|
1029 |
+
"max_steps is given, it will override any value given in num_train_epochs\n",
|
1030 |
+
"Using cuda_amp half precision backend\n"
|
1031 |
+
]
|
1032 |
+
}
|
1033 |
+
],
|
1034 |
+
"source": [
|
1035 |
+
"from transformers import Seq2SeqTrainer\n",
|
1036 |
+
"\n",
|
1037 |
+
"trainer = Seq2SeqTrainer(\n",
|
1038 |
+
" args=training_args,\n",
|
1039 |
+
" model=model,\n",
|
1040 |
+
" train_dataset=cv['train'],\n",
|
1041 |
+
" eval_dataset=cv['test'],\n",
|
1042 |
+
" data_collator=data_collator,\n",
|
1043 |
+
" compute_metrics=compute_metrics,\n",
|
1044 |
+
" tokenizer=processor.feature_extractor,\n",
|
1045 |
+
")"
|
1046 |
+
]
|
1047 |
+
},
|
1048 |
+
{
|
1049 |
+
"cell_type": "markdown",
|
1050 |
+
"id": "uOrRhDGtN5S4",
|
1051 |
+
"metadata": {
|
1052 |
+
"id": "uOrRhDGtN5S4"
|
1053 |
+
},
|
1054 |
+
"source": [
|
1055 |
+
"We'll save the processor object once before starting training. Since the processor is not trainable, it won't change over the course of training:"
|
1056 |
+
]
|
1057 |
+
},
|
1058 |
+
{
|
1059 |
+
"cell_type": "code",
|
1060 |
+
"execution_count": 23,
|
1061 |
+
"id": "-2zQwMfEOBJq",
|
1062 |
+
"metadata": {
|
1063 |
+
"id": "-2zQwMfEOBJq"
|
1064 |
+
},
|
1065 |
+
"outputs": [
|
1066 |
+
{
|
1067 |
+
"name": "stderr",
|
1068 |
+
"output_type": "stream",
|
1069 |
+
"text": [
|
1070 |
+
"Feature extractor saved in ./preprocessor_config.json\n",
|
1071 |
+
"tokenizer config file saved in ./tokenizer_config.json\n",
|
1072 |
+
"Special tokens file saved in ./special_tokens_map.json\n",
|
1073 |
+
"added tokens file saved in ./added_tokens.json\n"
|
1074 |
+
]
|
1075 |
+
}
|
1076 |
+
],
|
1077 |
+
"source": [
|
1078 |
+
"processor.save_pretrained(training_args.output_dir)"
|
1079 |
+
]
|
1080 |
+
},
|
1081 |
+
{
|
1082 |
+
"cell_type": "markdown",
|
1083 |
+
"id": "7f404cf9-4345-468c-8196-4bd101d9bd51",
|
1084 |
+
"metadata": {
|
1085 |
+
"id": "7f404cf9-4345-468c-8196-4bd101d9bd51"
|
1086 |
+
},
|
1087 |
+
"source": [
|
1088 |
+
"### Training"
|
1089 |
+
]
|
1090 |
+
},
|
1091 |
+
{
|
1092 |
+
"cell_type": "markdown",
|
1093 |
+
"id": "5e8b8d56-5a70-4f68-bd2e-f0752d0bd112",
|
1094 |
+
"metadata": {
|
1095 |
+
"id": "5e8b8d56-5a70-4f68-bd2e-f0752d0bd112"
|
1096 |
+
},
|
1097 |
+
"source": [
|
1098 |
+
"Training will take approximately 5-10 hours depending on your GPU. The peak GPU memory for the given training configuration is approximately 36GB. \n",
|
1099 |
+
"Depending on your GPU, it is possible that you will encounter a CUDA `\"out-of-memory\"` error when you launch training. \n",
|
1100 |
+
"In this case, you can reduce the `per_device_train_batch_size` incrementally by factors of 2 \n",
|
1101 |
+
"and employ [`gradient_accumulation_steps`](https://huggingface.co/docs/transformers/main_classes/trainer#transformers.Seq2SeqTrainingArguments.gradient_accumulation_steps)\n",
|
1102 |
+
"to compensate.\n",
|
1103 |
+
"\n",
|
1104 |
+
"To launch training, simply execute:"
|
1105 |
+
]
|
1106 |
+
},
|
1107 |
+
{
|
1108 |
+
"cell_type": "code",
|
1109 |
+
"execution_count": null,
|
1110 |
+
"id": "ee8b7b8e-1c9a-4d77-9137-1778a629e6de",
|
1111 |
+
"metadata": {
|
1112 |
+
"id": "ee8b7b8e-1c9a-4d77-9137-1778a629e6de",
|
1113 |
+
"scrolled": false
|
1114 |
+
},
|
1115 |
+
"outputs": [
|
1116 |
+
{
|
1117 |
+
"name": "stderr",
|
1118 |
+
"output_type": "stream",
|
1119 |
+
"text": [
|
1120 |
+
"The following columns in the training set don't have a corresponding argument in `WhisperForConditionalGeneration.forward` and have been ignored: input_length. If input_length are not expected by `WhisperForConditionalGeneration.forward`, you can safely ignore this message.\n",
|
1121 |
+
"***** Running training *****\n",
|
1122 |
+
" Num examples = 11277\n",
|
1123 |
+
" Num Epochs = 3\n",
|
1124 |
+
" Instantaneous batch size per device = 2\n",
|
1125 |
+
" Total train batch size (w. parallel, distributed & accumulation) = 32\n",
|
1126 |
+
" Gradient Accumulation steps = 16\n",
|
1127 |
+
" Total optimization steps = 1000\n",
|
1128 |
+
" Number of trainable parameters = 763857920\n"
|
1129 |
+
]
|
1130 |
+
},
|
1131 |
+
{
|
1132 |
+
"data": {
|
1133 |
+
"text/html": [
|
1134 |
+
"\n",
|
1135 |
+
" <div>\n",
|
1136 |
+
" \n",
|
1137 |
+
" <progress value='201' max='1000' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
1138 |
+
" [ 201/1000 29:58 < 2:00:21, 0.11 it/s, Epoch 0.57/3]\n",
|
1139 |
+
" </div>\n",
|
1140 |
+
" <table border=\"1\" class=\"dataframe\">\n",
|
1141 |
+
" <thead>\n",
|
1142 |
+
" <tr style=\"text-align: left;\">\n",
|
1143 |
+
" <th>Step</th>\n",
|
1144 |
+
" <th>Training Loss</th>\n",
|
1145 |
+
" <th>Validation Loss</th>\n",
|
1146 |
+
" </tr>\n",
|
1147 |
+
" </thead>\n",
|
1148 |
+
" <tbody>\n",
|
1149 |
+
" </tbody>\n",
|
1150 |
+
"</table><p>\n",
|
1151 |
+
" <div>\n",
|
1152 |
+
" \n",
|
1153 |
+
" <progress value='2355' max='2355' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
|
1154 |
+
" [2355/2355 47:17]\n",
|
1155 |
+
" </div>\n",
|
1156 |
+
" "
|
1157 |
+
],
|
1158 |
+
"text/plain": [
|
1159 |
+
"<IPython.core.display.HTML object>"
|
1160 |
+
]
|
1161 |
+
},
|
1162 |
+
"metadata": {},
|
1163 |
+
"output_type": "display_data"
|
1164 |
+
},
|
1165 |
+
{
|
1166 |
+
"name": "stderr",
|
1167 |
+
"output_type": "stream",
|
1168 |
+
"text": [
|
1169 |
+
"The following columns in the evaluation set don't have a corresponding argument in `WhisperForConditionalGeneration.forward` and have been ignored: input_length. If input_length are not expected by `WhisperForConditionalGeneration.forward`, you can safely ignore this message.\n",
|
1170 |
+
"***** Running Evaluation *****\n",
|
1171 |
+
" Num examples = 4709\n",
|
1172 |
+
" Batch size = 2\n"
|
1173 |
+
]
|
1174 |
+
}
|
1175 |
+
],
|
1176 |
+
"source": [
|
1177 |
+
"trainer.train()"
|
1178 |
+
]
|
1179 |
+
},
|
1180 |
+
{
|
1181 |
+
"cell_type": "markdown",
|
1182 |
+
"id": "810ced54-7187-4a06-b2fe-ba6dcca94dc3",
|
1183 |
+
"metadata": {
|
1184 |
+
"id": "810ced54-7187-4a06-b2fe-ba6dcca94dc3"
|
1185 |
+
},
|
1186 |
+
"source": [
|
1187 |
+
"We can label our checkpoint with the `whisper-event` tag on push by setting the appropriate key-word arguments (kwargs):"
|
1188 |
+
]
|
1189 |
+
},
|
1190 |
+
{
|
1191 |
+
"cell_type": "code",
|
1192 |
+
"execution_count": 28,
|
1193 |
+
"id": "c704f91e-241b-48c9-b8e0-f0da396a9663",
|
1194 |
+
"metadata": {
|
1195 |
+
"id": "c704f91e-241b-48c9-b8e0-f0da396a9663"
|
1196 |
+
},
|
1197 |
+
"outputs": [],
|
1198 |
+
"source": [
|
1199 |
+
"kwargs = {\n",
|
1200 |
+
" \"dataset_tags\": \"mozilla-foundation/common_voice_11_0\",\n",
|
1201 |
+
" \"dataset\": \"mozilla-foundation/common_voice_11_0\", # a 'pretty' name for the training dataset\n",
|
1202 |
+
" \"language\": \"zh-TW\",\n",
|
1203 |
+
" \"model_name\": \"Whisper Medium MS - Augmented\", # a 'pretty' name for your model\n",
|
1204 |
+
" \"finetuned_from\": \"openai/whisper-medium\",\n",
|
1205 |
+
" \"tasks\": \"automatic-speech-recognition\",\n",
|
1206 |
+
" \"tags\": \"whisper-event\",\n",
|
1207 |
+
"}"
|
1208 |
+
]
|
1209 |
+
},
|
1210 |
+
{
|
1211 |
+
"cell_type": "markdown",
|
1212 |
+
"id": "090d676a-f944-4297-a938-a40eda0b2b68",
|
1213 |
+
"metadata": {
|
1214 |
+
"id": "090d676a-f944-4297-a938-a40eda0b2b68"
|
1215 |
+
},
|
1216 |
+
"source": [
|
1217 |
+
"The training results can now be uploaded to the Hub. To do so, execute the `push_to_hub` command and save the preprocessor object we created:"
|
1218 |
+
]
|
1219 |
+
},
|
1220 |
+
{
|
1221 |
+
"cell_type": "code",
|
1222 |
+
"execution_count": 29,
|
1223 |
+
"id": "d7030622-caf7-4039-939b-6195cdaa2585",
|
1224 |
+
"metadata": {
|
1225 |
+
"id": "d7030622-caf7-4039-939b-6195cdaa2585"
|
1226 |
+
},
|
1227 |
+
"outputs": [
|
1228 |
+
{
|
1229 |
+
"name": "stderr",
|
1230 |
+
"output_type": "stream",
|
1231 |
+
"text": [
|
1232 |
+
"Saving model checkpoint to ./\n",
|
1233 |
+
"Configuration saved in ./config.json\n",
|
1234 |
+
"Model weights saved in ./pytorch_model.bin\n",
|
1235 |
+
"Feature extractor saved in ./preprocessor_config.json\n",
|
1236 |
+
"Several commits (3) will be pushed upstream.\n",
|
1237 |
+
"The progress bars may be unreliable.\n",
|
1238 |
+
"To https://huggingface.co/Scrya/whisper-medium-ms-augmented\n",
|
1239 |
+
" 1684a4c..b46b3bd main -> main\n",
|
1240 |
+
"\n"
|
1241 |
+
]
|
1242 |
+
}
|
1243 |
+
],
|
1244 |
+
"source": [
|
1245 |
+
"trainer.push_to_hub(**kwargs)"
|
1246 |
+
]
|
1247 |
+
},
|
1248 |
+
{
|
1249 |
+
"cell_type": "code",
|
1250 |
+
"execution_count": 35,
|
1251 |
+
"id": "9659fee2",
|
1252 |
+
"metadata": {},
|
1253 |
+
"outputs": [
|
1254 |
+
{
|
1255 |
+
"data": {
|
1256 |
+
"text/plain": [
|
1257 |
+
"{'eval_loss': 0.20663268864154816,\n",
|
1258 |
+
" 'eval_wer': 9.578362255965294,\n",
|
1259 |
+
" 'eval_cer': 2.8109053797929726,\n",
|
1260 |
+
" 'eval_runtime': 873.5198,\n",
|
1261 |
+
" 'eval_samples_per_second': 0.857,\n",
|
1262 |
+
" 'eval_steps_per_second': 0.429,\n",
|
1263 |
+
" 'epoch': 10.75,\n",
|
1264 |
+
" 'step': 1000}"
|
1265 |
+
]
|
1266 |
+
},
|
1267 |
+
"execution_count": 35,
|
1268 |
+
"metadata": {},
|
1269 |
+
"output_type": "execute_result"
|
1270 |
+
}
|
1271 |
+
],
|
1272 |
+
"source": [
|
1273 |
+
"trainer.state.log_history[-2]['eval_wer']"
|
1274 |
+
]
|
1275 |
+
},
|
1276 |
+
{
|
1277 |
+
"cell_type": "code",
|
1278 |
+
"execution_count": 36,
|
1279 |
+
"id": "25703cb1",
|
1280 |
+
"metadata": {},
|
1281 |
+
"outputs": [
|
1282 |
+
{
|
1283 |
+
"data": {
|
1284 |
+
"application/vnd.jupyter.widget-view+json": {
|
1285 |
+
"model_id": "4ea15f06fd6643ae94ab2a23ee1a1a71",
|
1286 |
+
"version_major": 2,
|
1287 |
+
"version_minor": 0
|
1288 |
+
},
|
1289 |
+
"text/plain": [
|
1290 |
+
"Downloading: 0%| | 0.00/2.15k [00:00<?, ?B/s]"
|
1291 |
+
]
|
1292 |
+
},
|
1293 |
+
"metadata": {},
|
1294 |
+
"output_type": "display_data"
|
1295 |
+
},
|
1296 |
+
{
|
1297 |
+
"data": {
|
1298 |
+
"text/plain": [
|
1299 |
+
"'https://huggingface.co/Scrya/whisper-medium-ms-augmented/blob/main/README.md'"
|
1300 |
+
]
|
1301 |
+
},
|
1302 |
+
"execution_count": 36,
|
1303 |
+
"metadata": {},
|
1304 |
+
"output_type": "execute_result"
|
1305 |
+
}
|
1306 |
+
],
|
1307 |
+
"source": [
|
1308 |
+
"evaluate.push_to_hub(\n",
|
1309 |
+
" model_id='Scrya/whisper-medium-zh-TW-augmented',\n",
|
1310 |
+
" metric_value=trainer.state.log_history[-2]['eval_wer'],\n",
|
1311 |
+
" metric_type=\"wer\",\n",
|
1312 |
+
" metric_name=\"WER\",\n",
|
1313 |
+
" dataset_name='mozilla-foundation/common_voice_11_0',\n",
|
1314 |
+
" dataset_type='mozilla-foundation/common_voice_11_0',\n",
|
1315 |
+
" dataset_split='test',\n",
|
1316 |
+
" dataset_config='zh-TW',\n",
|
1317 |
+
" task_type=\"automatic-speech-recognition\",\n",
|
1318 |
+
" task_name=\"Automatic Speech Recognition\"\n",
|
1319 |
+
")"
|
1320 |
+
]
|
1321 |
+
},
|
1322 |
+
{
|
1323 |
+
"cell_type": "markdown",
|
1324 |
+
"id": "ca743fbd-602c-48d4-ba8d-a2fe60af64ba",
|
1325 |
+
"metadata": {
|
1326 |
+
"id": "ca743fbd-602c-48d4-ba8d-a2fe60af64ba"
|
1327 |
+
},
|
1328 |
+
"source": [
|
1329 |
+
"## Closing Remarks"
|
1330 |
+
]
|
1331 |
+
},
|
1332 |
+
{
|
1333 |
+
"cell_type": "markdown",
|
1334 |
+
"id": "7f737783-2870-4e35-aa11-86a42d7d997a",
|
1335 |
+
"metadata": {
|
1336 |
+
"id": "7f737783-2870-4e35-aa11-86a42d7d997a"
|
1337 |
+
},
|
1338 |
+
"source": [
|
1339 |
+
"In this blog, we covered a step-by-step guide on fine-tuning Whisper for multilingual ASR \n",
|
1340 |
+
"using 🤗 Datasets, Transformers and the Hugging Face Hub. For more details on the Whisper model, the Common Voice dataset and the theory behind fine-tuning, refere to the accompanying [blog post](https://huggingface.co/blog/fine-tune-whisper). If you're interested in fine-tuning other \n",
|
1341 |
+
"Transformers models, both for English and multilingual ASR, be sure to check out the \n",
|
1342 |
+
"examples scripts at [examples/pytorch/speech-recognition](https://github.com/huggingface/transformers/tree/main/examples/pytorch/speech-recognition)."
|
1343 |
+
]
|
1344 |
+
}
|
1345 |
+
],
|
1346 |
+
"metadata": {
|
1347 |
+
"colab": {
|
1348 |
+
"include_colab_link": true,
|
1349 |
+
"provenance": []
|
1350 |
+
},
|
1351 |
+
"kernelspec": {
|
1352 |
+
"display_name": "Python 3 (ipykernel)",
|
1353 |
+
"language": "python",
|
1354 |
+
"name": "python3"
|
1355 |
+
},
|
1356 |
+
"language_info": {
|
1357 |
+
"codemirror_mode": {
|
1358 |
+
"name": "ipython",
|
1359 |
+
"version": 3
|
1360 |
+
},
|
1361 |
+
"file_extension": ".py",
|
1362 |
+
"mimetype": "text/x-python",
|
1363 |
+
"name": "python",
|
1364 |
+
"nbconvert_exporter": "python",
|
1365 |
+
"pygments_lexer": "ipython3",
|
1366 |
+
"version": "3.8.10"
|
1367 |
+
}
|
1368 |
+
},
|
1369 |
+
"nbformat": 4,
|
1370 |
+
"nbformat_minor": 5
|
1371 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
normalizer.json
ADDED
@@ -0,0 +1,1742 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"accessorise": "accessorize",
|
3 |
+
"accessorised": "accessorized",
|
4 |
+
"accessorises": "accessorizes",
|
5 |
+
"accessorising": "accessorizing",
|
6 |
+
"acclimatisation": "acclimatization",
|
7 |
+
"acclimatise": "acclimatize",
|
8 |
+
"acclimatised": "acclimatized",
|
9 |
+
"acclimatises": "acclimatizes",
|
10 |
+
"acclimatising": "acclimatizing",
|
11 |
+
"accoutrements": "accouterments",
|
12 |
+
"aeon": "eon",
|
13 |
+
"aeons": "eons",
|
14 |
+
"aerogramme": "aerogram",
|
15 |
+
"aerogrammes": "aerograms",
|
16 |
+
"aeroplane": "airplane",
|
17 |
+
"aeroplanes": "airplanes",
|
18 |
+
"aesthete": "esthete",
|
19 |
+
"aesthetes": "esthetes",
|
20 |
+
"aesthetic": "esthetic",
|
21 |
+
"aesthetically": "esthetically",
|
22 |
+
"aesthetics": "esthetics",
|
23 |
+
"aetiology": "etiology",
|
24 |
+
"ageing": "aging",
|
25 |
+
"aggrandisement": "aggrandizement",
|
26 |
+
"agonise": "agonize",
|
27 |
+
"agonised": "agonized",
|
28 |
+
"agonises": "agonizes",
|
29 |
+
"agonising": "agonizing",
|
30 |
+
"agonisingly": "agonizingly",
|
31 |
+
"almanack": "almanac",
|
32 |
+
"almanacks": "almanacs",
|
33 |
+
"aluminium": "aluminum",
|
34 |
+
"amortisable": "amortizable",
|
35 |
+
"amortisation": "amortization",
|
36 |
+
"amortisations": "amortizations",
|
37 |
+
"amortise": "amortize",
|
38 |
+
"amortised": "amortized",
|
39 |
+
"amortises": "amortizes",
|
40 |
+
"amortising": "amortizing",
|
41 |
+
"amphitheatre": "amphitheater",
|
42 |
+
"amphitheatres": "amphitheaters",
|
43 |
+
"anaemia": "anemia",
|
44 |
+
"anaemic": "anemic",
|
45 |
+
"anaesthesia": "anesthesia",
|
46 |
+
"anaesthetic": "anesthetic",
|
47 |
+
"anaesthetics": "anesthetics",
|
48 |
+
"anaesthetise": "anesthetize",
|
49 |
+
"anaesthetised": "anesthetized",
|
50 |
+
"anaesthetises": "anesthetizes",
|
51 |
+
"anaesthetising": "anesthetizing",
|
52 |
+
"anaesthetist": "anesthetist",
|
53 |
+
"anaesthetists": "anesthetists",
|
54 |
+
"anaesthetize": "anesthetize",
|
55 |
+
"anaesthetized": "anesthetized",
|
56 |
+
"anaesthetizes": "anesthetizes",
|
57 |
+
"anaesthetizing": "anesthetizing",
|
58 |
+
"analogue": "analog",
|
59 |
+
"analogues": "analogs",
|
60 |
+
"analyse": "analyze",
|
61 |
+
"analysed": "analyzed",
|
62 |
+
"analyses": "analyzes",
|
63 |
+
"analysing": "analyzing",
|
64 |
+
"anglicise": "anglicize",
|
65 |
+
"anglicised": "anglicized",
|
66 |
+
"anglicises": "anglicizes",
|
67 |
+
"anglicising": "anglicizing",
|
68 |
+
"annualised": "annualized",
|
69 |
+
"antagonise": "antagonize",
|
70 |
+
"antagonised": "antagonized",
|
71 |
+
"antagonises": "antagonizes",
|
72 |
+
"antagonising": "antagonizing",
|
73 |
+
"apologise": "apologize",
|
74 |
+
"apologised": "apologized",
|
75 |
+
"apologises": "apologizes",
|
76 |
+
"apologising": "apologizing",
|
77 |
+
"appal": "appall",
|
78 |
+
"appals": "appalls",
|
79 |
+
"appetiser": "appetizer",
|
80 |
+
"appetisers": "appetizers",
|
81 |
+
"appetising": "appetizing",
|
82 |
+
"appetisingly": "appetizingly",
|
83 |
+
"arbour": "arbor",
|
84 |
+
"arbours": "arbors",
|
85 |
+
"archaeologically": "archeologically",
|
86 |
+
"archaeologist": "archeologist",
|
87 |
+
"archaeologists": "archeologists",
|
88 |
+
"archaeology": "archeology</span>",
|
89 |
+
"archeological": "archaeological",
|
90 |
+
"ardour": "ardor",
|
91 |
+
"armour": "armor",
|
92 |
+
"armoured": "armored",
|
93 |
+
"armourer": "armorer",
|
94 |
+
"armourers": "armorers",
|
95 |
+
"armouries": "armories",
|
96 |
+
"armoury": "armory",
|
97 |
+
"artefact": "artifact",
|
98 |
+
"artefacts": "artifacts",
|
99 |
+
"authorise": "authorize",
|
100 |
+
"authorised": "authorized",
|
101 |
+
"authorises": "authorizes",
|
102 |
+
"authorising": "authorizing",
|
103 |
+
"axe": "ax",
|
104 |
+
"backpedalled": "backpedaled",
|
105 |
+
"backpedalling": "backpedaling",
|
106 |
+
"bannister": "banister",
|
107 |
+
"bannisters": "banisters",
|
108 |
+
"baptise": "baptize",
|
109 |
+
"baptised": "baptized",
|
110 |
+
"baptises": "baptizes",
|
111 |
+
"baptising": "baptizing",
|
112 |
+
"bastardise": "bastardize",
|
113 |
+
"bastardised": "bastardized",
|
114 |
+
"bastardises": "bastardizes",
|
115 |
+
"bastardising": "bastardizing",
|
116 |
+
"battleax": "battleaxe",
|
117 |
+
"baulk": "balk",
|
118 |
+
"baulked": "balked",
|
119 |
+
"baulking": "balking",
|
120 |
+
"baulks": "balks",
|
121 |
+
"bedevilled": "bedeviled",
|
122 |
+
"bedevilling": "bedeviling",
|
123 |
+
"behaviour": "behavior",
|
124 |
+
"behavioural": "behavioral",
|
125 |
+
"behaviourism": "behaviorism",
|
126 |
+
"behaviourist": "behaviorist",
|
127 |
+
"behaviourists": "behaviorists",
|
128 |
+
"behaviours": "behaviors",
|
129 |
+
"behove": "behoove",
|
130 |
+
"behoved": "behooved",
|
131 |
+
"behoves": "behooves",
|
132 |
+
"bejewelled": "bejeweled",
|
133 |
+
"belabour": "belabor",
|
134 |
+
"belaboured": "belabored",
|
135 |
+
"belabouring": "belaboring",
|
136 |
+
"belabours": "belabors",
|
137 |
+
"bevelled": "beveled",
|
138 |
+
"bevvies": "bevies",
|
139 |
+
"bevvy": "bevy",
|
140 |
+
"biassed": "biased",
|
141 |
+
"biassing": "biasing",
|
142 |
+
"bingeing": "binging",
|
143 |
+
"bougainvillaea": "bougainvillea",
|
144 |
+
"bougainvillaeas": "bougainvilleas",
|
145 |
+
"bowdlerise": "bowdlerize",
|
146 |
+
"bowdlerised": "bowdlerized",
|
147 |
+
"bowdlerises": "bowdlerizes",
|
148 |
+
"bowdlerising": "bowdlerizing",
|
149 |
+
"breathalyse": "breathalyze",
|
150 |
+
"breathalysed": "breathalyzed",
|
151 |
+
"breathalyser": "breathalyzer",
|
152 |
+
"breathalysers": "breathalyzers",
|
153 |
+
"breathalyses": "breathalyzes",
|
154 |
+
"breathalysing": "breathalyzing",
|
155 |
+
"brutalise": "brutalize",
|
156 |
+
"brutalised": "brutalized",
|
157 |
+
"brutalises": "brutalizes",
|
158 |
+
"brutalising": "brutalizing",
|
159 |
+
"busses": "buses",
|
160 |
+
"bussing": "busing",
|
161 |
+
"caesarean": "cesarean",
|
162 |
+
"caesareans": "cesareans",
|
163 |
+
"calibre": "caliber",
|
164 |
+
"calibres": "calibers",
|
165 |
+
"calliper": "caliper",
|
166 |
+
"callipers": "calipers",
|
167 |
+
"callisthenics": "calisthenics",
|
168 |
+
"canalise": "canalize",
|
169 |
+
"canalised": "canalized",
|
170 |
+
"canalises": "canalizes",
|
171 |
+
"canalising": "canalizing",
|
172 |
+
"cancelation": "cancellation",
|
173 |
+
"cancelations": "cancellations",
|
174 |
+
"cancelled": "canceled",
|
175 |
+
"cancelling": "canceling",
|
176 |
+
"candour": "candor",
|
177 |
+
"cannibalise": "cannibalize",
|
178 |
+
"cannibalised": "cannibalized",
|
179 |
+
"cannibalises": "cannibalizes",
|
180 |
+
"cannibalising": "cannibalizing",
|
181 |
+
"canonise": "canonize",
|
182 |
+
"canonised": "canonized",
|
183 |
+
"canonises": "canonizes",
|
184 |
+
"canonising": "canonizing",
|
185 |
+
"capitalise": "capitalize",
|
186 |
+
"capitalised": "capitalized",
|
187 |
+
"capitalises": "capitalizes",
|
188 |
+
"capitalising": "capitalizing",
|
189 |
+
"caramelise": "caramelize",
|
190 |
+
"caramelised": "caramelized",
|
191 |
+
"caramelises": "caramelizes",
|
192 |
+
"caramelising": "caramelizing",
|
193 |
+
"carbonise": "carbonize",
|
194 |
+
"carbonised": "carbonized",
|
195 |
+
"carbonises": "carbonizes",
|
196 |
+
"carbonising": "carbonizing",
|
197 |
+
"carolled": "caroled",
|
198 |
+
"carolling": "caroling",
|
199 |
+
"catalogue": "catalog",
|
200 |
+
"catalogued": "cataloged",
|
201 |
+
"catalogues": "catalogs",
|
202 |
+
"cataloguing": "cataloging",
|
203 |
+
"catalyse": "catalyze",
|
204 |
+
"catalysed": "catalyzed",
|
205 |
+
"catalyses": "catalyzes",
|
206 |
+
"catalysing": "catalyzing",
|
207 |
+
"categorise": "categorize",
|
208 |
+
"categorised": "categorized",
|
209 |
+
"categorises": "categorizes",
|
210 |
+
"categorising": "categorizing",
|
211 |
+
"cauterise": "cauterize",
|
212 |
+
"cauterised": "cauterized",
|
213 |
+
"cauterises": "cauterizes",
|
214 |
+
"cauterising": "cauterizing",
|
215 |
+
"cavilled": "caviled",
|
216 |
+
"cavilling": "caviling",
|
217 |
+
"centigramme": "centigram",
|
218 |
+
"centigrammes": "centigrams",
|
219 |
+
"centilitre": "centiliter",
|
220 |
+
"centilitres": "centiliters",
|
221 |
+
"centimetre": "centimeter",
|
222 |
+
"centimetres": "centimeters",
|
223 |
+
"centralise": "centralize",
|
224 |
+
"centralised": "centralized",
|
225 |
+
"centralises": "centralizes",
|
226 |
+
"centralising": "centralizing",
|
227 |
+
"centre": "center",
|
228 |
+
"centred": "centered",
|
229 |
+
"centrefold": "centerfold",
|
230 |
+
"centrefolds": "centerfolds",
|
231 |
+
"centrepiece": "centerpiece",
|
232 |
+
"centrepieces": "centerpieces",
|
233 |
+
"centres": "centers",
|
234 |
+
"channelled": "channeled",
|
235 |
+
"channelling": "channeling",
|
236 |
+
"characterise": "characterize",
|
237 |
+
"characterised": "characterized",
|
238 |
+
"characterises": "characterizes",
|
239 |
+
"characterising": "characterizing",
|
240 |
+
"cheque": "check",
|
241 |
+
"chequebook": "checkbook",
|
242 |
+
"chequebooks": "checkbooks",
|
243 |
+
"chequered": "checkered",
|
244 |
+
"cheques": "checks",
|
245 |
+
"chilli": "chili",
|
246 |
+
"chimaera": "chimera",
|
247 |
+
"chimaeras": "chimeras",
|
248 |
+
"chiselled": "chiseled",
|
249 |
+
"chiselling": "chiseling",
|
250 |
+
"circularise": "circularize",
|
251 |
+
"circularised": "circularized",
|
252 |
+
"circularises": "circularizes",
|
253 |
+
"circularising": "circularizing",
|
254 |
+
"civilise": "civilize",
|
255 |
+
"civilised": "civilized",
|
256 |
+
"civilises": "civilizes",
|
257 |
+
"civilising": "civilizing",
|
258 |
+
"clamour": "clamor",
|
259 |
+
"clamoured": "clamored",
|
260 |
+
"clamouring": "clamoring",
|
261 |
+
"clamours": "clamors",
|
262 |
+
"clangour": "clangor",
|
263 |
+
"clarinettist": "clarinetist",
|
264 |
+
"clarinettists": "clarinetists",
|
265 |
+
"collectivise": "collectivize",
|
266 |
+
"collectivised": "collectivized",
|
267 |
+
"collectivises": "collectivizes",
|
268 |
+
"collectivising": "collectivizing",
|
269 |
+
"colonisation": "colonization",
|
270 |
+
"colonise": "colonize",
|
271 |
+
"colonised": "colonized",
|
272 |
+
"coloniser": "colonizer",
|
273 |
+
"colonisers": "colonizers",
|
274 |
+
"colonises": "colonizes",
|
275 |
+
"colonising": "colonizing",
|
276 |
+
"colour": "color",
|
277 |
+
"colourant": "colorant",
|
278 |
+
"colourants": "colorants",
|
279 |
+
"coloured": "colored",
|
280 |
+
"coloureds": "coloreds",
|
281 |
+
"colourful": "colorful",
|
282 |
+
"colourfully": "colorfully",
|
283 |
+
"colouring": "coloring",
|
284 |
+
"colourize": "colorize",
|
285 |
+
"colourized": "colorized",
|
286 |
+
"colourizes": "colorizes",
|
287 |
+
"colourizing": "colorizing",
|
288 |
+
"colourless": "colorless",
|
289 |
+
"colours": "colors",
|
290 |
+
"commercialise": "commercialize",
|
291 |
+
"commercialised": "commercialized",
|
292 |
+
"commercialises": "commercializes",
|
293 |
+
"commercialising": "commercializing",
|
294 |
+
"compartmentalise": "compartmentalize",
|
295 |
+
"compartmentalised": "compartmentalized",
|
296 |
+
"compartmentalises": "compartmentalizes",
|
297 |
+
"compartmentalising": "compartmentalizing",
|
298 |
+
"computerise": "computerize",
|
299 |
+
"computerised": "computerized",
|
300 |
+
"computerises": "computerizes",
|
301 |
+
"computerising": "computerizing",
|
302 |
+
"conceptualise": "conceptualize",
|
303 |
+
"conceptualised": "conceptualized",
|
304 |
+
"conceptualises": "conceptualizes",
|
305 |
+
"conceptualising": "conceptualizing",
|
306 |
+
"connexion": "connection",
|
307 |
+
"connexions": "connections",
|
308 |
+
"contextualise": "contextualize",
|
309 |
+
"contextualised": "contextualized",
|
310 |
+
"contextualises": "contextualizes",
|
311 |
+
"contextualising": "contextualizing",
|
312 |
+
"cosier": "cozier",
|
313 |
+
"cosies": "cozies",
|
314 |
+
"cosiest": "coziest",
|
315 |
+
"cosily": "cozily",
|
316 |
+
"cosiness": "coziness",
|
317 |
+
"cosy": "cozy",
|
318 |
+
"councillor": "councilor",
|
319 |
+
"councillors": "councilors",
|
320 |
+
"counselled": "counseled",
|
321 |
+
"counselling": "counseling",
|
322 |
+
"counsellor": "counselor",
|
323 |
+
"counsellors": "counselors",
|
324 |
+
"crenelated": "crenellated",
|
325 |
+
"criminalise": "criminalize",
|
326 |
+
"criminalised": "criminalized",
|
327 |
+
"criminalises": "criminalizes",
|
328 |
+
"criminalising": "criminalizing",
|
329 |
+
"criticise": "criticize",
|
330 |
+
"criticised": "criticized",
|
331 |
+
"criticises": "criticizes",
|
332 |
+
"criticising": "criticizing",
|
333 |
+
"crueller": "crueler",
|
334 |
+
"cruellest": "cruelest",
|
335 |
+
"crystallisation": "crystallization",
|
336 |
+
"crystallise": "crystallize",
|
337 |
+
"crystallised": "crystallized",
|
338 |
+
"crystallises": "crystallizes",
|
339 |
+
"crystallising": "crystallizing",
|
340 |
+
"cudgelled": "cudgeled",
|
341 |
+
"cudgelling": "cudgeling",
|
342 |
+
"customise": "customize",
|
343 |
+
"customised": "customized",
|
344 |
+
"customises": "customizes",
|
345 |
+
"customising": "customizing",
|
346 |
+
"cypher": "cipher",
|
347 |
+
"cyphers": "ciphers",
|
348 |
+
"decentralisation": "decentralization",
|
349 |
+
"decentralise": "decentralize",
|
350 |
+
"decentralised": "decentralized",
|
351 |
+
"decentralises": "decentralizes",
|
352 |
+
"decentralising": "decentralizing",
|
353 |
+
"decriminalisation": "decriminalization",
|
354 |
+
"decriminalise": "decriminalize",
|
355 |
+
"decriminalised": "decriminalized",
|
356 |
+
"decriminalises": "decriminalizes",
|
357 |
+
"decriminalising": "decriminalizing",
|
358 |
+
"defence": "defense",
|
359 |
+
"defenceless": "defenseless",
|
360 |
+
"defences": "defenses",
|
361 |
+
"dehumanisation": "dehumanization",
|
362 |
+
"dehumanise": "dehumanize",
|
363 |
+
"dehumanised": "dehumanized",
|
364 |
+
"dehumanises": "dehumanizes",
|
365 |
+
"dehumanising": "dehumanizing",
|
366 |
+
"demeanour": "demeanor",
|
367 |
+
"demilitarisation": "demilitarization",
|
368 |
+
"demilitarise": "demilitarize",
|
369 |
+
"demilitarised": "demilitarized",
|
370 |
+
"demilitarises": "demilitarizes",
|
371 |
+
"demilitarising": "demilitarizing",
|
372 |
+
"demobilisation": "demobilization",
|
373 |
+
"demobilise": "demobilize",
|
374 |
+
"demobilised": "demobilized",
|
375 |
+
"demobilises": "demobilizes",
|
376 |
+
"demobilising": "demobilizing",
|
377 |
+
"democratisation": "democratization",
|
378 |
+
"democratise": "democratize",
|
379 |
+
"democratised": "democratized",
|
380 |
+
"democratises": "democratizes",
|
381 |
+
"democratising": "democratizing",
|
382 |
+
"demonise": "demonize",
|
383 |
+
"demonised": "demonized",
|
384 |
+
"demonises": "demonizes",
|
385 |
+
"demonising": "demonizing",
|
386 |
+
"demoralisation": "demoralization",
|
387 |
+
"demoralise": "demoralize",
|
388 |
+
"demoralised": "demoralized",
|
389 |
+
"demoralises": "demoralizes",
|
390 |
+
"demoralising": "demoralizing",
|
391 |
+
"denationalisation": "denationalization",
|
392 |
+
"denationalise": "denationalize",
|
393 |
+
"denationalised": "denationalized",
|
394 |
+
"denationalises": "denationalizes",
|
395 |
+
"denationalising": "denationalizing",
|
396 |
+
"deodorise": "deodorize",
|
397 |
+
"deodorised": "deodorized",
|
398 |
+
"deodorises": "deodorizes",
|
399 |
+
"deodorising": "deodorizing",
|
400 |
+
"depersonalise": "depersonalize",
|
401 |
+
"depersonalised": "depersonalized",
|
402 |
+
"depersonalises": "depersonalizes",
|
403 |
+
"depersonalising": "depersonalizing",
|
404 |
+
"deputise": "deputize",
|
405 |
+
"deputised": "deputized",
|
406 |
+
"deputises": "deputizes",
|
407 |
+
"deputising": "deputizing",
|
408 |
+
"desensitisation": "desensitization",
|
409 |
+
"desensitise": "desensitize",
|
410 |
+
"desensitised": "desensitized",
|
411 |
+
"desensitises": "desensitizes",
|
412 |
+
"desensitising": "desensitizing",
|
413 |
+
"destabilisation": "destabilization",
|
414 |
+
"destabilise": "destabilize",
|
415 |
+
"destabilised": "destabilized",
|
416 |
+
"destabilises": "destabilizes",
|
417 |
+
"destabilising": "destabilizing",
|
418 |
+
"dialled": "dialed",
|
419 |
+
"dialling": "dialing",
|
420 |
+
"dialogue": "dialog",
|
421 |
+
"dialogues": "dialogs",
|
422 |
+
"diarrhoea": "diarrhea",
|
423 |
+
"digitise": "digitize",
|
424 |
+
"digitised": "digitized",
|
425 |
+
"digitises": "digitizes",
|
426 |
+
"digitising": "digitizing",
|
427 |
+
"disc": "disk",
|
428 |
+
"discolour": "discolor",
|
429 |
+
"discoloured": "discolored",
|
430 |
+
"discolouring": "discoloring",
|
431 |
+
"discolours": "discolors",
|
432 |
+
"discs": "disks",
|
433 |
+
"disembowelled": "disemboweled",
|
434 |
+
"disembowelling": "disemboweling",
|
435 |
+
"disfavour": "disfavor",
|
436 |
+
"dishevelled": "disheveled",
|
437 |
+
"dishonour": "dishonor",
|
438 |
+
"dishonourable": "dishonorable",
|
439 |
+
"dishonourably": "dishonorably",
|
440 |
+
"dishonoured": "dishonored",
|
441 |
+
"dishonouring": "dishonoring",
|
442 |
+
"dishonours": "dishonors",
|
443 |
+
"disorganisation": "disorganization",
|
444 |
+
"disorganised": "disorganized",
|
445 |
+
"distil": "distill",
|
446 |
+
"distils": "distills",
|
447 |
+
"dramatisation": "dramatization",
|
448 |
+
"dramatisations": "dramatizations",
|
449 |
+
"dramatise": "dramatize",
|
450 |
+
"dramatised": "dramatized",
|
451 |
+
"dramatises": "dramatizes",
|
452 |
+
"dramatising": "dramatizing",
|
453 |
+
"draught": "draft",
|
454 |
+
"draughtboard": "draftboard",
|
455 |
+
"draughtboards": "draftboards",
|
456 |
+
"draughtier": "draftier",
|
457 |
+
"draughtiest": "draftiest",
|
458 |
+
"draughts": "drafts",
|
459 |
+
"draughtsman": "draftsman",
|
460 |
+
"draughtsmanship": "draftsmanship",
|
461 |
+
"draughtsmen": "draftsmen",
|
462 |
+
"draughtswoman": "draftswoman",
|
463 |
+
"draughtswomen": "draftswomen",
|
464 |
+
"draughty": "drafty",
|
465 |
+
"drivelled": "driveled",
|
466 |
+
"drivelling": "driveling",
|
467 |
+
"duelled": "dueled",
|
468 |
+
"duelling": "dueling",
|
469 |
+
"economise": "economize",
|
470 |
+
"economised": "economized",
|
471 |
+
"economises": "economizes",
|
472 |
+
"economising": "economizing",
|
473 |
+
"editorialise": "editorialize",
|
474 |
+
"editorialised": "editorialized",
|
475 |
+
"editorialises": "editorializes",
|
476 |
+
"editorialising": "editorializing",
|
477 |
+
"edoema": "edema",
|
478 |
+
"empathise": "empathize",
|
479 |
+
"empathised": "empathized",
|
480 |
+
"empathises": "empathizes",
|
481 |
+
"empathising": "empathizing",
|
482 |
+
"emphasise": "emphasize",
|
483 |
+
"emphasised": "emphasized",
|
484 |
+
"emphasises": "emphasizes",
|
485 |
+
"emphasising": "emphasizing",
|
486 |
+
"enamelled": "enameled",
|
487 |
+
"enamelling": "enameling",
|
488 |
+
"enamoured": "enamored",
|
489 |
+
"encyclopaedia": "encyclopedia",
|
490 |
+
"encyclopaedias": "encyclopedias",
|
491 |
+
"encyclopaedic": "encyclopedic",
|
492 |
+
"endeavour": "endeavor",
|
493 |
+
"endeavoured": "endeavored",
|
494 |
+
"endeavouring": "endeavoring",
|
495 |
+
"endeavours": "endeavors",
|
496 |
+
"energise": "energize",
|
497 |
+
"energised": "energized",
|
498 |
+
"energises": "energizes",
|
499 |
+
"energising": "energizing",
|
500 |
+
"enrol": "enroll",
|
501 |
+
"enrols": "enrolls",
|
502 |
+
"enthral": "enthrall",
|
503 |
+
"enthrals": "enthralls",
|
504 |
+
"epaulette": "epaulet",
|
505 |
+
"epaulettes": "epaulets",
|
506 |
+
"epicentre": "epicenter",
|
507 |
+
"epicentres": "epicenters",
|
508 |
+
"epilogue": "epilog",
|
509 |
+
"epilogues": "epilogs",
|
510 |
+
"epitomise": "epitomize",
|
511 |
+
"epitomised": "epitomized",
|
512 |
+
"epitomises": "epitomizes",
|
513 |
+
"epitomising": "epitomizing",
|
514 |
+
"equalisation": "equalization",
|
515 |
+
"equalise": "equalize",
|
516 |
+
"equalised": "equalized",
|
517 |
+
"equaliser": "equalizer",
|
518 |
+
"equalisers": "equalizers",
|
519 |
+
"equalises": "equalizes",
|
520 |
+
"equalising": "equalizing",
|
521 |
+
"eulogise": "eulogize",
|
522 |
+
"eulogised": "eulogized",
|
523 |
+
"eulogises": "eulogizes",
|
524 |
+
"eulogising": "eulogizing",
|
525 |
+
"evangelise": "evangelize",
|
526 |
+
"evangelised": "evangelized",
|
527 |
+
"evangelises": "evangelizes",
|
528 |
+
"evangelising": "evangelizing",
|
529 |
+
"exorcise": "exorcize",
|
530 |
+
"exorcised": "exorcized",
|
531 |
+
"exorcises": "exorcizes",
|
532 |
+
"exorcising": "exorcizing",
|
533 |
+
"extemporisation": "extemporization",
|
534 |
+
"extemporise": "extemporize",
|
535 |
+
"extemporised": "extemporized",
|
536 |
+
"extemporises": "extemporizes",
|
537 |
+
"extemporising": "extemporizing",
|
538 |
+
"externalisation": "externalization",
|
539 |
+
"externalisations": "externalizations",
|
540 |
+
"externalise": "externalize",
|
541 |
+
"externalised": "externalized",
|
542 |
+
"externalises": "externalizes",
|
543 |
+
"externalising": "externalizing",
|
544 |
+
"factorise": "factorize",
|
545 |
+
"factorised": "factorized",
|
546 |
+
"factorises": "factorizes",
|
547 |
+
"factorising": "factorizing",
|
548 |
+
"faecal": "fecal",
|
549 |
+
"faeces": "feces",
|
550 |
+
"familiarisation": "familiarization",
|
551 |
+
"familiarise": "familiarize",
|
552 |
+
"familiarised": "familiarized",
|
553 |
+
"familiarises": "familiarizes",
|
554 |
+
"familiarising": "familiarizing",
|
555 |
+
"fantasise": "fantasize",
|
556 |
+
"fantasised": "fantasized",
|
557 |
+
"fantasises": "fantasizes",
|
558 |
+
"fantasising": "fantasizing",
|
559 |
+
"favour": "favor",
|
560 |
+
"favourable": "favorable",
|
561 |
+
"favourably": "favorably",
|
562 |
+
"favoured": "favored",
|
563 |
+
"favouring": "favoring",
|
564 |
+
"favourite": "favorite",
|
565 |
+
"favourites": "favorites",
|
566 |
+
"favouritism": "favoritism",
|
567 |
+
"favours": "favors",
|
568 |
+
"feminise": "feminize",
|
569 |
+
"feminised": "feminized",
|
570 |
+
"feminises": "feminizes",
|
571 |
+
"feminising": "feminizing",
|
572 |
+
"fertilisation": "fertilization",
|
573 |
+
"fertilise": "fertilize",
|
574 |
+
"fertilised": "fertilized",
|
575 |
+
"fertiliser": "fertilizer",
|
576 |
+
"fertilisers": "fertilizers",
|
577 |
+
"fertilises": "fertilizes",
|
578 |
+
"fertilising": "fertilizing",
|
579 |
+
"fervour": "fervor",
|
580 |
+
"fibre": "fiber",
|
581 |
+
"fibreglass": "fiberglass",
|
582 |
+
"fibres": "fibers",
|
583 |
+
"fictionalisation": "fictionalization",
|
584 |
+
"fictionalisations": "fictionalizations",
|
585 |
+
"fictionalise": "fictionalize",
|
586 |
+
"fictionalised": "fictionalized",
|
587 |
+
"fictionalises": "fictionalizes",
|
588 |
+
"fictionalising": "fictionalizing",
|
589 |
+
"fillet": "filet",
|
590 |
+
"filleted": "fileted",
|
591 |
+
"filleting": "fileting",
|
592 |
+
"fillets": "filets",
|
593 |
+
"finalisation": "finalization",
|
594 |
+
"finalise": "finalize",
|
595 |
+
"finalised": "finalized",
|
596 |
+
"finalises": "finalizes",
|
597 |
+
"finalising": "finalizing",
|
598 |
+
"flautist": "flutist",
|
599 |
+
"flautists": "flutists",
|
600 |
+
"flavour": "flavor",
|
601 |
+
"flavoured": "flavored",
|
602 |
+
"flavouring": "flavoring",
|
603 |
+
"flavourings": "flavorings",
|
604 |
+
"flavourless": "flavorless",
|
605 |
+
"flavours": "flavors",
|
606 |
+
"flavoursome": "flavorsome",
|
607 |
+
"flyer / flier": "flier / flyer",
|
608 |
+
"foetal": "fetal",
|
609 |
+
"foetid": "fetid",
|
610 |
+
"foetus": "fetus",
|
611 |
+
"foetuses": "fetuses",
|
612 |
+
"formalisation": "formalization",
|
613 |
+
"formalise": "formalize",
|
614 |
+
"formalised": "formalized",
|
615 |
+
"formalises": "formalizes",
|
616 |
+
"formalising": "formalizing",
|
617 |
+
"fossilisation": "fossilization",
|
618 |
+
"fossilise": "fossilize",
|
619 |
+
"fossilised": "fossilized",
|
620 |
+
"fossilises": "fossilizes",
|
621 |
+
"fossilising": "fossilizing",
|
622 |
+
"fraternisation": "fraternization",
|
623 |
+
"fraternise": "fraternize",
|
624 |
+
"fraternised": "fraternized",
|
625 |
+
"fraternises": "fraternizes",
|
626 |
+
"fraternising": "fraternizing",
|
627 |
+
"fulfil": "fulfill",
|
628 |
+
"fulfilment": "fulfillment",
|
629 |
+
"fulfils": "fulfills",
|
630 |
+
"funnelled": "funneled",
|
631 |
+
"funnelling": "funneling",
|
632 |
+
"gage": "gauge",
|
633 |
+
"gaged": "gauged",
|
634 |
+
"gages": "gauges",
|
635 |
+
"gaging": "gauging",
|
636 |
+
"galvanise": "galvanize",
|
637 |
+
"galvanised": "galvanized",
|
638 |
+
"galvanises": "galvanizes",
|
639 |
+
"galvanising": "galvanizing",
|
640 |
+
"gambolled": "gamboled",
|
641 |
+
"gambolling": "gamboling",
|
642 |
+
"gaol": "jail",
|
643 |
+
"gaolbird": "jailbird",
|
644 |
+
"gaolbirds": "jailbirds",
|
645 |
+
"gaolbreak": "jailbreak",
|
646 |
+
"gaolbreaks": "jailbreaks",
|
647 |
+
"gaoled": "jailed",
|
648 |
+
"gaoler": "jailer",
|
649 |
+
"gaolers": "jailers",
|
650 |
+
"gaoling": "jailing",
|
651 |
+
"gaols": "jails",
|
652 |
+
"gasses": "gases",
|
653 |
+
"generalisation": "generalization",
|
654 |
+
"generalisations": "generalizations",
|
655 |
+
"generalise": "generalize",
|
656 |
+
"generalised": "generalized",
|
657 |
+
"generalises": "generalizes",
|
658 |
+
"generalising": "generalizing",
|
659 |
+
"ghettoise": "ghettoize",
|
660 |
+
"ghettoised": "ghettoized",
|
661 |
+
"ghettoises": "ghettoizes",
|
662 |
+
"ghettoising": "ghettoizing",
|
663 |
+
"gipsies": "gypsies",
|
664 |
+
"glamor": "glamour",
|
665 |
+
"glamorise": "glamorize",
|
666 |
+
"glamorised": "glamorized",
|
667 |
+
"glamorises": "glamorizes",
|
668 |
+
"glamorising": "glamorizing",
|
669 |
+
"globalisation": "globalization",
|
670 |
+
"globalise": "globalize",
|
671 |
+
"globalised": "globalized",
|
672 |
+
"globalises": "globalizes",
|
673 |
+
"globalising": "globalizing",
|
674 |
+
"glueing": "gluing",
|
675 |
+
"goitre": "goiter",
|
676 |
+
"goitres": "goiters",
|
677 |
+
"gonorrhoea": "gonorrhea",
|
678 |
+
"gramme": "gram",
|
679 |
+
"grammes": "grams",
|
680 |
+
"gravelled": "graveled",
|
681 |
+
"grey": "gray",
|
682 |
+
"greyed": "grayed",
|
683 |
+
"greying": "graying",
|
684 |
+
"greyish": "grayish",
|
685 |
+
"greyness": "grayness",
|
686 |
+
"greys": "grays",
|
687 |
+
"grovelled": "groveled",
|
688 |
+
"grovelling": "groveling",
|
689 |
+
"groyne": "groin",
|
690 |
+
"groynes": "groins",
|
691 |
+
"gruelling": "grueling",
|
692 |
+
"gruellingly": "gruelingly",
|
693 |
+
"gryphon": "griffin",
|
694 |
+
"gryphons": "griffins",
|
695 |
+
"gynaecological": "gynecological",
|
696 |
+
"gynaecologist": "gynecologist",
|
697 |
+
"gynaecologists": "gynecologists",
|
698 |
+
"gynaecology": "gynecology",
|
699 |
+
"haematological": "hematological",
|
700 |
+
"haematologist": "hematologist",
|
701 |
+
"haematologists": "hematologists",
|
702 |
+
"haematology": "hematology",
|
703 |
+
"haemoglobin": "hemoglobin",
|
704 |
+
"haemophilia": "hemophilia",
|
705 |
+
"haemophiliac": "hemophiliac",
|
706 |
+
"haemophiliacs": "hemophiliacs",
|
707 |
+
"haemorrhage": "hemorrhage",
|
708 |
+
"haemorrhaged": "hemorrhaged",
|
709 |
+
"haemorrhages": "hemorrhages",
|
710 |
+
"haemorrhaging": "hemorrhaging",
|
711 |
+
"haemorrhoids": "hemorrhoids",
|
712 |
+
"harbour": "harbor",
|
713 |
+
"harboured": "harbored",
|
714 |
+
"harbouring": "harboring",
|
715 |
+
"harbours": "harbors",
|
716 |
+
"harmonisation": "harmonization",
|
717 |
+
"harmonise": "harmonize",
|
718 |
+
"harmonised": "harmonized",
|
719 |
+
"harmonises": "harmonizes",
|
720 |
+
"harmonising": "harmonizing",
|
721 |
+
"homoeopath": "homeopath",
|
722 |
+
"homoeopathic": "homeopathic",
|
723 |
+
"homoeopaths": "homeopaths",
|
724 |
+
"homoeopathy": "homeopathy",
|
725 |
+
"homogenise": "homogenize",
|
726 |
+
"homogenised": "homogenized",
|
727 |
+
"homogenises": "homogenizes",
|
728 |
+
"homogenising": "homogenizing",
|
729 |
+
"honour": "honor",
|
730 |
+
"honourable": "honorable",
|
731 |
+
"honourably": "honorably",
|
732 |
+
"honoured": "honored",
|
733 |
+
"honouring": "honoring",
|
734 |
+
"honours": "honors",
|
735 |
+
"hospitalisation": "hospitalization",
|
736 |
+
"hospitalise": "hospitalize",
|
737 |
+
"hospitalised": "hospitalized",
|
738 |
+
"hospitalises": "hospitalizes",
|
739 |
+
"hospitalising": "hospitalizing",
|
740 |
+
"humanise": "humanize",
|
741 |
+
"humanised": "humanized",
|
742 |
+
"humanises": "humanizes",
|
743 |
+
"humanising": "humanizing",
|
744 |
+
"humour": "humor",
|
745 |
+
"humoured": "humored",
|
746 |
+
"humouring": "humoring",
|
747 |
+
"humourless": "humorless",
|
748 |
+
"humours": "humors",
|
749 |
+
"hybridise": "hybridize",
|
750 |
+
"hybridised": "hybridized",
|
751 |
+
"hybridises": "hybridizes",
|
752 |
+
"hybridising": "hybridizing",
|
753 |
+
"hypnotise": "hypnotize",
|
754 |
+
"hypnotised": "hypnotized",
|
755 |
+
"hypnotises": "hypnotizes",
|
756 |
+
"hypnotising": "hypnotizing",
|
757 |
+
"hypothesise": "hypothesize",
|
758 |
+
"hypothesised": "hypothesized",
|
759 |
+
"hypothesises": "hypothesizes",
|
760 |
+
"hypothesising": "hypothesizing",
|
761 |
+
"idealisation": "idealization",
|
762 |
+
"idealise": "idealize",
|
763 |
+
"idealised": "idealized",
|
764 |
+
"idealises": "idealizes",
|
765 |
+
"idealising": "idealizing",
|
766 |
+
"idolise": "idolize",
|
767 |
+
"idolised": "idolized",
|
768 |
+
"idolises": "idolizes",
|
769 |
+
"idolising": "idolizing",
|
770 |
+
"immobilisation": "immobilization",
|
771 |
+
"immobilise": "immobilize",
|
772 |
+
"immobilised": "immobilized",
|
773 |
+
"immobiliser": "immobilizer",
|
774 |
+
"immobilisers": "immobilizers",
|
775 |
+
"immobilises": "immobilizes",
|
776 |
+
"immobilising": "immobilizing",
|
777 |
+
"immortalise": "immortalize",
|
778 |
+
"immortalised": "immortalized",
|
779 |
+
"immortalises": "immortalizes",
|
780 |
+
"immortalising": "immortalizing",
|
781 |
+
"immunisation": "immunization",
|
782 |
+
"immunise": "immunize",
|
783 |
+
"immunised": "immunized",
|
784 |
+
"immunises": "immunizes",
|
785 |
+
"immunising": "immunizing",
|
786 |
+
"impanelled": "impaneled",
|
787 |
+
"impanelling": "impaneling",
|
788 |
+
"imperilled": "imperiled",
|
789 |
+
"imperilling": "imperiling",
|
790 |
+
"individualise": "individualize",
|
791 |
+
"individualised": "individualized",
|
792 |
+
"individualises": "individualizes",
|
793 |
+
"individualising": "individualizing",
|
794 |
+
"industrialise": "industrialize",
|
795 |
+
"industrialised": "industrialized",
|
796 |
+
"industrialises": "industrializes",
|
797 |
+
"industrialising": "industrializing",
|
798 |
+
"inflexion": "inflection",
|
799 |
+
"inflexions": "inflections",
|
800 |
+
"initialise": "initialize",
|
801 |
+
"initialised": "initialized",
|
802 |
+
"initialises": "initializes",
|
803 |
+
"initialising": "initializing",
|
804 |
+
"initialled": "initialed",
|
805 |
+
"initialling": "initialing",
|
806 |
+
"instal": "install",
|
807 |
+
"instalment": "installment",
|
808 |
+
"instalments": "installments",
|
809 |
+
"instals": "installs",
|
810 |
+
"instil": "instill",
|
811 |
+
"instils": "instills",
|
812 |
+
"institutionalisation": "institutionalization",
|
813 |
+
"institutionalise": "institutionalize",
|
814 |
+
"institutionalised": "institutionalized",
|
815 |
+
"institutionalises": "institutionalizes",
|
816 |
+
"institutionalising": "institutionalizing",
|
817 |
+
"intellectualise": "intellectualize",
|
818 |
+
"intellectualised": "intellectualized",
|
819 |
+
"intellectualises": "intellectualizes",
|
820 |
+
"intellectualising": "intellectualizing",
|
821 |
+
"internalisation": "internalization",
|
822 |
+
"internalise": "internalize",
|
823 |
+
"internalised": "internalized",
|
824 |
+
"internalises": "internalizes",
|
825 |
+
"internalising": "internalizing",
|
826 |
+
"internationalisation": "internationalization",
|
827 |
+
"internationalise": "internationalize",
|
828 |
+
"internationalised": "internationalized",
|
829 |
+
"internationalises": "internationalizes",
|
830 |
+
"internationalising": "internationalizing",
|
831 |
+
"ionisation": "ionization",
|
832 |
+
"ionise": "ionize",
|
833 |
+
"ionised": "ionized",
|
834 |
+
"ioniser": "ionizer",
|
835 |
+
"ionisers": "ionizers",
|
836 |
+
"ionises": "ionizes",
|
837 |
+
"ionising": "ionizing",
|
838 |
+
"italicise": "italicize",
|
839 |
+
"italicised": "italicized",
|
840 |
+
"italicises": "italicizes",
|
841 |
+
"italicising": "italicizing",
|
842 |
+
"itemise": "itemize",
|
843 |
+
"itemised": "itemized",
|
844 |
+
"itemises": "itemizes",
|
845 |
+
"itemising": "itemizing",
|
846 |
+
"jeopardise": "jeopardize",
|
847 |
+
"jeopardised": "jeopardized",
|
848 |
+
"jeopardises": "jeopardizes",
|
849 |
+
"jeopardising": "jeopardizing",
|
850 |
+
"jewelled": "jeweled",
|
851 |
+
"jeweller": "jeweler",
|
852 |
+
"jewellers": "jewelers",
|
853 |
+
"jewellery": "jewelry",
|
854 |
+
"judgement": "judgment",
|
855 |
+
"kilogramme": "kilogram",
|
856 |
+
"kilogrammes": "kilograms",
|
857 |
+
"kilometre": "kilometer",
|
858 |
+
"kilometres": "kilometers",
|
859 |
+
"labelled": "labeled",
|
860 |
+
"labelling": "labeling",
|
861 |
+
"labour": "labor",
|
862 |
+
"laboured": "labored",
|
863 |
+
"labourer": "laborer",
|
864 |
+
"labourers": "laborers",
|
865 |
+
"labouring": "laboring",
|
866 |
+
"labours": "labors",
|
867 |
+
"lacklustre": "lackluster",
|
868 |
+
"legalisation": "legalization",
|
869 |
+
"legalise": "legalize",
|
870 |
+
"legalised": "legalized",
|
871 |
+
"legalises": "legalizes",
|
872 |
+
"legalising": "legalizing",
|
873 |
+
"legitimise": "legitimize",
|
874 |
+
"legitimised": "legitimized",
|
875 |
+
"legitimises": "legitimizes",
|
876 |
+
"legitimising": "legitimizing",
|
877 |
+
"leukaemia": "leukemia",
|
878 |
+
"levelled": "leveled",
|
879 |
+
"leveller": "leveler",
|
880 |
+
"levellers": "levelers",
|
881 |
+
"levelling": "leveling",
|
882 |
+
"libelled": "libeled",
|
883 |
+
"libelling": "libeling",
|
884 |
+
"libellous": "libelous",
|
885 |
+
"liberalisation": "liberalization",
|
886 |
+
"liberalise": "liberalize",
|
887 |
+
"liberalised": "liberalized",
|
888 |
+
"liberalises": "liberalizes",
|
889 |
+
"liberalising": "liberalizing",
|
890 |
+
"licence": "license",
|
891 |
+
"licenced": "licensed",
|
892 |
+
"licences": "licenses",
|
893 |
+
"licencing": "licensing",
|
894 |
+
"likeable": "likable",
|
895 |
+
"lionisation": "lionization",
|
896 |
+
"lionise": "lionize",
|
897 |
+
"lionised": "lionized",
|
898 |
+
"lionises": "lionizes",
|
899 |
+
"lionising": "lionizing",
|
900 |
+
"liquidise": "liquidize",
|
901 |
+
"liquidised": "liquidized",
|
902 |
+
"liquidiser": "liquidizer",
|
903 |
+
"liquidisers": "liquidizers",
|
904 |
+
"liquidises": "liquidizes",
|
905 |
+
"liquidising": "liquidizing",
|
906 |
+
"litre": "liter",
|
907 |
+
"litres": "liters",
|
908 |
+
"localise": "localize",
|
909 |
+
"localised": "localized",
|
910 |
+
"localises": "localizes",
|
911 |
+
"localising": "localizing",
|
912 |
+
"louvre": "louver",
|
913 |
+
"louvred": "louvered",
|
914 |
+
"louvres": "louvers",
|
915 |
+
"lustre": "luster",
|
916 |
+
"magnetise": "magnetize",
|
917 |
+
"magnetised": "magnetized",
|
918 |
+
"magnetises": "magnetizes",
|
919 |
+
"magnetising": "magnetizing",
|
920 |
+
"manoeuvrability": "maneuverability",
|
921 |
+
"manoeuvrable": "maneuverable",
|
922 |
+
"manoeuvre": "maneuver",
|
923 |
+
"manoeuvred": "maneuvered",
|
924 |
+
"manoeuvres": "maneuvers",
|
925 |
+
"manoeuvring": "maneuvering",
|
926 |
+
"manoeuvrings": "maneuverings",
|
927 |
+
"marginalisation": "marginalization",
|
928 |
+
"marginalise": "marginalize",
|
929 |
+
"marginalised": "marginalized",
|
930 |
+
"marginalises": "marginalizes",
|
931 |
+
"marginalising": "marginalizing",
|
932 |
+
"marshalled": "marshaled",
|
933 |
+
"marshalling": "marshaling",
|
934 |
+
"marvelled": "marveled",
|
935 |
+
"marvelling": "marveling",
|
936 |
+
"marvellous": "marvelous",
|
937 |
+
"marvellously": "marvelously",
|
938 |
+
"materialisation": "materialization",
|
939 |
+
"materialise": "materialize",
|
940 |
+
"materialised": "materialized",
|
941 |
+
"materialises": "materializes",
|
942 |
+
"materialising": "materializing",
|
943 |
+
"maximisation": "maximization",
|
944 |
+
"maximise": "maximize",
|
945 |
+
"maximised": "maximized",
|
946 |
+
"maximises": "maximizes",
|
947 |
+
"maximising": "maximizing",
|
948 |
+
"meagre": "meager",
|
949 |
+
"mechanisation": "mechanization",
|
950 |
+
"mechanise": "mechanize",
|
951 |
+
"mechanised": "mechanized",
|
952 |
+
"mechanises": "mechanizes",
|
953 |
+
"mechanising": "mechanizing",
|
954 |
+
"mediaeval": "medieval",
|
955 |
+
"memorialise": "memorialize",
|
956 |
+
"memorialised": "memorialized",
|
957 |
+
"memorialises": "memorializes",
|
958 |
+
"memorialising": "memorializing",
|
959 |
+
"memorise": "memorize",
|
960 |
+
"memorised": "memorized",
|
961 |
+
"memorises": "memorizes",
|
962 |
+
"memorising": "memorizing",
|
963 |
+
"mesmerise": "mesmerize",
|
964 |
+
"mesmerised": "mesmerized",
|
965 |
+
"mesmerises": "mesmerizes",
|
966 |
+
"mesmerising": "mesmerizing",
|
967 |
+
"metabolise": "metabolize",
|
968 |
+
"metabolised": "metabolized",
|
969 |
+
"metabolises": "metabolizes",
|
970 |
+
"metabolising": "metabolizing",
|
971 |
+
"metre": "meter",
|
972 |
+
"metres": "meters",
|
973 |
+
"mhm": "hmm",
|
974 |
+
"micrometre": "micrometer",
|
975 |
+
"micrometres": "micrometers",
|
976 |
+
"militarise": "militarize",
|
977 |
+
"militarised": "militarized",
|
978 |
+
"militarises": "militarizes",
|
979 |
+
"militarising": "militarizing",
|
980 |
+
"milligramme": "milligram",
|
981 |
+
"milligrammes": "milligrams",
|
982 |
+
"millilitre": "milliliter",
|
983 |
+
"millilitres": "milliliters",
|
984 |
+
"millimetre": "millimeter",
|
985 |
+
"millimetres": "millimeters",
|
986 |
+
"miniaturisation": "miniaturization",
|
987 |
+
"miniaturise": "miniaturize",
|
988 |
+
"miniaturised": "miniaturized",
|
989 |
+
"miniaturises": "miniaturizes",
|
990 |
+
"miniaturising": "miniaturizing",
|
991 |
+
"minibusses": "minibuses",
|
992 |
+
"minimise": "minimize",
|
993 |
+
"minimised": "minimized",
|
994 |
+
"minimises": "minimizes",
|
995 |
+
"minimising": "minimizing",
|
996 |
+
"misbehaviour": "misbehavior",
|
997 |
+
"misdemeanour": "misdemeanor",
|
998 |
+
"misdemeanours": "misdemeanors",
|
999 |
+
"misspelt": "misspelled",
|
1000 |
+
"mitre": "miter",
|
1001 |
+
"mitres": "miters",
|
1002 |
+
"mm": "hmm",
|
1003 |
+
"mmm": "hmm",
|
1004 |
+
"mobilisation": "mobilization",
|
1005 |
+
"mobilise": "mobilize",
|
1006 |
+
"mobilised": "mobilized",
|
1007 |
+
"mobilises": "mobilizes",
|
1008 |
+
"mobilising": "mobilizing",
|
1009 |
+
"modelled": "modeled",
|
1010 |
+
"modeller": "modeler",
|
1011 |
+
"modellers": "modelers",
|
1012 |
+
"modelling": "modeling",
|
1013 |
+
"modernise": "modernize",
|
1014 |
+
"modernised": "modernized",
|
1015 |
+
"modernises": "modernizes",
|
1016 |
+
"modernising": "modernizing",
|
1017 |
+
"moisturise": "moisturize",
|
1018 |
+
"moisturised": "moisturized",
|
1019 |
+
"moisturiser": "moisturizer",
|
1020 |
+
"moisturisers": "moisturizers",
|
1021 |
+
"moisturises": "moisturizes",
|
1022 |
+
"moisturising": "moisturizing",
|
1023 |
+
"monologue": "monolog",
|
1024 |
+
"monologues": "monologs",
|
1025 |
+
"monopolisation": "monopolization",
|
1026 |
+
"monopolise": "monopolize",
|
1027 |
+
"monopolised": "monopolized",
|
1028 |
+
"monopolises": "monopolizes",
|
1029 |
+
"monopolising": "monopolizing",
|
1030 |
+
"moralise": "moralize",
|
1031 |
+
"moralised": "moralized",
|
1032 |
+
"moralises": "moralizes",
|
1033 |
+
"moralising": "moralizing",
|
1034 |
+
"motorised": "motorized",
|
1035 |
+
"mould": "mold",
|
1036 |
+
"moulded": "molded",
|
1037 |
+
"moulder": "molder",
|
1038 |
+
"mouldered": "moldered",
|
1039 |
+
"mouldering": "moldering",
|
1040 |
+
"moulders": "molders",
|
1041 |
+
"mouldier": "moldier",
|
1042 |
+
"mouldiest": "moldiest",
|
1043 |
+
"moulding": "molding",
|
1044 |
+
"mouldings": "moldings",
|
1045 |
+
"moulds": "molds",
|
1046 |
+
"mouldy": "moldy",
|
1047 |
+
"moult": "molt",
|
1048 |
+
"moulted": "molted",
|
1049 |
+
"moulting": "molting",
|
1050 |
+
"moults": "molts",
|
1051 |
+
"moustache": "mustache",
|
1052 |
+
"moustached": "mustached",
|
1053 |
+
"moustaches": "mustaches",
|
1054 |
+
"moustachioed": "mustachioed",
|
1055 |
+
"multicoloured": "multicolored",
|
1056 |
+
"nationalisation": "nationalization",
|
1057 |
+
"nationalisations": "nationalizations",
|
1058 |
+
"nationalise": "nationalize",
|
1059 |
+
"nationalised": "nationalized",
|
1060 |
+
"nationalises": "nationalizes",
|
1061 |
+
"nationalising": "nationalizing",
|
1062 |
+
"naturalisation": "naturalization",
|
1063 |
+
"naturalise": "naturalize",
|
1064 |
+
"naturalised": "naturalized",
|
1065 |
+
"naturalises": "naturalizes",
|
1066 |
+
"naturalising": "naturalizing",
|
1067 |
+
"neighbour": "neighbor",
|
1068 |
+
"neighbourhood": "neighborhood",
|
1069 |
+
"neighbourhoods": "neighborhoods",
|
1070 |
+
"neighbouring": "neighboring",
|
1071 |
+
"neighbourliness": "neighborliness",
|
1072 |
+
"neighbourly": "neighborly",
|
1073 |
+
"neighbours": "neighbors",
|
1074 |
+
"neutralisation": "neutralization",
|
1075 |
+
"neutralise": "neutralize",
|
1076 |
+
"neutralised": "neutralized",
|
1077 |
+
"neutralises": "neutralizes",
|
1078 |
+
"neutralising": "neutralizing",
|
1079 |
+
"normalisation": "normalization",
|
1080 |
+
"normalise": "normalize",
|
1081 |
+
"normalised": "normalized",
|
1082 |
+
"normalises": "normalizes",
|
1083 |
+
"normalising": "normalizing",
|
1084 |
+
"odour": "odor",
|
1085 |
+
"odourless": "odorless",
|
1086 |
+
"odours": "odors",
|
1087 |
+
"oesophagus": "esophagus",
|
1088 |
+
"oesophaguses": "esophaguses",
|
1089 |
+
"oestrogen": "estrogen",
|
1090 |
+
"offence": "offense",
|
1091 |
+
"offences": "offenses",
|
1092 |
+
"omelette": "omelet",
|
1093 |
+
"omelettes": "omelets",
|
1094 |
+
"optimise": "optimize",
|
1095 |
+
"optimised": "optimized",
|
1096 |
+
"optimises": "optimizes",
|
1097 |
+
"optimising": "optimizing",
|
1098 |
+
"organisation": "organization",
|
1099 |
+
"organisational": "organizational",
|
1100 |
+
"organisations": "organizations",
|
1101 |
+
"organise": "organize",
|
1102 |
+
"organised": "organized",
|
1103 |
+
"organiser": "organizer",
|
1104 |
+
"organisers": "organizers",
|
1105 |
+
"organises": "organizes",
|
1106 |
+
"organising": "organizing",
|
1107 |
+
"orthopaedic": "orthopedic",
|
1108 |
+
"orthopaedics": "orthopedics",
|
1109 |
+
"ostracise": "ostracize",
|
1110 |
+
"ostracised": "ostracized",
|
1111 |
+
"ostracises": "ostracizes",
|
1112 |
+
"ostracising": "ostracizing",
|
1113 |
+
"outmanoeuvre": "outmaneuver",
|
1114 |
+
"outmanoeuvred": "outmaneuvered",
|
1115 |
+
"outmanoeuvres": "outmaneuvers",
|
1116 |
+
"outmanoeuvring": "outmaneuvering",
|
1117 |
+
"overemphasise": "overemphasize",
|
1118 |
+
"overemphasised": "overemphasized",
|
1119 |
+
"overemphasises": "overemphasizes",
|
1120 |
+
"overemphasising": "overemphasizing",
|
1121 |
+
"oxidisation": "oxidization",
|
1122 |
+
"oxidise": "oxidize",
|
1123 |
+
"oxidised": "oxidized",
|
1124 |
+
"oxidises": "oxidizes",
|
1125 |
+
"oxidising": "oxidizing",
|
1126 |
+
"paederast": "pederast",
|
1127 |
+
"paederasts": "pederasts",
|
1128 |
+
"paediatric": "pediatric",
|
1129 |
+
"paediatrician": "pediatrician",
|
1130 |
+
"paediatricians": "pediatricians",
|
1131 |
+
"paediatrics": "pediatrics",
|
1132 |
+
"paedophile": "pedophile",
|
1133 |
+
"paedophiles": "pedophiles",
|
1134 |
+
"paedophilia": "pedophilia",
|
1135 |
+
"palaeolithic": "paleolithic",
|
1136 |
+
"palaeontologist": "paleontologist",
|
1137 |
+
"palaeontologists": "paleontologists",
|
1138 |
+
"palaeontology": "paleontology",
|
1139 |
+
"panelled": "paneled",
|
1140 |
+
"panelling": "paneling",
|
1141 |
+
"panellist": "panelist",
|
1142 |
+
"panellists": "panelists",
|
1143 |
+
"paralyse": "paralyze",
|
1144 |
+
"paralysed": "paralyzed",
|
1145 |
+
"paralyses": "paralyzes",
|
1146 |
+
"paralysing": "paralyzing",
|
1147 |
+
"parcelled": "parceled",
|
1148 |
+
"parcelling": "parceling",
|
1149 |
+
"parlour": "parlor",
|
1150 |
+
"parlours": "parlors",
|
1151 |
+
"particularise": "particularize",
|
1152 |
+
"particularised": "particularized",
|
1153 |
+
"particularises": "particularizes",
|
1154 |
+
"particularising": "particularizing",
|
1155 |
+
"passivisation": "passivization",
|
1156 |
+
"passivise": "passivize",
|
1157 |
+
"passivised": "passivized",
|
1158 |
+
"passivises": "passivizes",
|
1159 |
+
"passivising": "passivizing",
|
1160 |
+
"pasteurisation": "pasteurization",
|
1161 |
+
"pasteurise": "pasteurize",
|
1162 |
+
"pasteurised": "pasteurized",
|
1163 |
+
"pasteurises": "pasteurizes",
|
1164 |
+
"pasteurising": "pasteurizing",
|
1165 |
+
"patronise": "patronize",
|
1166 |
+
"patronised": "patronized",
|
1167 |
+
"patronises": "patronizes",
|
1168 |
+
"patronising": "patronizing",
|
1169 |
+
"patronisingly": "patronizingly",
|
1170 |
+
"pedalled": "pedaled",
|
1171 |
+
"pedalling": "pedaling",
|
1172 |
+
"pedestrianisation": "pedestrianization",
|
1173 |
+
"pedestrianise": "pedestrianize",
|
1174 |
+
"pedestrianised": "pedestrianized",
|
1175 |
+
"pedestrianises": "pedestrianizes",
|
1176 |
+
"pedestrianising": "pedestrianizing",
|
1177 |
+
"penalise": "penalize",
|
1178 |
+
"penalised": "penalized",
|
1179 |
+
"penalises": "penalizes",
|
1180 |
+
"penalising": "penalizing",
|
1181 |
+
"pencilled": "penciled",
|
1182 |
+
"pencilling": "penciling",
|
1183 |
+
"personalise": "personalize",
|
1184 |
+
"personalised": "personalized",
|
1185 |
+
"personalises": "personalizes",
|
1186 |
+
"personalising": "personalizing",
|
1187 |
+
"pharmacopoeia": "pharmacopeia",
|
1188 |
+
"pharmacopoeias": "pharmacopeias",
|
1189 |
+
"philosophise": "philosophize",
|
1190 |
+
"philosophised": "philosophized",
|
1191 |
+
"philosophises": "philosophizes",
|
1192 |
+
"philosophising": "philosophizing",
|
1193 |
+
"philtre": "filter",
|
1194 |
+
"philtres": "filters",
|
1195 |
+
"phoney": "phony",
|
1196 |
+
"plagiarise": "plagiarize",
|
1197 |
+
"plagiarised": "plagiarized",
|
1198 |
+
"plagiarises": "plagiarizes",
|
1199 |
+
"plagiarising": "plagiarizing",
|
1200 |
+
"plough": "plow",
|
1201 |
+
"ploughed": "plowed",
|
1202 |
+
"ploughing": "plowing",
|
1203 |
+
"ploughman": "plowman",
|
1204 |
+
"ploughmen": "plowmen",
|
1205 |
+
"ploughs": "plows",
|
1206 |
+
"ploughshare": "plowshare",
|
1207 |
+
"ploughshares": "plowshares",
|
1208 |
+
"polarisation": "polarization",
|
1209 |
+
"polarise": "polarize",
|
1210 |
+
"polarised": "polarized",
|
1211 |
+
"polarises": "polarizes",
|
1212 |
+
"polarising": "polarizing",
|
1213 |
+
"politicisation": "politicization",
|
1214 |
+
"politicise": "politicize",
|
1215 |
+
"politicised": "politicized",
|
1216 |
+
"politicises": "politicizes",
|
1217 |
+
"politicising": "politicizing",
|
1218 |
+
"popularisation": "popularization",
|
1219 |
+
"popularise": "popularize",
|
1220 |
+
"popularised": "popularized",
|
1221 |
+
"popularises": "popularizes",
|
1222 |
+
"popularising": "popularizing",
|
1223 |
+
"pouffe": "pouf",
|
1224 |
+
"pouffes": "poufs",
|
1225 |
+
"practise": "practice",
|
1226 |
+
"practised": "practiced",
|
1227 |
+
"practises": "practices",
|
1228 |
+
"practising": "practicing",
|
1229 |
+
"praesidium": "presidium",
|
1230 |
+
"praesidiums": "presidiums",
|
1231 |
+
"pressurisation": "pressurization",
|
1232 |
+
"pressurise": "pressurize",
|
1233 |
+
"pressurised": "pressurized",
|
1234 |
+
"pressurises": "pressurizes",
|
1235 |
+
"pressurising": "pressurizing",
|
1236 |
+
"pretence": "pretense",
|
1237 |
+
"pretences": "pretenses",
|
1238 |
+
"primaeval": "primeval",
|
1239 |
+
"prioritisation": "prioritization",
|
1240 |
+
"prioritise": "prioritize",
|
1241 |
+
"prioritised": "prioritized",
|
1242 |
+
"prioritises": "prioritizes",
|
1243 |
+
"prioritising": "prioritizing",
|
1244 |
+
"privatisation": "privatization",
|
1245 |
+
"privatisations": "privatizations",
|
1246 |
+
"privatise": "privatize",
|
1247 |
+
"privatised": "privatized",
|
1248 |
+
"privatises": "privatizes",
|
1249 |
+
"privatising": "privatizing",
|
1250 |
+
"professionalisation": "professionalization",
|
1251 |
+
"professionalise": "professionalize",
|
1252 |
+
"professionalised": "professionalized",
|
1253 |
+
"professionalises": "professionalizes",
|
1254 |
+
"professionalising": "professionalizing",
|
1255 |
+
"programme": "program",
|
1256 |
+
"programmes": "programs",
|
1257 |
+
"prologue": "prolog",
|
1258 |
+
"prologues": "prologs",
|
1259 |
+
"propagandise": "propagandize",
|
1260 |
+
"propagandised": "propagandized",
|
1261 |
+
"propagandises": "propagandizes",
|
1262 |
+
"propagandising": "propagandizing",
|
1263 |
+
"proselytise": "proselytize",
|
1264 |
+
"proselytised": "proselytized",
|
1265 |
+
"proselytiser": "proselytizer",
|
1266 |
+
"proselytisers": "proselytizers",
|
1267 |
+
"proselytises": "proselytizes",
|
1268 |
+
"proselytising": "proselytizing",
|
1269 |
+
"psychoanalyse": "psychoanalyze",
|
1270 |
+
"psychoanalysed": "psychoanalyzed",
|
1271 |
+
"psychoanalyses": "psychoanalyzes",
|
1272 |
+
"psychoanalysing": "psychoanalyzing",
|
1273 |
+
"publicise": "publicize",
|
1274 |
+
"publicised": "publicized",
|
1275 |
+
"publicises": "publicizes",
|
1276 |
+
"publicising": "publicizing",
|
1277 |
+
"pulverisation": "pulverization",
|
1278 |
+
"pulverise": "pulverize",
|
1279 |
+
"pulverised": "pulverized",
|
1280 |
+
"pulverises": "pulverizes",
|
1281 |
+
"pulverising": "pulverizing",
|
1282 |
+
"pummelled": "pummel",
|
1283 |
+
"pummelling": "pummeled",
|
1284 |
+
"pyjama": "pajama",
|
1285 |
+
"pyjamas": "pajamas",
|
1286 |
+
"pzazz": "pizzazz",
|
1287 |
+
"quarrelled": "quarreled",
|
1288 |
+
"quarrelling": "quarreling",
|
1289 |
+
"radicalise": "radicalize",
|
1290 |
+
"radicalised": "radicalized",
|
1291 |
+
"radicalises": "radicalizes",
|
1292 |
+
"radicalising": "radicalizing",
|
1293 |
+
"rancour": "rancor",
|
1294 |
+
"randomise": "randomize",
|
1295 |
+
"randomised": "randomized",
|
1296 |
+
"randomises": "randomizes",
|
1297 |
+
"randomising": "randomizing",
|
1298 |
+
"rationalisation": "rationalization",
|
1299 |
+
"rationalisations": "rationalizations",
|
1300 |
+
"rationalise": "rationalize",
|
1301 |
+
"rationalised": "rationalized",
|
1302 |
+
"rationalises": "rationalizes",
|
1303 |
+
"rationalising": "rationalizing",
|
1304 |
+
"ravelled": "raveled",
|
1305 |
+
"ravelling": "raveling",
|
1306 |
+
"realisable": "realizable",
|
1307 |
+
"realisation": "realization",
|
1308 |
+
"realisations": "realizations",
|
1309 |
+
"realise": "realize",
|
1310 |
+
"realised": "realized",
|
1311 |
+
"realises": "realizes",
|
1312 |
+
"realising": "realizing",
|
1313 |
+
"recognisable": "recognizable",
|
1314 |
+
"recognisably": "recognizably",
|
1315 |
+
"recognisance": "recognizance",
|
1316 |
+
"recognise": "recognize",
|
1317 |
+
"recognised": "recognized",
|
1318 |
+
"recognises": "recognizes",
|
1319 |
+
"recognising": "recognizing",
|
1320 |
+
"reconnoitre": "reconnoiter",
|
1321 |
+
"reconnoitred": "reconnoitered",
|
1322 |
+
"reconnoitres": "reconnoiters",
|
1323 |
+
"reconnoitring": "reconnoitering",
|
1324 |
+
"refuelled": "refueled",
|
1325 |
+
"refuelling": "refueling",
|
1326 |
+
"regularisation": "regularization",
|
1327 |
+
"regularise": "regularize",
|
1328 |
+
"regularised": "regularized",
|
1329 |
+
"regularises": "regularizes",
|
1330 |
+
"regularising": "regularizing",
|
1331 |
+
"remodelled": "remodeled",
|
1332 |
+
"remodelling": "remodeling",
|
1333 |
+
"remould": "remold",
|
1334 |
+
"remoulded": "remolded",
|
1335 |
+
"remoulding": "remolding",
|
1336 |
+
"remoulds": "remolds",
|
1337 |
+
"reorganisation": "reorganization",
|
1338 |
+
"reorganisations": "reorganizations",
|
1339 |
+
"reorganise": "reorganize",
|
1340 |
+
"reorganised": "reorganized",
|
1341 |
+
"reorganises": "reorganizes",
|
1342 |
+
"reorganising": "reorganizing",
|
1343 |
+
"revelled": "reveled",
|
1344 |
+
"reveller": "reveler",
|
1345 |
+
"revellers": "revelers",
|
1346 |
+
"revelling": "reveling",
|
1347 |
+
"revitalise": "revitalize",
|
1348 |
+
"revitalised": "revitalized",
|
1349 |
+
"revitalises": "revitalizes",
|
1350 |
+
"revitalising": "revitalizing",
|
1351 |
+
"revolutionise": "revolutionize",
|
1352 |
+
"revolutionised": "revolutionized",
|
1353 |
+
"revolutionises": "revolutionizes",
|
1354 |
+
"revolutionising": "revolutionizing",
|
1355 |
+
"rhapsodise": "rhapsodize",
|
1356 |
+
"rhapsodised": "rhapsodized",
|
1357 |
+
"rhapsodises": "rhapsodizes",
|
1358 |
+
"rhapsodising": "rhapsodizing",
|
1359 |
+
"rigour": "rigor",
|
1360 |
+
"rigours": "rigors",
|
1361 |
+
"ritualised": "ritualized",
|
1362 |
+
"rivalled": "rivaled",
|
1363 |
+
"rivalling": "rivaling",
|
1364 |
+
"romanticise": "romanticize",
|
1365 |
+
"romanticised": "romanticized",
|
1366 |
+
"romanticises": "romanticizes",
|
1367 |
+
"romanticising": "romanticizing",
|
1368 |
+
"rumour": "rumor",
|
1369 |
+
"rumoured": "rumored",
|
1370 |
+
"rumours": "rumors",
|
1371 |
+
"sabre": "saber",
|
1372 |
+
"sabres": "sabers",
|
1373 |
+
"saltpetre": "saltpeter",
|
1374 |
+
"sanitise": "sanitize",
|
1375 |
+
"sanitised": "sanitized",
|
1376 |
+
"sanitises": "sanitizes",
|
1377 |
+
"sanitising": "sanitizing",
|
1378 |
+
"satirise": "satirize",
|
1379 |
+
"satirised": "satirized",
|
1380 |
+
"satirises": "satirizes",
|
1381 |
+
"satirising": "satirizing",
|
1382 |
+
"saviour": "savior",
|
1383 |
+
"saviours": "saviors",
|
1384 |
+
"savour": "savor",
|
1385 |
+
"savoured": "savored",
|
1386 |
+
"savouries": "savories",
|
1387 |
+
"savouring": "savoring",
|
1388 |
+
"savours": "savors",
|
1389 |
+
"savoury": "savory",
|
1390 |
+
"scandalise": "scandalize",
|
1391 |
+
"scandalised": "scandalized",
|
1392 |
+
"scandalises": "scandalizes",
|
1393 |
+
"scandalising": "scandalizing",
|
1394 |
+
"sceptic": "skeptic",
|
1395 |
+
"sceptical": "skeptical",
|
1396 |
+
"sceptically": "skeptically",
|
1397 |
+
"scepticism": "skepticism",
|
1398 |
+
"sceptics": "skeptics",
|
1399 |
+
"sceptre": "scepter",
|
1400 |
+
"sceptres": "scepters",
|
1401 |
+
"scrutinise": "scrutinize",
|
1402 |
+
"scrutinised": "scrutinized",
|
1403 |
+
"scrutinises": "scrutinizes",
|
1404 |
+
"scrutinising": "scrutinizing",
|
1405 |
+
"secularisation": "secularization",
|
1406 |
+
"secularise": "secularize",
|
1407 |
+
"secularised": "secularized",
|
1408 |
+
"secularises": "secularizes",
|
1409 |
+
"secularising": "secularizing",
|
1410 |
+
"sensationalise": "sensationalize",
|
1411 |
+
"sensationalised": "sensationalized",
|
1412 |
+
"sensationalises": "sensationalizes",
|
1413 |
+
"sensationalising": "sensationalizing",
|
1414 |
+
"sensitise": "sensitize",
|
1415 |
+
"sensitised": "sensitized",
|
1416 |
+
"sensitises": "sensitizes",
|
1417 |
+
"sensitising": "sensitizing",
|
1418 |
+
"sentimentalise": "sentimentalize",
|
1419 |
+
"sentimentalised": "sentimentalized",
|
1420 |
+
"sentimentalises": "sentimentalizes",
|
1421 |
+
"sentimentalising": "sentimentalizing",
|
1422 |
+
"sepulchre": "sepulcher",
|
1423 |
+
"sepulchres": "sepulchers",
|
1424 |
+
"serialisation": "serialization",
|
1425 |
+
"serialisations": "serializations",
|
1426 |
+
"serialise": "serialize",
|
1427 |
+
"serialised": "serialized",
|
1428 |
+
"serialises": "serializes",
|
1429 |
+
"serialising": "serializing",
|
1430 |
+
"sermonise": "sermonize",
|
1431 |
+
"sermonised": "sermonized",
|
1432 |
+
"sermonises": "sermonizes",
|
1433 |
+
"sermonising": "sermonizing",
|
1434 |
+
"sheikh": "sheik",
|
1435 |
+
"shovelled": "shoveled",
|
1436 |
+
"shovelling": "shoveling",
|
1437 |
+
"shrivelled": "shriveled",
|
1438 |
+
"shrivelling": "shriveling",
|
1439 |
+
"signalise": "signalize",
|
1440 |
+
"signalised": "signalized",
|
1441 |
+
"signalises": "signalizes",
|
1442 |
+
"signalising": "signalizing",
|
1443 |
+
"signalled": "signaled",
|
1444 |
+
"signalling": "signaling",
|
1445 |
+
"smoulder": "smolder",
|
1446 |
+
"smouldered": "smoldered",
|
1447 |
+
"smouldering": "smoldering",
|
1448 |
+
"smoulders": "smolders",
|
1449 |
+
"snivelled": "sniveled",
|
1450 |
+
"snivelling": "sniveling",
|
1451 |
+
"snorkelled": "snorkeled",
|
1452 |
+
"snorkelling": "snorkeling",
|
1453 |
+
"snowplough": "snowplow",
|
1454 |
+
"snowploughs": "snowplow",
|
1455 |
+
"socialisation": "socialization",
|
1456 |
+
"socialise": "socialize",
|
1457 |
+
"socialised": "socialized",
|
1458 |
+
"socialises": "socializes",
|
1459 |
+
"socialising": "socializing",
|
1460 |
+
"sodomise": "sodomize",
|
1461 |
+
"sodomised": "sodomized",
|
1462 |
+
"sodomises": "sodomizes",
|
1463 |
+
"sodomising": "sodomizing",
|
1464 |
+
"solemnise": "solemnize",
|
1465 |
+
"solemnised": "solemnized",
|
1466 |
+
"solemnises": "solemnizes",
|
1467 |
+
"solemnising": "solemnizing",
|
1468 |
+
"sombre": "somber",
|
1469 |
+
"specialisation": "specialization",
|
1470 |
+
"specialisations": "specializations",
|
1471 |
+
"specialise": "specialize",
|
1472 |
+
"specialised": "specialized",
|
1473 |
+
"specialises": "specializes",
|
1474 |
+
"specialising": "specializing",
|
1475 |
+
"spectre": "specter",
|
1476 |
+
"spectres": "specters",
|
1477 |
+
"spiralled": "spiraled",
|
1478 |
+
"spiralling": "spiraling",
|
1479 |
+
"splendour": "splendor",
|
1480 |
+
"splendours": "splendors",
|
1481 |
+
"squirrelled": "squirreled",
|
1482 |
+
"squirrelling": "squirreling",
|
1483 |
+
"stabilisation": "stabilization",
|
1484 |
+
"stabilise": "stabilize",
|
1485 |
+
"stabilised": "stabilized",
|
1486 |
+
"stabiliser": "stabilizer",
|
1487 |
+
"stabilisers": "stabilizers",
|
1488 |
+
"stabilises": "stabilizes",
|
1489 |
+
"stabilising": "stabilizing",
|
1490 |
+
"standardisation": "standardization",
|
1491 |
+
"standardise": "standardize",
|
1492 |
+
"standardised": "standardized",
|
1493 |
+
"standardises": "standardizes",
|
1494 |
+
"standardising": "standardizing",
|
1495 |
+
"stencilled": "stenciled",
|
1496 |
+
"stencilling": "stenciling",
|
1497 |
+
"sterilisation": "sterilization",
|
1498 |
+
"sterilisations": "sterilizations",
|
1499 |
+
"sterilise": "sterilize",
|
1500 |
+
"sterilised": "sterilized",
|
1501 |
+
"steriliser": "sterilizer",
|
1502 |
+
"sterilisers": "sterilizers",
|
1503 |
+
"sterilises": "sterilizes",
|
1504 |
+
"sterilising": "sterilizing",
|
1505 |
+
"stigmatisation": "stigmatization",
|
1506 |
+
"stigmatise": "stigmatize",
|
1507 |
+
"stigmatised": "stigmatized",
|
1508 |
+
"stigmatises": "stigmatizes",
|
1509 |
+
"stigmatising": "stigmatizing",
|
1510 |
+
"storey": "story",
|
1511 |
+
"storeys": "stories",
|
1512 |
+
"subsidisation": "subsidization",
|
1513 |
+
"subsidise": "subsidize",
|
1514 |
+
"subsidised": "subsidized",
|
1515 |
+
"subsidiser": "subsidizer",
|
1516 |
+
"subsidisers": "subsidizers",
|
1517 |
+
"subsidises": "subsidizes",
|
1518 |
+
"subsidising": "subsidizing",
|
1519 |
+
"succour": "succor",
|
1520 |
+
"succoured": "succored",
|
1521 |
+
"succouring": "succoring",
|
1522 |
+
"succours": "succors",
|
1523 |
+
"sulphate": "sulfate",
|
1524 |
+
"sulphates": "sulfates",
|
1525 |
+
"sulphide": "sulfide",
|
1526 |
+
"sulphides": "sulfides",
|
1527 |
+
"sulphur": "sulfur",
|
1528 |
+
"sulphurous": "sulfurous",
|
1529 |
+
"summarise": "summarize",
|
1530 |
+
"summarised": "summarized",
|
1531 |
+
"summarises": "summarizes",
|
1532 |
+
"summarising": "summarizing",
|
1533 |
+
"swivelled": "swiveled",
|
1534 |
+
"swivelling": "swiveling",
|
1535 |
+
"symbolise": "symbolize",
|
1536 |
+
"symbolised": "symbolized",
|
1537 |
+
"symbolises": "symbolizes",
|
1538 |
+
"symbolising": "symbolizing",
|
1539 |
+
"sympathise": "sympathize",
|
1540 |
+
"sympathised": "sympathized",
|
1541 |
+
"sympathiser": "sympathizer",
|
1542 |
+
"sympathisers": "sympathizers",
|
1543 |
+
"sympathises": "sympathizes",
|
1544 |
+
"sympathising": "sympathizing",
|
1545 |
+
"synchronisation": "synchronization",
|
1546 |
+
"synchronise": "synchronize",
|
1547 |
+
"synchronised": "synchronized",
|
1548 |
+
"synchronises": "synchronizes",
|
1549 |
+
"synchronising": "synchronizing",
|
1550 |
+
"synthesise": "synthesize",
|
1551 |
+
"synthesised": "synthesized",
|
1552 |
+
"synthesiser": "synthesizer",
|
1553 |
+
"synthesisers": "synthesizers",
|
1554 |
+
"synthesises": "synthesizes",
|
1555 |
+
"synthesising": "synthesizing",
|
1556 |
+
"syphon": "siphon",
|
1557 |
+
"syphoned": "siphoned",
|
1558 |
+
"syphoning": "siphoning",
|
1559 |
+
"syphons": "siphons",
|
1560 |
+
"systematisation": "systematization",
|
1561 |
+
"systematise": "systematize",
|
1562 |
+
"systematised": "systematized",
|
1563 |
+
"systematises": "systematizes",
|
1564 |
+
"systematising": "systematizing",
|
1565 |
+
"tantalise": "tantalize",
|
1566 |
+
"tantalised": "tantalized",
|
1567 |
+
"tantalises": "tantalizes",
|
1568 |
+
"tantalising": "tantalizing",
|
1569 |
+
"tantalisingly": "tantalizingly",
|
1570 |
+
"tasselled": "tasseled",
|
1571 |
+
"technicolour": "technicolor",
|
1572 |
+
"temporise": "temporize",
|
1573 |
+
"temporised": "temporized",
|
1574 |
+
"temporises": "temporizes",
|
1575 |
+
"temporising": "temporizing",
|
1576 |
+
"tenderise": "tenderize",
|
1577 |
+
"tenderised": "tenderized",
|
1578 |
+
"tenderises": "tenderizes",
|
1579 |
+
"tenderising": "tenderizing",
|
1580 |
+
"terrorise": "terrorize",
|
1581 |
+
"terrorised": "terrorized",
|
1582 |
+
"terrorises": "terrorizes",
|
1583 |
+
"terrorising": "terrorizing",
|
1584 |
+
"theatre": "theater",
|
1585 |
+
"theatregoer": "theatergoer",
|
1586 |
+
"theatregoers": "theatergoers",
|
1587 |
+
"theatres": "theaters",
|
1588 |
+
"theorise": "theorize",
|
1589 |
+
"theorised": "theorized",
|
1590 |
+
"theorises": "theorizes",
|
1591 |
+
"theorising": "theorizing",
|
1592 |
+
"tonne": "ton",
|
1593 |
+
"tonnes": "tons",
|
1594 |
+
"towelled": "toweled",
|
1595 |
+
"towelling": "toweling",
|
1596 |
+
"toxaemia": "toxemia",
|
1597 |
+
"tranquillise": "tranquilize",
|
1598 |
+
"tranquillised": "tranquilized",
|
1599 |
+
"tranquilliser": "tranquilizer",
|
1600 |
+
"tranquillisers": "tranquilizers",
|
1601 |
+
"tranquillises": "tranquilizes",
|
1602 |
+
"tranquillising": "tranquilizing",
|
1603 |
+
"tranquillity": "tranquility",
|
1604 |
+
"tranquillize": "tranquilize",
|
1605 |
+
"tranquillized": "tranquilized",
|
1606 |
+
"tranquillizer": "tranquilizer",
|
1607 |
+
"tranquillizers": "tranquilizers",
|
1608 |
+
"tranquillizes": "tranquilizes",
|
1609 |
+
"tranquillizing": "tranquilizing",
|
1610 |
+
"tranquilly": "tranquility",
|
1611 |
+
"transistorised": "transistorized",
|
1612 |
+
"traumatise": "traumatize",
|
1613 |
+
"traumatised": "traumatized",
|
1614 |
+
"traumatises": "traumatizes",
|
1615 |
+
"traumatising": "traumatizing",
|
1616 |
+
"travelled": "traveled",
|
1617 |
+
"traveller": "traveler",
|
1618 |
+
"travellers": "travelers",
|
1619 |
+
"travelling": "traveling",
|
1620 |
+
"travelog": "travelogue",
|
1621 |
+
"travelogs": "travelogues",
|
1622 |
+
"trialled": "trialed",
|
1623 |
+
"trialling": "trialing",
|
1624 |
+
"tricolour": "tricolor",
|
1625 |
+
"tricolours": "tricolors",
|
1626 |
+
"trivialise": "trivialize",
|
1627 |
+
"trivialised": "trivialized",
|
1628 |
+
"trivialises": "trivializes",
|
1629 |
+
"trivialising": "trivializing",
|
1630 |
+
"tumour": "tumor",
|
1631 |
+
"tumours": "tumors",
|
1632 |
+
"tunnelled": "tunneled",
|
1633 |
+
"tunnelling": "tunneling",
|
1634 |
+
"tyrannise": "tyrannize",
|
1635 |
+
"tyrannised": "tyrannized",
|
1636 |
+
"tyrannises": "tyrannizes",
|
1637 |
+
"tyrannising": "tyrannizing",
|
1638 |
+
"tyre": "tire",
|
1639 |
+
"tyres": "tires",
|
1640 |
+
"unauthorised": "unauthorized",
|
1641 |
+
"uncivilised": "uncivilized",
|
1642 |
+
"underutilised": "underutilized",
|
1643 |
+
"unequalled": "unequaled",
|
1644 |
+
"unfavourable": "unfavorable",
|
1645 |
+
"unfavourably": "unfavorably",
|
1646 |
+
"unionisation": "unionization",
|
1647 |
+
"unionise": "unionize",
|
1648 |
+
"unionised": "unionized",
|
1649 |
+
"unionises": "unionizes",
|
1650 |
+
"unionising": "unionizing",
|
1651 |
+
"unorganised": "unorganized",
|
1652 |
+
"unravelled": "unraveled",
|
1653 |
+
"unravelling": "unraveling",
|
1654 |
+
"unrecognisable": "unrecognizable",
|
1655 |
+
"unrecognised": "unrecognized",
|
1656 |
+
"unrivalled": "unrivaled",
|
1657 |
+
"unsavoury": "unsavory",
|
1658 |
+
"untrammelled": "untrammeled",
|
1659 |
+
"urbanisation": "urbanization",
|
1660 |
+
"urbanise": "urbanize",
|
1661 |
+
"urbanised": "urbanized",
|
1662 |
+
"urbanises": "urbanizes",
|
1663 |
+
"urbanising": "urbanizing",
|
1664 |
+
"utilisable": "utilizable",
|
1665 |
+
"utilisation": "utilization",
|
1666 |
+
"utilise": "utilize",
|
1667 |
+
"utilised": "utilized",
|
1668 |
+
"utilises": "utilizes",
|
1669 |
+
"utilising": "utilizing",
|
1670 |
+
"valour": "valor",
|
1671 |
+
"vandalise": "vandalize",
|
1672 |
+
"vandalised": "vandalized",
|
1673 |
+
"vandalises": "vandalizes",
|
1674 |
+
"vandalising": "vandalizing",
|
1675 |
+
"vaporisation": "vaporization",
|
1676 |
+
"vaporise": "vaporize",
|
1677 |
+
"vaporised": "vaporized",
|
1678 |
+
"vaporises": "vaporizes",
|
1679 |
+
"vaporising": "vaporizing",
|
1680 |
+
"vapour": "vapor",
|
1681 |
+
"vapours": "vapors",
|
1682 |
+
"verbalise": "verbalize",
|
1683 |
+
"verbalised": "verbalized",
|
1684 |
+
"verbalises": "verbalizes",
|
1685 |
+
"verbalising": "verbalizing",
|
1686 |
+
"victimisation": "victimization",
|
1687 |
+
"victimise": "victimize",
|
1688 |
+
"victimised": "victimized",
|
1689 |
+
"victimises": "victimizes",
|
1690 |
+
"victimising": "victimizing",
|
1691 |
+
"videodisc": "videodisk",
|
1692 |
+
"videodiscs": "videodisks",
|
1693 |
+
"vigour": "vigor",
|
1694 |
+
"visualisation": "visualization",
|
1695 |
+
"visualisations": "visualizations",
|
1696 |
+
"visualise": "visualize",
|
1697 |
+
"visualised": "visualized",
|
1698 |
+
"visualises": "visualizes",
|
1699 |
+
"visualising": "visualizing",
|
1700 |
+
"vocalisation": "vocalization",
|
1701 |
+
"vocalisations": "vocalizations",
|
1702 |
+
"vocalise": "vocalize",
|
1703 |
+
"vocalised": "vocalized",
|
1704 |
+
"vocalises": "vocalizes",
|
1705 |
+
"vocalising": "vocalizing",
|
1706 |
+
"vulcanised": "vulcanized",
|
1707 |
+
"vulgarisation": "vulgarization",
|
1708 |
+
"vulgarise": "vulgarize",
|
1709 |
+
"vulgarised": "vulgarized",
|
1710 |
+
"vulgarises": "vulgarizes",
|
1711 |
+
"vulgarising": "vulgarizing",
|
1712 |
+
"waggon": "wagon",
|
1713 |
+
"waggons": "wagons",
|
1714 |
+
"watercolour": "watercolor",
|
1715 |
+
"watercolours": "watercolors",
|
1716 |
+
"weaselled": "weaseled",
|
1717 |
+
"weaselling": "weaseling",
|
1718 |
+
"westernisation": "westernization",
|
1719 |
+
"westernise": "westernize",
|
1720 |
+
"westernised": "westernized",
|
1721 |
+
"westernises": "westernizes",
|
1722 |
+
"westernising": "westernizing",
|
1723 |
+
"womanise": "womanize",
|
1724 |
+
"womanised": "womanized",
|
1725 |
+
"womaniser": "womanizer",
|
1726 |
+
"womanisers": "womanizers",
|
1727 |
+
"womanises": "womanizes",
|
1728 |
+
"womanising": "womanizing",
|
1729 |
+
"woollen": "woolen",
|
1730 |
+
"woollens": "woolens",
|
1731 |
+
"woollies": "woolies",
|
1732 |
+
"woolly": "wooly",
|
1733 |
+
"worshipped": "worshiped",
|
1734 |
+
"worshipper": "worshiper",
|
1735 |
+
"worshipping": "worshiping",
|
1736 |
+
"yodelled": "yodeled",
|
1737 |
+
"yodelling": "yodeling",
|
1738 |
+
"yoghourt": "yogurt",
|
1739 |
+
"yoghourts": "yogurts",
|
1740 |
+
"yoghurt": "yogurt",
|
1741 |
+
"yoghurts": "yogurts"
|
1742 |
+
}
|
preprocessor_config.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a5a8227f4a39bc6dd7990dfda947536795ea443f38a0f3b1795e7bf1fcc1c589
|
3 |
+
size 3055754841
|
runs/Dec20_16-48-49_DANDAN/1671526137.5930755/events.out.tfevents.1671526137.DANDAN.29004.1
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9b6c06aadfa0313931e61406a91e2b548cfca72d758a4d81ca418cfadcc53ab0
|
3 |
+
size 5862
|
runs/Dec20_16-48-49_DANDAN/events.out.tfevents.1671526137.DANDAN.29004.0
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7585198ea948eac755dd191984b60040bde39582b5fcd8daa36a96d537e749ec
|
3 |
+
size 5844
|
special_tokens_map.json
ADDED
@@ -0,0 +1,133 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"additional_special_tokens": [
|
3 |
+
"<|endoftext|>",
|
4 |
+
"<|startoftranscript|>",
|
5 |
+
"<|en|>",
|
6 |
+
"<|zh|>",
|
7 |
+
"<|de|>",
|
8 |
+
"<|es|>",
|
9 |
+
"<|ru|>",
|
10 |
+
"<|ko|>",
|
11 |
+
"<|fr|>",
|
12 |
+
"<|ja|>",
|
13 |
+
"<|pt|>",
|
14 |
+
"<|tr|>",
|
15 |
+
"<|pl|>",
|
16 |
+
"<|ca|>",
|
17 |
+
"<|nl|>",
|
18 |
+
"<|ar|>",
|
19 |
+
"<|sv|>",
|
20 |
+
"<|it|>",
|
21 |
+
"<|id|>",
|
22 |
+
"<|hi|>",
|
23 |
+
"<|fi|>",
|
24 |
+
"<|vi|>",
|
25 |
+
"<|iw|>",
|
26 |
+
"<|uk|>",
|
27 |
+
"<|el|>",
|
28 |
+
"<|ms|>",
|
29 |
+
"<|cs|>",
|
30 |
+
"<|ro|>",
|
31 |
+
"<|da|>",
|
32 |
+
"<|hu|>",
|
33 |
+
"<|ta|>",
|
34 |
+
"<|no|>",
|
35 |
+
"<|th|>",
|
36 |
+
"<|ur|>",
|
37 |
+
"<|hr|>",
|
38 |
+
"<|bg|>",
|
39 |
+
"<|lt|>",
|
40 |
+
"<|la|>",
|
41 |
+
"<|mi|>",
|
42 |
+
"<|ml|>",
|
43 |
+
"<|cy|>",
|
44 |
+
"<|sk|>",
|
45 |
+
"<|te|>",
|
46 |
+
"<|fa|>",
|
47 |
+
"<|lv|>",
|
48 |
+
"<|bn|>",
|
49 |
+
"<|sr|>",
|
50 |
+
"<|az|>",
|
51 |
+
"<|sl|>",
|
52 |
+
"<|kn|>",
|
53 |
+
"<|et|>",
|
54 |
+
"<|mk|>",
|
55 |
+
"<|br|>",
|
56 |
+
"<|eu|>",
|
57 |
+
"<|is|>",
|
58 |
+
"<|hy|>",
|
59 |
+
"<|ne|>",
|
60 |
+
"<|mn|>",
|
61 |
+
"<|bs|>",
|
62 |
+
"<|kk|>",
|
63 |
+
"<|sq|>",
|
64 |
+
"<|sw|>",
|
65 |
+
"<|gl|>",
|
66 |
+
"<|mr|>",
|
67 |
+
"<|pa|>",
|
68 |
+
"<|si|>",
|
69 |
+
"<|km|>",
|
70 |
+
"<|sn|>",
|
71 |
+
"<|yo|>",
|
72 |
+
"<|so|>",
|
73 |
+
"<|af|>",
|
74 |
+
"<|oc|>",
|
75 |
+
"<|ka|>",
|
76 |
+
"<|be|>",
|
77 |
+
"<|tg|>",
|
78 |
+
"<|sd|>",
|
79 |
+
"<|gu|>",
|
80 |
+
"<|am|>",
|
81 |
+
"<|yi|>",
|
82 |
+
"<|lo|>",
|
83 |
+
"<|uz|>",
|
84 |
+
"<|fo|>",
|
85 |
+
"<|ht|>",
|
86 |
+
"<|ps|>",
|
87 |
+
"<|tk|>",
|
88 |
+
"<|nn|>",
|
89 |
+
"<|mt|>",
|
90 |
+
"<|sa|>",
|
91 |
+
"<|lb|>",
|
92 |
+
"<|my|>",
|
93 |
+
"<|bo|>",
|
94 |
+
"<|tl|>",
|
95 |
+
"<|mg|>",
|
96 |
+
"<|as|>",
|
97 |
+
"<|tt|>",
|
98 |
+
"<|haw|>",
|
99 |
+
"<|ln|>",
|
100 |
+
"<|ha|>",
|
101 |
+
"<|ba|>",
|
102 |
+
"<|jw|>",
|
103 |
+
"<|su|>",
|
104 |
+
"<|translate|>",
|
105 |
+
"<|transcribe|>",
|
106 |
+
"<|startoflm|>",
|
107 |
+
"<|startofprev|>",
|
108 |
+
"<|nocaptions|>",
|
109 |
+
"<|notimestamps|>"
|
110 |
+
],
|
111 |
+
"bos_token": {
|
112 |
+
"content": "<|endoftext|>",
|
113 |
+
"lstrip": false,
|
114 |
+
"normalized": true,
|
115 |
+
"rstrip": false,
|
116 |
+
"single_word": false
|
117 |
+
},
|
118 |
+
"eos_token": {
|
119 |
+
"content": "<|endoftext|>",
|
120 |
+
"lstrip": false,
|
121 |
+
"normalized": true,
|
122 |
+
"rstrip": false,
|
123 |
+
"single_word": false
|
124 |
+
},
|
125 |
+
"pad_token": "<|endoftext|>",
|
126 |
+
"unk_token": {
|
127 |
+
"content": "",
|
128 |
+
"lstrip": false,
|
129 |
+
"normalized": true,
|
130 |
+
"rstrip": false,
|
131 |
+
"single_word": false
|
132 |
+
}
|
133 |
+
}
|
tokenizer_config.json
ADDED
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_bos_token": false,
|
3 |
+
"add_prefix_space": false,
|
4 |
+
"bos_token": {
|
5 |
+
"__type": "AddedToken",
|
6 |
+
"content": "<|endoftext|>",
|
7 |
+
"lstrip": false,
|
8 |
+
"normalized": true,
|
9 |
+
"rstrip": false,
|
10 |
+
"single_word": false
|
11 |
+
},
|
12 |
+
"eos_token": {
|
13 |
+
"__type": "AddedToken",
|
14 |
+
"content": "<|endoftext|>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": true,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"errors": "replace",
|
21 |
+
"model_max_length": 1024,
|
22 |
+
"name_or_path": "openai/whisper-medium",
|
23 |
+
"pad_token": null,
|
24 |
+
"processor_class": "WhisperProcessor",
|
25 |
+
"return_attention_mask": false,
|
26 |
+
"special_tokens_map_file": null,
|
27 |
+
"tokenizer_class": "WhisperTokenizer",
|
28 |
+
"unk_token": {
|
29 |
+
"__type": "AddedToken",
|
30 |
+
"content": "",
|
31 |
+
"lstrip": false,
|
32 |
+
"normalized": true,
|
33 |
+
"rstrip": false,
|
34 |
+
"single_word": false
|
35 |
+
}
|
36 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f531abeca1fda8b9546b7daee7e5878faed01d6460b74d5aa379989de3a1f334
|
3 |
+
size 3579
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|