import{s as ba,o as wa,n as Ys}from"../chunks/scheduler.25b97de1.js";import{S as Ua,i as Ta,g as m,s as n,r as M,A as $a,h as o,f as a,c as p,j as ua,u as h,x as g,k as ga,y as Ca,a as l,v as d,d as y,t as j,w as u}from"../chunks/index.d9030fc9.js";import{T as zt}from"../chunks/Tip.baa67368.js";import{Y as _a}from"../chunks/Youtube.eaf1a617.js";import{C as w}from"../chunks/CodeBlock.b38ef023.js";import{D as Ia}from"../chunks/DocNotebookDropdown.e33c1a4f.js";import{F as fa,M as Ja}from"../chunks/Markdown.d8c1b6cc.js";import{H as Xs,E as Za}from"../chunks/index.676ef4be.js";function Ra(I){let e,f='如果您想查看所有与本任务兼容的架构和检查点，最好查看<a href="https://huggingface.co/tasks/automatic-speech-recognition" rel="nofollow">任务页</a>。';return{c(){e=m("p"),e.innerHTML=f},l(c){e=o(c,"P",{"data-svelte-h":!0}),g(e)!=="svelte-1sxjcl1"&&(e.innerHTML=f)},m(c,J){l(c,e,J)},p:Ys,d(c){c&&a(e)}}}function va(I){let e,f='如果您不熟悉使用<code>Trainer</code>微调模型，请查看这里的基本教程<a href="../training#train-with-pytorch-trainer">here</a>！';return{c(){e=m("p"),e.innerHTML=f},l(c){e=o(c,"P",{"data-svelte-h":!0}),g(e)!=="svelte-bisjpu"&&(e.innerHTML=f)},m(c,J){l(c,e,J)},p:Ys,d(c){c&&a(e)}}}function ka(I){let e,f,c,J=`现在您已经准备好开始训练您的模型了！使用 <code>AutoModelForCTC</code> 加载 Wav2Vec2。
使用 <code>ctc_loss_reduction</code> 参数指定要应用的减少方式。通常最好使用平均值而不是默认的求和：`,U,_,v,R,Z="此时，只剩下 3 个步骤：",k,T,X=`<li>在 <code>TrainingArguments</code> 中定义您的训练参数。唯一必需的参数是 <code>output_dir</code>，用于指定保存模型的位置。
您可以通过设置 <code>push_to_hub=True</code> 将此模型推送到 Hub（您需要登录到 Hugging Face 才能上传您的模型）。
在每个 epoch 结束时，<code>Trainer</code> 将评估 WER 并保存训练检查点。</li> <li>将训练参数与模型、数据集、分词器、数据整理器和 <code>compute_metrics</code> 函数一起传递给 <code>Trainer</code>。</li> <li>调用 <code>train()</code> 来微调您的模型。</li>`,W,$,x,i,C="训练完成后，使用 <code>push_to_hub()</code> 方法将您的模型分享到 Hub，方便大家使用您的模型：",N,B,G;return e=new zt({props:{$$slots:{default:[va]},$$scope:{ctx:I}}}),_=new w({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckNUQyUyQyUyMFRyYWluaW5nQXJndW1lbnRzJTJDJTIwVHJhaW5lciUwQSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQ1RDLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJmYWNlYm9vayUyRndhdjJ2ZWMyLWJhc2UlMjIlMkMlMEElMjAlMjAlMjAlMjBjdGNfbG9zc19yZWR1Y3Rpb24lM0QlMjJtZWFuJTIyJTJDJTBBJTIwJTIwJTIwJTIwcGFkX3Rva2VuX2lkJTNEcHJvY2Vzc29yLnRva2VuaXplci5wYWRfdG9rZW5faWQlMkM=",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,
)`,wrap:!1}}),$=new w({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX2Fzcl9taW5kX21vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMGdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDIlMkMlMEElMjAlMjAlMjAlMjBsZWFybmluZ19yYXRlJTNEMWUtNSUyQyUwQSUyMCUyMCUyMCUyMHdhcm11cF9zdGVwcyUzRDUwMCUyQyUwQSUyMCUyMCUyMCUyMG1heF9zdGVwcyUzRDIwMDAlMkMlMEElMjAlMjAlMjAlMjBncmFkaWVudF9jaGVja3BvaW50aW5nJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGZwMTYlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ3JvdXBfYnlfbGVuZ3RoJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RlcHMlM0QxMDAwJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdGVwcyUzRDEwMDAlMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMjUlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG1ldHJpY19mb3JfYmVzdF9tb2RlbCUzRCUyMndlciUyMiUyQyUwQSUyMCUyMCUyMCUyMGdyZWF0ZXJfaXNfYmV0dGVyJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBwdXNoX3RvX2h1YiUzRFRydWUlMkMlMEEpJTBBJTBBdHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0ZXN0JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwcHJvY2Vzc2luZ19jbGFzcyUzRHByb2Nlc3NvciUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBJTIwJTIwJTIwJTIwY29tcHV0ZV9tZXRyaWNzJTNEY29tcHV0ZV9tZXRyaWNzJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",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>    eval_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>    processing_class=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()`,wrap:!1}}),B=new w({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){M(e.$$.fragment),f=n(),c=m("p"),c.innerHTML=J,U=n(),M(_.$$.fragment),v=n(),R=m("p"),R.textContent=Z,k=n(),T=m("ol"),T.innerHTML=X,W=n(),M($.$$.fragment),x=n(),i=m("p"),i.innerHTML=C,N=n(),M(B.$$.fragment)},l(r){h(e.$$.fragment,r),f=p(r),c=o(r,"P",{"data-svelte-h":!0}),g(c)!=="svelte-1i9mog3"&&(c.innerHTML=J),U=p(r),h(_.$$.fragment,r),v=p(r),R=o(r,"P",{"data-svelte-h":!0}),g(R)!=="svelte-1vzgb2k"&&(R.textContent=Z),k=p(r),T=o(r,"OL",{"data-svelte-h":!0}),g(T)!=="svelte-o2regg"&&(T.innerHTML=X),W=p(r),h($.$$.fragment,r),x=p(r),i=o(r,"P",{"data-svelte-h":!0}),g(i)!=="svelte-10tsnqb"&&(i.innerHTML=C),N=p(r),h(B.$$.fragment,r)},m(r,b){d(e,r,b),l(r,f,b),l(r,c,b),l(r,U,b),d(_,r,b),l(r,v,b),l(r,R,b),l(r,k,b),l(r,T,b),l(r,W,b),d($,r,b),l(r,x,b),l(r,i,b),l(r,N,b),d(B,r,b),G=!0},p(r,b){const Vs={};b&2&&(Vs.$$scope={dirty:b,ctx:r}),e.$set(Vs)},i(r){G||(y(e.$$.fragment,r),y(_.$$.fragment,r),y($.$$.fragment,r),y(B.$$.fragment,r),G=!0)},o(r){j(e.$$.fragment,r),j(_.$$.fragment,r),j($.$$.fragment,r),j(B.$$.fragment,r),G=!1},d(r){r&&(a(f),a(c),a(U),a(v),a(R),a(k),a(T),a(W),a(x),a(i),a(N)),u(e,r),u(_,r),u($,r),u(B,r)}}}function Wa(I){let e,f;return e=new Ja({props:{$$slots:{default:[ka]},$$scope:{ctx:I}}}),{c(){M(e.$$.fragment)},l(c){h(e.$$.fragment,c)},m(c,J){d(e,c,J),f=!0},p(c,J){const U={};J&2&&(U.$$scope={dirty:J,ctx:c}),e.$set(U)},i(c){f||(y(e.$$.fragment,c),f=!0)},o(c){j(e.$$.fragment,c),f=!1},d(c){u(e,c)}}}function Ga(I){let e,f=`要深入了解如何微调模型进行自动语音识别，
请查看这篇博客<a href="https://huggingface.co/blog/fine-tune-wav2vec2-english" rel="nofollow">文章</a>以了解英语 ASR，
还可以参阅<a href="https://huggingface.co/blog/fine-tune-xlsr-wav2vec2" rel="nofollow">这篇文章</a>以了解多语言 ASR。`;return{c(){e=m("p"),e.innerHTML=f},l(c){e=o(c,"P",{"data-svelte-h":!0}),g(e)!=="svelte-1wfwd7q"&&(e.innerHTML=f)},m(c,J){l(c,e,J)},p:Ys,d(c){c&&a(e)}}}function xa(I){let e,f="转录结果还不错，但可以更好！尝试用更多示例微调您的模型，以获得更好的结果！";return{c(){e=m("p"),e.textContent=f},l(c){e=o(c,"P",{"data-svelte-h":!0}),g(e)!=="svelte-1bd4l8u"&&(e.textContent=f)},m(c,J){l(c,e,J)},p:Ys,d(c){c&&a(e)}}}function Ba(I){let e,f="加载一个处理器来预处理音频文件和转录，并将 <code>input</code> 返回为 PyTorch 张量：",c,J,U,_,v="将您的输入传递给模型并返回 logits：",R,Z,k,T,X="获取具有最高概率的预测 <code>input_ids</code>，并使用处理器将预测的 <code>input_ids</code> 解码回文本：",W,$,x;return J=new w({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>)`,wrap:!1}}),Z=new w({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`,wrap:!1}}),$=new w({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>]`,wrap:!1}}),{c(){e=m("p"),e.innerHTML=f,c=n(),M(J.$$.fragment),U=n(),_=m("p"),_.textContent=v,R=n(),M(Z.$$.fragment),k=n(),T=m("p"),T.innerHTML=X,W=n(),M($.$$.fragment)},l(i){e=o(i,"P",{"data-svelte-h":!0}),g(e)!=="svelte-edj5mp"&&(e.innerHTML=f),c=p(i),h(J.$$.fragment,i),U=p(i),_=o(i,"P",{"data-svelte-h":!0}),g(_)!=="svelte-yh2snz"&&(_.textContent=v),R=p(i),h(Z.$$.fragment,i),k=p(i),T=o(i,"P",{"data-svelte-h":!0}),g(T)!=="svelte-dawe82"&&(T.innerHTML=X),W=p(i),h($.$$.fragment,i)},m(i,C){l(i,e,C),l(i,c,C),d(J,i,C),l(i,U,C),l(i,_,C),l(i,R,C),d(Z,i,C),l(i,k,C),l(i,T,C),l(i,W,C),d($,i,C),x=!0},p:Ys,i(i){x||(y(J.$$.fragment,i),y(Z.$$.fragment,i),y($.$$.fragment,i),x=!0)},o(i){j(J.$$.fragment,i),j(Z.$$.fragment,i),j($.$$.fragment,i),x=!1},d(i){i&&(a(e),a(c),a(U),a(_),a(R),a(k),a(T),a(W)),u(J,i),u(Z,i),u($,i)}}}function Xa(I){let e,f;return e=new Ja({props:{$$slots:{default:[Ba]},$$scope:{ctx:I}}}),{c(){M(e.$$.fragment)},l(c){h(e.$$.fragment,c)},m(c,J){d(e,c,J),f=!0},p(c,J){const U={};J&2&&(U.$$scope={dirty:J,ctx:c}),e.$set(U)},i(c){f||(y(e.$$.fragment,c),f=!0)},o(c){j(e.$$.fragment,c),f=!1},d(c){u(e,c)}}}function Va(I){let e,f,c,J,U,_,v,R,Z,k,T,X=`自动语音识别（ASR）将语音信号转换为文本，将一系列音频输入映射到文本输出。
Siri 和 Alexa 这类虚拟助手使用 ASR 模型来帮助用户日常生活，还有许多其他面向用户的有用应用，如会议实时字幕和会议纪要。`,W,$,x="本指南将向您展示如何：",i,C,N=`<li>在 <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a> 数据集上对
<a href="https://huggingface.co/facebook/wav2vec2-base" rel="nofollow">Wav2Vec2</a> 进行微调，以将音频转录为文本。</li> <li>使用微调后的模型进行推断。</li>`,B,G,r,b,Vs="在开始之前，请确保您已安装所有必要的库：",zs,Q,Ns,E,Nt=`我们鼓励您登录自己的 Hugging Face 账户，这样您就可以上传并与社区分享您的模型。
出现提示时，输入您的令牌登录：`,Qs,F,Es,A,Fs,q,Qt=`首先从🤗 Datasets 库中加载 <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a>
数据集的一个较小子集。这将让您有机会先进行实验，确保一切正常，然后再花更多时间在完整数据集上进行训练。`,As,S,qs,L,Et="使用 <code>~Dataset.train_test_split</code> 方法将数据集的 <code>train</code> 拆分为训练集和测试集：",Ss,P,Ls,D,Ft="然后看看数据集：",Ps,K,Ds,O,At=`虽然数据集包含 <code>lang_id </code>和 <code>english_transcription</code> 等许多有用的信息，但在本指南中，
您将专注于 <code>audio</code> 和 <code>transcription</code>。使用 <code>remove_columns</code> 方法删除其他列：`,Ks,ss,Os,ts,qt="再看看示例：",st,as,tt,ls,St="有 2 个字段：",at,es,Lt="<li><code>audio</code>：由语音信号形成的一维 <code>array</code>，用于加载和重新采样音频文件。</li> <li><code>transcription</code>：目标文本。</li>",lt,ns,et,ps,Pt="下一步是加载一个 Wav2Vec2 处理器来处理音频信号：",nt,cs,pt,rs,Dt=`MInDS-14 数据集的采样率为 8000kHz（您可以在其<a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">数据集卡片</a>中找到此信息），
这意味着您需要将数据集重新采样为 16000kHz 以使用预训练的 Wav2Vec2 模型：`,ct,is,rt,ms,Kt=`如您在上面的 <code>transcription</code> 中所看到的，文本包含大小写字符的混合。
Wav2Vec2 分词器仅训练了大写字符，因此您需要确保文本与分词器的词汇表匹配：`,it,os,mt,Ms,Ot="现在创建一个预处理函数，该函数应该：",ot,hs,sa="<li>调用 <code>audio</code> 列以加载和重新采样音频文件。</li> <li>从音频文件中提取 <code>input_values</code> 并使用处理器对 <code>transcription</code> 列执行 tokenizer 操作。</li>",Mt,ds,ht,ys,ta=`要在整个数据集上应用预处理函数，可以使用🤗 Datasets 的 <code>map</code> 函数。
您可以通过增加 <code>num_proc</code> 参数来加速 <code>map</code> 的处理进程数量。
使用 <code>remove_columns</code> 方法删除不需要的列：`,dt,js,yt,us,aa=`🤗 Transformers 没有用于 ASR 的数据整理器，因此您需要调整 <a href="/docs/transformers/main/zh/main_classes/data_collator#transformers.DataCollatorWithPadding">DataCollatorWithPadding</a> 来创建一个示例批次。
它还会动态地将您的文本和标签填充到其批次中最长元素的长度（而不是整个数据集），以使它们具有统一的长度。
虽然可以通过在 <code>tokenizer</code> 函数中设置 <code>padding=True</code> 来填充文本，但动态填充更有效。`,jt,gs,la="与其他数据整理器不同，这个特定的数据整理器需要对 <code>input_values</code> 和 <code>labels </code>应用不同的填充方法：",ut,fs,gt,Js,ea="现在实例化您的 <code>DataCollatorForCTCWithPadding</code>：",ft,bs,Jt,ws,bt,Us,na=`在训练过程中包含一个指标通常有助于评估模型的性能。
您可以通过🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> 库快速加载一个评估方法。
对于这个任务，加载 <a href="https://huggingface.co/spaces/evaluate-metric/wer" rel="nofollow">word error rate</a>（WER）指标
（请参阅🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">快速上手</a>以了解如何加载和计算指标）：`,wt,Ts,Ut,$s,pa="然后创建一个函数，将您的预测和标签传递给 <code>compute</code> 来计算 WER：",Tt,Cs,$t,_s,ca="您的 <code>compute_metrics</code> 函数现在已经准备就绪，当您设置好训练时将返回给此函数。",Ct,Is,_t,V,It,H,Zt,Zs,Rt,Rs,ra="很好，现在您已经微调了一个模型，您可以用它进行推断了！",vt,vs,ia="加载您想要运行推断的音频文件。请记住，如果需要，将音频文件的采样率重新采样为与模型匹配的采样率！",kt,ks,Wt,Ws,ma=`尝试使用微调后的模型进行推断的最简单方法是使用 <a href="/docs/transformers/main/zh/main_classes/pipelines#transformers.pipeline">pipeline()</a>。
使用您的模型实例化一个用于自动语音识别的 <code>pipeline</code>，并将您的音频文件传递给它：`,Gt,Gs,xt,Y,Bt,xs,oa="如果您愿意，您也可以手动复制 <code>pipeline</code> 的结果：",Xt,z,Vt,Bs,Ht,Hs,Yt;return U=new Xs({props:{title:"自动语音识别",local:"自动语音识别",headingTag:"h1"}}),v=new Ia({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/zh/asr.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/zh/pytorch/asr.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/zh/tensorflow/asr.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/zh/asr.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/zh/pytorch/asr.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/zh/tensorflow/asr.ipynb"}]}}),Z=new _a({props:{id:"TksaY_FDgnk"}}),G=new zt({props:{$$slots:{default:[Ra]},$$scope:{ctx:I}}}),Q=new w({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGUlMjBqaXdlcg==",highlighted:"pip install transformers datasets evaluate jiwer",wrap:!1}}),F=new w({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()`,wrap:!1}}),A=new Xs({props:{title:"加载 MInDS-14 数据集",local:"加载-minds-14-数据集",headingTag:"h2"}}),S=new w({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>)`,wrap:!1}}),P=new w({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>)',wrap:!1}}),K=new w({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>
    })
})`,wrap:!1}}),ss=new w({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>])',wrap:!1}}),as=new w({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>}`,wrap:!1}}),ns=new Xs({props:{title:"预处理",local:"预处理",headingTag:"h2"}}),cs=new w({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>)`,wrap:!1}}),is=new w({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>}`,wrap:!1}}),os=new w({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)`,wrap:!1}}),ds=new w({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`,wrap:!1}}),js=new w({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>)',wrap:!1}}),fs=new w({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`,wrap:!1}}),bs=new w({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>)',wrap:!1}}),ws=new Xs({props:{title:"评估",local:"评估",headingTag:"h2"}}),Ts=new w({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>)`,wrap:!1}}),Cs=new w({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}`,wrap:!1}}),Is=new Xs({props:{title:"训练",local:"训练",headingTag:"h2"}}),V=new fa({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Wa]},$$scope:{ctx:I}}}),H=new zt({props:{$$slots:{default:[Ga]},$$scope:{ctx:I}}}),Zs=new Xs({props:{title:"推断",local:"推断",headingTag:"h2"}}),ks=new w({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>]`,wrap:!1}}),Gs=new w({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>}`,wrap:!1}}),Y=new zt({props:{$$slots:{default:[xa]},$$scope:{ctx:I}}}),z=new fa({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Xa]},$$scope:{ctx:I}}}),Bs=new Za({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/zh/tasks/asr.md"}}),{c(){e=m("meta"),f=n(),c=m("p"),J=n(),M(U.$$.fragment),_=n(),M(v.$$.fragment),R=n(),M(Z.$$.fragment),k=n(),T=m("p"),T.textContent=X,W=n(),$=m("p"),$.textContent=x,i=n(),C=m("ol"),C.innerHTML=N,B=n(),M(G.$$.fragment),r=n(),b=m("p"),b.textContent=Vs,zs=n(),M(Q.$$.fragment),Ns=n(),E=m("p"),E.textContent=Nt,Qs=n(),M(F.$$.fragment),Es=n(),M(A.$$.fragment),Fs=n(),q=m("p"),q.innerHTML=Qt,As=n(),M(S.$$.fragment),qs=n(),L=m("p"),L.innerHTML=Et,Ss=n(),M(P.$$.fragment),Ls=n(),D=m("p"),D.textContent=Ft,Ps=n(),M(K.$$.fragment),Ds=n(),O=m("p"),O.innerHTML=At,Ks=n(),M(ss.$$.fragment),Os=n(),ts=m("p"),ts.textContent=qt,st=n(),M(as.$$.fragment),tt=n(),ls=m("p"),ls.textContent=St,at=n(),es=m("ul"),es.innerHTML=Lt,lt=n(),M(ns.$$.fragment),et=n(),ps=m("p"),ps.textContent=Pt,nt=n(),M(cs.$$.fragment),pt=n(),rs=m("p"),rs.innerHTML=Dt,ct=n(),M(is.$$.fragment),rt=n(),ms=m("p"),ms.innerHTML=Kt,it=n(),M(os.$$.fragment),mt=n(),Ms=m("p"),Ms.textContent=Ot,ot=n(),hs=m("ol"),hs.innerHTML=sa,Mt=n(),M(ds.$$.fragment),ht=n(),ys=m("p"),ys.innerHTML=ta,dt=n(),M(js.$$.fragment),yt=n(),us=m("p"),us.innerHTML=aa,jt=n(),gs=m("p"),gs.innerHTML=la,ut=n(),M(fs.$$.fragment),gt=n(),Js=m("p"),Js.innerHTML=ea,ft=n(),M(bs.$$.fragment),Jt=n(),M(ws.$$.fragment),bt=n(),Us=m("p"),Us.innerHTML=na,wt=n(),M(Ts.$$.fragment),Ut=n(),$s=m("p"),$s.innerHTML=pa,Tt=n(),M(Cs.$$.fragment),$t=n(),_s=m("p"),_s.innerHTML=ca,Ct=n(),M(Is.$$.fragment),_t=n(),M(V.$$.fragment),It=n(),M(H.$$.fragment),Zt=n(),M(Zs.$$.fragment),Rt=n(),Rs=m("p"),Rs.textContent=ra,vt=n(),vs=m("p"),vs.textContent=ia,kt=n(),M(ks.$$.fragment),Wt=n(),Ws=m("p"),Ws.innerHTML=ma,Gt=n(),M(Gs.$$.fragment),xt=n(),M(Y.$$.fragment),Bt=n(),xs=m("p"),xs.innerHTML=oa,Xt=n(),M(z.$$.fragment),Vt=n(),M(Bs.$$.fragment),Ht=n(),Hs=m("p"),this.h()},l(s){const t=$a("svelte-u9bgzb",document.head);e=o(t,"META",{name:!0,content:!0}),t.forEach(a),f=p(s),c=o(s,"P",{}),ua(c).forEach(a),J=p(s),h(U.$$.fragment,s),_=p(s),h(v.$$.fragment,s),R=p(s),h(Z.$$.fragment,s),k=p(s),T=o(s,"P",{"data-svelte-h":!0}),g(T)!=="svelte-1is3cg2"&&(T.textContent=X),W=p(s),$=o(s,"P",{"data-svelte-h":!0}),g($)!=="svelte-t113tb"&&($.textContent=x),i=p(s),C=o(s,"OL",{"data-svelte-h":!0}),g(C)!=="svelte-14dko6t"&&(C.innerHTML=N),B=p(s),h(G.$$.fragment,s),r=p(s),b=o(s,"P",{"data-svelte-h":!0}),g(b)!=="svelte-tatoy7"&&(b.textContent=Vs),zs=p(s),h(Q.$$.fragment,s),Ns=p(s),E=o(s,"P",{"data-svelte-h":!0}),g(E)!=="svelte-kr9h35"&&(E.textContent=Nt),Qs=p(s),h(F.$$.fragment,s),Es=p(s),h(A.$$.fragment,s),Fs=p(s),q=o(s,"P",{"data-svelte-h":!0}),g(q)!=="svelte-1rjtqvw"&&(q.innerHTML=Qt),As=p(s),h(S.$$.fragment,s),qs=p(s),L=o(s,"P",{"data-svelte-h":!0}),g(L)!=="svelte-1m5ohtx"&&(L.innerHTML=Et),Ss=p(s),h(P.$$.fragment,s),Ls=p(s),D=o(s,"P",{"data-svelte-h":!0}),g(D)!=="svelte-1n374q4"&&(D.textContent=Ft),Ps=p(s),h(K.$$.fragment,s),Ds=p(s),O=o(s,"P",{"data-svelte-h":!0}),g(O)!=="svelte-nfc1p1"&&(O.innerHTML=At),Ks=p(s),h(ss.$$.fragment,s),Os=p(s),ts=o(s,"P",{"data-svelte-h":!0}),g(ts)!=="svelte-1pkn7jo"&&(ts.textContent=qt),st=p(s),h(as.$$.fragment,s),tt=p(s),ls=o(s,"P",{"data-svelte-h":!0}),g(ls)!=="svelte-3uiz9"&&(ls.textContent=St),at=p(s),es=o(s,"UL",{"data-svelte-h":!0}),g(es)!=="svelte-1pfos8g"&&(es.innerHTML=Lt),lt=p(s),h(ns.$$.fragment,s),et=p(s),ps=o(s,"P",{"data-svelte-h":!0}),g(ps)!=="svelte-12o5whx"&&(ps.textContent=Pt),nt=p(s),h(cs.$$.fragment,s),pt=p(s),rs=o(s,"P",{"data-svelte-h":!0}),g(rs)!=="svelte-1ri3w02"&&(rs.innerHTML=Dt),ct=p(s),h(is.$$.fragment,s),rt=p(s),ms=o(s,"P",{"data-svelte-h":!0}),g(ms)!=="svelte-msrpss"&&(ms.innerHTML=Kt),it=p(s),h(os.$$.fragment,s),mt=p(s),Ms=o(s,"P",{"data-svelte-h":!0}),g(Ms)!=="svelte-xedpbt"&&(Ms.textContent=Ot),ot=p(s),hs=o(s,"OL",{"data-svelte-h":!0}),g(hs)!=="svelte-1vt1wa"&&(hs.innerHTML=sa),Mt=p(s),h(ds.$$.fragment,s),ht=p(s),ys=o(s,"P",{"data-svelte-h":!0}),g(ys)!=="svelte-1y8tefx"&&(ys.innerHTML=ta),dt=p(s),h(js.$$.fragment,s),yt=p(s),us=o(s,"P",{"data-svelte-h":!0}),g(us)!=="svelte-a75skc"&&(us.innerHTML=aa),jt=p(s),gs=o(s,"P",{"data-svelte-h":!0}),g(gs)!=="svelte-1ulir2"&&(gs.innerHTML=la),ut=p(s),h(fs.$$.fragment,s),gt=p(s),Js=o(s,"P",{"data-svelte-h":!0}),g(Js)!=="svelte-1lzy2ns"&&(Js.innerHTML=ea),ft=p(s),h(bs.$$.fragment,s),Jt=p(s),h(ws.$$.fragment,s),bt=p(s),Us=o(s,"P",{"data-svelte-h":!0}),g(Us)!=="svelte-zxn94k"&&(Us.innerHTML=na),wt=p(s),h(Ts.$$.fragment,s),Ut=p(s),$s=o(s,"P",{"data-svelte-h":!0}),g($s)!=="svelte-tcc4mm"&&($s.innerHTML=pa),Tt=p(s),h(Cs.$$.fragment,s),$t=p(s),_s=o(s,"P",{"data-svelte-h":!0}),g(_s)!=="svelte-1ka9fc6"&&(_s.innerHTML=ca),Ct=p(s),h(Is.$$.fragment,s),_t=p(s),h(V.$$.fragment,s),It=p(s),h(H.$$.fragment,s),Zt=p(s),h(Zs.$$.fragment,s),Rt=p(s),Rs=o(s,"P",{"data-svelte-h":!0}),g(Rs)!=="svelte-z5bkut"&&(Rs.textContent=ra),vt=p(s),vs=o(s,"P",{"data-svelte-h":!0}),g(vs)!=="svelte-1vriigd"&&(vs.textContent=ia),kt=p(s),h(ks.$$.fragment,s),Wt=p(s),Ws=o(s,"P",{"data-svelte-h":!0}),g(Ws)!=="svelte-1y9ko04"&&(Ws.innerHTML=ma),Gt=p(s),h(Gs.$$.fragment,s),xt=p(s),h(Y.$$.fragment,s),Bt=p(s),xs=o(s,"P",{"data-svelte-h":!0}),g(xs)!=="svelte-10au8tt"&&(xs.innerHTML=oa),Xt=p(s),h(z.$$.fragment,s),Vt=p(s),h(Bs.$$.fragment,s),Ht=p(s),Hs=o(s,"P",{}),ua(Hs).forEach(a),this.h()},h(){ga(e,"name","hf:doc:metadata"),ga(e,"content",Ha)},m(s,t){Ca(document.head,e),l(s,f,t),l(s,c,t),l(s,J,t),d(U,s,t),l(s,_,t),d(v,s,t),l(s,R,t),d(Z,s,t),l(s,k,t),l(s,T,t),l(s,W,t),l(s,$,t),l(s,i,t),l(s,C,t),l(s,B,t),d(G,s,t),l(s,r,t),l(s,b,t),l(s,zs,t),d(Q,s,t),l(s,Ns,t),l(s,E,t),l(s,Qs,t),d(F,s,t),l(s,Es,t),d(A,s,t),l(s,Fs,t),l(s,q,t),l(s,As,t),d(S,s,t),l(s,qs,t),l(s,L,t),l(s,Ss,t),d(P,s,t),l(s,Ls,t),l(s,D,t),l(s,Ps,t),d(K,s,t),l(s,Ds,t),l(s,O,t),l(s,Ks,t),d(ss,s,t),l(s,Os,t),l(s,ts,t),l(s,st,t),d(as,s,t),l(s,tt,t),l(s,ls,t),l(s,at,t),l(s,es,t),l(s,lt,t),d(ns,s,t),l(s,et,t),l(s,ps,t),l(s,nt,t),d(cs,s,t),l(s,pt,t),l(s,rs,t),l(s,ct,t),d(is,s,t),l(s,rt,t),l(s,ms,t),l(s,it,t),d(os,s,t),l(s,mt,t),l(s,Ms,t),l(s,ot,t),l(s,hs,t),l(s,Mt,t),d(ds,s,t),l(s,ht,t),l(s,ys,t),l(s,dt,t),d(js,s,t),l(s,yt,t),l(s,us,t),l(s,jt,t),l(s,gs,t),l(s,ut,t),d(fs,s,t),l(s,gt,t),l(s,Js,t),l(s,ft,t),d(bs,s,t),l(s,Jt,t),d(ws,s,t),l(s,bt,t),l(s,Us,t),l(s,wt,t),d(Ts,s,t),l(s,Ut,t),l(s,$s,t),l(s,Tt,t),d(Cs,s,t),l(s,$t,t),l(s,_s,t),l(s,Ct,t),d(Is,s,t),l(s,_t,t),d(V,s,t),l(s,It,t),d(H,s,t),l(s,Zt,t),d(Zs,s,t),l(s,Rt,t),l(s,Rs,t),l(s,vt,t),l(s,vs,t),l(s,kt,t),d(ks,s,t),l(s,Wt,t),l(s,Ws,t),l(s,Gt,t),d(Gs,s,t),l(s,xt,t),d(Y,s,t),l(s,Bt,t),l(s,xs,t),l(s,Xt,t),d(z,s,t),l(s,Vt,t),d(Bs,s,t),l(s,Ht,t),l(s,Hs,t),Yt=!0},p(s,[t]){const Ma={};t&2&&(Ma.$$scope={dirty:t,ctx:s}),G.$set(Ma);const ha={};t&2&&(ha.$$scope={dirty:t,ctx:s}),V.$set(ha);const da={};t&2&&(da.$$scope={dirty:t,ctx:s}),H.$set(da);const ya={};t&2&&(ya.$$scope={dirty:t,ctx:s}),Y.$set(ya);const ja={};t&2&&(ja.$$scope={dirty:t,ctx:s}),z.$set(ja)},i(s){Yt||(y(U.$$.fragment,s),y(v.$$.fragment,s),y(Z.$$.fragment,s),y(G.$$.fragment,s),y(Q.$$.fragment,s),y(F.$$.fragment,s),y(A.$$.fragment,s),y(S.$$.fragment,s),y(P.$$.fragment,s),y(K.$$.fragment,s),y(ss.$$.fragment,s),y(as.$$.fragment,s),y(ns.$$.fragment,s),y(cs.$$.fragment,s),y(is.$$.fragment,s),y(os.$$.fragment,s),y(ds.$$.fragment,s),y(js.$$.fragment,s),y(fs.$$.fragment,s),y(bs.$$.fragment,s),y(ws.$$.fragment,s),y(Ts.$$.fragment,s),y(Cs.$$.fragment,s),y(Is.$$.fragment,s),y(V.$$.fragment,s),y(H.$$.fragment,s),y(Zs.$$.fragment,s),y(ks.$$.fragment,s),y(Gs.$$.fragment,s),y(Y.$$.fragment,s),y(z.$$.fragment,s),y(Bs.$$.fragment,s),Yt=!0)},o(s){j(U.$$.fragment,s),j(v.$$.fragment,s),j(Z.$$.fragment,s),j(G.$$.fragment,s),j(Q.$$.fragment,s),j(F.$$.fragment,s),j(A.$$.fragment,s),j(S.$$.fragment,s),j(P.$$.fragment,s),j(K.$$.fragment,s),j(ss.$$.fragment,s),j(as.$$.fragment,s),j(ns.$$.fragment,s),j(cs.$$.fragment,s),j(is.$$.fragment,s),j(os.$$.fragment,s),j(ds.$$.fragment,s),j(js.$$.fragment,s),j(fs.$$.fragment,s),j(bs.$$.fragment,s),j(ws.$$.fragment,s),j(Ts.$$.fragment,s),j(Cs.$$.fragment,s),j(Is.$$.fragment,s),j(V.$$.fragment,s),j(H.$$.fragment,s),j(Zs.$$.fragment,s),j(ks.$$.fragment,s),j(Gs.$$.fragment,s),j(Y.$$.fragment,s),j(z.$$.fragment,s),j(Bs.$$.fragment,s),Yt=!1},d(s){s&&(a(f),a(c),a(J),a(_),a(R),a(k),a(T),a(W),a($),a(i),a(C),a(B),a(r),a(b),a(zs),a(Ns),a(E),a(Qs),a(Es),a(Fs),a(q),a(As),a(qs),a(L),a(Ss),a(Ls),a(D),a(Ps),a(Ds),a(O),a(Ks),a(Os),a(ts),a(st),a(tt),a(ls),a(at),a(es),a(lt),a(et),a(ps),a(nt),a(pt),a(rs),a(ct),a(rt),a(ms),a(it),a(mt),a(Ms),a(ot),a(hs),a(Mt),a(ht),a(ys),a(dt),a(yt),a(us),a(jt),a(gs),a(ut),a(gt),a(Js),a(ft),a(Jt),a(bt),a(Us),a(wt),a(Ut),a($s),a(Tt),a($t),a(_s),a(Ct),a(_t),a(It),a(Zt),a(Rt),a(Rs),a(vt),a(vs),a(kt),a(Wt),a(Ws),a(Gt),a(xt),a(Bt),a(xs),a(Xt),a(Vt),a(Ht),a(Hs)),a(e),u(U,s),u(v,s),u(Z,s),u(G,s),u(Q,s),u(F,s),u(A,s),u(S,s),u(P,s),u(K,s),u(ss,s),u(as,s),u(ns,s),u(cs,s),u(is,s),u(os,s),u(ds,s),u(js,s),u(fs,s),u(bs,s),u(ws,s),u(Ts,s),u(Cs,s),u(Is,s),u(V,s),u(H,s),u(Zs,s),u(ks,s),u(Gs,s),u(Y,s),u(z,s),u(Bs,s)}}}const Ha='{"title":"自动语音识别","local":"自动语音识别","sections":[{"title":"加载 MInDS-14 数据集","local":"加载-minds-14-数据集","sections":[],"depth":2},{"title":"预处理","local":"预处理","sections":[],"depth":2},{"title":"评估","local":"评估","sections":[],"depth":2},{"title":"训练","local":"训练","sections":[],"depth":2},{"title":"推断","local":"推断","sections":[],"depth":2}],"depth":1}';function Ya(I){return wa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class La extends Ua{constructor(e){super(),Ta(this,e,Ya,Va,ba,{})}}export{La as component};
