import{s as Se,o as Ge}from"../chunks/scheduler.f6b352c8.js";import{S as He,i as Xe,g as p,s as a,r,m as As,H as Zl,A as Ne,h as m,f as l,c as n,j as Ks,u as c,x as i,n as Qs,E as kl,k as xe,y as b,a as e,v as y,d as o,t as M,w as h}from"../chunks/index.7f38e934.js";import{T as _e}from"../chunks/Tip.ae532637.js";import{C as U}from"../chunks/CodeBlock.2a338b68.js";import{H as Ys}from"../chunks/Heading.333929c4.js";function Fe(Ls){let d;return{c(){d=As("如果在加载数据集时遇到身份验证问题，请确保您已经通过以下链接在 Hugging Face Hub 上接受了数据集的使用条款：https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0")},l(w){d=Qs(w,"如果在加载数据集时遇到身份验证问题，请确保您已经通过以下链接在 Hugging Face Hub 上接受了数据集的使用条款：https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0")},m(w,f){e(w,d,f)},d(w){w&&l(d)}}}function ze(Ls){let d;return{c(){d=As("如果在运行上述单元时遇到 CUDA 内存不足（out-of-memory, OOM）问题，请将 `batch_size` 逐渐减小 2 的倍数，直到找到适合您设备的批次大小。")},l(w){d=Qs(w,"如果在运行上述单元时遇到 CUDA 内存不足（out-of-memory, OOM）问题，请将 `batch_size` 逐渐减小 2 的倍数，直到找到适合您设备的批次大小。")},m(w,f){e(w,d,f)},d(w){w&&l(d)}}}function Ye(Ls){let d,w,f,st,v,tt,g,Vl=`如果您熟悉自然语言处理（NLP）中的<a href="https://en.wikipedia.org/wiki/Levenshtein_distance" rel="nofollow">莱文斯坦距离（Levenshtein distance）</a>，
那么您会发现评估语音识别系统的指标颇为相似！如果您不熟悉，也不用担心，我们会从头到尾解释这些指标，确保您了解它们的不同之处以及它们的含义。`,lt,C,Sl="在评估语音识别系统时，我们将系统的预测与目标文本的转写进行比较，并标注出现的任何错误。我们将这些错误归类为以下三种类别：",et,E,Gl="<li>替换错误（Substitution, S）：在预测中转写了<strong>错误的词</strong>（例如，将 “sat” 转写为 “sit”）</li> <li>插入错误（Insertion, I）：在预测中<strong>多加了一个词</strong></li> <li>删除错误（Deletion, D）：在预测中<strong>漏掉了一个词</strong></li>",at,$,Hl="这些错误类别在所有语音识别指标中都是相同的，不同的是我们计算这些错误的粒度：我们可以在 <em>词级别</em> 或者 <em>字符级别</em> 上进行计算。",nt,R,Xl="我们将使用一个示例来解释每个指标的定义。这里，我们有一个 <em>基准</em> 或 <em>参考</em> 文本序列：",pt,W,mt,I,Nl="以及一个来自我们尝试评估的语音识别系统的预测序列：",it,B,rt,x,Fl="我们可以看到，预测相当接近，但有些词不太对。我们将用三种最流行的语音识别指标评估此预测，看看会算出什么样的结果。",ct,_,yt,Z,zl="<em>词错误率（WER）</em> 是语音识别的“事实上的”指标。它在<em>词级别</em>上计算替换、插入和删除错误，即错误是逐词标注的。以我们的示例为例：",ot,k,Yl="<thead><tr><th>参考</th> <th>the</th> <th>cat</th> <th>sat</th> <th>on</th> <th>the</th> <th>mat</th></tr></thead> <tbody><tr><td>预测</td> <td>the</td> <td>cat</td> <td><strong>sit</strong></td> <td>on</td> <td>the</td> <td></td></tr> <tr><td>标签</td> <td>✅</td> <td>✅</td> <td>S</td> <td>✅</td> <td>✅</td> <td>D</td></tr></tbody>",Mt,V,Al="在这里，我们有：",ht,S,Ql="<li>1 个替换错误（“sit” 而不是 “sat”）</li> <li>0 个插入错误</li> <li>1 个删除错误（缺少 “mat”）</li>",dt,G,Rl,Ut,Ze=`<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>W</mi><mi>E</mi><mi>R</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mfrac><mrow><mi>S</mi><mo>+</mo><mi>I</mi><mo>+</mo><mi>D</mi></mrow><mi>N</mi></mfrac></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mfrac><mrow><mn>1</mn><mo>+</mo><mn>0</mn><mo>+</mo><mn>1</mn></mrow><mn>6</mn></mfrac></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mn>0.333</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">
\\begin{aligned}
WER &amp;= \\frac{S + I + D}{N} \\\\
&amp;= \\frac{1 + 0 + 1}{6} \\\\
&amp;= 0.333
\\end{aligned}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:6.1538em;vertical-align:-2.8269em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.3269em;"><span style="top:-5.3269em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="mord mathnormal" style="margin-right:0.00773em;">ER</span></span></span><span style="top:-3.0194em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"></span></span><span style="top:-1.1934em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.8269em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.3269em;"><span style="top:-5.3269em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3603em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">N</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span><span style="top:-3.0194em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">6</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">0</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">1</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span><span style="top:-1.1934em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">0.333</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.8269em;"><span></span></span></span></span></span></span></span></span></span></span></span>`,wt,H,Ll=`好的！所以我们得到的 WER 是 0.333，或 33.3%。注意，“sit”这个词只有一个字符是错误的，
但整个词都被标记为不正确。这是 WER 的一个特点：无论错误多么轻微，拼写错误都会受到重罚。`,Jt,X,Pl="WER <em>越低越好</em>：较低的 WER 意味着我们的预测中错误较少，因此完美的语音识别系统的 WER 应为零（无错误）。",Tt,N,ql="我们来看看如何使用 🤗 Evaluate 来计算 WER。我们需要两个库来计算我们的 WER 指标：🤗 Evaluate 用于 API 接口，JIWER 用于执行计算：",ft,F,ut,z,Dl="太好了！我们现在可以加载 WER 指标，并为我们的示例计算出结果：",jt,Y,bt,A,Ol="<strong>打印输出：</strong>",vt,Q,gt,L,Kl="0.33，或 33.3%，与预期一致！我们现在知道了这个 WER 计算的幕后情况。",Ct,P,se=`现在，这里有一个坑……您认为 WER 的上限是多少？您可能会认为是 1 或 100% 对吧？并不是！由于 WER 是错误与单词数（N）的比率，因此 WER 没有上限！
让我们以一个预测了 10 个词而目标只有 2 个词的示例为例。如果我们的所有预测都是错误的（10 个错误），我们将得到 WER 为 10 / 2 = 5，或 500%！
这是在训练 ASR 系统并看到超过 100% 的 WER 时需要牢记的一点。如果您看到这种情况，可能意味着什么地方出了问题……😅`,Et,q,$t,J,Wl,Ps,te="越高越好",Il,qs,le="词准确率（WAcc）",Bl,Rt,ke=`<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.16em" columnspacing="1em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>W</mi><mi>A</mi><mi>c</mi><mi>c</mi><mo>=</mo><mn>1</mn><mo>−</mo><mi>W</mi><mi>E</mi><mi>R</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">
\\begin{equation}
WAcc = 1 - WER \\nonumber
\\end{equation}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1.2em;vertical-align:-0.35em;"></span><span class="mord"><span class="mtable"><span class="col-align-c"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.85em;"><span style="top:-3.01em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="mord mathnormal">A</span><span class="mord mathnormal">cc</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.13889em;">W</span><span class="mord mathnormal" style="margin-right:0.00773em;">ER</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.35em;"><span></span></span></span></span></span></span></span></span></span></span></span>`,Wt,D,ee=`WAcc 也是在词级别上测量的，它只是将 WER 重新表述为准确率指标，而不是错误率指标。
WAcc 在语音文献中很少被引用——我们倾向于以词错误为中心思考系统的预测，因此更喜欢与这些错误类型标注更相关的错误率指标。`,It,O,Bt,K,ae=`我们将整个词 “sit” 标记为错误似乎有点不公平，事实上只有一个字母是不正确的。这是因为我们是在词的级别上评估我们的系统，只能逐词标注错误。
<em>字符错误率（CER）</em> 则在<em>字符级别</em>上评估系统。这意味着我们将单词分解为它们的各个字符，并在字符级别上标注错误：`,xt,ss,ne="<thead><tr><th>参考</th> <th>t</th> <th>h</th> <th>e</th> <th></th> <th>c</th> <th>a</th> <th>t</th> <th></th> <th>s</th> <th>a</th> <th>t</th> <th></th> <th>o</th> <th>n</th> <th></th> <th>t</th> <th>h</th> <th>e</th> <th></th> <th>m</th> <th>a</th> <th>t</th></tr></thead> <tbody><tr><td>预测</td> <td>t</td> <td>h</td> <td>e</td> <td></td> <td>c</td> <td>a</td> <td>t</td> <td></td> <td>s</td> <td><strong>i</strong></td> <td>t</td> <td></td> <td>o</td> <td>n</td> <td></td> <td>t</td> <td>h</td> <td>e</td> <td></td> <td></td> <td></td> <td></td></tr> <tr><td>标签</td> <td>✅</td> <td>✅</td> <td>✅</td> <td></td> <td>✅</td> <td>✅</td> <td>✅</td> <td></td> <td>✅</td> <td>S</td> <td>✅</td> <td></td> <td>✅</td> <td>✅</td> <td></td> <td>✅</td> <td>✅</td> <td>✅</td> <td></td> <td>D</td> <td>D</td> <td>D</td></tr></tbody>",_t,ts,pe="我们现在可以看到，对于词 “sit”，“s” 和 “t” 被标记为正确。只有 “i” 被标记为替换错误（S）。因此，我们奖励了我们的系统部分正确的预测 🤝",Zt,ls,xl,kt,Ve=`<span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mtable rowspacing="0.25em" columnalign="right left" columnspacing="0em"><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mi>C</mi><mi>E</mi><mi>R</mi></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mfrac><mrow><mi>S</mi><mo>+</mo><mi>I</mi><mo>+</mo><mi>D</mi></mrow><mi>N</mi></mfrac></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mfrac><mrow><mn>1</mn><mo>+</mo><mn>0</mn><mo>+</mo><mn>3</mn></mrow><mn>14</mn></mfrac></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow></mrow></mstyle></mtd><mtd><mstyle scriptlevel="0" displaystyle="true"><mrow><mrow></mrow><mo>=</mo><mn>0.286</mn></mrow></mstyle></mtd></mtr></mtable><annotation encoding="application/x-tex">
\\begin{aligned}
CER &amp;= \\frac{S + I + D}{N} \\\\
&amp;= \\frac{1 + 0 + 3}{14} \\\\
&amp;= 0.286
\\end{aligned}
</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:6.1538em;vertical-align:-2.8269em;"></span><span class="mord"><span class="mtable"><span class="col-align-r"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.3269em;"><span style="top:-5.3269em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.00773em;">CER</span></span></span><span style="top:-3.0194em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"></span></span><span style="top:-1.1934em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.8269em;"><span></span></span></span></span></span><span class="col-align-l"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:3.3269em;"><span style="top:-5.3269em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3603em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10903em;">N</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.05764em;">S</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord mathnormal" style="margin-right:0.02778em;">D</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span><span style="top:-3.0194em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord"><span class="mopen nulldelimiter"></span><span class="mfrac"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:1.3214em;"><span style="top:-2.314em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">14</span></span></span><span style="top:-3.23em;"><span class="pstrut" style="height:3em;"></span><span class="frac-line" style="border-bottom-width:0.04em;"></span></span><span style="top:-3.677em;"><span class="pstrut" style="height:3em;"></span><span class="mord"><span class="mord">1</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">0</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">+</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mord">3</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:0.686em;"><span></span></span></span></span></span><span class="mclose nulldelimiter"></span></span></span></span><span style="top:-1.1934em;"><span class="pstrut" style="height:3.3603em;"></span><span class="mord"><span class="mord"></span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mord">0.286</span></span></span></span><span class="vlist-s">​</span></span><span class="vlist-r"><span class="vlist" style="height:2.8269em;"><span></span></span></span></span></span></span></span></span></span></span></span>`,Vt,es,me="好的！我们得到了一个 CER 为 0.286，或 28.6%。注意这比我们的 WER 低——现在我们对拼写错误的惩罚要少得多了。",St,as,Gt,ns,ie=`一般来说，WER 比 CER 更多地用于评估语音系统。这是因为 WER 要求系统对预测的上下文有更深入的理解。在我们的例子中，“sit” 使用了错误的时态。
一个理解句子中动词和时态关系的系统会预测出正确的动词时态 “sat”。我们希望训练我们的语音系统达到这种理解水平。
所以，尽管 WER 比 CER 更不宽容，但它也更有助于我们开发出我们想要的智能系统。因此，我们通常使用 WER，并鼓励您也这样做！
然而，在某些情况下，使用 WER 是不可能的。某些语言，如汉语和日语，没有“词”的概念，因此 WER 没有意义。在这里，我们转而使用 CER。`,Ht,ps,re=`在我们的例子中，我们只在计算 WER 时使用了一句话。但真正在评估一个系统时，我们通常会使用包含几千句话的整个测试集。
在评估多个句子时，我们会将所有句子的 S、I、D 和 N 求和，然后根据上面定义的公式计算 WER。这样可以更好地估计未见数据的 WER。`,Xt,ms,Nt,is,ce=`如果我们在带有标点和大小写的数据上训练 ASR 模型，它将学会在其转写中预测大小写和标点。当我们想将我们的模型用于实际的语音识别应用，
如记录会议或口述时，这很有用，因为预测的转写将完全格式化，带有大小写和标点，这种风格被称为<em>正字法</em>（orthographic）。`,Ft,rs,ye=`然而，我们可以选择<em>规范化</em>（normalise）数据集以消除任何大小写和标点。规范化数据集使语音识别任务变得更容易：模型不再需要区分大写和小写字符，
也不需要单独从音频数据中预测标点（例如，分号发出什么声音？）。因此，词错误率自然更低（结果更好）。Whisper 论文演示了规范化转写对 WER 结果的巨大影响（参见 <a href="https://cdn.openai.com/papers/whisper.pdf" rel="nofollow">Whisper 论文</a> 的第 4.4 节）。
虽然我们获得了更低的 WER，但模型并不一定更适合生产。缺乏大小写和标点使模型预测的文本难以阅读。以 <a href="asr_models">前一节</a> 中的示例为例，
我们在 LibriSpeech 数据集的同一音频样本上运行了 Wav2Vec2 和 Whisper。Wav2Vec2 模型既不预测标点也不预测大小写，而 Whisper 则预测了这两者。
对比两种转写，我们看到 Whisper 的转写更易于阅读：`,zt,cs,Yt,ys,oe=`Whisper 的转写是符合正字法的，因此可以直接使用——它写成了我们期望的会议记录或口述记录的格式，带有标点和大小写。
相反，如果我们想将 Wav2Vec2 的预测用于下游应用，我们需要使用额外的后处理来恢复标点和大小写。`,At,os,Me=`在规范化和不规范化之间有一个折中方案：我们可以在正字法转写上训练我们的系统，然后在计算 WER 之前对预测和目标进行规范化。
这样，我们既能够训练系统预测带有完整格式的文本，又通过规范化转写提高了 WER。`,Qt,Ms,he="Whisper 模型发布时带有一个能有效处理大小写、标点和数字格式化等规范化任务的规范器（normaliser）。让我们将规范器应用于 Whisper 转写，以演示如何对它们进行规范化：",Lt,hs,Pt,ds,de="<strong>输出：</strong>",qt,Us,Dt,ws,Ue="太好了！我们可以看到文本全部小写，并且没有标点。现在让我们定义参考转写，然后计算参考和预测之间的规范化 WER：",Ot,Js,Kt,Ts,we="<strong>输出：</strong>",sl,fs,tl,us,Je="6.25%——这大概就是我们能预期 Whisper 基础模型在 LibriSpeech 验证集上达到的效果。正如我们在这里看到的，我们预测了一个符合正字法的转写，但通过在计算 WER 之前规范化参考和预测提升了 WER。",ll,js,Te="您如何规范化转写最终取决于您的需求。我们建议在正字法文本上进行训练，并在规范化文本上进行评估，以获得两全其美的效果。",el,bs,al,vs,fe=`好的！到目前为止，我们在本单元已经介绍了三个主题：预训练模型、数据集选择和评估。让我们来做点有趣的，将它们结合在一起做一个端到端的样例 🚀
我们将评估预训练的 Whisper 模型在 Common Voice 13 Dhivehi 测试集上的表现，为下一节关于微调的内容做铺垫。我们会将算出的 WER 作为微调的 <em>基准</em>，并尝试超越这个目标 🥊`,nl,gs,ue="首先，我们将使用 <code>pipeline()</code> 类加载预训练的 Whisper 模型。我们现在对这个过程应该非常熟悉了！我们唯一的新步骤是在 GPU 上使用半精度（float16）加载模型——这样会加速推理且几乎不影响 WER。",pl,Cs,ml,Es,je=`接下来，我们将加载 Common Voice 13 的迪维希语测试子集。您可能还记得，从上一节中我们了解到 Common Voice 13 是<em>受限的</em>，
这意味着我们必须同意数据集的使用条款才能访问数据集。我们现在可以将我们的 Hugging Face 账户链接到我们的笔记本，以便我们可以从当前使用的机器访问数据集。`,il,$s,be='将笔记本链接到 Hub 非常简单——只需要依照提示输入您的 Hub 身份验证令牌即可。在 <a href="https://huggingface.co/settings/tokens" rel="nofollow">这里</a> 找到您的 Hub 身份验证令牌：',rl,Rs,cl,Ws,ve=`太好了！我们将笔记本链接到我们的 Hugging Face 账户之后，就可以下载 Common Voice 数据集了。
下载和预处理需要几分钟，以下代码会从 Hugging Face Hub 获取数据并在您的笔记本上自动准备：`,yl,Is,ol,u,Ml,Bs,ge=`用与推理单个样本相同的方式评估整个数据集——我们所要做的就是<strong>循环</strong>处理输入的所有音频，而不是仅推理单个样本。为此，我们首先将我们的数据集转换为 <code>KeyDataset</code>。
我们要做的只是挑选出我们要传递给模型的特定的数据列（在我们的案例中，那是 <code>&quot;audio&quot;</code> 列），忽略其余的（如目标转写，在推理时用不上）。
然后我们遍历这个转换后的数据集，将模型输出的预测结果保存到列表中。以下代码单元将在 GPU 上以半精度运行时大约需要五分钟，内存峰值为 12GB：`,hl,xs,dl,j,Ul,_s,Ce="最后，我们可以计算 WER。让我们首先计算正字法 WER，即没有任何后处理时的 WER：",wl,Zs,Jl,ks,Ee="<strong>输出：</strong>",Tl,Vs,fl,Ss,$e="好吧……167% 意味着我们的模型输出的是垃圾 😜 别担心，我们的目标是通过在迪维希语训练集上微调模型来改善这一点！",ul,Gs,Re="接下来，我们将评估规范化 WER，即规范化后处理过再得到的 WER。我们必须过滤掉规范化后为空的样本，否则我们参考中的总词数（N）将为零，这将导致我们的计算中出现除以零的错误：",jl,Hs,bl,Xs,We="<strong>输出：</strong>",vl,Ns,gl,Fs,Ie="我们再次看到通过规范化我们的参考和预测，我们显著降低了 WER：基线模型在正字法的测试中的 WER 为 168%，而规范化 WER 为 126%。",Cl,zs,Be="好了！这些是我们在通过微调提高 Whisper 模型语音识别迪维希语的能力时需要超越的目标。继续阅读，开始动手尝试微调示例吧 🚀",El,Os,$l;return v=new Ys({props:{title:"语音识别的评价指标",local:"语音识别的评价指标",headingTag:"h1"}}),W=new U({props:{code:"cmVmZXJlbmNlJTIwJTNEJTIwJTIydGhlJTIwY2F0JTIwc2F0JTIwb24lMjB0aGUlMjBtYXQlMjI=",highlighted:'reference = <span class="hljs-string">&quot;the cat sat on the mat&quot;</span>',wrap:!1}}),B=new U({props:{code:"cHJlZGljdGlvbiUyMCUzRCUyMCUyMnRoZSUyMGNhdCUyMHNpdCUyMG9uJTIwdGhlJTIy",highlighted:'prediction = <span class="hljs-string">&quot;the cat sit on the&quot;</span>',wrap:!1}}),_=new Ys({props:{title:"词错误率",local:"词错误率",headingTag:"h2"}}),F=new U({props:{code:"cGlwJTIwaW5zdGFsbCUyMC0tdXBncmFkZSUyMGV2YWx1YXRlJTIwaml3ZXI=",highlighted:'pip install <span class="hljs-comment">--upgrade evaluate jiwer</span>',wrap:!1}}),Y=new U({props:{code:"ZnJvbSUyMGV2YWx1YXRlJTIwaW1wb3J0JTIwbG9hZCUwQSUwQXdlcl9tZXRyaWMlMjAlM0QlMjBsb2FkKCUyMndlciUyMiklMEElMEF3ZXIlMjAlM0QlMjB3ZXJfbWV0cmljLmNvbXB1dGUocmVmZXJlbmNlcyUzRCU1QnJlZmVyZW5jZSU1RCUyQyUyMHByZWRpY3Rpb25zJTNEJTVCcHJlZGljdGlvbiU1RCklMEElMEFwcmludCh3ZXIp",highlighted:`<span class="hljs-keyword">from</span> evaluate <span class="hljs-keyword">import</span> load

wer_metric = load(<span class="hljs-string">&quot;wer&quot;</span>)

wer = wer_metric.compute(references=[reference], predictions=[prediction])

<span class="hljs-built_in">print</span>(wer)`,wrap:!1}}),Q=new U({props:{code:"MC4zMzMzMzMzMzMzMzMzMzMz",highlighted:'<span class="hljs-attribute">0</span>.<span class="hljs-number">3333333333333333</span>',wrap:!1}}),q=new Ys({props:{title:"词准确率",local:"词准确率",headingTag:"h2"}}),O=new Ys({props:{title:"字符错误率",local:"字符错误率",headingTag:"h2"}}),as=new Ys({props:{title:"我应该使用哪个指标？",local:"我应该使用哪个指标",headingTag:"h2"}}),ms=new Ys({props:{title:"规范化",local:"规范化",headingTag:"h2"}}),cs=new U({props:{code:"V2F2MlZlYzIlM0ElMjAlMjBIRSUyMFRFTExTJTIwVVMlMjBUSEFUJTIwQVQlMjBUSElTJTIwRkVTVElWRSUyMFNFQVNPTiUyME9GJTIwVEhFJTIwWUVBUiUyMFdJVEglMjBDSFJJU1RNQVVTJTIwQU5EJTIwUk9TRSUyMEJFRUYlMjBMT09NSU5HJTIwQkVGT1JFJTIwVVMlMjBTSU1BTFlJUyUyMERSQVdOJTIwRlJPTSUyMEVBVElORyUyMEFORCUyMElUUyUyMFJFU1VMVFMlMjBPQ0NVUiUyME1PU1QlMjBSRUFESUxZJTIwVE8lMjBUSEUlMjBNSU5EJTBBV2hpc3BlciUzQSUyMCUyMCUyMEhlJTIwdGVsbHMlMjB1cyUyMHRoYXQlMjBhdCUyMHRoaXMlMjBmZXN0aXZlJTIwc2Vhc29uJTIwb2YlMjB0aGUlMjB5ZWFyJTJDJTIwd2l0aCUyMENocmlzdG1hcyUyMGFuZCUyMHJvYXN0JTIwYmVlZiUyMGxvb21pbmclMjBiZWZvcmUlMjB1cyUyQyUyMHNpbWlsYXJseSUyMGlzJTIwZHJhd24lMjBmcm9tJTIwZWF0aW5nJTIwYW5kJTIwaXRzJTIwcmVzdWx0cyUyMG9jY3VyJTIwbW9zdCUyMHJlYWRpbHklMjB0byUyMHRoZSUyMG1pbmQu",highlighted:`<span class="hljs-symbol">Wav2Vec2:</span>  HE TELLS US THAT <span class="hljs-built_in">AT</span> THIS FESTIVE SEASON OF THE YEAR WITH CHRISTMAUS <span class="hljs-keyword">AND </span>ROSE <span class="hljs-keyword">BEEF </span>LOOMING <span class="hljs-keyword">BEFORE </span>US SIMALYIS DRAWN FROM EATING <span class="hljs-keyword">AND </span>ITS RESULTS OCCUR MOST READILY TO THE MIND
<span class="hljs-symbol">Whisper:</span>   He tells us that <span class="hljs-built_in">at</span> this festive season of the year, with Christmas <span class="hljs-keyword">and </span>roast <span class="hljs-keyword">beef </span>looming <span class="hljs-keyword">before </span>us, similarly is drawn from eating <span class="hljs-keyword">and </span>its results occur most readily to the mind.`,wrap:!1}}),hs=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMud2hpc3Blci5lbmdsaXNoX25vcm1hbGl6ZXIlMjBpbXBvcnQlMjBCYXNpY1RleHROb3JtYWxpemVyJTBBJTBBbm9ybWFsaXplciUyMCUzRCUyMEJhc2ljVGV4dE5vcm1hbGl6ZXIoKSUwQSUwQXByZWRpY3Rpb24lMjAlM0QlMjAlMjIlMjBIZSUyMHRlbGxzJTIwdXMlMjB0aGF0JTIwYXQlMjB0aGlzJTIwZmVzdGl2ZSUyMHNlYXNvbiUyMG9mJTIwdGhlJTIweWVhciUyQyUyMHdpdGglMjBDaHJpc3RtYXMlMjBhbmQlMjByb2FzdCUyMGJlZWYlMjBsb29taW5nJTIwYmVmb3JlJTIwdXMlMkMlMjBzaW1pbGFybHklMjBpcyUyMGRyYXduJTIwZnJvbSUyMGVhdGluZyUyMGFuZCUyMGl0cyUyMHJlc3VsdHMlMjBvY2N1ciUyMG1vc3QlMjByZWFkaWx5JTIwdG8lMjB0aGUlMjBtaW5kLiUyMiUwQW5vcm1hbGl6ZWRfcHJlZGljdGlvbiUyMCUzRCUyMG5vcm1hbGl6ZXIocHJlZGljdGlvbiklMEElMEFub3JtYWxpemVkX3ByZWRpY3Rpb24=",highlighted:`<span class="hljs-keyword">from</span> transformers.models.whisper.english_normalizer <span class="hljs-keyword">import</span> BasicTextNormalizer

normalizer = BasicTextNormalizer()

prediction = <span class="hljs-string">&quot; He tells us that at this festive season of the year, with Christmas and roast beef looming before us, similarly is drawn from eating and its results occur most readily to the mind.&quot;</span>
normalized_prediction = normalizer(prediction)

normalized_prediction`,wrap:!1}}),Us=new U({props:{code:"JyUyMGhlJTIwdGVsbHMlMjB1cyUyMHRoYXQlMjBhdCUyMHRoaXMlMjBmZXN0aXZlJTIwc2Vhc29uJTIwb2YlMjB0aGUlMjB5ZWFyJTIwd2l0aCUyMGNocmlzdG1hcyUyMGFuZCUyMHJvYXN0JTIwYmVlZiUyMGxvb21pbmclMjBiZWZvcmUlMjB1cyUyMHNpbWlsYXJseSUyMGlzJTIwZHJhd24lMjBmcm9tJTIwZWF0aW5nJTIwYW5kJTIwaXRzJTIwcmVzdWx0cyUyMG9jY3VyJTIwbW9zdCUyMHJlYWRpbHklMjB0byUyMHRoZSUyMG1pbmQlMjAn",highlighted:'&#x27; he tells us <span class="hljs-keyword">that</span> <span class="hljs-keyword">at</span> this festive season <span class="hljs-keyword">of</span> <span class="hljs-keyword">the</span> <span class="hljs-built_in">year</span> <span class="hljs-keyword">with</span> christmas <span class="hljs-keyword">and</span> roast beef looming <span class="hljs-keyword">before</span> us similarly <span class="hljs-keyword">is</span> drawn <span class="hljs-keyword">from</span> eating <span class="hljs-keyword">and</span> <span class="hljs-keyword">its</span> results occur most readily <span class="hljs-keyword">to</span> <span class="hljs-keyword">the</span> mind &#x27;',wrap:!1}}),Js=new U({props:{code:"cmVmZXJlbmNlJTIwJTNEJTIwJTIySEUlMjBURUxMUyUyMFVTJTIwVEhBVCUyMEFUJTIwVEhJUyUyMEZFU1RJVkUlMjBTRUFTT04lMjBPRiUyMFRIRSUyMFlFQVIlMjBXSVRIJTIwQ0hSSVNUTUFTJTIwQU5EJTIwUk9BU1QlMjBCRUVGJTIwTE9PTUlORyUyMEJFRk9SRSUyMFVTJTIwU0lNSUxFUyUyMERSQVdOJTIwRlJPTSUyMEVBVElORyUyMEFORCUyMElUUyUyMFJFU1VMVFMlMjBPQ0NVUiUyME1PU1QlMjBSRUFESUxZJTIwVE8lMjBUSEUlMjBNSU5EJTIyJTBBbm9ybWFsaXplZF9yZWZlcmVjZSUyMCUzRCUyMG5vcm1hbGl6ZXIocmVmZXJlbmNlKSUwQSUwQXdlciUyMCUzRCUyMHdlcl9tZXRyaWMuY29tcHV0ZSglMEElMjAlMjAlMjAlMjByZWZlcmVuY2VzJTNEJTVCbm9ybWFsaXplZF9yZWZlcmVjZSU1RCUyQyUyMHByZWRpY3Rpb25zJTNEJTVCbm9ybWFsaXplZF9wcmVkaWN0aW9uJTVEJTBBKSUwQXdlcg==",highlighted:`reference = <span class="hljs-string">&quot;HE TELLS US THAT AT THIS FESTIVE SEASON OF THE YEAR WITH CHRISTMAS AND ROAST BEEF LOOMING BEFORE US SIMILES DRAWN FROM EATING AND ITS RESULTS OCCUR MOST READILY TO THE MIND&quot;</span>
normalized_referece = normalizer(reference)

wer = wer_metric.compute(
    references=[normalized_referece], predictions=[normalized_prediction]
)
wer`,wrap:!1}}),fs=new U({props:{code:"MC4wNjI1",highlighted:'<span class="hljs-attribute">0</span>.<span class="hljs-number">0625</span>',wrap:!1}}),bs=new Ys({props:{title:"汇总",local:"汇总",headingTag:"h2"}}),Cs=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBaW1wb3J0JTIwdG9yY2glMEElMEFpZiUyMHRvcmNoLmN1ZGEuaXNfYXZhaWxhYmxlKCklM0ElMEElMjAlMjAlMjAlMjBkZXZpY2UlMjAlM0QlMjAlMjJjdWRhJTNBMCUyMiUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTIwJTNEJTIwdG9yY2guZmxvYXQxNiUwQWVsc2UlM0ElMEElMjAlMjAlMjAlMjBkZXZpY2UlMjAlM0QlMjAlMjJjcHUlMjIlMEElMjAlMjAlMjAlMjB0b3JjaF9kdHlwZSUyMCUzRCUyMHRvcmNoLmZsb2F0MzIlMEElMEFwaXBlJTIwJTNEJTIwcGlwZWxpbmUoJTBBJTIwJTIwJTIwJTIwJTIyYXV0b21hdGljLXNwZWVjaC1yZWNvZ25pdGlvbiUyMiUyQyUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEJTIyb3BlbmFpJTJGd2hpc3Blci1zbWFsbCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRvcmNoX2R0eXBlJTNEdG9yY2hfZHR5cGUlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2UlM0RkZXZpY2UlMkMlMEEp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline
<span class="hljs-keyword">import</span> torch

<span class="hljs-keyword">if</span> torch.cuda.is_available():
    device = <span class="hljs-string">&quot;cuda:0&quot;</span>
    torch_dtype = torch.float16
<span class="hljs-keyword">else</span>:
    device = <span class="hljs-string">&quot;cpu&quot;</span>
    torch_dtype = torch.float32

pipe = pipeline(
    <span class="hljs-string">&quot;automatic-speech-recognition&quot;</span>,
    model=<span class="hljs-string">&quot;openai/whisper-small&quot;</span>,
    torch_dtype=torch_dtype,
    device=device,
)`,wrap:!1}}),Rs=new U({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

notebook_login()`,wrap:!1}}),Is=new U({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBY29tbW9uX3ZvaWNlX3Rlc3QlMjAlM0QlMjBsb2FkX2RhdGFzZXQoJTBBJTIwJTIwJTIwJTIwJTIybW96aWxsYS1mb3VuZGF0aW9uJTJGY29tbW9uX3ZvaWNlXzEzXzAlMjIlMkMlMjAlMjJkdiUyMiUyQyUyMHNwbGl0JTNEJTIydGVzdCUyMiUwQSk=",highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

common_voice_test = load_dataset(
    <span class="hljs-string">&quot;mozilla-foundation/common_voice_13_0&quot;</span>, <span class="hljs-string">&quot;dv&quot;</span>, split=<span class="hljs-string">&quot;test&quot;</span>
)`,wrap:!1}}),u=new _e({props:{$$slots:{default:[Fe]},$$scope:{ctx:Ls}}}),xs=new U({props:{code:"ZnJvbSUyMHRxZG0lMjBpbXBvcnQlMjB0cWRtJTBBZnJvbSUyMHRyYW5zZm9ybWVycy5waXBlbGluZXMucHRfdXRpbHMlMjBpbXBvcnQlMjBLZXlEYXRhc2V0JTBBJTBBYWxsX3ByZWRpY3Rpb25zJTIwJTNEJTIwJTVCJTVEJTBBJTBBJTIzJTIwJUU4JUJGJTkwJUU4JUExJThDJUU2JUI1JTgxJUU1JUJDJThGJUU2JThFJUE4JUU3JTkwJTg2JTBBZm9yJTIwcHJlZGljdGlvbiUyMGluJTIwdHFkbSglMEElMjAlMjAlMjAlMjBwaXBlKCUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMEtleURhdGFzZXQoY29tbW9uX3ZvaWNlX3Rlc3QlMkMlMjAlMjJhdWRpbyUyMiklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBtYXhfbmV3X3Rva2VucyUzRDEyOCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGdlbmVyYXRlX2t3YXJncyUzRCU3QiUyMnRhc2slMjIlM0ElMjAlMjJ0cmFuc2NyaWJlJTIyJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYmF0Y2hfc2l6ZSUzRDMyJTJDJTBBJTIwJTIwJTIwJTIwKSUyQyUwQSUyMCUyMCUyMCUyMHRvdGFsJTNEbGVuKGNvbW1vbl92b2ljZV90ZXN0KSUyQyUwQSklM0ElMEElMjAlMjAlMjAlMjBhbGxfcHJlZGljdGlvbnMuYXBwZW5kKHByZWRpY3Rpb24lNUIlMjJ0ZXh0JTIyJTVEKQ==",highlighted:`<span class="hljs-keyword">from</span> tqdm <span class="hljs-keyword">import</span> tqdm
<span class="hljs-keyword">from</span> transformers.pipelines.pt_utils <span class="hljs-keyword">import</span> KeyDataset

all_predictions = []

<span class="hljs-comment"># 运行流式推理</span>
<span class="hljs-keyword">for</span> prediction <span class="hljs-keyword">in</span> tqdm(
    pipe(
        KeyDataset(common_voice_test, <span class="hljs-string">&quot;audio&quot;</span>),
        max_new_tokens=<span class="hljs-number">128</span>,
        generate_kwargs={<span class="hljs-string">&quot;task&quot;</span>: <span class="hljs-string">&quot;transcribe&quot;</span>},
        batch_size=<span class="hljs-number">32</span>,
    ),
    total=<span class="hljs-built_in">len</span>(common_voice_test),
):
    all_predictions.append(prediction[<span class="hljs-string">&quot;text&quot;</span>])`,wrap:!1}}),j=new _e({props:{$$slots:{default:[ze]},$$scope:{ctx:Ls}}}),Zs=new U({props:{code:"ZnJvbSUyMGV2YWx1YXRlJTIwaW1wb3J0JTIwbG9hZCUwQSUwQXdlcl9tZXRyaWMlMjAlM0QlMjBsb2FkKCUyMndlciUyMiklMEElMEF3ZXJfb3J0aG8lMjAlM0QlMjAxMDAlMjAqJTIwd2VyX21ldHJpYy5jb21wdXRlKCUwQSUyMCUyMCUyMCUyMHJlZmVyZW5jZXMlM0Rjb21tb25fdm9pY2VfdGVzdCU1QiUyMnNlbnRlbmNlJTIyJTVEJTJDJTIwcHJlZGljdGlvbnMlM0RhbGxfcHJlZGljdGlvbnMlMEEpJTBBd2VyX29ydGhv",highlighted:`<span class="hljs-keyword">from</span> evaluate <span class="hljs-keyword">import</span> load

wer_metric = load(<span class="hljs-string">&quot;wer&quot;</span>)

wer_ortho = <span class="hljs-number">100</span> * wer_metric.compute(
    references=common_voice_test[<span class="hljs-string">&quot;sentence&quot;</span>], predictions=all_predictions
)
wer_ortho`,wrap:!1}}),Vs=new U({props:{code:"MTY3LjI5NTc3MjY4NjEyMDIy",highlighted:'<span class="hljs-attribute">167</span>.<span class="hljs-number">29577268612022</span>',wrap:!1}}),Hs=new U({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5tb2RlbHMud2hpc3Blci5lbmdsaXNoX25vcm1hbGl6ZXIlMjBpbXBvcnQlMjBCYXNpY1RleHROb3JtYWxpemVyJTBBJTBBbm9ybWFsaXplciUyMCUzRCUyMEJhc2ljVGV4dE5vcm1hbGl6ZXIoKSUwQSUwQSUyMyUyMCVFOCVBRSVBMSVFNyVBRSU5NyVFOCVBNyU4NCVFOCU4QyU4MyVFNSU4QyU5NiUyMFdFUiUwQWFsbF9wcmVkaWN0aW9uc19ub3JtJTIwJTNEJTIwJTVCbm9ybWFsaXplcihwcmVkKSUyMGZvciUyMHByZWQlMjBpbiUyMGFsbF9wcmVkaWN0aW9ucyU1RCUwQWFsbF9yZWZlcmVuY2VzX25vcm0lMjAlM0QlMjAlNUJub3JtYWxpemVyKGxhYmVsKSUyMGZvciUyMGxhYmVsJTIwaW4lMjBjb21tb25fdm9pY2VfdGVzdCU1QiUyMnNlbnRlbmNlJTIyJTVEJTVEJTBBJTBBJTIzJTIwJUU4JUJGJTg3JUU2JUJCJUE0JUU2JThFJTg5JUU1JThGJTgyJUU4JTgwJTgzJUU2JTk2JTg3JUU2JTlDJUFDJUU4JUEyJUFCJUU4JUE3JTg0JUU4JThDJTgzJUU1JThDJTk2JUU1JTkwJThFJUU0JUI4JUJBJUU5JTlCJUI2JUU1JTgwJUJDJUU3JTlBJTg0JUU2JUEwJUI3JUU2JTlDJUFDJTBBYWxsX3ByZWRpY3Rpb25zX25vcm0lMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjBhbGxfcHJlZGljdGlvbnNfbm9ybSU1QmklNUQlMEElMjAlMjAlMjAlMjBmb3IlMjBpJTIwaW4lMjByYW5nZShsZW4oYWxsX3ByZWRpY3Rpb25zX25vcm0pKSUwQSUyMCUyMCUyMCUyMGlmJTIwbGVuKGFsbF9yZWZlcmVuY2VzX25vcm0lNUJpJTVEKSUyMCUzRSUyMDAlMEElNUQlMEFhbGxfcmVmZXJlbmNlc19ub3JtJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTIwJTIwYWxsX3JlZmVyZW5jZXNfbm9ybSU1QmklNUQlMEElMjAlMjAlMjAlMjBmb3IlMjBpJTIwaW4lMjByYW5nZShsZW4oYWxsX3JlZmVyZW5jZXNfbm9ybSkpJTBBJTIwJTIwJTIwJTIwaWYlMjBsZW4oYWxsX3JlZmVyZW5jZXNfbm9ybSU1QmklNUQpJTIwJTNFJTIwMCUwQSU1RCUwQSUwQXdlciUyMCUzRCUyMDEwMCUyMColMjB3ZXJfbWV0cmljLmNvbXB1dGUoJTBBJTIwJTIwJTIwJTIwcmVmZXJlbmNlcyUzRGFsbF9yZWZlcmVuY2VzX25vcm0lMkMlMjBwcmVkaWN0aW9ucyUzRGFsbF9wcmVkaWN0aW9uc19ub3JtJTBBKSUwQSUwQXdlcg==",highlighted:`<span class="hljs-keyword">from</span> transformers.models.whisper.english_normalizer <span class="hljs-keyword">import</span> BasicTextNormalizer

normalizer = BasicTextNormalizer()

<span class="hljs-comment"># 计算规范化 WER</span>
all_predictions_norm = [normalizer(pred) <span class="hljs-keyword">for</span> pred <span class="hljs-keyword">in</span> all_predictions]
all_references_norm = [normalizer(label) <span class="hljs-keyword">for</span> label <span class="hljs-keyword">in</span> common_voice_test[<span class="hljs-string">&quot;sentence&quot;</span>]]

<span class="hljs-comment"># 过滤掉参考文本被规范化后为零值的样本</span>
all_predictions_norm = [
    all_predictions_norm[i]
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-built_in">len</span>(all_predictions_norm))
    <span class="hljs-keyword">if</span> <span class="hljs-built_in">len</span>(all_references_norm[i]) &gt; <span class="hljs-number">0</span>
]
all_references_norm = [
    all_references_norm[i]
    <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(<span class="hljs-built_in">len</span>(all_references_norm))
    <span class="hljs-keyword">if</span> <span class="hljs-built_in">len</span>(all_references_norm[i]) &gt; <span class="hljs-number">0</span>
]

wer = <span class="hljs-number">100</span> * wer_metric.compute(
    references=all_references_norm, predictions=all_predictions_norm
)

wer`,wrap:!1}}),Ns=new U({props:{code:"MTI1LjY5ODA5MDg5OTYwNzA3",highlighted:'<span class="hljs-attribute">125</span>.<span class="hljs-number">69809089960707</span>',wrap:!1}}),{c(){d=p("meta"),w=a(),f=p("p"),st=a(),r(v.$$.fragment),tt=a(),g=p("p"),g.innerHTML=Vl,lt=a(),C=p("p"),C.textContent=Sl,et=a(),E=p("ol"),E.innerHTML=Gl,at=a(),$=p("p"),$.innerHTML=Hl,nt=a(),R=p("p"),R.innerHTML=Xl,pt=a(),r(W.$$.fragment),mt=a(),I=p("p"),I.textContent=Nl,it=a(),r(B.$$.fragment),rt=a(),x=p("p"),x.textContent=Fl,ct=a(),r(_.$$.fragment),yt=a(),Z=p("p"),Z.innerHTML=zl,ot=a(),k=p("table"),k.innerHTML=Yl,Mt=a(),V=p("p"),V.textContent=Al,ht=a(),S=p("ul"),S.innerHTML=Ql,dt=a(),G=p("p"),Rl=As(`这样总共有 2 个错误。要得到错误率，我们将错误数除以参考文本中的总词数（N），在这个例子中为 6：
`),Ut=new Zl(!1),wt=a(),H=p("p"),H.textContent=Ll,Jt=a(),X=p("p"),X.innerHTML=Pl,Tt=a(),N=p("p"),N.textContent=ql,ft=a(),r(F.$$.fragment),ut=a(),z=p("p"),z.textContent=Dl,jt=a(),r(Y.$$.fragment),bt=a(),A=p("p"),A.innerHTML=Ol,vt=a(),r(Q.$$.fragment),gt=a(),L=p("p"),L.textContent=Kl,Ct=a(),P=p("p"),P.textContent=se,Et=a(),r(q.$$.fragment),$t=a(),J=p("p"),Wl=As("我们可以将 WER 反过来，得到一个"),Ps=p("em"),Ps.textContent=te,Il=As("的指标。与其衡量词错误率，不如衡量我们系统的"),qs=p("em"),qs.textContent=le,Bl=As(`：
`),Rt=new Zl(!1),Wt=a(),D=p("p"),D.textContent=ee,It=a(),r(O.$$.fragment),Bt=a(),K=p("p"),K.innerHTML=ae,xt=a(),ss=p("table"),ss.innerHTML=ne,_t=a(),ts=p("p"),ts.textContent=pe,Zt=a(),ls=p("p"),xl=As(`在我们的例子中，我们有 1 个字符替换，0 个插入和 3 个删除。总共有 14 个字符。所以，我们的 CER 是：
`),kt=new Zl(!1),Vt=a(),es=p("p"),es.textContent=me,St=a(),r(as.$$.fragment),Gt=a(),ns=p("p"),ns.textContent=ie,Ht=a(),ps=p("p"),ps.textContent=re,Xt=a(),r(ms.$$.fragment),Nt=a(),is=p("p"),is.innerHTML=ce,Ft=a(),rs=p("p"),rs.innerHTML=ye,zt=a(),r(cs.$$.fragment),Yt=a(),ys=p("p"),ys.textContent=oe,At=a(),os=p("p"),os.textContent=Me,Qt=a(),Ms=p("p"),Ms.textContent=he,Lt=a(),r(hs.$$.fragment),Pt=a(),ds=p("p"),ds.innerHTML=de,qt=a(),r(Us.$$.fragment),Dt=a(),ws=p("p"),ws.textContent=Ue,Ot=a(),r(Js.$$.fragment),Kt=a(),Ts=p("p"),Ts.innerHTML=we,sl=a(),r(fs.$$.fragment),tl=a(),us=p("p"),us.textContent=Je,ll=a(),js=p("p"),js.textContent=Te,el=a(),r(bs.$$.fragment),al=a(),vs=p("p"),vs.innerHTML=fe,nl=a(),gs=p("p"),gs.innerHTML=ue,pl=a(),r(Cs.$$.fragment),ml=a(),Es=p("p"),Es.innerHTML=je,il=a(),$s=p("p"),$s.innerHTML=be,rl=a(),r(Rs.$$.fragment),cl=a(),Ws=p("p"),Ws.textContent=ve,yl=a(),r(Is.$$.fragment),ol=a(),r(u.$$.fragment),Ml=a(),Bs=p("p"),Bs.innerHTML=ge,hl=a(),r(xs.$$.fragment),dl=a(),r(j.$$.fragment),Ul=a(),_s=p("p"),_s.textContent=Ce,wl=a(),r(Zs.$$.fragment),Jl=a(),ks=p("p"),ks.innerHTML=Ee,Tl=a(),r(Vs.$$.fragment),fl=a(),Ss=p("p"),Ss.textContent=$e,ul=a(),Gs=p("p"),Gs.textContent=Re,jl=a(),r(Hs.$$.fragment),bl=a(),Xs=p("p"),Xs.innerHTML=We,vl=a(),r(Ns.$$.fragment),gl=a(),Fs=p("p"),Fs.textContent=Ie,Cl=a(),zs=p("p"),zs.textContent=Be,El=a(),Os=p("p"),this.h()},l(s){const t=Ne("svelte-u9bgzb",document.head);d=m(t,"META",{name:!0,content:!0}),t.forEach(l),w=n(s),f=m(s,"P",{}),Ks(f).forEach(l),st=n(s),c(v.$$.fragment,s),tt=n(s),g=m(s,"P",{"data-svelte-h":!0}),i(g)!=="svelte-13w2mej"&&(g.innerHTML=Vl),lt=n(s),C=m(s,"P",{"data-svelte-h":!0}),i(C)!=="svelte-5v5md3"&&(C.textContent=Sl),et=n(s),E=m(s,"OL",{"data-svelte-h":!0}),i(E)!=="svelte-4nxp3q"&&(E.innerHTML=Gl),at=n(s),$=m(s,"P",{"data-svelte-h":!0}),i($)!=="svelte-jdruu3"&&($.innerHTML=Hl),nt=n(s),R=m(s,"P",{"data-svelte-h":!0}),i(R)!=="svelte-1k6mlt0"&&(R.innerHTML=Xl),pt=n(s),c(W.$$.fragment,s),mt=n(s),I=m(s,"P",{"data-svelte-h":!0}),i(I)!=="svelte-xrulp1"&&(I.textContent=Nl),it=n(s),c(B.$$.fragment,s),rt=n(s),x=m(s,"P",{"data-svelte-h":!0}),i(x)!=="svelte-15kzs7w"&&(x.textContent=Fl),ct=n(s),c(_.$$.fragment,s),yt=n(s),Z=m(s,"P",{"data-svelte-h":!0}),i(Z)!=="svelte-hwqgs8"&&(Z.innerHTML=zl),ot=n(s),k=m(s,"TABLE",{"data-svelte-h":!0}),i(k)!=="svelte-1bab141"&&(k.innerHTML=Yl),Mt=n(s),V=m(s,"P",{"data-svelte-h":!0}),i(V)!=="svelte-1l4zcaj"&&(V.textContent=Al),ht=n(s),S=m(s,"UL",{"data-svelte-h":!0}),i(S)!=="svelte-przajt"&&(S.innerHTML=Ql),dt=n(s),G=m(s,"P",{});var Ds=Ks(G);Rl=Qs(Ds,`这样总共有 2 个错误。要得到错误率，我们将错误数除以参考文本中的总词数（N），在这个例子中为 6：
`),Ut=kl(Ds,!1),Ds.forEach(l),wt=n(s),H=m(s,"P",{"data-svelte-h":!0}),i(H)!=="svelte-1854o91"&&(H.textContent=Ll),Jt=n(s),X=m(s,"P",{"data-svelte-h":!0}),i(X)!=="svelte-8dxaxe"&&(X.innerHTML=Pl),Tt=n(s),N=m(s,"P",{"data-svelte-h":!0}),i(N)!=="svelte-n48bqc"&&(N.textContent=ql),ft=n(s),c(F.$$.fragment,s),ut=n(s),z=m(s,"P",{"data-svelte-h":!0}),i(z)!=="svelte-6f8n73"&&(z.textContent=Dl),jt=n(s),c(Y.$$.fragment,s),bt=n(s),A=m(s,"P",{"data-svelte-h":!0}),i(A)!=="svelte-1natdjh"&&(A.innerHTML=Ol),vt=n(s),c(Q.$$.fragment,s),gt=n(s),L=m(s,"P",{"data-svelte-h":!0}),i(L)!=="svelte-vqjr3x"&&(L.textContent=Kl),Ct=n(s),P=m(s,"P",{"data-svelte-h":!0}),i(P)!=="svelte-1dyyekh"&&(P.textContent=se),Et=n(s),c(q.$$.fragment,s),$t=n(s),J=m(s,"P",{});var T=Ks(J);Wl=Qs(T,"我们可以将 WER 反过来，得到一个"),Ps=m(T,"EM",{"data-svelte-h":!0}),i(Ps)!=="svelte-1z0qahd"&&(Ps.textContent=te),Il=Qs(T,"的指标。与其衡量词错误率，不如衡量我们系统的"),qs=m(T,"EM",{"data-svelte-h":!0}),i(qs)!=="svelte-1xpv9p7"&&(qs.textContent=le),Bl=Qs(T,`：
`),Rt=kl(T,!1),T.forEach(l),Wt=n(s),D=m(s,"P",{"data-svelte-h":!0}),i(D)!=="svelte-1p5gbbh"&&(D.textContent=ee),It=n(s),c(O.$$.fragment,s),Bt=n(s),K=m(s,"P",{"data-svelte-h":!0}),i(K)!=="svelte-11kxh74"&&(K.innerHTML=ae),xt=n(s),ss=m(s,"TABLE",{"data-svelte-h":!0}),i(ss)!=="svelte-10jcjwa"&&(ss.innerHTML=ne),_t=n(s),ts=m(s,"P",{"data-svelte-h":!0}),i(ts)!=="svelte-1fpw1vj"&&(ts.textContent=pe),Zt=n(s),ls=m(s,"P",{});var _l=Ks(ls);xl=Qs(_l,`在我们的例子中，我们有 1 个字符替换，0 个插入和 3 个删除。总共有 14 个字符。所以，我们的 CER 是：
`),kt=kl(_l,!1),_l.forEach(l),Vt=n(s),es=m(s,"P",{"data-svelte-h":!0}),i(es)!=="svelte-1xggcld"&&(es.textContent=me),St=n(s),c(as.$$.fragment,s),Gt=n(s),ns=m(s,"P",{"data-svelte-h":!0}),i(ns)!=="svelte-gm0bq8"&&(ns.textContent=ie),Ht=n(s),ps=m(s,"P",{"data-svelte-h":!0}),i(ps)!=="svelte-877zxy"&&(ps.textContent=re),Xt=n(s),c(ms.$$.fragment,s),Nt=n(s),is=m(s,"P",{"data-svelte-h":!0}),i(is)!=="svelte-16kfuwf"&&(is.innerHTML=ce),Ft=n(s),rs=m(s,"P",{"data-svelte-h":!0}),i(rs)!=="svelte-1kylplg"&&(rs.innerHTML=ye),zt=n(s),c(cs.$$.fragment,s),Yt=n(s),ys=m(s,"P",{"data-svelte-h":!0}),i(ys)!=="svelte-1py4m7q"&&(ys.textContent=oe),At=n(s),os=m(s,"P",{"data-svelte-h":!0}),i(os)!=="svelte-1j7bc1s"&&(os.textContent=Me),Qt=n(s),Ms=m(s,"P",{"data-svelte-h":!0}),i(Ms)!=="svelte-1c2839h"&&(Ms.textContent=he),Lt=n(s),c(hs.$$.fragment,s),Pt=n(s),ds=m(s,"P",{"data-svelte-h":!0}),i(ds)!=="svelte-1yevus4"&&(ds.innerHTML=de),qt=n(s),c(Us.$$.fragment,s),Dt=n(s),ws=m(s,"P",{"data-svelte-h":!0}),i(ws)!=="svelte-sp2e50"&&(ws.textContent=Ue),Ot=n(s),c(Js.$$.fragment,s),Kt=n(s),Ts=m(s,"P",{"data-svelte-h":!0}),i(Ts)!=="svelte-1yevus4"&&(Ts.innerHTML=we),sl=n(s),c(fs.$$.fragment,s),tl=n(s),us=m(s,"P",{"data-svelte-h":!0}),i(us)!=="svelte-xj5w0b"&&(us.textContent=Je),ll=n(s),js=m(s,"P",{"data-svelte-h":!0}),i(js)!=="svelte-10zdssa"&&(js.textContent=Te),el=n(s),c(bs.$$.fragment,s),al=n(s),vs=m(s,"P",{"data-svelte-h":!0}),i(vs)!=="svelte-d5c5ze"&&(vs.innerHTML=fe),nl=n(s),gs=m(s,"P",{"data-svelte-h":!0}),i(gs)!=="svelte-1tj62ql"&&(gs.innerHTML=ue),pl=n(s),c(Cs.$$.fragment,s),ml=n(s),Es=m(s,"P",{"data-svelte-h":!0}),i(Es)!=="svelte-kib0od"&&(Es.innerHTML=je),il=n(s),$s=m(s,"P",{"data-svelte-h":!0}),i($s)!=="svelte-1qz7o4u"&&($s.innerHTML=be),rl=n(s),c(Rs.$$.fragment,s),cl=n(s),Ws=m(s,"P",{"data-svelte-h":!0}),i(Ws)!=="svelte-ib1gqi"&&(Ws.textContent=ve),yl=n(s),c(Is.$$.fragment,s),ol=n(s),c(u.$$.fragment,s),Ml=n(s),Bs=m(s,"P",{"data-svelte-h":!0}),i(Bs)!=="svelte-10xvjaf"&&(Bs.innerHTML=ge),hl=n(s),c(xs.$$.fragment,s),dl=n(s),c(j.$$.fragment,s),Ul=n(s),_s=m(s,"P",{"data-svelte-h":!0}),i(_s)!=="svelte-1cw0qmx"&&(_s.textContent=Ce),wl=n(s),c(Zs.$$.fragment,s),Jl=n(s),ks=m(s,"P",{"data-svelte-h":!0}),i(ks)!=="svelte-1yevus4"&&(ks.innerHTML=Ee),Tl=n(s),c(Vs.$$.fragment,s),fl=n(s),Ss=m(s,"P",{"data-svelte-h":!0}),i(Ss)!=="svelte-1tn7dv0"&&(Ss.textContent=$e),ul=n(s),Gs=m(s,"P",{"data-svelte-h":!0}),i(Gs)!=="svelte-1wtd744"&&(Gs.textContent=Re),jl=n(s),c(Hs.$$.fragment,s),bl=n(s),Xs=m(s,"P",{"data-svelte-h":!0}),i(Xs)!=="svelte-1yevus4"&&(Xs.innerHTML=We),vl=n(s),c(Ns.$$.fragment,s),gl=n(s),Fs=m(s,"P",{"data-svelte-h":!0}),i(Fs)!=="svelte-19brpui"&&(Fs.textContent=Ie),Cl=n(s),zs=m(s,"P",{"data-svelte-h":!0}),i(zs)!=="svelte-mr5dx1"&&(zs.textContent=Be),El=n(s),Os=m(s,"P",{}),Ks(Os).forEach(l),this.h()},h(){xe(d,"name","hf:doc:metadata"),xe(d,"content",Ae),Ut.a=null,Rt.a=null,kt.a=null},m(s,t){b(document.head,d),e(s,w,t),e(s,f,t),e(s,st,t),y(v,s,t),e(s,tt,t),e(s,g,t),e(s,lt,t),e(s,C,t),e(s,et,t),e(s,E,t),e(s,at,t),e(s,$,t),e(s,nt,t),e(s,R,t),e(s,pt,t),y(W,s,t),e(s,mt,t),e(s,I,t),e(s,it,t),y(B,s,t),e(s,rt,t),e(s,x,t),e(s,ct,t),y(_,s,t),e(s,yt,t),e(s,Z,t),e(s,ot,t),e(s,k,t),e(s,Mt,t),e(s,V,t),e(s,ht,t),e(s,S,t),e(s,dt,t),e(s,G,t),b(G,Rl),Ut.m(Ze,G),e(s,wt,t),e(s,H,t),e(s,Jt,t),e(s,X,t),e(s,Tt,t),e(s,N,t),e(s,ft,t),y(F,s,t),e(s,ut,t),e(s,z,t),e(s,jt,t),y(Y,s,t),e(s,bt,t),e(s,A,t),e(s,vt,t),y(Q,s,t),e(s,gt,t),e(s,L,t),e(s,Ct,t),e(s,P,t),e(s,Et,t),y(q,s,t),e(s,$t,t),e(s,J,t),b(J,Wl),b(J,Ps),b(J,Il),b(J,qs),b(J,Bl),Rt.m(ke,J),e(s,Wt,t),e(s,D,t),e(s,It,t),y(O,s,t),e(s,Bt,t),e(s,K,t),e(s,xt,t),e(s,ss,t),e(s,_t,t),e(s,ts,t),e(s,Zt,t),e(s,ls,t),b(ls,xl),kt.m(Ve,ls),e(s,Vt,t),e(s,es,t),e(s,St,t),y(as,s,t),e(s,Gt,t),e(s,ns,t),e(s,Ht,t),e(s,ps,t),e(s,Xt,t),y(ms,s,t),e(s,Nt,t),e(s,is,t),e(s,Ft,t),e(s,rs,t),e(s,zt,t),y(cs,s,t),e(s,Yt,t),e(s,ys,t),e(s,At,t),e(s,os,t),e(s,Qt,t),e(s,Ms,t),e(s,Lt,t),y(hs,s,t),e(s,Pt,t),e(s,ds,t),e(s,qt,t),y(Us,s,t),e(s,Dt,t),e(s,ws,t),e(s,Ot,t),y(Js,s,t),e(s,Kt,t),e(s,Ts,t),e(s,sl,t),y(fs,s,t),e(s,tl,t),e(s,us,t),e(s,ll,t),e(s,js,t),e(s,el,t),y(bs,s,t),e(s,al,t),e(s,vs,t),e(s,nl,t),e(s,gs,t),e(s,pl,t),y(Cs,s,t),e(s,ml,t),e(s,Es,t),e(s,il,t),e(s,$s,t),e(s,rl,t),y(Rs,s,t),e(s,cl,t),e(s,Ws,t),e(s,yl,t),y(Is,s,t),e(s,ol,t),y(u,s,t),e(s,Ml,t),e(s,Bs,t),e(s,hl,t),y(xs,s,t),e(s,dl,t),y(j,s,t),e(s,Ul,t),e(s,_s,t),e(s,wl,t),y(Zs,s,t),e(s,Jl,t),e(s,ks,t),e(s,Tl,t),y(Vs,s,t),e(s,fl,t),e(s,Ss,t),e(s,ul,t),e(s,Gs,t),e(s,jl,t),y(Hs,s,t),e(s,bl,t),e(s,Xs,t),e(s,vl,t),y(Ns,s,t),e(s,gl,t),e(s,Fs,t),e(s,Cl,t),e(s,zs,t),e(s,El,t),e(s,Os,t),$l=!0},p(s,[t]){const Ds={};t&2&&(Ds.$$scope={dirty:t,ctx:s}),u.$set(Ds);const T={};t&2&&(T.$$scope={dirty:t,ctx:s}),j.$set(T)},i(s){$l||(o(v.$$.fragment,s),o(W.$$.fragment,s),o(B.$$.fragment,s),o(_.$$.fragment,s),o(F.$$.fragment,s),o(Y.$$.fragment,s),o(Q.$$.fragment,s),o(q.$$.fragment,s),o(O.$$.fragment,s),o(as.$$.fragment,s),o(ms.$$.fragment,s),o(cs.$$.fragment,s),o(hs.$$.fragment,s),o(Us.$$.fragment,s),o(Js.$$.fragment,s),o(fs.$$.fragment,s),o(bs.$$.fragment,s),o(Cs.$$.fragment,s),o(Rs.$$.fragment,s),o(Is.$$.fragment,s),o(u.$$.fragment,s),o(xs.$$.fragment,s),o(j.$$.fragment,s),o(Zs.$$.fragment,s),o(Vs.$$.fragment,s),o(Hs.$$.fragment,s),o(Ns.$$.fragment,s),$l=!0)},o(s){M(v.$$.fragment,s),M(W.$$.fragment,s),M(B.$$.fragment,s),M(_.$$.fragment,s),M(F.$$.fragment,s),M(Y.$$.fragment,s),M(Q.$$.fragment,s),M(q.$$.fragment,s),M(O.$$.fragment,s),M(as.$$.fragment,s),M(ms.$$.fragment,s),M(cs.$$.fragment,s),M(hs.$$.fragment,s),M(Us.$$.fragment,s),M(Js.$$.fragment,s),M(fs.$$.fragment,s),M(bs.$$.fragment,s),M(Cs.$$.fragment,s),M(Rs.$$.fragment,s),M(Is.$$.fragment,s),M(u.$$.fragment,s),M(xs.$$.fragment,s),M(j.$$.fragment,s),M(Zs.$$.fragment,s),M(Vs.$$.fragment,s),M(Hs.$$.fragment,s),M(Ns.$$.fragment,s),$l=!1},d(s){s&&(l(w),l(f),l(st),l(tt),l(g),l(lt),l(C),l(et),l(E),l(at),l($),l(nt),l(R),l(pt),l(mt),l(I),l(it),l(rt),l(x),l(ct),l(yt),l(Z),l(ot),l(k),l(Mt),l(V),l(ht),l(S),l(dt),l(G),l(wt),l(H),l(Jt),l(X),l(Tt),l(N),l(ft),l(ut),l(z),l(jt),l(bt),l(A),l(vt),l(gt),l(L),l(Ct),l(P),l(Et),l($t),l(J),l(Wt),l(D),l(It),l(Bt),l(K),l(xt),l(ss),l(_t),l(ts),l(Zt),l(ls),l(Vt),l(es),l(St),l(Gt),l(ns),l(Ht),l(ps),l(Xt),l(Nt),l(is),l(Ft),l(rs),l(zt),l(Yt),l(ys),l(At),l(os),l(Qt),l(Ms),l(Lt),l(Pt),l(ds),l(qt),l(Dt),l(ws),l(Ot),l(Kt),l(Ts),l(sl),l(tl),l(us),l(ll),l(js),l(el),l(al),l(vs),l(nl),l(gs),l(pl),l(ml),l(Es),l(il),l($s),l(rl),l(cl),l(Ws),l(yl),l(ol),l(Ml),l(Bs),l(hl),l(dl),l(Ul),l(_s),l(wl),l(Jl),l(ks),l(Tl),l(fl),l(Ss),l(ul),l(Gs),l(jl),l(bl),l(Xs),l(vl),l(gl),l(Fs),l(Cl),l(zs),l(El),l(Os)),l(d),h(v,s),h(W,s),h(B,s),h(_,s),h(F,s),h(Y,s),h(Q,s),h(q,s),h(O,s),h(as,s),h(ms,s),h(cs,s),h(hs,s),h(Us,s),h(Js,s),h(fs,s),h(bs,s),h(Cs,s),h(Rs,s),h(Is,s),h(u,s),h(xs,s),h(j,s),h(Zs,s),h(Vs,s),h(Hs,s),h(Ns,s)}}}const Ae='{"title":"语音识别的评价指标","local":"语音识别的评价指标","sections":[{"title":"词错误率","local":"词错误率","sections":[],"depth":2},{"title":"词准确率","local":"词准确率","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 Qe(Ls){return Ge(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ke extends He{constructor(d){super(),Xe(this,d,Qe,Ye,Se,{})}}export{Ke as component};
