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

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