import{s as he,n as ue,o as pe}from"../chunks/scheduler.f7e1785c.js";import{S as ce,i as fe,g as i,s as o,r,A as me,h as l,f as a,c as s,j as de,u as h,x as d,k as Dt,y as ge,a as n,v as u,d as p,t as c,w as f}from"../chunks/index.9f8f0838.js";import{C as re}from"../chunks/CodeBlock.b3510e34.js";import{H as w}from"../chunks/Heading.6643a2f7.js";function we(Nt){let m,K,X,tt,y,et,v,Wt=`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.`,at,b,Yt="Before we pick a dataset, we first need to understand the key defining features.",nt,C,ot,x,st,$,Jt=`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.`,it,k,lt,T,Vt=`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.`,dt,_,Bt=`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.`,rt,M,ht,H,Et="The speaking style falls into one of two categories:",ut,P,Ft="<li>Narrated: read from a script</li> <li>Spontaneous: un-scripted, conversational speech</li>",pt,L,Gt=`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:`,ct,U,ft,j,qt=`Whereas for spontaneous speech, we can expect a more colloquial style of speech, with the inclusion of repetitions,
hesitations and false-starts:`,mt,S,gt,A,wt,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.`,yt,D,vt,N,Rt="Here is a summary of the most popular English speech recognition datasets on the Hugging Face Hub:",bt,W,Zt='<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>',Ct,Y,Ot=`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,J,Xt='<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>',$t,V,Qt=`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.`,kt,B,Kt=`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!`,Tt,E,_t,F,te=`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.`,Mt,G,ee=`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.`,Ht,q,ae=`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.`,Pt,z,ne=`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):`,Lt,g,oe='<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"/>',Ut,R,se=`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.`,jt,Z,ie=`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.`,St,O,le=`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!`,At,Q,It;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"}}),x=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 re({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 re({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"}}),E=new w({props:{title:"Common Voice 13",local:"common-voice-13",headingTag:"h2"}}),{c(){m=i("meta"),K=o(),X=i("p"),tt=o(),r(y.$$.fragment),et=o(),v=i("p"),v.textContent=Wt,at=o(),b=i("p"),b.textContent=Yt,nt=o(),r(C.$$.fragment),ot=o(),r(x.$$.fragment),st=o(),$=i("p"),$.innerHTML=Jt,it=o(),r(k.$$.fragment),lt=o(),T=i("p"),T.textContent=Vt,dt=o(),_=i("p"),_.textContent=Bt,rt=o(),r(M.$$.fragment),ht=o(),H=i("p"),H.textContent=Et,ut=o(),P=i("ul"),P.innerHTML=Ft,pt=o(),L=i("p"),L.textContent=Gt,ct=o(),r(U.$$.fragment),ft=o(),j=i("p"),j.textContent=qt,mt=o(),r(S.$$.fragment),gt=o(),r(A.$$.fragment),wt=o(),I=i("p"),I.textContent=zt,yt=o(),r(D.$$.fragment),vt=o(),N=i("p"),N.textContent=Rt,bt=o(),W=i("table"),W.innerHTML=Zt,Ct=o(),Y=i("p"),Y.textContent=Ot,xt=o(),J=i("table"),J.innerHTML=Xt,$t=o(),V=i("p"),V.innerHTML=Qt,kt=o(),B=i("p"),B.textContent=Kt,Tt=o(),r(E.$$.fragment),_t=o(),F=i("p"),F.textContent=te,Mt=o(),G=i("p"),G.innerHTML=ee,Ht=o(),q=i("p"),q.innerHTML=ae,Pt=o(),z=i("p"),z.innerHTML=ne,Lt=o(),g=i("div"),g.innerHTML=oe,Ut=o(),R=i("p"),R.textContent=se,jt=o(),Z=i("p"),Z.textContent=ie,St=o(),O=i("p"),O.innerHTML=le,At=o(),Q=i("p"),this.h()},l(t){const e=me("svelte-u9bgzb",document.head);m=l(e,"META",{name:!0,content:!0}),e.forEach(a),K=s(t),X=l(t,"P",{}),de(X).forEach(a),tt=s(t),h(y.$$.fragment,t),et=s(t),v=l(t,"P",{"data-svelte-h":!0}),d(v)!=="svelte-15zyog0"&&(v.textContent=Wt),at=s(t),b=l(t,"P",{"data-svelte-h":!0}),d(b)!=="svelte-1rsl8i9"&&(b.textContent=Yt),nt=s(t),h(C.$$.fragment,t),ot=s(t),h(x.$$.fragment,t),st=s(t),$=l(t,"P",{"data-svelte-h":!0}),d($)!=="svelte-1mt3582"&&($.innerHTML=Jt),it=s(t),h(k.$$.fragment,t),lt=s(t),T=l(t,"P",{"data-svelte-h":!0}),d(T)!=="svelte-utmvu5"&&(T.textContent=Vt),dt=s(t),_=l(t,"P",{"data-svelte-h":!0}),d(_)!=="svelte-k3up68"&&(_.textContent=Bt),rt=s(t),h(M.$$.fragment,t),ht=s(t),H=l(t,"P",{"data-svelte-h":!0}),d(H)!=="svelte-1je74i9"&&(H.textContent=Et),ut=s(t),P=l(t,"UL",{"data-svelte-h":!0}),d(P)!=="svelte-1l9j9hu"&&(P.innerHTML=Ft),pt=s(t),L=l(t,"P",{"data-svelte-h":!0}),d(L)!=="svelte-1tb6mrj"&&(L.textContent=Gt),ct=s(t),h(U.$$.fragment,t),ft=s(t),j=l(t,"P",{"data-svelte-h":!0}),d(j)!=="svelte-th73kg"&&(j.textContent=qt),mt=s(t),h(S.$$.fragment,t),gt=s(t),h(A.$$.fragment,t),wt=s(t),I=l(t,"P",{"data-svelte-h":!0}),d(I)!=="svelte-lu6hxf"&&(I.textContent=zt),yt=s(t),h(D.$$.fragment,t),vt=s(t),N=l(t,"P",{"data-svelte-h":!0}),d(N)!=="svelte-12pozb0"&&(N.textContent=Rt),bt=s(t),W=l(t,"TABLE",{"data-svelte-h":!0}),d(W)!=="svelte-1tshwgv"&&(W.innerHTML=Zt),Ct=s(t),Y=l(t,"P",{"data-svelte-h":!0}),d(Y)!=="svelte-m8mw9i"&&(Y.textContent=Ot),xt=s(t),J=l(t,"TABLE",{"data-svelte-h":!0}),d(J)!=="svelte-1wjgm7a"&&(J.innerHTML=Xt),$t=s(t),V=l(t,"P",{"data-svelte-h":!0}),d(V)!=="svelte-tge7kj"&&(V.innerHTML=Qt),kt=s(t),B=l(t,"P",{"data-svelte-h":!0}),d(B)!=="svelte-gltk6z"&&(B.textContent=Kt),Tt=s(t),h(E.$$.fragment,t),_t=s(t),F=l(t,"P",{"data-svelte-h":!0}),d(F)!=="svelte-19tt3h8"&&(F.textContent=te),Mt=s(t),G=l(t,"P",{"data-svelte-h":!0}),d(G)!=="svelte-1c1tn1u"&&(G.innerHTML=ee),Ht=s(t),q=l(t,"P",{"data-svelte-h":!0}),d(q)!=="svelte-ckc95o"&&(q.innerHTML=ae),Pt=s(t),z=l(t,"P",{"data-svelte-h":!0}),d(z)!=="svelte-1emkleh"&&(z.innerHTML=ne),Lt=s(t),g=l(t,"DIV",{class:!0,"data-svelte-h":!0}),d(g)!=="svelte-y9qjeu"&&(g.innerHTML=oe),Ut=s(t),R=l(t,"P",{"data-svelte-h":!0}),d(R)!=="svelte-1im4yyp"&&(R.textContent=se),jt=s(t),Z=l(t,"P",{"data-svelte-h":!0}),d(Z)!=="svelte-1yhqqce"&&(Z.textContent=ie),St=s(t),O=l(t,"P",{"data-svelte-h":!0}),d(O)!=="svelte-1esedkp"&&(O.innerHTML=le),At=s(t),Q=l(t,"P",{}),de(Q).forEach(a),this.h()},h(){Dt(m,"name","hf:doc:metadata"),Dt(m,"content",ye),Dt(g,"class","flex justify-center")},m(t,e){ge(document.head,m),n(t,K,e),n(t,X,e),n(t,tt,e),u(y,t,e),n(t,et,e),n(t,v,e),n(t,at,e),n(t,b,e),n(t,nt,e),u(C,t,e),n(t,ot,e),u(x,t,e),n(t,st,e),n(t,$,e),n(t,it,e),u(k,t,e),n(t,lt,e),n(t,T,e),n(t,dt,e),n(t,_,e),n(t,rt,e),u(M,t,e),n(t,ht,e),n(t,H,e),n(t,ut,e),n(t,P,e),n(t,pt,e),n(t,L,e),n(t,ct,e),u(U,t,e),n(t,ft,e),n(t,j,e),n(t,mt,e),u(S,t,e),n(t,gt,e),u(A,t,e),n(t,wt,e),n(t,I,e),n(t,yt,e),u(D,t,e),n(t,vt,e),n(t,N,e),n(t,bt,e),n(t,W,e),n(t,Ct,e),n(t,Y,e),n(t,xt,e),n(t,J,e),n(t,$t,e),n(t,V,e),n(t,kt,e),n(t,B,e),n(t,Tt,e),u(E,t,e),n(t,_t,e),n(t,F,e),n(t,Mt,e),n(t,G,e),n(t,Ht,e),n(t,q,e),n(t,Pt,e),n(t,z,e),n(t,Lt,e),n(t,g,e),n(t,Ut,e),n(t,R,e),n(t,jt,e),n(t,Z,e),n(t,St,e),n(t,O,e),n(t,At,e),n(t,Q,e),It=!0},p:ue,i(t){It||(p(y.$$.fragment,t),p(C.$$.fragment,t),p(x.$$.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(E.$$.fragment,t),It=!0)},o(t){c(y.$$.fragment,t),c(C.$$.fragment,t),c(x.$$.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(E.$$.fragment,t),It=!1},d(t){t&&(a(K),a(X),a(tt),a(et),a(v),a(at),a(b),a(nt),a(ot),a(st),a($),a(it),a(lt),a(T),a(dt),a(_),a(rt),a(ht),a(H),a(ut),a(P),a(pt),a(L),a(ct),a(ft),a(j),a(mt),a(gt),a(wt),a(I),a(yt),a(vt),a(N),a(bt),a(W),a(Ct),a(Y),a(xt),a(J),a($t),a(V),a(kt),a(B),a(Tt),a(_t),a(F),a(Mt),a(G),a(Ht),a(q),a(Pt),a(z),a(Lt),a(g),a(Ut),a(R),a(jt),a(Z),a(St),a(O),a(At),a(Q)),a(m),f(y,t),f(C,t),f(x,t),f(k,t),f(M,t),f(U,t),f(S,t),f(A,t),f(D,t),f(E,t)}}}const ye='{"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 ve(Nt){return pe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ke extends ce{constructor(m){super(),fe(this,m,ve,we,he,{})}}export{ke as component};
