import{s as Ma,o as ya,n as Mt}from"../chunks/scheduler.9bc65507.js";import{S as fa,i as ga,g as r,s as l,u as d,A as ja,h as o,f as t,c as n,j as I,v as u,y as m,k as J,o as T,a,w as M,d as y,t as f,x as g,m as ba,n as wa}from"../chunks/index.78c82d43.js";import{T as we}from"../chunks/Tip.87d55b76.js";import{Y as Ja}from"../chunks/Youtube.b19762b6.js";import{I as nt}from"../chunks/IconCopyLink.bedaa44d.js";import{C as $}from"../chunks/CodeBlock.48618ec2.js";import{D as Ta}from"../chunks/DocNotebookDropdown.40f7599b.js";import{F as da,M as ua}from"../chunks/Markdown.993b48ef.js";function Ua(x){let p,j,i='<a href="../model_doc/data2vec-audio">Data2VecAudio</a>, <a href="../model_doc/hubert">Hubert</a>, <a href="../model_doc/mctct">M-CTC-T</a>, <a href="../model_doc/sew">SEW</a>, <a href="../model_doc/sew-d">SEW-D</a>, <a href="../model_doc/unispeech">UniSpeech</a>, <a href="../model_doc/unispeech-sat">UniSpeechSat</a>, <a href="../model_doc/wav2vec2">Wav2Vec2</a>, <a href="../model_doc/wav2vec2-conformer">Wav2Vec2-Conformer</a>, <a href="../model_doc/wavlm">WavLM</a>';return{c(){p=ba(`The task illustrated in this tutorial is supported by the following model architectures:

`),j=r("p"),j.innerHTML=i},l(b){p=wa(b,`The task illustrated in this tutorial is supported by the following model architectures:

`),j=o(b,"P",{"data-svelte-h":!0}),m(j)!=="svelte-1xfq5e"&&(j.innerHTML=i)},m(b,w){a(b,p,w),a(b,j,w)},p:Mt,d(b){b&&(t(p),t(j))}}}function $a(x){let p,j='If you aren’t familiar with finetuning a model with the <a href="/docs/transformers/v4.33.3/en/main_classes/trainer#transformers.Trainer">Trainer</a>, take a look at the basic tutorial <a href="../training#train-with-pytorch-trainer">here</a>!';return{c(){p=r("p"),p.innerHTML=j},l(i){p=o(i,"P",{"data-svelte-h":!0}),m(p)!=="svelte-1kww4sq"&&(p.innerHTML=j)},m(i,b){a(i,p,b)},p:Mt,d(i){i&&t(p)}}}function va(x){let p,j,i,b='You’re ready to start training your model now! Load Wav2Vec2 with <a href="/docs/transformers/v4.33.3/en/model_doc/auto#transformers.AutoModelForCTC">AutoModelForCTC</a>. Specify the reduction to apply with the <code>ctc_loss_reduction</code> parameter. It is often better to use the average instead of the default summation:',w,U,X,C,B="At this point, only three steps remain:",G,R,Y='<li>Define your training hyperparameters in <a href="/docs/transformers/v4.33.3/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>. The only required parameter is <code>output_dir</code> which specifies where to save your model. You’ll push this model to the Hub by setting <code>push_to_hub=True</code> (you need to be signed in to Hugging Face to upload your model). At the end of each epoch, the <a href="/docs/transformers/v4.33.3/en/main_classes/trainer#transformers.Trainer">Trainer</a> will evaluate the WER and save the training checkpoint.</li> <li>Pass the training arguments to <a href="/docs/transformers/v4.33.3/en/main_classes/trainer#transformers.Trainer">Trainer</a> along with the model, dataset, tokenizer, data collator, and <code>compute_metrics</code> function.</li> <li>Call <a href="/docs/transformers/v4.33.3/en/main_classes/trainer#transformers.Trainer.train">train()</a> to finetune your model.</li>',Z,k,W,h,_='Once training is completed, share your model to the Hub with the <a href="/docs/transformers/v4.33.3/en/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> method so everyone can use your model:',as,V,H;return p=new we({props:{$$slots:{default:[$a]},$$scope:{ctx:x}}}),U=new $({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNUQyUyQyUyMFRyYWluaW5nQXJndW1lbnRzJTJDJTIwVHJhaW5lciUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIlMkMlMEElMjAlMjAlMjAlMjBjdGNfbG9zc19yZWR1Y3Rpb24lM0QlMjJtZWFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwcGFkX3Rva2VuX2lkJTNEcHJvY2Vzc29yLnRva2VuaXplci5wYWRfdG9rZW5faWQlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCTC, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCTC.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>,
<span class="hljs-meta">... </span>    ctc_loss_reduction=<span class="hljs-string">&quot;mean&quot;</span>,
<span class="hljs-meta">... </span>    pad_token_id=processor.tokenizer.pad_token_id,
<span class="hljs-meta">... </span>)`}}),k=new $({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX2Fzcl9taW5kX21vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMGdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDIlMkMlMEElMjAlMjAlMjAlMjBsZWFybmluZ19yYXRlJTNEMWUtNSUyQyUwQSUyMCUyMCUyMCUyMHdhcm11cF9zdGVwcyUzRDUwMCUyQyUwQSUyMCUyMCUyMCUyMG1heF9zdGVwcyUzRDIwMDAlMkMlMEElMjAlMjAlMjAlMjBncmFkaWVudF9jaGVja3BvaW50aW5nJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGZwMTYlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ3JvdXBfYnlfbGVuZ3RoJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGV2YWx1YXRpb25fc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RlcHMlM0QxMDAwJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdGVwcyUzRDEwMDAlMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMjUlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG1ldHJpY19mb3JfYmVzdF9tb2RlbCUzRCUyMndlciUyMiUyQyUwQSUyMCUyMCUyMCUyMGdyZWF0ZXJfaXNfYmV0dGVyJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBwdXNoX3RvX2h1YiUzRFRydWUlMkMlMEEpJTBBJTBBdHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0ZXN0JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVyJTNEcHJvY2Vzc29yJTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRGRhdGFfY29sbGF0b3IlMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_asr_mind_model&quot;</span>,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">8</span>,
<span class="hljs-meta">... </span>    gradient_accumulation_steps=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">1e-5</span>,
<span class="hljs-meta">... </span>    warmup_steps=<span class="hljs-number">500</span>,
<span class="hljs-meta">... </span>    max_steps=<span class="hljs-number">2000</span>,
<span class="hljs-meta">... </span>    gradient_checkpointing=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    fp16=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    group_by_length=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    evaluation_strategy=<span class="hljs-string">&quot;steps&quot;</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">8</span>,
<span class="hljs-meta">... </span>    save_steps=<span class="hljs-number">1000</span>,
<span class="hljs-meta">... </span>    eval_steps=<span class="hljs-number">1000</span>,
<span class="hljs-meta">... </span>    logging_steps=<span class="hljs-number">25</span>,
<span class="hljs-meta">... </span>    load_best_model_at_end=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    metric_for_best_model=<span class="hljs-string">&quot;wer&quot;</span>,
<span class="hljs-meta">... </span>    greater_is_better=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    push_to_hub=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=encoded_minds[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=encoded_minds[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    tokenizer=processor,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`}}),V=new $({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()'}}),{c(){d(p.$$.fragment),j=l(),i=r("p"),i.innerHTML=b,w=l(),d(U.$$.fragment),X=l(),C=r("p"),C.textContent=B,G=l(),R=r("ol"),R.innerHTML=Y,Z=l(),d(k.$$.fragment),W=l(),h=r("p"),h.innerHTML=_,as=l(),d(V.$$.fragment)},l(c){u(p.$$.fragment,c),j=n(c),i=o(c,"P",{"data-svelte-h":!0}),m(i)!=="svelte-1uhvay2"&&(i.innerHTML=b),w=n(c),u(U.$$.fragment,c),X=n(c),C=o(c,"P",{"data-svelte-h":!0}),m(C)!=="svelte-l42k0i"&&(C.textContent=B),G=n(c),R=o(c,"OL",{"data-svelte-h":!0}),m(R)!=="svelte-1750396"&&(R.innerHTML=Y),Z=n(c),u(k.$$.fragment,c),W=n(c),h=o(c,"P",{"data-svelte-h":!0}),m(h)!=="svelte-158pnaw"&&(h.innerHTML=_),as=n(c),u(V.$$.fragment,c)},m(c,v){M(p,c,v),a(c,j,v),a(c,i,v),a(c,w,v),M(U,c,v),a(c,X,v),a(c,C,v),a(c,G,v),a(c,R,v),a(c,Z,v),M(k,c,v),a(c,W,v),a(c,h,v),a(c,as,v),M(V,c,v),H=!0},p(c,v){const E={};v&2&&(E.$$scope={dirty:v,ctx:c}),p.$set(E)},i(c){H||(y(p.$$.fragment,c),y(U.$$.fragment,c),y(k.$$.fragment,c),y(V.$$.fragment,c),H=!0)},o(c){f(p.$$.fragment,c),f(U.$$.fragment,c),f(k.$$.fragment,c),f(V.$$.fragment,c),H=!1},d(c){c&&(t(j),t(i),t(w),t(X),t(C),t(G),t(R),t(Z),t(W),t(h),t(as)),g(p,c),g(U,c),g(k,c),g(V,c)}}}function _a(x){let p,j;return p=new ua({props:{$$slots:{default:[va]},$$scope:{ctx:x}}}),{c(){d(p.$$.fragment)},l(i){u(p.$$.fragment,i)},m(i,b){M(p,i,b),j=!0},p(i,b){const w={};b&2&&(w.$$scope={dirty:b,ctx:i}),p.$set(w)},i(i){j||(y(p.$$.fragment,i),j=!0)},o(i){f(p.$$.fragment,i),j=!1},d(i){g(p,i)}}}function Ca(x){let p,j='For a more in-depth example of how to finetune a model for automatic speech recognition, take a look at this blog <a href="https://huggingface.co/blog/fine-tune-wav2vec2-english" rel="nofollow">post</a> for English ASR and this <a href="https://huggingface.co/blog/fine-tune-xlsr-wav2vec2" rel="nofollow">post</a> for multilingual ASR.';return{c(){p=r("p"),p.innerHTML=j},l(i){p=o(i,"P",{"data-svelte-h":!0}),m(p)!=="svelte-1jxkvde"&&(p.innerHTML=j)},m(i,b){a(i,p,b)},p:Mt,d(i){i&&t(p)}}}function ka(x){let p,j="The transcription is decent, but it could be better! Try finetuning your model on more examples to get even better results!";return{c(){p=r("p"),p.textContent=j},l(i){p=o(i,"P",{"data-svelte-h":!0}),m(p)!=="svelte-1a2d12i"&&(p.textContent=j)},m(i,b){a(i,p,b)},p:Mt,d(i){i&&t(p)}}}function Ia(x){let p,j="Load a processor to preprocess the audio file and transcription and return the <code>input</code> as PyTorch tensors:",i,b,w,U,X="Pass your inputs to the model and return the logits:",C,B,G,R,Y="Get the predicted <code>input_ids</code> with the highest probability, and use the processor to decode the predicted <code>input_ids</code> back into text:",Z,k,W;return b=new $({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfYXNyX21pbmRfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwcHJvY2Vzc29yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_asr_mind_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = processor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`}}),B=new $({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNUQyUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfYXNyX21pbmRfbW9kZWwlMjIpJTBBd2l0aCUyMHRvcmNoLm5vX2dyYWQoKSUzQSUwQSUyMCUyMCUyMCUyMGxvZ2l0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKS5sb2dpdHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForCTC

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForCTC.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_asr_mind_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits`}}),k=new $({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFwcmVkaWN0ZWRfaWRzJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cyUyQyUyMGRpbSUzRC0xKSUwQXRyYW5zY3JpcHRpb24lMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKHByZWRpY3RlZF9pZHMpJTBBdHJhbnNjcmlwdGlvbg==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_ids = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription = processor.batch_decode(predicted_ids)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcription
[<span class="hljs-string">&#x27;I WOUL LIKE O SET UP JOINT ACOUNT WTH Y PARTNER&#x27;</span>]`}}),{c(){p=r("p"),p.innerHTML=j,i=l(),d(b.$$.fragment),w=l(),U=r("p"),U.textContent=X,C=l(),d(B.$$.fragment),G=l(),R=r("p"),R.innerHTML=Y,Z=l(),d(k.$$.fragment)},l(h){p=o(h,"P",{"data-svelte-h":!0}),m(p)!=="svelte-apwwja"&&(p.innerHTML=j),i=n(h),u(b.$$.fragment,h),w=n(h),U=o(h,"P",{"data-svelte-h":!0}),m(U)!=="svelte-1at92g"&&(U.textContent=X),C=n(h),u(B.$$.fragment,h),G=n(h),R=o(h,"P",{"data-svelte-h":!0}),m(R)!=="svelte-1hxzj8m"&&(R.innerHTML=Y),Z=n(h),u(k.$$.fragment,h)},m(h,_){a(h,p,_),a(h,i,_),M(b,h,_),a(h,w,_),a(h,U,_),a(h,C,_),M(B,h,_),a(h,G,_),a(h,R,_),a(h,Z,_),M(k,h,_),W=!0},p:Mt,i(h){W||(y(b.$$.fragment,h),y(B.$$.fragment,h),y(k.$$.fragment,h),W=!0)},o(h){f(b.$$.fragment,h),f(B.$$.fragment,h),f(k.$$.fragment,h),W=!1},d(h){h&&(t(p),t(i),t(w),t(U),t(C),t(G),t(R),t(Z)),g(b,h),g(B,h),g(k,h)}}}function xa(x){let p,j;return p=new ua({props:{$$slots:{default:[Ia]},$$scope:{ctx:x}}}),{c(){d(p.$$.fragment)},l(i){u(p.$$.fragment,i)},m(i,b){M(p,i,b),j=!0},p(i,b){const w={};b&2&&(w.$$scope={dirty:b,ctx:i}),p.$set(w)},i(i){j||(y(p.$$.fragment,i),j=!0)},o(i){f(p.$$.fragment,i),j=!1},d(i){g(p,i)}}}function Ra(x){let p,j,i,b,w,U,X,C,B,G,R="Automatic speech recognition",Y,Z,k,W,h,_,as="Automatic speech recognition (ASR) converts a speech signal to text, mapping a sequence of audio inputs to text outputs. Virtual assistants like Siri and Alexa use ASR models to help users everyday, and there are many other useful user-facing applications like live captioning and note-taking during meetings.",V,H,c="This guide will show you how to:",v,E,_e='<li>Finetune <a href="https://huggingface.co/facebook/wav2vec2-base" rel="nofollow">Wav2Vec2</a> on the <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a> dataset to transcribe audio to text.</li> <li>Use your finetuned model for inference.</li>',yt,q,ft,ls,Ce="Before you begin, make sure you have all the necessary libraries installed:",gt,ns,jt,ps,ke="We encourage you to login to your Hugging Face account so you can upload and share your model with the community. When prompted, enter your token to login:",bt,rs,wt,N,S,pt,os,Je,st,Ie="Load MInDS-14 dataset",Jt,is,xe='Start by loading a smaller subset of the <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a> dataset from the 🤗 Datasets library. This’ll give you a chance to experiment and make sure everything works before spending more time training on the full dataset.',Tt,cs,Ut,hs,Re="Split the dataset’s <code>train</code> split into a train and test set with the <code>~Dataset.train_test_split</code> method:",$t,ms,vt,ds,Ze="Then take a look at the dataset:",_t,us,Ct,Ms,We='While the dataset contains a lot of useful information, like <code>lang_id</code> and <code>english_transcription</code>, you’ll focus on the <code>audio</code> and <code>transcription</code> in this guide. Remove the other columns with the <a href="https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.remove_columns" rel="nofollow">remove_columns</a> method:',kt,ys,It,fs,Ge="Take a look at the example again:",xt,gs,Rt,js,Be="There are two fields:",Zt,bs,Xe="<li><code>audio</code>: a 1-dimensional <code>array</code> of the speech signal that must be called to load and resample the audio file.</li> <li><code>transcription</code>: the target text.</li>",Wt,A,L,rt,ws,Te,tt,Ve="Preprocess",Gt,Js,He="The next step is to load a Wav2Vec2 processor to process the audio signal:",Bt,Ts,Xt,Us,Ye='The MInDS-14 dataset has a sampling rate of 8000kHz (you can find this information in its <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">dataset card</a>), which means you’ll need to resample the dataset to 16000kHz to use the pretrained Wav2Vec2 model:',Vt,$s,Ht,vs,Ee="As you can see in the <code>transcription</code> above, the text contains a mix of upper and lowercase characters. The Wav2Vec2 tokenizer is only trained on uppercase characters so you’ll need to make sure the text matches the tokenizer’s vocabulary:",Yt,_s,Et,Cs,Ne="Now create a preprocessing function that:",Nt,ks,Ae="<li>Calls the <code>audio</code> column to load and resample the audio file.</li> <li>Extracts the <code>input_values</code> from the audio file and tokenize the <code>transcription</code> column with the processor.</li>",At,Is,Qt,xs,Qe='To apply the preprocessing function over the entire dataset, use 🤗 Datasets <a href="https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.map" rel="nofollow">map</a> function. You can speed up <code>map</code> by increasing the number of processes with the <code>num_proc</code> parameter. Remove the columns you don’t need with the <a href="https://huggingface.co/docs/datasets/v2.14.5/en/package_reference/main_classes#datasets.Dataset.remove_columns" rel="nofollow">remove_columns</a> method:',zt,Rs,Ft,Zs,ze='🤗 Transformers doesn’t have a data collator for ASR, so you’ll need to adapt the <a href="/docs/transformers/v4.33.3/en/main_classes/data_collator#transformers.DataCollatorWithPadding">DataCollatorWithPadding</a> to create a batch of examples. It’ll also dynamically pad your text and labels to the length of the longest element in its batch (instead of the entire dataset) so they are a uniform length. While it is possible to pad your text in the <code>tokenizer</code> function by setting <code>padding=True</code>, dynamic padding is more efficient.',qt,Ws,Fe="Unlike other data collators, this specific data collator needs to apply a different padding method to <code>input_values</code> and <code>labels</code>:",St,Gs,Lt,Bs,qe="Now instantiate your <code>DataCollatorForCTCWithPadding</code>:",Pt,Xs,Dt,Q,P,ot,Vs,Ue,et,Se="Evaluate",Kt,Hs,Le='Including a metric during training is often helpful for evaluating your model’s performance. You can quickly load a evaluation method with the 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> library. For this task, load the <a href="https://huggingface.co/spaces/evaluate-metric/wer" rel="nofollow">word error rate</a> (WER) metric (see the 🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">quick tour</a> to learn more about how to load and compute a metric):',Ot,Ys,se,Es,Pe='Then create a function that passes your predictions and labels to <a href="https://huggingface.co/docs/evaluate/v0.4.0/en/package_reference/main_classes#evaluate.EvaluationModule.compute" rel="nofollow">compute</a> to calculate the WER:',te,Ns,ee,As,De="Your <code>compute_metrics</code> function is ready to go now, and you’ll return to it when you setup your training.",ae,z,D,it,Qs,$e,at,Ke="Train",le,K,ne,O,pe,F,ss,ct,zs,ve,lt,Oe="Inference",re,Fs,sa="Great, now that you’ve finetuned a model, you can use it for inference!",oe,qs,ta="Load an audio file you’d like to run inference on. Remember to resample the sampling rate of the audio file to match the sampling rate of the model if you need to!",ie,Ss,ce,Ls,ea='The simplest way to try out your finetuned model for inference is to use it in a <a href="/docs/transformers/v4.33.3/en/main_classes/pipelines#transformers.pipeline">pipeline()</a>. Instantiate a <code>pipeline</code> for automatic speech recognition with your model, and pass your audio file to it:',he,Ps,me,ts,de,Ds,aa="You can also manually replicate the results of the <code>pipeline</code> if you’d like:",ue,es,Me,ht,ye;return C=new nt({}),Z=new Ta({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/asr.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/asr.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/asr.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/asr.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/asr.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/asr.ipynb"}]}}),W=new Ja({props:{id:"TksaY_FDgnk"}}),q=new we({props:{$$slots:{default:[Ua]},$$scope:{ctx:x}}}),ns=new $({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGUlMjBqaXdlcg==",highlighted:"pip install transformers datasets evaluate jiwer"}}),rs=new $({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_login()`}}),os=new nt({}),cs=new $({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEFtaW5kcyUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJQb2x5QUklMkZtaW5kczE0JTIyJTJDJTIwbmFtZSUzRCUyMmVuLVVTJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiU1QiUzQTEwMCU1RCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-meta">&gt;&gt;&gt; </span>minds = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, name=<span class="hljs-string">&quot;en-US&quot;</span>, split=<span class="hljs-string">&quot;train[:100]&quot;</span>)`}}),ms=new $({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy50cmFpbl90ZXN0X3NwbGl0KHRlc3Rfc2l6ZSUzRDAuMik=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.train_test_split(test_size=<span class="hljs-number">0.2</span>)'}}),us=new $({props:{code:"bWluZHM=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds
DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;audio&#x27;</span>, <span class="hljs-string">&#x27;transcription&#x27;</span>, <span class="hljs-string">&#x27;english_transcription&#x27;</span>, <span class="hljs-string">&#x27;intent_class&#x27;</span>, <span class="hljs-string">&#x27;lang_id&#x27;</span>],
        num_rows: <span class="hljs-number">16</span>
    })
    test: Dataset({
        features: [<span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;audio&#x27;</span>, <span class="hljs-string">&#x27;transcription&#x27;</span>, <span class="hljs-string">&#x27;english_transcription&#x27;</span>, <span class="hljs-string">&#x27;intent_class&#x27;</span>, <span class="hljs-string">&#x27;lang_id&#x27;</span>],
        num_rows: <span class="hljs-number">4</span>
    })
})`}}),ys=new $({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy5yZW1vdmVfY29sdW1ucyglNUIlMjJlbmdsaXNoX3RyYW5zY3JpcHRpb24lMjIlMkMlMjAlMjJpbnRlbnRfY2xhc3MlMjIlMkMlMjAlMjJsYW5nX2lkJTIyJTVEKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.remove_columns([<span class="hljs-string">&quot;english_transcription&quot;</span>, <span class="hljs-string">&quot;intent_class&quot;</span>, <span class="hljs-string">&quot;lang_id&quot;</span>])'}}),gs=new $({props:{code:"bWluZHMlNUIlMjJ0cmFpbiUyMiU1RCU1QjAlNUQ=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;audio&#x27;</span>: {<span class="hljs-string">&#x27;array&#x27;</span>: array([-<span class="hljs-number">0.00024414</span>,  <span class="hljs-number">0.</span>        ,  <span class="hljs-number">0.</span>        , ...,  <span class="hljs-number">0.00024414</span>,
          <span class="hljs-number">0.00024414</span>,  <span class="hljs-number">0.00024414</span>], dtype=float32),
  <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
  <span class="hljs-string">&#x27;sampling_rate&#x27;</span>: <span class="hljs-number">8000</span>},
 <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
 <span class="hljs-string">&#x27;transcription&#x27;</span>: <span class="hljs-string">&quot;hi I&#x27;m trying to use the banking app on my phone and currently my checking and savings account balance is not refreshing&quot;</span>}`}}),ws=new nt({}),Ts=new $({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Qcm9jZXNzb3IlMEElMEFwcm9jZXNzb3IlMjAlM0QlMjBBdXRvUHJvY2Vzc29yLmZyb21fcHJldHJhaW5lZCglMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoProcessor

<span class="hljs-meta">&gt;&gt;&gt; </span>processor = AutoProcessor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>)`}}),$s=new $({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy5jYXN0X2NvbHVtbiglMjJhdWRpbyUyMiUyQyUyMEF1ZGlvKHNhbXBsaW5nX3JhdGUlM0QxNl8wMDApKSUwQW1pbmRzJTVCJTIydHJhaW4lMjIlNUQlNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16_000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>minds[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;audio&#x27;</span>: {<span class="hljs-string">&#x27;array&#x27;</span>: array([-<span class="hljs-number">2.38064706e-04</span>, -<span class="hljs-number">1.58618059e-04</span>, -<span class="hljs-number">5.43987835e-06</span>, ...,
          <span class="hljs-number">2.78103951e-04</span>,  <span class="hljs-number">2.38446111e-04</span>,  <span class="hljs-number">1.18740834e-04</span>], dtype=float32),
  <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
  <span class="hljs-string">&#x27;sampling_rate&#x27;</span>: <span class="hljs-number">16000</span>},
 <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602ba9e2963e11ccd901cd4f.wav&#x27;</span>,
 <span class="hljs-string">&#x27;transcription&#x27;</span>: <span class="hljs-string">&quot;hi I&#x27;m trying to use the banking app on my phone and currently my checking and savings account balance is not refreshing&quot;</span>}`}}),_s=new $({props:{code:"ZGVmJTIwdXBwZXJjYXNlKGV4YW1wbGUpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTIydHJhbnNjcmlwdGlvbiUyMiUzQSUyMGV4YW1wbGUlNUIlMjJ0cmFuc2NyaXB0aW9uJTIyJTVELnVwcGVyKCklN0QlMEElMEElMEFtaW5kcyUyMCUzRCUyMG1pbmRzLm1hcCh1cHBlcmNhc2Up",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">uppercase</span>(<span class="hljs-params">example</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;transcription&quot;</span>: example[<span class="hljs-string">&quot;transcription&quot;</span>].upper()}


<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.<span class="hljs-built_in">map</span>(uppercase)`}}),Is=new $({props:{code:"ZGVmJTIwcHJlcGFyZV9kYXRhc2V0KGJhdGNoKSUzQSUwQSUyMCUyMCUyMCUyMGF1ZGlvJTIwJTNEJTIwYmF0Y2glNUIlMjJhdWRpbyUyMiU1RCUwQSUyMCUyMCUyMCUyMGJhdGNoJTIwJTNEJTIwcHJvY2Vzc29yKGF1ZGlvJTVCJTIyYXJyYXklMjIlNUQlMkMlMjBzYW1wbGluZ19yYXRlJTNEYXVkaW8lNUIlMjJzYW1wbGluZ19yYXRlJTIyJTVEJTJDJTIwdGV4dCUzRGJhdGNoJTVCJTIydHJhbnNjcmlwdGlvbiUyMiU1RCklMEElMjAlMjAlMjAlMjBiYXRjaCU1QiUyMmlucHV0X2xlbmd0aCUyMiU1RCUyMCUzRCUyMGxlbihiYXRjaCU1QiUyMmlucHV0X3ZhbHVlcyUyMiU1RCU1QjAlNUQpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYmF0Y2g=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">prepare_dataset</span>(<span class="hljs-params">batch</span>):
<span class="hljs-meta">... </span>    audio = batch[<span class="hljs-string">&quot;audio&quot;</span>]
<span class="hljs-meta">... </span>    batch = processor(audio[<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=audio[<span class="hljs-string">&quot;sampling_rate&quot;</span>], text=batch[<span class="hljs-string">&quot;transcription&quot;</span>])
<span class="hljs-meta">... </span>    batch[<span class="hljs-string">&quot;input_length&quot;</span>] = <span class="hljs-built_in">len</span>(batch[<span class="hljs-string">&quot;input_values&quot;</span>][<span class="hljs-number">0</span>])
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> batch`}}),Rs=new $({props:{code:"ZW5jb2RlZF9taW5kcyUyMCUzRCUyMG1pbmRzLm1hcChwcmVwYXJlX2RhdGFzZXQlMkMlMjByZW1vdmVfY29sdW1ucyUzRG1pbmRzLmNvbHVtbl9uYW1lcyU1QiUyMnRyYWluJTIyJTVEJTJDJTIwbnVtX3Byb2MlM0Q0KQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_minds = minds.<span class="hljs-built_in">map</span>(prepare_dataset, remove_columns=minds.column_names[<span class="hljs-string">&quot;train&quot;</span>], num_proc=<span class="hljs-number">4</span>)'}}),Gs=new $({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFmcm9tJTIwZGF0YWNsYXNzZXMlMjBpbXBvcnQlMjBkYXRhY2xhc3MlMkMlMjBmaWVsZCUwQWZyb20lMjB0eXBpbmclMjBpbXBvcnQlMjBBbnklMkMlMjBEaWN0JTJDJTIwTGlzdCUyQyUyME9wdGlvbmFsJTJDJTIwVW5pb24lMEElMEElMEElNDBkYXRhY2xhc3MlMEFjbGFzcyUyMERhdGFDb2xsYXRvckNUQ1dpdGhQYWRkaW5nJTNBJTBBJTIwJTIwJTIwJTIwcHJvY2Vzc29yJTNBJTIwQXV0b1Byb2Nlc3NvciUwQSUyMCUyMCUyMCUyMHBhZGRpbmclM0ElMjBVbmlvbiU1QmJvb2wlMkMlMjBzdHIlNUQlMjAlM0QlMjAlMjJsb25nZXN0JTIyJTBBJTBBJTIwJTIwJTIwJTIwZGVmJTIwX19jYWxsX18oc2VsZiUyQyUyMGZlYXR1cmVzJTNBJTIwTGlzdCU1QkRpY3QlNUJzdHIlMkMlMjBVbmlvbiU1Qkxpc3QlNUJpbnQlNUQlMkMlMjB0b3JjaC5UZW5zb3IlNUQlNUQlNUQpJTIwLSUzRSUyMERpY3QlNUJzdHIlMkMlMjB0b3JjaC5UZW5zb3IlNUQlM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBzcGxpdCUyMGlucHV0cyUyMGFuZCUyMGxhYmVscyUyMHNpbmNlJTIwdGhleSUyMGhhdmUlMjB0byUyMGJlJTIwb2YlMjBkaWZmZXJlbnQlMjBsZW5ndGhzJTIwYW5kJTIwbmVlZCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMGRpZmZlcmVudCUyMHBhZGRpbmclMjBtZXRob2RzJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwaW5wdXRfZmVhdHVyZXMlMjAlM0QlMjAlNUIlN0IlMjJpbnB1dF92YWx1ZXMlMjIlM0ElMjBmZWF0dXJlJTVCJTIyaW5wdXRfdmFsdWVzJTIyJTVEJTVCMCU1RCU3RCUyMGZvciUyMGZlYXR1cmUlMjBpbiUyMGZlYXR1cmVzJTVEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbGFiZWxfZmVhdHVyZXMlMjAlM0QlMjAlNUIlN0IlMjJpbnB1dF9pZHMlMjIlM0ElMjBmZWF0dXJlJTVCJTIybGFiZWxzJTIyJTVEJTdEJTIwZm9yJTIwZmVhdHVyZSUyMGluJTIwZmVhdHVyZXMlNUQlMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaCUyMCUzRCUyMHNlbGYucHJvY2Vzc29yLnBhZChpbnB1dF9mZWF0dXJlcyUyQyUyMHBhZGRpbmclM0RzZWxmLnBhZGRpbmclMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxhYmVsc19iYXRjaCUyMCUzRCUyMHNlbGYucHJvY2Vzc29yLnBhZChsYWJlbHMlM0RsYWJlbF9mZWF0dXJlcyUyQyUyMHBhZGRpbmclM0RzZWxmLnBhZGRpbmclMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMyUyMHJlcGxhY2UlMjBwYWRkaW5nJTIwd2l0aCUyMC0xMDAlMjB0byUyMGlnbm9yZSUyMGxvc3MlMjBjb3JyZWN0bHklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsYWJlbHMlMjAlM0QlMjBsYWJlbHNfYmF0Y2glNUIlMjJpbnB1dF9pZHMlMjIlNUQubWFza2VkX2ZpbGwobGFiZWxzX2JhdGNoLmF0dGVudGlvbl9tYXNrLm5lKDEpJTJDJTIwLTEwMCklMEElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBiYXRjaCU1QiUyMmxhYmVscyUyMiU1RCUyMCUzRCUyMGxhYmVscyUwQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGJhdGNo",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> dataclasses <span class="hljs-keyword">import</span> dataclass, field
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> typing <span class="hljs-keyword">import</span> <span class="hljs-type">Any</span>, <span class="hljs-type">Dict</span>, <span class="hljs-type">List</span>, <span class="hljs-type">Optional</span>, <span class="hljs-type">Union</span>


<span class="hljs-meta">&gt;&gt;&gt; </span>@dataclass
<span class="hljs-meta">... </span><span class="hljs-keyword">class</span> <span class="hljs-title class_">DataCollatorCTCWithPadding</span>:
<span class="hljs-meta">... </span>    processor: AutoProcessor
<span class="hljs-meta">... </span>    padding: <span class="hljs-type">Union</span>[<span class="hljs-built_in">bool</span>, <span class="hljs-built_in">str</span>] = <span class="hljs-string">&quot;longest&quot;</span>

<span class="hljs-meta">... </span>    <span class="hljs-keyword">def</span> <span class="hljs-title function_">__call__</span>(<span class="hljs-params">self, features: <span class="hljs-type">List</span>[<span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, <span class="hljs-type">Union</span>[<span class="hljs-type">List</span>[<span class="hljs-built_in">int</span>], torch.Tensor]]]</span>) -&gt; <span class="hljs-type">Dict</span>[<span class="hljs-built_in">str</span>, torch.Tensor]:
<span class="hljs-meta">... </span>        <span class="hljs-comment"># split inputs and labels since they have to be of different lengths and need</span>
<span class="hljs-meta">... </span>        <span class="hljs-comment"># different padding methods</span>
<span class="hljs-meta">... </span>        input_features = [{<span class="hljs-string">&quot;input_values&quot;</span>: feature[<span class="hljs-string">&quot;input_values&quot;</span>][<span class="hljs-number">0</span>]} <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]
<span class="hljs-meta">... </span>        label_features = [{<span class="hljs-string">&quot;input_ids&quot;</span>: feature[<span class="hljs-string">&quot;labels&quot;</span>]} <span class="hljs-keyword">for</span> feature <span class="hljs-keyword">in</span> features]

<span class="hljs-meta">... </span>        batch = self.processor.pad(input_features, padding=self.padding, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">... </span>        labels_batch = self.processor.pad(labels=label_features, padding=self.padding, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)

<span class="hljs-meta">... </span>        <span class="hljs-comment"># replace padding with -100 to ignore loss correctly</span>
<span class="hljs-meta">... </span>        labels = labels_batch[<span class="hljs-string">&quot;input_ids&quot;</span>].masked_fill(labels_batch.attention_mask.ne(<span class="hljs-number">1</span>), -<span class="hljs-number">100</span>)

<span class="hljs-meta">... </span>        batch[<span class="hljs-string">&quot;labels&quot;</span>] = labels

<span class="hljs-meta">... </span>        <span class="hljs-keyword">return</span> batch`}}),Xs=new $({props:{code:"ZGF0YV9jb2xsYXRvciUyMCUzRCUyMERhdGFDb2xsYXRvckNUQ1dpdGhQYWRkaW5nKHByb2Nlc3NvciUzRHByb2Nlc3NvciUyQyUyMHBhZGRpbmclM0QlMjJsb25nZXN0JTIyKQ==",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorCTCWithPadding(processor=processor, padding=<span class="hljs-string">&quot;longest&quot;</span>)'}}),Vs=new nt({}),Ys=new $({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEElMEF3ZXIlMjAlM0QlMjBldmFsdWF0ZS5sb2FkKCUyMndlciUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate

<span class="hljs-meta">&gt;&gt;&gt; </span>wer = evaluate.load(<span class="hljs-string">&quot;wer&quot;</span>)`}}),Ns=new $({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBJTBBZGVmJTIwY29tcHV0ZV9tZXRyaWNzKHByZWQpJTNBJTBBJTIwJTIwJTIwJTIwcHJlZF9sb2dpdHMlMjAlM0QlMjBwcmVkLnByZWRpY3Rpb25zJTBBJTIwJTIwJTIwJTIwcHJlZF9pZHMlMjAlM0QlMjBucC5hcmdtYXgocHJlZF9sb2dpdHMlMkMlMjBheGlzJTNELTEpJTBBJTBBJTIwJTIwJTIwJTIwcHJlZC5sYWJlbF9pZHMlNUJwcmVkLmxhYmVsX2lkcyUyMCUzRCUzRCUyMC0xMDAlNUQlMjAlM0QlMjBwcm9jZXNzb3IudG9rZW5pemVyLnBhZF90b2tlbl9pZCUwQSUwQSUyMCUyMCUyMCUyMHByZWRfc3RyJTIwJTNEJTIwcHJvY2Vzc29yLmJhdGNoX2RlY29kZShwcmVkX2lkcyklMEElMjAlMjAlMjAlMjBsYWJlbF9zdHIlMjAlM0QlMjBwcm9jZXNzb3IuYmF0Y2hfZGVjb2RlKHByZWQubGFiZWxfaWRzJTJDJTIwZ3JvdXBfdG9rZW5zJTNERmFsc2UpJTBBJTBBJTIwJTIwJTIwJTIwd2VyJTIwJTNEJTIwd2VyLmNvbXB1dGUocHJlZGljdGlvbnMlM0RwcmVkX3N0ciUyQyUyMHJlZmVyZW5jZXMlM0RsYWJlbF9zdHIpJTBBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwJTdCJTIyd2VyJTIyJTNBJTIwd2VyJTdE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_metrics</span>(<span class="hljs-params">pred</span>):
<span class="hljs-meta">... </span>    pred_logits = pred.predictions
<span class="hljs-meta">... </span>    pred_ids = np.argmax(pred_logits, axis=-<span class="hljs-number">1</span>)

<span class="hljs-meta">... </span>    pred.label_ids[pred.label_ids == -<span class="hljs-number">100</span>] = processor.tokenizer.pad_token_id

<span class="hljs-meta">... </span>    pred_str = processor.batch_decode(pred_ids)
<span class="hljs-meta">... </span>    label_str = processor.batch_decode(pred.label_ids, group_tokens=<span class="hljs-literal">False</span>)

<span class="hljs-meta">... </span>    wer = wer.compute(predictions=pred_str, references=label_str)

<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> {<span class="hljs-string">&quot;wer&quot;</span>: wer}`}}),Qs=new nt({}),K=new da({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[_a]},$$scope:{ctx:x}}}),O=new we({props:{$$slots:{default:[Ca]},$$scope:{ctx:x}}}),zs=new nt({}),Ss=new $({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMlBvbHlBSSUyRm1pbmRzMTQlMjIlMkMlMjAlMjJlbi1VUyUyMiUyQyUyMHNwbGl0JTNEJTIydHJhaW4lMjIpJTBBZGF0YXNldCUyMCUzRCUyMGRhdGFzZXQuY2FzdF9jb2x1bW4oJTIyYXVkaW8lMjIlMkMlMjBBdWRpbyhzYW1wbGluZ19yYXRlJTNEMTYwMDApKSUwQXNhbXBsaW5nX3JhdGUlMjAlM0QlMjBkYXRhc2V0LmZlYXR1cmVzJTVCJTIyYXVkaW8lMjIlNUQuc2FtcGxpbmdfcmF0ZSUwQWF1ZGlvX2ZpbGUlMjAlM0QlMjBkYXRhc2V0JTVCMCU1RCU1QiUyMmF1ZGlvJTIyJTVEJTVCJTIycGF0aCUyMiU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, <span class="hljs-string">&quot;en-US&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_file = dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;path&quot;</span>]`}}),Ps=new $({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBdHJhbnNjcmliZXIlMjAlM0QlMjBwaXBlbGluZSglMjJhdXRvbWF0aWMtc3BlZWNoLXJlY29nbml0aW9uJTIyJTJDJTIwbW9kZWwlM0QlMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfYXNyX21pbmRzX21vZGVsJTIyKSUwQXRyYW5zY3JpYmVyKGF1ZGlvX2ZpbGUp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>transcriber = pipeline(<span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>, model=<span class="hljs-string">&quot;stevhliu/my_awesome_asr_minds_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>transcriber(audio_file)
{<span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;I WOUD LIKE O SET UP JOINT ACOUNT WTH Y PARTNER&#x27;</span>}`}}),ts=new we({props:{$$slots:{default:[ka]},$$scope:{ctx:x}}}),es=new da({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[xa]},$$scope:{ctx:x}}}),{c(){p=r("meta"),j=l(),i=r("p"),b=l(),w=r("h1"),U=r("a"),X=r("span"),d(C.$$.fragment),B=l(),G=r("span"),G.textContent=R,Y=l(),d(Z.$$.fragment),k=l(),d(W.$$.fragment),h=l(),_=r("p"),_.textContent=as,V=l(),H=r("p"),H.textContent=c,v=l(),E=r("ol"),E.innerHTML=_e,yt=l(),d(q.$$.fragment),ft=l(),ls=r("p"),ls.textContent=Ce,gt=l(),d(ns.$$.fragment),jt=l(),ps=r("p"),ps.textContent=ke,bt=l(),d(rs.$$.fragment),wt=l(),N=r("h2"),S=r("a"),pt=r("span"),d(os.$$.fragment),Je=l(),st=r("span"),st.textContent=Ie,Jt=l(),is=r("p"),is.innerHTML=xe,Tt=l(),d(cs.$$.fragment),Ut=l(),hs=r("p"),hs.innerHTML=Re,$t=l(),d(ms.$$.fragment),vt=l(),ds=r("p"),ds.textContent=Ze,_t=l(),d(us.$$.fragment),Ct=l(),Ms=r("p"),Ms.innerHTML=We,kt=l(),d(ys.$$.fragment),It=l(),fs=r("p"),fs.textContent=Ge,xt=l(),d(gs.$$.fragment),Rt=l(),js=r("p"),js.textContent=Be,Zt=l(),bs=r("ul"),bs.innerHTML=Xe,Wt=l(),A=r("h2"),L=r("a"),rt=r("span"),d(ws.$$.fragment),Te=l(),tt=r("span"),tt.textContent=Ve,Gt=l(),Js=r("p"),Js.textContent=He,Bt=l(),d(Ts.$$.fragment),Xt=l(),Us=r("p"),Us.innerHTML=Ye,Vt=l(),d($s.$$.fragment),Ht=l(),vs=r("p"),vs.innerHTML=Ee,Yt=l(),d(_s.$$.fragment),Et=l(),Cs=r("p"),Cs.textContent=Ne,Nt=l(),ks=r("ol"),ks.innerHTML=Ae,At=l(),d(Is.$$.fragment),Qt=l(),xs=r("p"),xs.innerHTML=Qe,zt=l(),d(Rs.$$.fragment),Ft=l(),Zs=r("p"),Zs.innerHTML=ze,qt=l(),Ws=r("p"),Ws.innerHTML=Fe,St=l(),d(Gs.$$.fragment),Lt=l(),Bs=r("p"),Bs.innerHTML=qe,Pt=l(),d(Xs.$$.fragment),Dt=l(),Q=r("h2"),P=r("a"),ot=r("span"),d(Vs.$$.fragment),Ue=l(),et=r("span"),et.textContent=Se,Kt=l(),Hs=r("p"),Hs.innerHTML=Le,Ot=l(),d(Ys.$$.fragment),se=l(),Es=r("p"),Es.innerHTML=Pe,te=l(),d(Ns.$$.fragment),ee=l(),As=r("p"),As.innerHTML=De,ae=l(),z=r("h2"),D=r("a"),it=r("span"),d(Qs.$$.fragment),$e=l(),at=r("span"),at.textContent=Ke,le=l(),d(K.$$.fragment),ne=l(),d(O.$$.fragment),pe=l(),F=r("h2"),ss=r("a"),ct=r("span"),d(zs.$$.fragment),ve=l(),lt=r("span"),lt.textContent=Oe,re=l(),Fs=r("p"),Fs.textContent=sa,oe=l(),qs=r("p"),qs.textContent=ta,ie=l(),d(Ss.$$.fragment),ce=l(),Ls=r("p"),Ls.innerHTML=ea,he=l(),d(Ps.$$.fragment),me=l(),d(ts.$$.fragment),de=l(),Ds=r("p"),Ds.innerHTML=aa,ue=l(),d(es.$$.fragment),Me=l(),ht=r("p"),this.h()},l(s){const e=ja("svelte-1phssyn",document.head);p=o(e,"META",{name:!0,content:!0}),e.forEach(t),j=n(s),i=o(s,"P",{}),I(i).forEach(t),b=n(s),w=o(s,"H1",{class:!0});var Ks=I(w);U=o(Ks,"A",{id:!0,class:!0,href:!0});var mt=I(U);X=o(mt,"SPAN",{});var dt=I(X);u(C.$$.fragment,dt),dt.forEach(t),mt.forEach(t),B=n(Ks),G=o(Ks,"SPAN",{"data-svelte-h":!0}),m(G)!=="svelte-4lpwt"&&(G.textContent=R),Ks.forEach(t),Y=n(s),u(Z.$$.fragment,s),k=n(s),u(W.$$.fragment,s),h=n(s),_=o(s,"P",{"data-svelte-h":!0}),m(_)!=="svelte-jaigob"&&(_.textContent=as),V=n(s),H=o(s,"P",{"data-svelte-h":!0}),m(H)!=="svelte-1aff4p7"&&(H.textContent=c),v=n(s),E=o(s,"OL",{"data-svelte-h":!0}),m(E)!=="svelte-swvwb8"&&(E.innerHTML=_e),yt=n(s),u(q.$$.fragment,s),ft=n(s),ls=o(s,"P",{"data-svelte-h":!0}),m(ls)!=="svelte-1c9nexd"&&(ls.textContent=Ce),gt=n(s),u(ns.$$.fragment,s),jt=n(s),ps=o(s,"P",{"data-svelte-h":!0}),m(ps)!=="svelte-k76o1m"&&(ps.textContent=ke),bt=n(s),u(rs.$$.fragment,s),wt=n(s),N=o(s,"H2",{class:!0});var Os=I(N);S=o(Os,"A",{id:!0,class:!0,href:!0});var ut=I(S);pt=o(ut,"SPAN",{});var la=I(pt);u(os.$$.fragment,la),la.forEach(t),ut.forEach(t),Je=n(Os),st=o(Os,"SPAN",{"data-svelte-h":!0}),m(st)!=="svelte-sjpygq"&&(st.textContent=Ie),Os.forEach(t),Jt=n(s),is=o(s,"P",{"data-svelte-h":!0}),m(is)!=="svelte-17q5vds"&&(is.innerHTML=xe),Tt=n(s),u(cs.$$.fragment,s),Ut=n(s),hs=o(s,"P",{"data-svelte-h":!0}),m(hs)!=="svelte-1mnfdd3"&&(hs.innerHTML=Re),$t=n(s),u(ms.$$.fragment,s),vt=n(s),ds=o(s,"P",{"data-svelte-h":!0}),m(ds)!=="svelte-2twqg0"&&(ds.textContent=Ze),_t=n(s),u(us.$$.fragment,s),Ct=n(s),Ms=o(s,"P",{"data-svelte-h":!0}),m(Ms)!=="svelte-r5lg50"&&(Ms.innerHTML=We),kt=n(s),u(ys.$$.fragment,s),It=n(s),fs=o(s,"P",{"data-svelte-h":!0}),m(fs)!=="svelte-kucdg1"&&(fs.textContent=Ge),xt=n(s),u(gs.$$.fragment,s),Rt=n(s),js=o(s,"P",{"data-svelte-h":!0}),m(js)!=="svelte-bf7elb"&&(js.textContent=Be),Zt=n(s),bs=o(s,"UL",{"data-svelte-h":!0}),m(bs)!=="svelte-k1dj8f"&&(bs.innerHTML=Xe),Wt=n(s),A=o(s,"H2",{class:!0});var fe=I(A);L=o(fe,"A",{id:!0,class:!0,href:!0});var na=I(L);rt=o(na,"SPAN",{});var pa=I(rt);u(ws.$$.fragment,pa),pa.forEach(t),na.forEach(t),Te=n(fe),tt=o(fe,"SPAN",{"data-svelte-h":!0}),m(tt)!=="svelte-1cg9qj"&&(tt.textContent=Ve),fe.forEach(t),Gt=n(s),Js=o(s,"P",{"data-svelte-h":!0}),m(Js)!=="svelte-1u4mmu7"&&(Js.textContent=He),Bt=n(s),u(Ts.$$.fragment,s),Xt=n(s),Us=o(s,"P",{"data-svelte-h":!0}),m(Us)!=="svelte-yrxfgz"&&(Us.innerHTML=Ye),Vt=n(s),u($s.$$.fragment,s),Ht=n(s),vs=o(s,"P",{"data-svelte-h":!0}),m(vs)!=="svelte-w66yza"&&(vs.innerHTML=Ee),Yt=n(s),u(_s.$$.fragment,s),Et=n(s),Cs=o(s,"P",{"data-svelte-h":!0}),m(Cs)!=="svelte-8cflje"&&(Cs.textContent=Ne),Nt=n(s),ks=o(s,"OL",{"data-svelte-h":!0}),m(ks)!=="svelte-1ydcdgg"&&(ks.innerHTML=Ae),At=n(s),u(Is.$$.fragment,s),Qt=n(s),xs=o(s,"P",{"data-svelte-h":!0}),m(xs)!=="svelte-1eam6z6"&&(xs.innerHTML=Qe),zt=n(s),u(Rs.$$.fragment,s),Ft=n(s),Zs=o(s,"P",{"data-svelte-h":!0}),m(Zs)!=="svelte-3j87fz"&&(Zs.innerHTML=ze),qt=n(s),Ws=o(s,"P",{"data-svelte-h":!0}),m(Ws)!=="svelte-ik80vf"&&(Ws.innerHTML=Fe),St=n(s),u(Gs.$$.fragment,s),Lt=n(s),Bs=o(s,"P",{"data-svelte-h":!0}),m(Bs)!=="svelte-hven70"&&(Bs.innerHTML=qe),Pt=n(s),u(Xs.$$.fragment,s),Dt=n(s),Q=o(s,"H2",{class:!0});var ge=I(Q);P=o(ge,"A",{id:!0,class:!0,href:!0});var ra=I(P);ot=o(ra,"SPAN",{});var oa=I(ot);u(Vs.$$.fragment,oa),oa.forEach(t),ra.forEach(t),Ue=n(ge),et=o(ge,"SPAN",{"data-svelte-h":!0}),m(et)!=="svelte-sh8s6s"&&(et.textContent=Se),ge.forEach(t),Kt=n(s),Hs=o(s,"P",{"data-svelte-h":!0}),m(Hs)!=="svelte-od28ug"&&(Hs.innerHTML=Le),Ot=n(s),u(Ys.$$.fragment,s),se=n(s),Es=o(s,"P",{"data-svelte-h":!0}),m(Es)!=="svelte-1c1khyh"&&(Es.innerHTML=Pe),te=n(s),u(Ns.$$.fragment,s),ee=n(s),As=o(s,"P",{"data-svelte-h":!0}),m(As)!=="svelte-183aynn"&&(As.innerHTML=De),ae=n(s),z=o(s,"H2",{class:!0});var je=I(z);D=o(je,"A",{id:!0,class:!0,href:!0});var ia=I(D);it=o(ia,"SPAN",{});var ca=I(it);u(Qs.$$.fragment,ca),ca.forEach(t),ia.forEach(t),$e=n(je),at=o(je,"SPAN",{"data-svelte-h":!0}),m(at)!=="svelte-5arm0l"&&(at.textContent=Ke),je.forEach(t),le=n(s),u(K.$$.fragment,s),ne=n(s),u(O.$$.fragment,s),pe=n(s),F=o(s,"H2",{class:!0});var be=I(F);ss=o(be,"A",{id:!0,class:!0,href:!0});var ha=I(ss);ct=o(ha,"SPAN",{});var ma=I(ct);u(zs.$$.fragment,ma),ma.forEach(t),ha.forEach(t),ve=n(be),lt=o(be,"SPAN",{"data-svelte-h":!0}),m(lt)!=="svelte-199uz7g"&&(lt.textContent=Oe),be.forEach(t),re=n(s),Fs=o(s,"P",{"data-svelte-h":!0}),m(Fs)!=="svelte-633ppb"&&(Fs.textContent=sa),oe=n(s),qs=o(s,"P",{"data-svelte-h":!0}),m(qs)!=="svelte-1j24vrm"&&(qs.textContent=ta),ie=n(s),u(Ss.$$.fragment,s),ce=n(s),Ls=o(s,"P",{"data-svelte-h":!0}),m(Ls)!=="svelte-145dsg3"&&(Ls.innerHTML=ea),he=n(s),u(Ps.$$.fragment,s),me=n(s),u(ts.$$.fragment,s),de=n(s),Ds=o(s,"P",{"data-svelte-h":!0}),m(Ds)!=="svelte-1njl8vm"&&(Ds.innerHTML=aa),ue=n(s),u(es.$$.fragment,s),Me=n(s),ht=o(s,"P",{}),I(ht).forEach(t),this.h()},h(){J(p,"name","hf:doc:metadata"),J(p,"content",JSON.stringify(Za)),J(U,"id","automatic-speech-recognition"),J(U,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),J(U,"href","#automatic-speech-recognition"),J(w,"class","relative group"),J(S,"id","load-minds14-dataset"),J(S,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),J(S,"href","#load-minds14-dataset"),J(N,"class","relative group"),J(L,"id","preprocess"),J(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),J(L,"href","#preprocess"),J(A,"class","relative group"),J(P,"id","evaluate"),J(P,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),J(P,"href","#evaluate"),J(Q,"class","relative group"),J(D,"id","train"),J(D,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),J(D,"href","#train"),J(z,"class","relative group"),J(ss,"id","inference"),J(ss,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),J(ss,"href","#inference"),J(F,"class","relative group")},m(s,e){T(document.head,p),a(s,j,e),a(s,i,e),a(s,b,e),a(s,w,e),T(w,U),T(U,X),M(C,X,null),T(w,B),T(w,G),a(s,Y,e),M(Z,s,e),a(s,k,e),M(W,s,e),a(s,h,e),a(s,_,e),a(s,V,e),a(s,H,e),a(s,v,e),a(s,E,e),a(s,yt,e),M(q,s,e),a(s,ft,e),a(s,ls,e),a(s,gt,e),M(ns,s,e),a(s,jt,e),a(s,ps,e),a(s,bt,e),M(rs,s,e),a(s,wt,e),a(s,N,e),T(N,S),T(S,pt),M(os,pt,null),T(N,Je),T(N,st),a(s,Jt,e),a(s,is,e),a(s,Tt,e),M(cs,s,e),a(s,Ut,e),a(s,hs,e),a(s,$t,e),M(ms,s,e),a(s,vt,e),a(s,ds,e),a(s,_t,e),M(us,s,e),a(s,Ct,e),a(s,Ms,e),a(s,kt,e),M(ys,s,e),a(s,It,e),a(s,fs,e),a(s,xt,e),M(gs,s,e),a(s,Rt,e),a(s,js,e),a(s,Zt,e),a(s,bs,e),a(s,Wt,e),a(s,A,e),T(A,L),T(L,rt),M(ws,rt,null),T(A,Te),T(A,tt),a(s,Gt,e),a(s,Js,e),a(s,Bt,e),M(Ts,s,e),a(s,Xt,e),a(s,Us,e),a(s,Vt,e),M($s,s,e),a(s,Ht,e),a(s,vs,e),a(s,Yt,e),M(_s,s,e),a(s,Et,e),a(s,Cs,e),a(s,Nt,e),a(s,ks,e),a(s,At,e),M(Is,s,e),a(s,Qt,e),a(s,xs,e),a(s,zt,e),M(Rs,s,e),a(s,Ft,e),a(s,Zs,e),a(s,qt,e),a(s,Ws,e),a(s,St,e),M(Gs,s,e),a(s,Lt,e),a(s,Bs,e),a(s,Pt,e),M(Xs,s,e),a(s,Dt,e),a(s,Q,e),T(Q,P),T(P,ot),M(Vs,ot,null),T(Q,Ue),T(Q,et),a(s,Kt,e),a(s,Hs,e),a(s,Ot,e),M(Ys,s,e),a(s,se,e),a(s,Es,e),a(s,te,e),M(Ns,s,e),a(s,ee,e),a(s,As,e),a(s,ae,e),a(s,z,e),T(z,D),T(D,it),M(Qs,it,null),T(z,$e),T(z,at),a(s,le,e),M(K,s,e),a(s,ne,e),M(O,s,e),a(s,pe,e),a(s,F,e),T(F,ss),T(ss,ct),M(zs,ct,null),T(F,ve),T(F,lt),a(s,re,e),a(s,Fs,e),a(s,oe,e),a(s,qs,e),a(s,ie,e),M(Ss,s,e),a(s,ce,e),a(s,Ls,e),a(s,he,e),M(Ps,s,e),a(s,me,e),M(ts,s,e),a(s,de,e),a(s,Ds,e),a(s,ue,e),M(es,s,e),a(s,Me,e),a(s,ht,e),ye=!0},p(s,[e]){const Ks={};e&2&&(Ks.$$scope={dirty:e,ctx:s}),q.$set(Ks);const mt={};e&2&&(mt.$$scope={dirty:e,ctx:s}),K.$set(mt);const dt={};e&2&&(dt.$$scope={dirty:e,ctx:s}),O.$set(dt);const Os={};e&2&&(Os.$$scope={dirty:e,ctx:s}),ts.$set(Os);const ut={};e&2&&(ut.$$scope={dirty:e,ctx:s}),es.$set(ut)},i(s){ye||(y(C.$$.fragment,s),y(Z.$$.fragment,s),y(W.$$.fragment,s),y(q.$$.fragment,s),y(ns.$$.fragment,s),y(rs.$$.fragment,s),y(os.$$.fragment,s),y(cs.$$.fragment,s),y(ms.$$.fragment,s),y(us.$$.fragment,s),y(ys.$$.fragment,s),y(gs.$$.fragment,s),y(ws.$$.fragment,s),y(Ts.$$.fragment,s),y($s.$$.fragment,s),y(_s.$$.fragment,s),y(Is.$$.fragment,s),y(Rs.$$.fragment,s),y(Gs.$$.fragment,s),y(Xs.$$.fragment,s),y(Vs.$$.fragment,s),y(Ys.$$.fragment,s),y(Ns.$$.fragment,s),y(Qs.$$.fragment,s),y(K.$$.fragment,s),y(O.$$.fragment,s),y(zs.$$.fragment,s),y(Ss.$$.fragment,s),y(Ps.$$.fragment,s),y(ts.$$.fragment,s),y(es.$$.fragment,s),ye=!0)},o(s){f(C.$$.fragment,s),f(Z.$$.fragment,s),f(W.$$.fragment,s),f(q.$$.fragment,s),f(ns.$$.fragment,s),f(rs.$$.fragment,s),f(os.$$.fragment,s),f(cs.$$.fragment,s),f(ms.$$.fragment,s),f(us.$$.fragment,s),f(ys.$$.fragment,s),f(gs.$$.fragment,s),f(ws.$$.fragment,s),f(Ts.$$.fragment,s),f($s.$$.fragment,s),f(_s.$$.fragment,s),f(Is.$$.fragment,s),f(Rs.$$.fragment,s),f(Gs.$$.fragment,s),f(Xs.$$.fragment,s),f(Vs.$$.fragment,s),f(Ys.$$.fragment,s),f(Ns.$$.fragment,s),f(Qs.$$.fragment,s),f(K.$$.fragment,s),f(O.$$.fragment,s),f(zs.$$.fragment,s),f(Ss.$$.fragment,s),f(Ps.$$.fragment,s),f(ts.$$.fragment,s),f(es.$$.fragment,s),ye=!1},d(s){s&&(t(j),t(i),t(b),t(w),t(Y),t(k),t(h),t(_),t(V),t(H),t(v),t(E),t(yt),t(ft),t(ls),t(gt),t(jt),t(ps),t(bt),t(wt),t(N),t(Jt),t(is),t(Tt),t(Ut),t(hs),t($t),t(vt),t(ds),t(_t),t(Ct),t(Ms),t(kt),t(It),t(fs),t(xt),t(Rt),t(js),t(Zt),t(bs),t(Wt),t(A),t(Gt),t(Js),t(Bt),t(Xt),t(Us),t(Vt),t(Ht),t(vs),t(Yt),t(Et),t(Cs),t(Nt),t(ks),t(At),t(Qt),t(xs),t(zt),t(Ft),t(Zs),t(qt),t(Ws),t(St),t(Lt),t(Bs),t(Pt),t(Dt),t(Q),t(Kt),t(Hs),t(Ot),t(se),t(Es),t(te),t(ee),t(As),t(ae),t(z),t(le),t(ne),t(pe),t(F),t(re),t(Fs),t(oe),t(qs),t(ie),t(ce),t(Ls),t(he),t(me),t(de),t(Ds),t(ue),t(Me),t(ht)),t(p),g(C),g(Z,s),g(W,s),g(q,s),g(ns,s),g(rs,s),g(os),g(cs,s),g(ms,s),g(us,s),g(ys,s),g(gs,s),g(ws),g(Ts,s),g($s,s),g(_s,s),g(Is,s),g(Rs,s),g(Gs,s),g(Xs,s),g(Vs),g(Ys,s),g(Ns,s),g(Qs),g(K,s),g(O,s),g(zs),g(Ss,s),g(Ps,s),g(ts,s),g(es,s)}}}const Za={local:"automatic-speech-recognition",sections:[{local:"load-minds14-dataset",title:"Load MInDS-14 dataset"},{local:"preprocess",title:"Preprocess"},{local:"evaluate",title:"Evaluate"},{local:"train",title:"Train"},{local:"inference",title:"Inference"}],title:"Automatic speech recognition"};function Wa(x){return ya(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Aa extends fa{constructor(p){super(),ga(this,p,Wa,Ra,Ma,{})}}export{Aa as component};
