import{S as Ae,i as Le,s as Pe,e as i,k as h,w as ve,t as u,M as Ie,c as s,d as t,m as f,a as o,x as _e,h as d,b as r,G as a,g as c,y as be,L as Be,q as Ee,o as $e,B as Se,v as Fe}from"../../chunks/vendor-hf-doc-builder.js";import{I as xe}from"../../chunks/IconCopyLink-hf-doc-builder.js";function He(ne){let m,U,p,y,x,_,O,A,R,W,w,g,L,b,j,P,z,q,$,K,N,k,Q,E,V,X,G,S,Y,M,l,I,Z,ee,B,te,ae,F,ie,se,H,oe,T;return _=new xe({}),b=new xe({}),{c(){m=i("meta"),U=h(),p=i("h1"),y=i("a"),x=i("span"),ve(_.$$.fragment),O=h(),A=i("span"),R=u("Unit 4. Build a music genre classifier"),W=h(),w=i("h2"),g=i("a"),L=i("span"),ve(b.$$.fragment),j=h(),P=i("span"),z=u("What you'll learn and what you'll build"),q=h(),$=i("p"),K=u(`Audio classification is one of the most common applications of transformers in audio and speech processing. Like other
classification tasks in machine learning, this task involves assigning one or more labels to an audio recording based on
its content. For example, in the case of speech, we might want to detect when wake words like \u201CHey Siri\u201D are spoken, or
infer a key word like \u201Ctemperature\u201D from a spoken query like \u201CWhat is the weather today?\u201C. Environmental sounds
provide another example, where we might want to automatically distinguish between sounds such as \u201Ccar horn\u201D, \u201Csiren\u201D,
\u201Cdog barking\u201D, etc.`),N=h(),k=i("p"),Q=u(`In this section, we\u2019ll look at how pre-trained audio transformers can be applied to a range of audio classification tasks.
We\u2019ll then fine-tune a transformer model on the task of music classification, classifying songs into genres like \u201Cpop\u201D and
\u201Crock\u201D. This is an important part of music streaming platforms like `),E=i("a"),V=u("Spotify"),X=u(`, which
recommend songs that are similar to the ones the user is listening to.`),G=h(),S=i("p"),Y=u("By the end of this section, you\u2019ll know how to:"),M=h(),l=i("ul"),I=i("li"),Z=u("Find suitable pre-trained models for audio classification tasks"),ee=h(),B=i("li"),te=u("Use the \u{1F917} Datasets library and the Hugging Face Hub to select audio classification datasets"),ae=h(),F=i("li"),ie=u("Fine-tune a pretrained model to classify songs by genre"),se=h(),H=i("li"),oe=u("Build a Gradio demo that lets you classify your own songs"),this.h()},l(e){const n=Ie('[data-svelte="svelte-1phssyn"]',document.head);m=s(n,"META",{name:!0,content:!0}),n.forEach(t),U=f(e),p=s(e,"H1",{class:!0});var C=o(p);y=s(C,"A",{id:!0,class:!0,href:!0});var le=o(y);x=s(le,"SPAN",{});var re=o(x);_e(_.$$.fragment,re),re.forEach(t),le.forEach(t),O=f(C),A=s(C,"SPAN",{});var ce=o(A);R=d(ce,"Unit 4. Build a music genre classifier"),ce.forEach(t),C.forEach(t),W=f(e),w=s(e,"H2",{class:!0});var D=o(w);g=s(D,"A",{id:!0,class:!0,href:!0});var he=o(g);L=s(he,"SPAN",{});var ue=o(L);_e(b.$$.fragment,ue),ue.forEach(t),he.forEach(t),j=f(D),P=s(D,"SPAN",{});var fe=o(P);z=d(fe,"What you'll learn and what you'll build"),fe.forEach(t),D.forEach(t),q=f(e),$=s(e,"P",{});var de=o($);K=d(de,`Audio classification is one of the most common applications of transformers in audio and speech processing. Like other
classification tasks in machine learning, this task involves assigning one or more labels to an audio recording based on
its content. For example, in the case of speech, we might want to detect when wake words like \u201CHey Siri\u201D are spoken, or
infer a key word like \u201Ctemperature\u201D from a spoken query like \u201CWhat is the weather today?\u201C. Environmental sounds
provide another example, where we might want to automatically distinguish between sounds such as \u201Ccar horn\u201D, \u201Csiren\u201D,
\u201Cdog barking\u201D, etc.`),de.forEach(t),N=f(e),k=s(e,"P",{});var J=o(k);Q=d(J,`In this section, we\u2019ll look at how pre-trained audio transformers can be applied to a range of audio classification tasks.
We\u2019ll then fine-tune a transformer model on the task of music classification, classifying songs into genres like \u201Cpop\u201D and
\u201Crock\u201D. This is an important part of music streaming platforms like `),E=s(J,"A",{href:!0,rel:!0});var me=o(E);V=d(me,"Spotify"),me.forEach(t),X=d(J,`, which
recommend songs that are similar to the ones the user is listening to.`),J.forEach(t),G=f(e),S=s(e,"P",{});var pe=o(S);Y=d(pe,"By the end of this section, you\u2019ll know how to:"),pe.forEach(t),M=f(e),l=s(e,"UL",{});var v=o(l);I=s(v,"LI",{});var we=o(I);Z=d(we,"Find suitable pre-trained models for audio classification tasks"),we.forEach(t),ee=f(v),B=s(v,"LI",{});var ye=o(B);te=d(ye,"Use the \u{1F917} Datasets library and the Hugging Face Hub to select audio classification datasets"),ye.forEach(t),ae=f(v),F=s(v,"LI",{});var ge=o(F);ie=d(ge,"Fine-tune a pretrained model to classify songs by genre"),ge.forEach(t),se=f(v),H=s(v,"LI",{});var ke=o(H);oe=d(ke,"Build a Gradio demo that lets you classify your own songs"),ke.forEach(t),v.forEach(t),this.h()},h(){r(m,"name","hf:doc:metadata"),r(m,"content",JSON.stringify(Ue)),r(y,"id","unit-4-build-a-music-genre-classifier"),r(y,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(y,"href","#unit-4-build-a-music-genre-classifier"),r(p,"class","relative group"),r(g,"id","what-youll-learn-and-what-youll-build"),r(g,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),r(g,"href","#what-youll-learn-and-what-youll-build"),r(w,"class","relative group"),r(E,"href","https://en.wikipedia.org/wiki/Spotify"),r(E,"rel","nofollow")},m(e,n){a(document.head,m),c(e,U,n),c(e,p,n),a(p,y),a(y,x),be(_,x,null),a(p,O),a(p,A),a(A,R),c(e,W,n),c(e,w,n),a(w,g),a(g,L),be(b,L,null),a(w,j),a(w,P),a(P,z),c(e,q,n),c(e,$,n),a($,K),c(e,N,n),c(e,k,n),a(k,Q),a(k,E),a(E,V),a(k,X),c(e,G,n),c(e,S,n),a(S,Y),c(e,M,n),c(e,l,n),a(l,I),a(I,Z),a(l,ee),a(l,B),a(B,te),a(l,ae),a(l,F),a(F,ie),a(l,se),a(l,H),a(H,oe),T=!0},p:Be,i(e){T||(Ee(_.$$.fragment,e),Ee(b.$$.fragment,e),T=!0)},o(e){$e(_.$$.fragment,e),$e(b.$$.fragment,e),T=!1},d(e){t(m),e&&t(U),e&&t(p),Se(_),e&&t(W),e&&t(w),Se(b),e&&t(q),e&&t($),e&&t(N),e&&t(k),e&&t(G),e&&t(S),e&&t(M),e&&t(l)}}}const Ue={local:"unit-4-build-a-music-genre-classifier",sections:[{local:"what-youll-learn-and-what-youll-build",title:"What you'll learn and what you'll build"}],title:"Unit 4. Build a music genre classifier"};function We(ne){return Fe(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ge extends Ae{constructor(m){super();Le(this,m,We,He,Pe,{})}}export{Ge as default,Ue as metadata};
