import{s as pe,n as ce,o as fe}from"../chunks/scheduler.f7e1785c.js";import{S as me,i as ge,g as i,s,r,A as we,h as l,f as a,c as o,j as he,u as h,x as d,k as Wt,y as ye,a as n,v as u,d as p,t as c,w as f}from"../chunks/index.9f8f0838.js";import{C as ue}from"../chunks/CodeBlock.4baef5d7.js";import{H as w,E as ve}from"../chunks/getInferenceSnippets.ba5f4cd0.js";function be(Et){let m,tt,Q,et,y,at,v,Yt=`As with any machine learning problem, our model is only as good as the data that we train it on. Speech recognition
datasets vary considerably in how they are curated and the domains that they cover. To pick the right dataset, we need
to match our criteria with the features that a dataset offers.`,nt,b,Jt="Before we pick a dataset, we first need to understand the key defining features.",st,C,ot,$,it,x,Vt=`Simply put, the number of training hours indicates how large the dataset is. It’s analogous to the number of training
examples in an NLP dataset. However, bigger datasets aren’t necessarily better. If we want a model that generalises well,
we want a <strong>diverse</strong> dataset with lots of different speakers, domains and speaking styles.`,lt,k,dt,T,Bt=`The domain entails where the data was sourced from, whether it be audiobooks, podcasts, YouTube or financial meetings.
Each domain has a different distribution of data. For example, audiobooks are recorded in high-quality studio conditions
(with no background noise) and text that is taken from written literature. Whereas for YouTube, the audio likely contains
more background noise and a more informal style of speech.`,rt,_,Ft=`We need to match our domain to the conditions we anticipate at inference time. For instance, if we train our model on
audiobooks, we can’t expect it to perform well in noisy environments.`,ht,M,ut,H,Gt="The speaking style falls into one of two categories:",pt,P,qt="<li>Narrated: read from a script</li> <li>Spontaneous: un-scripted, conversational speech</li>",ct,L,zt=`The audio and text data reflect the style of speaking. Since narrated text is scripted, it tends to be spoken articulately
and without any errors:`,ft,U,mt,j,Rt=`Whereas for spontaneous speech, we can expect a more colloquial style of speech, with the inclusion of repetitions,
hesitations and false-starts:`,gt,S,wt,A,yt,I,Zt=`The transcription style refers to whether the target text has punctuation, casing or both. If we want a system to generate
fully formatted text that could be used for a publication or meeting transcription, we require training data with punctuation
and casing. If we just require the spoken words in an un-formatted structure, neither punctuation nor casing are necessary.
In this case, we can either pick a dataset without punctuation or casing, or pick one that has punctuation and casing and
then subsequently remove them from the target text through pre-processing.`,vt,D,bt,N,Ot="Here is a summary of the most popular English speech recognition datasets on the Hugging Face Hub:",Ct,W,Xt='<thead><tr><th>Dataset</th> <th>Train Hours</th> <th>Domain</th> <th>Speaking Style</th> <th>Casing</th> <th>Punctuation</th> <th>License</th> <th>Recommended Use</th></tr></thead> <tbody><tr><td><a href="https://huggingface.co/datasets/librispeech_asr" rel="nofollow">LibriSpeech</a></td> <td>960</td> <td>Audiobook</td> <td>Narrated</td> <td>❌</td> <td>❌</td> <td>CC-BY-4.0</td> <td>Academic benchmarks</td></tr> <tr><td><a href="https://huggingface.co/datasets/mozilla-foundation/common_voice_11_0" rel="nofollow">Common Voice 11</a></td> <td>3000</td> <td>Wikipedia</td> <td>Narrated</td> <td>✅</td> <td>✅</td> <td>CC0-1.0</td> <td>Non-native speakers</td></tr> <tr><td><a href="https://huggingface.co/datasets/facebook/voxpopuli" rel="nofollow">VoxPopuli</a></td> <td>540</td> <td>European Parliament</td> <td>Oratory</td> <td>❌</td> <td>✅</td> <td>CC0</td> <td>Non-native speakers</td></tr> <tr><td><a href="https://huggingface.co/datasets/LIUM/tedlium" rel="nofollow">TED-LIUM</a></td> <td>450</td> <td>TED talks</td> <td>Oratory</td> <td>❌</td> <td>❌</td> <td>CC-BY-NC-ND 3.0</td> <td>Technical topics</td></tr> <tr><td><a href="https://huggingface.co/datasets/speechcolab/gigaspeech" rel="nofollow">GigaSpeech</a></td> <td>10000</td> <td>Audiobook, podcast, YouTube</td> <td>Narrated, spontaneous</td> <td>❌</td> <td>✅</td> <td>apache-2.0</td> <td>Robustness over multiple domains</td></tr> <tr><td><a href="https://huggingface.co/datasets/kensho/spgispeech" rel="nofollow">SPGISpeech</a></td> <td>5000</td> <td>Financial meetings</td> <td>Oratory, spontaneous</td> <td>✅</td> <td>✅</td> <td>User Agreement</td> <td>Fully formatted transcriptions</td></tr> <tr><td><a href="https://huggingface.co/datasets/revdotcom/earnings22" rel="nofollow">Earnings-22</a></td> <td>119</td> <td>Financial meetings</td> <td>Oratory, spontaneous</td> <td>✅</td> <td>✅</td> <td>CC-BY-SA-4.0</td> <td>Diversity of accents</td></tr> <tr><td><a href="https://huggingface.co/datasets/edinburghcstr/ami" rel="nofollow">AMI</a></td> <td>100</td> <td>Meetings</td> <td>Spontaneous</td> <td>✅</td> <td>✅</td> <td>CC-BY-4.0</td> <td>Noisy speech conditions</td></tr></tbody>',$t,E,Qt=`This table serves as a reference for selecting a dataset based on your criterion. Below is an equivalent table for
multilingual speech recognition. Note that we omit the train hours column, since this varies depending on the language
for each dataset, and replace it with the number of languages per dataset:`,xt,Y,Kt='<thead><tr><th>Dataset</th> <th>Languages</th> <th>Domain</th> <th>Speaking Style</th> <th>Casing</th> <th>Punctuation</th> <th>License</th> <th>Recommended Usage</th></tr></thead> <tbody><tr><td><a href="https://huggingface.co/datasets/facebook/multilingual_librispeech" rel="nofollow">Multilingual LibriSpeech</a></td> <td>6</td> <td>Audiobooks</td> <td>Narrated</td> <td>❌</td> <td>❌</td> <td>CC-BY-4.0</td> <td>Academic benchmarks</td></tr> <tr><td><a href="https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0" rel="nofollow">Common Voice 13</a></td> <td>108</td> <td>Wikipedia text &amp; crowd-sourced speech</td> <td>Narrated</td> <td>✅</td> <td>✅</td> <td>CC0-1.0</td> <td>Diverse speaker set</td></tr> <tr><td><a href="https://huggingface.co/datasets/facebook/voxpopuli" rel="nofollow">VoxPopuli</a></td> <td>15</td> <td>European Parliament recordings</td> <td>Spontaneous</td> <td>❌</td> <td>✅</td> <td>CC0</td> <td>European languages</td></tr> <tr><td><a href="https://huggingface.co/datasets/google/fleurs" rel="nofollow">FLEURS</a></td> <td>101</td> <td>European Parliament recordings</td> <td>Spontaneous</td> <td>❌</td> <td>❌</td> <td>CC-BY-4.0</td> <td>Multilingual evaluation</td></tr></tbody>',kt,J,te=`For a detailed breakdown of the audio datasets covered in both tables, refer to the blog post <a href="https://huggingface.co/blog/audio-datasets#a-tour-of-audio-datasets-on-the-hub" rel="nofollow">A Complete Guide to Audio Datasets</a>.
While there are over 180 speech recognition datasets on the Hub, it may be possible that there isn’t a dataset that matches
your needs. In this case, it’s also possible to use your own audio data with 🤗 Datasets. To create a custom audio dataset,
refer to the guide <a href="https://huggingface.co/docs/datasets/audio_dataset" rel="nofollow">Create an audio dataset</a>. When creating a custom
audio dataset, consider sharing the final dataset on the Hub so that others in the community can benefit from your
efforts - the audio community is inclusive and wide-ranging, and others will appreciate your work as you do theirs.`,Tt,V,ee=`Alright! Now that we’ve gone through all the criterion for selecting an ASR dataset, let’s pick one for the purpose of this tutorial.
We know that Whisper already does a pretty good job at transcribing data in high-resource languages (such as English and Spanish), so
we’ll focus ourselves on low-resource multilingual transcription. We want to retain Whisper’s ability to predict punctuation and casing,
so it seems from the second table that Common Voice 13 is a great candidate dataset!`,_t,B,Mt,F,ae=`Common Voice 13 is a crowd-sourced dataset where speakers record text from Wikipedia in various languages. It forms part of
the Common Voice series, a collection of Common Voice datasets released by Mozilla Foundation. At the time of writing,
Common Voice 13 is the latest edition of the dataset, with the most languages and hours per language out of any release to date.`,Ht,G,ne=`We can get the full list of languages for the Common Voice 13 dataset by checking-out the dataset page on the Hub:
<a href="https://huggingface.co/datasets/mozilla-foundation/common_voice_13_0" rel="nofollow">mozilla-foundation/common_voice_13_0</a>.
The first time you view this page, you’ll be asked to accept the terms of use. After that, you’ll be given full access to the dataset.`,Pt,q,se=`Once we’ve provided authentication to use the dataset, we’ll be presented with the dataset preview. The dataset preview
shows us the first 100 samples of the dataset for each language. What’s more, it’s loaded up with audio samples ready for us
to listen to in real time. For this Unit, we’ll select <a href="https://en.wikipedia.org/wiki/Maldivian_language" rel="nofollow"><em>Dhivehi</em></a>
(or <em>Maldivian</em>), an Indo-Aryan language spoken in the South Asian island country of the Maldives. While we’re selecting
Dhivehi for this tutorial, the steps covered here apply to any one of the 108 languages in the Common Voice 13 dataset, and
more generally to any one of the 180+ audio datasets on the Hugging Face Hub, so there’s no restriction on language or dialect.`,Lt,z,oe=`We can select the Dhivehi subset of Common Voice 13 by setting the subset to <code>dv</code> using the dropdown menu (<code>dv</code> being the language
identifier code for Dhivehi):`,Ut,g,ie='<img src="https://huggingface.co/datasets/huggingface-course/audio-course-images/resolve/main/cv_13_dv_selection.png" alt="Selecting the Dhivehi split from the Dataset&#39;s Preview"/>',jt,R,le=`If we hit the play button on the first sample, we can listen to the audio and see the corresponding text. Have a scroll
through the samples for the train and test sets to get a better feel for the audio and text data that we’re dealing with.
You can tell from the intonation and style that the recordings are taken from narrated speech. You’ll also likely notice
the large variation in speakers and recording quality, a common trait of crowd-sourced data.`,St,Z,de=`The Dataset Preview is a brilliant way of experiencing audio datasets before committing to using them. You can pick any
dataset on the Hub, scroll through the samples and listen to the audio for the different subsets and splits, gauging whether
it’s the right dataset for your needs. Once you’ve selected a dataset, it’s trivial to load the data so that you can
start using it.`,At,O,re=`Now, I personally don’t speak Dhivehi, and expect the vast majority of readers not to either! To know if our fine-tuned model
is any good, we’ll need a rigorous way of <em>evaluating</em> it on unseen data and measuring its transcription accuracy.
We’ll cover exactly this in the next section!`,It,X,Dt,K,Nt;return y=new w({props:{title:"Choosing a dataset",local:"choosing-a-dataset",headingTag:"h1"}}),C=new w({props:{title:"Features of speech datasets",local:"features-of-speech-datasets",headingTag:"h2"}}),$=new w({props:{title:"1. Number of hours",local:"1-number-of-hours",headingTag:"h3"}}),k=new w({props:{title:"2. Domain",local:"2-domain",headingTag:"h3"}}),M=new w({props:{title:"3. Speaking style",local:"3-speaking-style",headingTag:"h3"}}),U=new ue({props:{code:"JUUyJTgwJTlDQ29uc2lkZXIlMjB0aGUlMjB0YXNrJTIwb2YlMjB0cmFpbmluZyUyMGElMjBtb2RlbCUyMG9uJTIwYSUyMHNwZWVjaCUyMHJlY29nbml0aW9uJTIwZGF0YXNldCVFMiU4MCU5RA==",highlighted:'“Consider <span class="hljs-keyword">the</span> task <span class="hljs-keyword">of</span> training <span class="hljs-keyword">a</span> model <span class="hljs-keyword">on</span> <span class="hljs-title">a</span> <span class="hljs-title">speech</span> <span class="hljs-title">recognition</span> <span class="hljs-title">dataset</span>”',wrap:!1}}),S=new ue({props:{code:"JUUyJTgwJTlDTGV0JUUyJTgwJTk5cyUyMHVoaCUyMGxldCdzJTIwdGFrZSUyMGElMjBsb29rJTIwYXQlMjBob3clMjB5b3UnZCUyMGdvJTIwYWJvdXQlMjB0cmFpbmluZyUyMGElMjBtb2RlbCUyMG9uJTIwdWhtJTIwYSUyMHNwLSUyMHNwZWVjaCUyMHJlY29nbml0aW9uJTIwZGF0YXNldCVFMiU4MCU5RA==",highlighted:'“<span class="hljs-keyword">Let</span>’s uhh <span class="hljs-keyword">let</span><span class="hljs-comment">&#x27;s take a look at how you&#x27;d go about training a model on uhm a sp- speech recognition dataset”</span>',wrap:!1}}),A=new w({props:{title:"4. Transcription style",local:"4-transcription-style",headingTag:"h3"}}),D=new w({props:{title:"A summary of datasets on the Hub",local:"a-summary-of-datasets-on-the-hub",headingTag:"h2"}}),B=new w({props:{title:"Common Voice 13",local:"common-voice-13",headingTag:"h2"}}),X=new ve({props:{source:"https://github.com/huggingface/audio-transformers-course/blob/main/chapters/en/chapter5/choosing_dataset.mdx"}}),{c(){m=i("meta"),tt=s(),Q=i("p"),et=s(),r(y.$$.fragment),at=s(),v=i("p"),v.textContent=Yt,nt=s(),b=i("p"),b.textContent=Jt,st=s(),r(C.$$.fragment),ot=s(),r($.$$.fragment),it=s(),x=i("p"),x.innerHTML=Vt,lt=s(),r(k.$$.fragment),dt=s(),T=i("p"),T.textContent=Bt,rt=s(),_=i("p"),_.textContent=Ft,ht=s(),r(M.$$.fragment),ut=s(),H=i("p"),H.textContent=Gt,pt=s(),P=i("ul"),P.innerHTML=qt,ct=s(),L=i("p"),L.textContent=zt,ft=s(),r(U.$$.fragment),mt=s(),j=i("p"),j.textContent=Rt,gt=s(),r(S.$$.fragment),wt=s(),r(A.$$.fragment),yt=s(),I=i("p"),I.textContent=Zt,vt=s(),r(D.$$.fragment),bt=s(),N=i("p"),N.textContent=Ot,Ct=s(),W=i("table"),W.innerHTML=Xt,$t=s(),E=i("p"),E.textContent=Qt,xt=s(),Y=i("table"),Y.innerHTML=Kt,kt=s(),J=i("p"),J.innerHTML=te,Tt=s(),V=i("p"),V.textContent=ee,_t=s(),r(B.$$.fragment),Mt=s(),F=i("p"),F.textContent=ae,Ht=s(),G=i("p"),G.innerHTML=ne,Pt=s(),q=i("p"),q.innerHTML=se,Lt=s(),z=i("p"),z.innerHTML=oe,Ut=s(),g=i("div"),g.innerHTML=ie,jt=s(),R=i("p"),R.textContent=le,St=s(),Z=i("p"),Z.textContent=de,At=s(),O=i("p"),O.innerHTML=re,It=s(),r(X.$$.fragment),Dt=s(),K=i("p"),this.h()},l(t){const e=we("svelte-u9bgzb",document.head);m=l(e,"META",{name:!0,content:!0}),e.forEach(a),tt=o(t),Q=l(t,"P",{}),he(Q).forEach(a),et=o(t),h(y.$$.fragment,t),at=o(t),v=l(t,"P",{"data-svelte-h":!0}),d(v)!=="svelte-15zyog0"&&(v.textContent=Yt),nt=o(t),b=l(t,"P",{"data-svelte-h":!0}),d(b)!=="svelte-1rsl8i9"&&(b.textContent=Jt),st=o(t),h(C.$$.fragment,t),ot=o(t),h($.$$.fragment,t),it=o(t),x=l(t,"P",{"data-svelte-h":!0}),d(x)!=="svelte-1mt3582"&&(x.innerHTML=Vt),lt=o(t),h(k.$$.fragment,t),dt=o(t),T=l(t,"P",{"data-svelte-h":!0}),d(T)!=="svelte-utmvu5"&&(T.textContent=Bt),rt=o(t),_=l(t,"P",{"data-svelte-h":!0}),d(_)!=="svelte-k3up68"&&(_.textContent=Ft),ht=o(t),h(M.$$.fragment,t),ut=o(t),H=l(t,"P",{"data-svelte-h":!0}),d(H)!=="svelte-1je74i9"&&(H.textContent=Gt),pt=o(t),P=l(t,"UL",{"data-svelte-h":!0}),d(P)!=="svelte-1l9j9hu"&&(P.innerHTML=qt),ct=o(t),L=l(t,"P",{"data-svelte-h":!0}),d(L)!=="svelte-1tb6mrj"&&(L.textContent=zt),ft=o(t),h(U.$$.fragment,t),mt=o(t),j=l(t,"P",{"data-svelte-h":!0}),d(j)!=="svelte-th73kg"&&(j.textContent=Rt),gt=o(t),h(S.$$.fragment,t),wt=o(t),h(A.$$.fragment,t),yt=o(t),I=l(t,"P",{"data-svelte-h":!0}),d(I)!=="svelte-lu6hxf"&&(I.textContent=Zt),vt=o(t),h(D.$$.fragment,t),bt=o(t),N=l(t,"P",{"data-svelte-h":!0}),d(N)!=="svelte-12pozb0"&&(N.textContent=Ot),Ct=o(t),W=l(t,"TABLE",{"data-svelte-h":!0}),d(W)!=="svelte-1tshwgv"&&(W.innerHTML=Xt),$t=o(t),E=l(t,"P",{"data-svelte-h":!0}),d(E)!=="svelte-m8mw9i"&&(E.textContent=Qt),xt=o(t),Y=l(t,"TABLE",{"data-svelte-h":!0}),d(Y)!=="svelte-1wjgm7a"&&(Y.innerHTML=Kt),kt=o(t),J=l(t,"P",{"data-svelte-h":!0}),d(J)!=="svelte-tge7kj"&&(J.innerHTML=te),Tt=o(t),V=l(t,"P",{"data-svelte-h":!0}),d(V)!=="svelte-gltk6z"&&(V.textContent=ee),_t=o(t),h(B.$$.fragment,t),Mt=o(t),F=l(t,"P",{"data-svelte-h":!0}),d(F)!=="svelte-19tt3h8"&&(F.textContent=ae),Ht=o(t),G=l(t,"P",{"data-svelte-h":!0}),d(G)!=="svelte-1c1tn1u"&&(G.innerHTML=ne),Pt=o(t),q=l(t,"P",{"data-svelte-h":!0}),d(q)!=="svelte-ckc95o"&&(q.innerHTML=se),Lt=o(t),z=l(t,"P",{"data-svelte-h":!0}),d(z)!=="svelte-1emkleh"&&(z.innerHTML=oe),Ut=o(t),g=l(t,"DIV",{class:!0,"data-svelte-h":!0}),d(g)!=="svelte-y9qjeu"&&(g.innerHTML=ie),jt=o(t),R=l(t,"P",{"data-svelte-h":!0}),d(R)!=="svelte-1im4yyp"&&(R.textContent=le),St=o(t),Z=l(t,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-1yhqqce"&&(Z.textContent=de),At=o(t),O=l(t,"P",{"data-svelte-h":!0}),d(O)!=="svelte-1esedkp"&&(O.innerHTML=re),It=o(t),h(X.$$.fragment,t),Dt=o(t),K=l(t,"P",{}),he(K).forEach(a),this.h()},h(){Wt(m,"name","hf:doc:metadata"),Wt(m,"content",Ce),Wt(g,"class","flex justify-center")},m(t,e){ye(document.head,m),n(t,tt,e),n(t,Q,e),n(t,et,e),u(y,t,e),n(t,at,e),n(t,v,e),n(t,nt,e),n(t,b,e),n(t,st,e),u(C,t,e),n(t,ot,e),u($,t,e),n(t,it,e),n(t,x,e),n(t,lt,e),u(k,t,e),n(t,dt,e),n(t,T,e),n(t,rt,e),n(t,_,e),n(t,ht,e),u(M,t,e),n(t,ut,e),n(t,H,e),n(t,pt,e),n(t,P,e),n(t,ct,e),n(t,L,e),n(t,ft,e),u(U,t,e),n(t,mt,e),n(t,j,e),n(t,gt,e),u(S,t,e),n(t,wt,e),u(A,t,e),n(t,yt,e),n(t,I,e),n(t,vt,e),u(D,t,e),n(t,bt,e),n(t,N,e),n(t,Ct,e),n(t,W,e),n(t,$t,e),n(t,E,e),n(t,xt,e),n(t,Y,e),n(t,kt,e),n(t,J,e),n(t,Tt,e),n(t,V,e),n(t,_t,e),u(B,t,e),n(t,Mt,e),n(t,F,e),n(t,Ht,e),n(t,G,e),n(t,Pt,e),n(t,q,e),n(t,Lt,e),n(t,z,e),n(t,Ut,e),n(t,g,e),n(t,jt,e),n(t,R,e),n(t,St,e),n(t,Z,e),n(t,At,e),n(t,O,e),n(t,It,e),u(X,t,e),n(t,Dt,e),n(t,K,e),Nt=!0},p:ce,i(t){Nt||(p(y.$$.fragment,t),p(C.$$.fragment,t),p($.$$.fragment,t),p(k.$$.fragment,t),p(M.$$.fragment,t),p(U.$$.fragment,t),p(S.$$.fragment,t),p(A.$$.fragment,t),p(D.$$.fragment,t),p(B.$$.fragment,t),p(X.$$.fragment,t),Nt=!0)},o(t){c(y.$$.fragment,t),c(C.$$.fragment,t),c($.$$.fragment,t),c(k.$$.fragment,t),c(M.$$.fragment,t),c(U.$$.fragment,t),c(S.$$.fragment,t),c(A.$$.fragment,t),c(D.$$.fragment,t),c(B.$$.fragment,t),c(X.$$.fragment,t),Nt=!1},d(t){t&&(a(tt),a(Q),a(et),a(at),a(v),a(nt),a(b),a(st),a(ot),a(it),a(x),a(lt),a(dt),a(T),a(rt),a(_),a(ht),a(ut),a(H),a(pt),a(P),a(ct),a(L),a(ft),a(mt),a(j),a(gt),a(wt),a(yt),a(I),a(vt),a(bt),a(N),a(Ct),a(W),a($t),a(E),a(xt),a(Y),a(kt),a(J),a(Tt),a(V),a(_t),a(Mt),a(F),a(Ht),a(G),a(Pt),a(q),a(Lt),a(z),a(Ut),a(g),a(jt),a(R),a(St),a(Z),a(At),a(O),a(It),a(Dt),a(K)),a(m),f(y,t),f(C,t),f($,t),f(k,t),f(M,t),f(U,t),f(S,t),f(A,t),f(D,t),f(B,t),f(X,t)}}}const Ce='{"title":"Choosing a dataset","local":"choosing-a-dataset","sections":[{"title":"Features of speech datasets","local":"features-of-speech-datasets","sections":[{"title":"1. Number of hours","local":"1-number-of-hours","sections":[],"depth":3},{"title":"2. Domain","local":"2-domain","sections":[],"depth":3},{"title":"3. Speaking style","local":"3-speaking-style","sections":[],"depth":3},{"title":"4. Transcription style","local":"4-transcription-style","sections":[],"depth":3}],"depth":2},{"title":"A summary of datasets on the Hub","local":"a-summary-of-datasets-on-the-hub","sections":[],"depth":2},{"title":"Common Voice 13","local":"common-voice-13","sections":[],"depth":2}],"depth":1}';function $e(Et){return fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Me extends me{constructor(m){super(),ge(this,m,$e,be,pe,{})}}export{Me as component};
