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