import{s as bl,o as wl,n as Ys}from"../chunks/scheduler.9991993c.js";import{S as Ul,i as Tl,g as m,s as n,r as M,A as $l,h as o,f as l,c as p,j as ul,u as h,x as g,k as gl,y as Cl,a,v as d,d as j,t as y,w as u}from"../chunks/index.7fc9a5e7.js";import{T as zt}from"../chunks/Tip.9de92fc6.js";import{Y as _l}from"../chunks/Youtube.7934cf81.js";import{C as w}from"../chunks/CodeBlock.e11cba92.js";import{D as Il}from"../chunks/DocNotebookDropdown.a0cb4c0f.js";import{F as fl,M as Jl}from"../chunks/Markdown.87f31c7e.js";import{H as Xs,E as Rl}from"../chunks/EditOnGithub.84ab7f0e.js";function Zl(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){a(c,e,J)},p:Ys,d(c){c&&l(e)}}}function vl(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){a(c,e,J)},p:Ys,d(c){c&&l(e)}}}function kl(I){let e,f,c,J=`现在您已经准备好开始训练您的模型了！使用 <code>AutoModelForCTC</code> 加载 Wav2Vec2。
使用 <code>ctc_loss_reduction</code> 参数指定要应用的减少方式。通常最好使用平均值而不是默认的求和：`,U,_,v,Z,R="此时，只剩下 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,$,G,i,C="训练完成后，使用 <code>push_to_hub()</code> 方法将您的模型分享到 Hub，方便大家使用您的模型：",N,B,x;return e=new zt({props:{$$slots:{default:[vl]},$$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:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX2Fzcl9taW5kX21vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwcGVyX2RldmljZV90cmFpbl9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMGdyYWRpZW50X2FjY3VtdWxhdGlvbl9zdGVwcyUzRDIlMkMlMEElMjAlMjAlMjAlMjBsZWFybmluZ19yYXRlJTNEMWUtNSUyQyUwQSUyMCUyMCUyMCUyMHdhcm11cF9zdGVwcyUzRDUwMCUyQyUwQSUyMCUyMCUyMCUyMG1heF9zdGVwcyUzRDIwMDAlMkMlMEElMjAlMjAlMjAlMjBncmFkaWVudF9jaGVja3BvaW50aW5nJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGZwMTYlM0RUcnVlJTJDJTBBJTIwJTIwJTIwJTIwZ3JvdXBfYnlfbGVuZ3RoJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfc3RyYXRlZ3klM0QlMjJzdGVwcyUyMiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEOCUyQyUwQSUyMCUyMCUyMCUyMHNhdmVfc3RlcHMlM0QxMDAwJTJDJTBBJTIwJTIwJTIwJTIwZXZhbF9zdGVwcyUzRDEwMDAlMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMjUlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG1ldHJpY19mb3JfYmVzdF9tb2RlbCUzRCUyMndlciUyMiUyQyUwQSUyMCUyMCUyMCUyMGdyZWF0ZXJfaXNfYmV0dGVyJTNERmFsc2UlMkMlMEElMjAlMjAlMjAlMjBwdXNoX3RvX2h1YiUzRFRydWUlMkMlMEEpJTBBJTBBdHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRGVuY29kZWRfbWluZHMlNUIlMjJ0ZXN0JTIyJTVEJTJDJTBBJTIwJTIwJTIwJTIwdG9rZW5pemVyJTNEcHJvY2Vzc29yJTJDJTBBJTIwJTIwJTIwJTIwZGF0YV9jb2xsYXRvciUzRGRhdGFfY29sbGF0b3IlMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEpJTBBJTBBdHJhaW5lci50cmFpbigp",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>    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()`,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(),Z=m("p"),Z.textContent=R,k=n(),T=m("ol"),T.innerHTML=X,W=n(),M($.$$.fragment),G=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),Z=o(r,"P",{"data-svelte-h":!0}),g(Z)!=="svelte-1vzgb2k"&&(Z.textContent=R),k=p(r),T=o(r,"OL",{"data-svelte-h":!0}),g(T)!=="svelte-o2regg"&&(T.innerHTML=X),W=p(r),h($.$$.fragment,r),G=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),a(r,f,b),a(r,c,b),a(r,U,b),d(_,r,b),a(r,v,b),a(r,Z,b),a(r,k,b),a(r,T,b),a(r,W,b),d($,r,b),a(r,G,b),a(r,i,b),a(r,N,b),d(B,r,b),x=!0},p(r,b){const Vs={};b&2&&(Vs.$$scope={dirty:b,ctx:r}),e.$set(Vs)},i(r){x||(j(e.$$.fragment,r),j(_.$$.fragment,r),j($.$$.fragment,r),j(B.$$.fragment,r),x=!0)},o(r){y(e.$$.fragment,r),y(_.$$.fragment,r),y($.$$.fragment,r),y(B.$$.fragment,r),x=!1},d(r){r&&(l(f),l(c),l(U),l(v),l(Z),l(k),l(T),l(W),l(G),l(i),l(N)),u(e,r),u(_,r),u($,r),u(B,r)}}}function Wl(I){let e,f;return e=new Jl({props:{$$slots:{default:[kl]},$$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||(j(e.$$.fragment,c),f=!0)},o(c){y(e.$$.fragment,c),f=!1},d(c){u(e,c)}}}function xl(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){a(c,e,J)},p:Ys,d(c){c&&l(e)}}}function Gl(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){a(c,e,J)},p:Ys,d(c){c&&l(e)}}}function Bl(I){let e,f="加载一个处理器来预处理音频文件和转录，并将 <code>input</code> 返回为 PyTorch 张量：",c,J,U,_,v="将您的输入传递给模型并返回 logits：",Z,R,k,T,X="获取具有最高概率的预测 <code>input_ids</code>，并使用处理器将预测的 <code>input_ids</code> 解码回文本：",W,$,G;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}}),R=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,Z=n(),M(R.$$.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),Z=p(i),h(R.$$.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){a(i,e,C),a(i,c,C),d(J,i,C),a(i,U,C),a(i,_,C),a(i,Z,C),d(R,i,C),a(i,k,C),a(i,T,C),a(i,W,C),d($,i,C),G=!0},p:Ys,i(i){G||(j(J.$$.fragment,i),j(R.$$.fragment,i),j($.$$.fragment,i),G=!0)},o(i){y(J.$$.fragment,i),y(R.$$.fragment,i),y($.$$.fragment,i),G=!1},d(i){i&&(l(e),l(c),l(U),l(_),l(Z),l(k),l(T),l(W)),u(J,i),u(R,i),u($,i)}}}function Xl(I){let e,f;return e=new Jl({props:{$$slots:{default:[Bl]},$$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||(j(e.$$.fragment,c),f=!0)},o(c){y(e.$$.fragment,c),f=!1},d(c){u(e,c)}}}function Vl(I){let e,f,c,J,U,_,v,Z,R,k,T,X=`自动语音识别（ASR）将语音信号转换为文本，将一系列音频输入映射到文本输出。
Siri 和 Alexa 这类虚拟助手使用 ASR 模型来帮助用户日常生活，还有许多其他面向用户的有用应用，如会议实时字幕和会议纪要。`,W,$,G="本指南将向您展示如何：",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,x,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,ls,tt,as,St="有 2 个字段：",lt,es,Lt="<li><code>audio</code>：由语音信号形成的一维 <code>array</code>，用于加载和重新采样音频文件。</li> <li><code>transcription</code>：目标文本。</li>",at,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,sl="<li>调用 <code>audio</code> 列以加载和重新采样音频文件。</li> <li>从音频文件中提取 <code>input_values</code> 并使用处理器对 <code>transcription</code> 列执行 tokenizer 操作。</li>",Mt,ds,ht,js,tl=`要在整个数据集上应用预处理函数，可以使用🤗 Datasets 的 <code>map</code> 函数。
您可以通过增加 <code>num_proc</code> 参数来加速 <code>map</code> 的处理进程数量。
使用 <code>remove_columns</code> 方法删除不需要的列：`,dt,ys,jt,us,ll=`🤗 Transformers 没有用于 ASR 的数据整理器，因此您需要调整 <a href="/docs/transformers/pr_30962/zh/main_classes/data_collator#transformers.DataCollatorWithPadding">DataCollatorWithPadding</a> 来创建一个示例批次。
它还会动态地将您的文本和标签填充到其批次中最长元素的长度（而不是整个数据集），以使它们具有统一的长度。
虽然可以通过在 <code>tokenizer</code> 函数中设置 <code>padding=True</code> 来填充文本，但动态填充更有效。`,yt,gs,al="与其他数据整理器不同，这个特定的数据整理器需要对 <code>input_values</code> 和 <code>labels </code>应用不同的填充方法：",ut,fs,gt,Js,el="现在实例化您的 <code>DataCollatorForCTCWithPadding</code>：",ft,bs,Jt,ws,bt,Us,nl=`在训练过程中包含一个指标通常有助于评估模型的性能。
您可以通过🤗 <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,pl="然后创建一个函数，将您的预测和标签传递给 <code>compute</code> 来计算 WER：",Tt,Cs,$t,_s,cl="您的 <code>compute_metrics</code> 函数现在已经准备就绪，当您设置好训练时将返回给此函数。",Ct,Is,_t,V,It,H,Rt,Rs,Zt,Zs,rl="很好，现在您已经微调了一个模型，您可以用它进行推断了！",vt,vs,il="加载您想要运行推断的音频文件。请记住，如果需要，将音频文件的采样率重新采样为与模型匹配的采样率！",kt,ks,Wt,Ws,ml=`尝试使用微调后的模型进行推断的最简单方法是使用 <a href="/docs/transformers/pr_30962/zh/main_classes/pipelines#transformers.pipeline">pipeline()</a>。
使用您的模型实例化一个用于自动语音识别的 <code>pipeline</code>，并将您的音频文件传递给它：`,xt,xs,Gt,Y,Bt,Gs,ol="如果您愿意，您也可以手动复制 <code>pipeline</code> 的结果：",Xt,z,Vt,Bs,Ht,Hs,Yt;return U=new Xs({props:{title:"自动语音识别",local:"自动语音识别",headingTag:"h1"}}),v=new Il({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"}]}}),R=new _l({props:{id:"TksaY_FDgnk"}}),x=new zt({props:{$$slots:{default:[Zl]},$$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}}),ls=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}}),ys=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 fl({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Wl]},$$scope:{ctx:I}}}),H=new zt({props:{$$slots:{default:[xl]},$$scope:{ctx:I}}}),Rs=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}}),xs=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:[Gl]},$$scope:{ctx:I}}}),z=new fl({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Xl]},$$scope:{ctx:I}}}),Bs=new Rl({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),Z=n(),M(R.$$.fragment),k=n(),T=m("p"),T.textContent=X,W=n(),$=m("p"),$.textContent=G,i=n(),C=m("ol"),C.innerHTML=N,B=n(),M(x.$$.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(ls.$$.fragment),tt=n(),as=m("p"),as.textContent=St,lt=n(),es=m("ul"),es.innerHTML=Lt,at=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=sl,Mt=n(),M(ds.$$.fragment),ht=n(),js=m("p"),js.innerHTML=tl,dt=n(),M(ys.$$.fragment),jt=n(),us=m("p"),us.innerHTML=ll,yt=n(),gs=m("p"),gs.innerHTML=al,ut=n(),M(fs.$$.fragment),gt=n(),Js=m("p"),Js.innerHTML=el,ft=n(),M(bs.$$.fragment),Jt=n(),M(ws.$$.fragment),bt=n(),Us=m("p"),Us.innerHTML=nl,wt=n(),M(Ts.$$.fragment),Ut=n(),$s=m("p"),$s.innerHTML=pl,Tt=n(),M(Cs.$$.fragment),$t=n(),_s=m("p"),_s.innerHTML=cl,Ct=n(),M(Is.$$.fragment),_t=n(),M(V.$$.fragment),It=n(),M(H.$$.fragment),Rt=n(),M(Rs.$$.fragment),Zt=n(),Zs=m("p"),Zs.textContent=rl,vt=n(),vs=m("p"),vs.textContent=il,kt=n(),M(ks.$$.fragment),Wt=n(),Ws=m("p"),Ws.innerHTML=ml,xt=n(),M(xs.$$.fragment),Gt=n(),M(Y.$$.fragment),Bt=n(),Gs=m("p"),Gs.innerHTML=ol,Xt=n(),M(z.$$.fragment),Vt=n(),M(Bs.$$.fragment),Ht=n(),Hs=m("p"),this.h()},l(s){const t=$l("svelte-u9bgzb",document.head);e=o(t,"META",{name:!0,content:!0}),t.forEach(l),f=p(s),c=o(s,"P",{}),ul(c).forEach(l),J=p(s),h(U.$$.fragment,s),_=p(s),h(v.$$.fragment,s),Z=p(s),h(R.$$.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=G),i=p(s),C=o(s,"OL",{"data-svelte-h":!0}),g(C)!=="svelte-14dko6t"&&(C.innerHTML=N),B=p(s),h(x.$$.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(ls.$$.fragment,s),tt=p(s),as=o(s,"P",{"data-svelte-h":!0}),g(as)!=="svelte-3uiz9"&&(as.textContent=St),lt=p(s),es=o(s,"UL",{"data-svelte-h":!0}),g(es)!=="svelte-1pfos8g"&&(es.innerHTML=Lt),at=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=sl),Mt=p(s),h(ds.$$.fragment,s),ht=p(s),js=o(s,"P",{"data-svelte-h":!0}),g(js)!=="svelte-1y8tefx"&&(js.innerHTML=tl),dt=p(s),h(ys.$$.fragment,s),jt=p(s),us=o(s,"P",{"data-svelte-h":!0}),g(us)!=="svelte-1ceu4i"&&(us.innerHTML=ll),yt=p(s),gs=o(s,"P",{"data-svelte-h":!0}),g(gs)!=="svelte-1ulir2"&&(gs.innerHTML=al),ut=p(s),h(fs.$$.fragment,s),gt=p(s),Js=o(s,"P",{"data-svelte-h":!0}),g(Js)!=="svelte-1lzy2ns"&&(Js.innerHTML=el),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=nl),wt=p(s),h(Ts.$$.fragment,s),Ut=p(s),$s=o(s,"P",{"data-svelte-h":!0}),g($s)!=="svelte-tcc4mm"&&($s.innerHTML=pl),Tt=p(s),h(Cs.$$.fragment,s),$t=p(s),_s=o(s,"P",{"data-svelte-h":!0}),g(_s)!=="svelte-1ka9fc6"&&(_s.innerHTML=cl),Ct=p(s),h(Is.$$.fragment,s),_t=p(s),h(V.$$.fragment,s),It=p(s),h(H.$$.fragment,s),Rt=p(s),h(Rs.$$.fragment,s),Zt=p(s),Zs=o(s,"P",{"data-svelte-h":!0}),g(Zs)!=="svelte-z5bkut"&&(Zs.textContent=rl),vt=p(s),vs=o(s,"P",{"data-svelte-h":!0}),g(vs)!=="svelte-1vriigd"&&(vs.textContent=il),kt=p(s),h(ks.$$.fragment,s),Wt=p(s),Ws=o(s,"P",{"data-svelte-h":!0}),g(Ws)!=="svelte-1ee5xu"&&(Ws.innerHTML=ml),xt=p(s),h(xs.$$.fragment,s),Gt=p(s),h(Y.$$.fragment,s),Bt=p(s),Gs=o(s,"P",{"data-svelte-h":!0}),g(Gs)!=="svelte-10au8tt"&&(Gs.innerHTML=ol),Xt=p(s),h(z.$$.fragment,s),Vt=p(s),h(Bs.$$.fragment,s),Ht=p(s),Hs=o(s,"P",{}),ul(Hs).forEach(l),this.h()},h(){gl(e,"name","hf:doc:metadata"),gl(e,"content",Hl)},m(s,t){Cl(document.head,e),a(s,f,t),a(s,c,t),a(s,J,t),d(U,s,t),a(s,_,t),d(v,s,t),a(s,Z,t),d(R,s,t),a(s,k,t),a(s,T,t),a(s,W,t),a(s,$,t),a(s,i,t),a(s,C,t),a(s,B,t),d(x,s,t),a(s,r,t),a(s,b,t),a(s,zs,t),d(Q,s,t),a(s,Ns,t),a(s,E,t),a(s,Qs,t),d(F,s,t),a(s,Es,t),d(A,s,t),a(s,Fs,t),a(s,q,t),a(s,As,t),d(S,s,t),a(s,qs,t),a(s,L,t),a(s,Ss,t),d(P,s,t),a(s,Ls,t),a(s,D,t),a(s,Ps,t),d(K,s,t),a(s,Ds,t),a(s,O,t),a(s,Ks,t),d(ss,s,t),a(s,Os,t),a(s,ts,t),a(s,st,t),d(ls,s,t),a(s,tt,t),a(s,as,t),a(s,lt,t),a(s,es,t),a(s,at,t),d(ns,s,t),a(s,et,t),a(s,ps,t),a(s,nt,t),d(cs,s,t),a(s,pt,t),a(s,rs,t),a(s,ct,t),d(is,s,t),a(s,rt,t),a(s,ms,t),a(s,it,t),d(os,s,t),a(s,mt,t),a(s,Ms,t),a(s,ot,t),a(s,hs,t),a(s,Mt,t),d(ds,s,t),a(s,ht,t),a(s,js,t),a(s,dt,t),d(ys,s,t),a(s,jt,t),a(s,us,t),a(s,yt,t),a(s,gs,t),a(s,ut,t),d(fs,s,t),a(s,gt,t),a(s,Js,t),a(s,ft,t),d(bs,s,t),a(s,Jt,t),d(ws,s,t),a(s,bt,t),a(s,Us,t),a(s,wt,t),d(Ts,s,t),a(s,Ut,t),a(s,$s,t),a(s,Tt,t),d(Cs,s,t),a(s,$t,t),a(s,_s,t),a(s,Ct,t),d(Is,s,t),a(s,_t,t),d(V,s,t),a(s,It,t),d(H,s,t),a(s,Rt,t),d(Rs,s,t),a(s,Zt,t),a(s,Zs,t),a(s,vt,t),a(s,vs,t),a(s,kt,t),d(ks,s,t),a(s,Wt,t),a(s,Ws,t),a(s,xt,t),d(xs,s,t),a(s,Gt,t),d(Y,s,t),a(s,Bt,t),a(s,Gs,t),a(s,Xt,t),d(z,s,t),a(s,Vt,t),d(Bs,s,t),a(s,Ht,t),a(s,Hs,t),Yt=!0},p(s,[t]){const Ml={};t&2&&(Ml.$$scope={dirty:t,ctx:s}),x.$set(Ml);const hl={};t&2&&(hl.$$scope={dirty:t,ctx:s}),V.$set(hl);const dl={};t&2&&(dl.$$scope={dirty:t,ctx:s}),H.$set(dl);const jl={};t&2&&(jl.$$scope={dirty:t,ctx:s}),Y.$set(jl);const yl={};t&2&&(yl.$$scope={dirty:t,ctx:s}),z.$set(yl)},i(s){Yt||(j(U.$$.fragment,s),j(v.$$.fragment,s),j(R.$$.fragment,s),j(x.$$.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(ls.$$.fragment,s),j(ns.$$.fragment,s),j(cs.$$.fragment,s),j(is.$$.fragment,s),j(os.$$.fragment,s),j(ds.$$.fragment,s),j(ys.$$.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(Rs.$$.fragment,s),j(ks.$$.fragment,s),j(xs.$$.fragment,s),j(Y.$$.fragment,s),j(z.$$.fragment,s),j(Bs.$$.fragment,s),Yt=!0)},o(s){y(U.$$.fragment,s),y(v.$$.fragment,s),y(R.$$.fragment,s),y(x.$$.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(ls.$$.fragment,s),y(ns.$$.fragment,s),y(cs.$$.fragment,s),y(is.$$.fragment,s),y(os.$$.fragment,s),y(ds.$$.fragment,s),y(ys.$$.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(Rs.$$.fragment,s),y(ks.$$.fragment,s),y(xs.$$.fragment,s),y(Y.$$.fragment,s),y(z.$$.fragment,s),y(Bs.$$.fragment,s),Yt=!1},d(s){s&&(l(f),l(c),l(J),l(_),l(Z),l(k),l(T),l(W),l($),l(i),l(C),l(B),l(r),l(b),l(zs),l(Ns),l(E),l(Qs),l(Es),l(Fs),l(q),l(As),l(qs),l(L),l(Ss),l(Ls),l(D),l(Ps),l(Ds),l(O),l(Ks),l(Os),l(ts),l(st),l(tt),l(as),l(lt),l(es),l(at),l(et),l(ps),l(nt),l(pt),l(rs),l(ct),l(rt),l(ms),l(it),l(mt),l(Ms),l(ot),l(hs),l(Mt),l(ht),l(js),l(dt),l(jt),l(us),l(yt),l(gs),l(ut),l(gt),l(Js),l(ft),l(Jt),l(bt),l(Us),l(wt),l(Ut),l($s),l(Tt),l($t),l(_s),l(Ct),l(_t),l(It),l(Rt),l(Zt),l(Zs),l(vt),l(vs),l(kt),l(Wt),l(Ws),l(xt),l(Gt),l(Bt),l(Gs),l(Xt),l(Vt),l(Ht),l(Hs)),l(e),u(U,s),u(v,s),u(R,s),u(x,s),u(Q,s),u(F,s),u(A,s),u(S,s),u(P,s),u(K,s),u(ss,s),u(ls,s),u(ns,s),u(cs,s),u(is,s),u(os,s),u(ds,s),u(ys,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(Rs,s),u(ks,s),u(xs,s),u(Y,s),u(z,s),u(Bs,s)}}}const Hl='{"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 Yl(I){return wl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ll extends Ul{constructor(e){super(),Tl(this,e,Yl,Vl,bl,{})}}export{Ll as component};
