import{S as tr,i as sr,s as lr,e as n,k as c,w as b,t as s,M as nr,c as r,d as t,m as u,a as i,x as j,h as l,b as h,G as a,g as p,y,q as w,o as E,B as k,v as rr,L as or}from"../../chunks/vendor-hf-doc-builder.js";import{T as Gl}from"../../chunks/Tip-hf-doc-builder.js";import{Y as ir}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Ua}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{C as L}from"../../chunks/CodeBlock-hf-doc-builder.js";import{F as er,M as ar}from"../../chunks/Markdown-hf-doc-builder.js";function pr(ee){let m,g,f,$,q,x,P,T,v,F,C,I,Y,W,z,V,J,U,H,S,R,d,D,M,B,G,K,je,le,re,he;return{c(){m=s(`The task illustrated in this tutorial is supported by the following model architectures:

`),g=n("p"),f=n("a"),$=s("Audio Spectrogram Transformer"),q=s(", "),x=n("a"),P=s("Data2VecAudio"),T=s(", "),v=n("a"),F=s("Hubert"),C=s(", "),I=n("a"),Y=s("SEW"),W=s(", "),z=n("a"),V=s("SEW-D"),J=s(", "),U=n("a"),H=s("UniSpeech"),S=s(", "),R=n("a"),d=s("UniSpeechSat"),D=s(", "),M=n("a"),B=s("Wav2Vec2"),G=s(", "),K=n("a"),je=s("Wav2Vec2-Conformer"),le=s(", "),re=n("a"),he=s("WavLM"),this.h()},l(N){m=l(N,`The task illustrated in this tutorial is supported by the following model architectures:

`),g=r(N,"P",{});var A=i(g);f=r(A,"A",{href:!0});var ue=i(f);$=l(ue,"Audio Spectrogram Transformer"),ue.forEach(t),q=l(A,", "),x=r(A,"A",{href:!0});var me=i(x);P=l(me,"Data2VecAudio"),me.forEach(t),T=l(A,", "),v=r(A,"A",{href:!0});var ye=i(v);F=l(ye,"Hubert"),ye.forEach(t),C=l(A,", "),I=r(A,"A",{href:!0});var oe=i(I);Y=l(oe,"SEW"),oe.forEach(t),W=l(A,", "),z=r(A,"A",{href:!0});var de=i(z);V=l(de,"SEW-D"),de.forEach(t),J=l(A,", "),U=r(A,"A",{href:!0});var Q=i(U);H=l(Q,"UniSpeech"),Q.forEach(t),S=l(A,", "),R=r(A,"A",{href:!0});var we=i(R);d=l(we,"UniSpeechSat"),we.forEach(t),D=l(A,", "),M=r(A,"A",{href:!0});var ae=i(M);B=l(ae,"Wav2Vec2"),ae.forEach(t),G=l(A,", "),K=r(A,"A",{href:!0});var ie=i(K);je=l(ie,"Wav2Vec2-Conformer"),ie.forEach(t),le=l(A,", "),re=r(A,"A",{href:!0});var pe=i(re);he=l(pe,"WavLM"),pe.forEach(t),A.forEach(t),this.h()},h(){h(f,"href","../model_doc/audio-spectrogram-transformer"),h(x,"href","../model_doc/data2vec-audio"),h(v,"href","../model_doc/hubert"),h(I,"href","../model_doc/sew"),h(z,"href","../model_doc/sew-d"),h(U,"href","../model_doc/unispeech"),h(R,"href","../model_doc/unispeech-sat"),h(M,"href","../model_doc/wav2vec2"),h(K,"href","../model_doc/wav2vec2-conformer"),h(re,"href","../model_doc/wavlm")},m(N,A){p(N,m,A),p(N,g,A),a(g,f),a(f,$),a(g,q),a(g,x),a(x,P),a(g,T),a(g,v),a(v,F),a(g,C),a(g,I),a(I,Y),a(g,W),a(g,z),a(z,V),a(g,J),a(g,U),a(U,H),a(g,S),a(g,R),a(R,d),a(g,D),a(g,M),a(M,B),a(g,G),a(g,K),a(K,je),a(g,le),a(g,re),a(re,he)},d(N){N&&t(m),N&&t(g)}}}function cr(ee){let m,g,f,$,q,x,P,T;return{c(){m=n("p"),g=s("If you aren\u2019t familiar with finetuning a model with the "),f=n("a"),$=s("Trainer"),q=s(", take a look at the basic tutorial "),x=n("a"),P=s("here"),T=s("!"),this.h()},l(v){m=r(v,"P",{});var F=i(m);g=l(F,"If you aren\u2019t familiar with finetuning a model with the "),f=r(F,"A",{href:!0});var C=i(f);$=l(C,"Trainer"),C.forEach(t),q=l(F,", take a look at the basic tutorial "),x=r(F,"A",{href:!0});var I=i(x);P=l(I,"here"),I.forEach(t),T=l(F,"!"),F.forEach(t),this.h()},h(){h(f,"href","/docs/transformers/main/en/main_classes/trainer#transformers.Trainer"),h(x,"href","../training#train-with-pytorch-trainer")},m(v,F){p(v,m,F),a(m,g),a(m,f),a(f,$),a(m,q),a(m,x),a(x,P),a(m,T)},d(v){v&&t(m)}}}function ur(ee){let m,g,f,$,q,x,P,T,v,F,C,I,Y,W,z,V,J,U,H,S,R,d,D,M,B,G,K,je,le,re,he,N,A,ue,me,ye,oe,de,Q,we,ae,ie,pe,fe,_e,Ee,ne,De;return m=new Gl({props:{$$slots:{default:[cr]},$$scope:{ctx:ee}}}),f=new L({props:{code:`from transformers import AutoModelForAudioClassification, TrainingArguments, Trainer

num_labels = len(id2label)
model = AutoModelForAudioClassification.from_pretrained(
    "facebook/wav2vec2-base", num_labels=num_labels, label2id=label2id, id2label=id2label
)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForAudioClassification, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>num_labels = <span class="hljs-built_in">len</span>(id2label)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForAudioClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>, num_labels=num_labels, label2id=label2id, id2label=id2label
<span class="hljs-meta">... </span>)`}}),Q=new L({props:{code:`training_args = TrainingArguments(
    output_dir="my_awesome_mind_model",
    evaluation_strategy="epoch",
    save_strategy="epoch",
    learning_rate=3e-5,
    per_device_train_batch_size=32,
    gradient_accumulation_steps=4,
    per_device_eval_batch_size=32,
    num_train_epochs=10,
    warmup_ratio=0.1,
    logging_steps=10,
    load_best_model_at_end=True,
    metric_for_best_model="accuracy",
    push_to_hub=True,
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=encoded_minds["train"],
    eval_dataset=encoded_minds["test"],
    tokenizer=feature_extractor,
    compute_metrics=compute_metrics,
)

trainer.train()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_mind_model&quot;</span>,
<span class="hljs-meta">... </span>    evaluation_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    save_strategy=<span class="hljs-string">&quot;epoch&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">3e-5</span>,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">32</span>,
<span class="hljs-meta">... </span>    gradient_accumulation_steps=<span class="hljs-number">4</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">32</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">10</span>,
<span class="hljs-meta">... </span>    warmup_ratio=<span class="hljs-number">0.1</span>,
<span class="hljs-meta">... </span>    logging_steps=<span class="hljs-number">10</span>,
<span class="hljs-meta">... </span>    load_best_model_at_end=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    metric_for_best_model=<span class="hljs-string">&quot;accuracy&quot;</span>,
<span class="hljs-meta">... </span>    push_to_hub=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=encoded_minds[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=encoded_minds[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    tokenizer=feature_extractor,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`}}),ne=new L({props:{code:"trainer.push_to_hub()",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()'}}),{c(){b(m.$$.fragment),g=s(`
You're ready to start training your model now! Load Wav2Vec2 with [AutoModelForAudioClassification](/docs/transformers/main/en/model_doc/auto#transformers.AutoModelForAudioClassification) along with the number of expected labels, and the label mappings:

	`),b(f.$$.fragment),$=c(),q=n("p"),x=s("At this point, only three steps remain:"),P=c(),T=n("ol"),v=n("li"),F=s("Define your training hyperparameters in "),C=n("a"),I=s("TrainingArguments"),Y=s(". The only required parameter is "),W=n("code"),z=s("output_dir"),V=s(" which specifies where to save your model. You\u2019ll push this model to the Hub by setting "),J=n("code"),U=s("push_to_hub=True"),H=s(" (you need to be signed in to Hugging Face to upload your model). At the end of each epoch, the "),S=n("a"),R=s("Trainer"),d=s(" will evaluate the accuracy and save the training checkpoint."),D=c(),M=n("li"),B=s("Pass the training arguments to "),G=n("a"),K=s("Trainer"),je=s(" along with the model, dataset, tokenizer, data collator, and "),le=n("code"),re=s("compute_metrics"),he=s(" function."),N=c(),A=n("li"),ue=s("Call "),me=n("a"),ye=s("train()"),oe=s(" to finetune your model."),de=c(),b(Q.$$.fragment),we=c(),ae=n("p"),ie=s("Once training is completed, share your model to the Hub with the "),pe=n("a"),fe=s("push_to_hub()"),_e=s(" method so everyone can use your model:"),Ee=c(),b(ne.$$.fragment),this.h()},l(_){j(m.$$.fragment,_),g=l(_,`
You're ready to start training your model now! Load Wav2Vec2 with [AutoModelForAudioClassification](/docs/transformers/main/en/model_doc/auto#transformers.AutoModelForAudioClassification) along with the number of expected labels, and the label mappings:

	`),j(f.$$.fragment,_),$=u(_),q=r(_,"P",{});var O=i(q);x=l(O,"At this point, only three steps remain:"),O.forEach(t),P=u(_),T=r(_,"OL",{});var ce=i(T);v=r(ce,"LI",{});var X=i(v);F=l(X,"Define your training hyperparameters in "),C=r(X,"A",{href:!0});var xa=i(C);I=l(xa,"TrainingArguments"),xa.forEach(t),Y=l(X,". The only required parameter is "),W=r(X,"CODE",{});var Je=i(W);z=l(Je,"output_dir"),Je.forEach(t),V=l(X," which specifies where to save your model. You\u2019ll push this model to the Hub by setting "),J=r(X,"CODE",{});var ke=i(J);U=l(ke,"push_to_hub=True"),ke.forEach(t),H=l(X," (you need to be signed in to Hugging Face to upload your model). At the end of each epoch, the "),S=r(X,"A",{href:!0});var Ke=i(S);R=l(Ke,"Trainer"),Ke.forEach(t),d=l(X," will evaluate the accuracy and save the training checkpoint."),X.forEach(t),D=u(ce),M=r(ce,"LI",{});var Z=i(M);B=l(Z,"Pass the training arguments to "),G=r(Z,"A",{href:!0});var Aa=i(G);K=l(Aa,"Trainer"),Aa.forEach(t),je=l(Z," along with the model, dataset, tokenizer, data collator, and "),le=r(Z,"CODE",{});var Ce=i(le);re=l(Ce,"compute_metrics"),Ce.forEach(t),he=l(Z," function."),Z.forEach(t),N=u(ce),A=r(ce,"LI",{});var Ie=i(A);ue=l(Ie,"Call "),me=r(Ie,"A",{href:!0});var qa=i(me);ye=l(qa,"train()"),qa.forEach(t),oe=l(Ie," to finetune your model."),Ie.forEach(t),ce.forEach(t),de=u(_),j(Q.$$.fragment,_),we=u(_),ae=r(_,"P",{});var ge=i(ae);ie=l(ge,"Once training is completed, share your model to the Hub with the "),pe=r(ge,"A",{href:!0});var Ta=i(pe);fe=l(Ta,"push_to_hub()"),Ta.forEach(t),_e=l(ge," method so everyone can use your model:"),ge.forEach(t),Ee=u(_),j(ne.$$.fragment,_),this.h()},h(){h(C,"href","/docs/transformers/main/en/main_classes/trainer#transformers.TrainingArguments"),h(S,"href","/docs/transformers/main/en/main_classes/trainer#transformers.Trainer"),h(G,"href","/docs/transformers/main/en/main_classes/trainer#transformers.Trainer"),h(me,"href","/docs/transformers/main/en/main_classes/trainer#transformers.Trainer.train"),h(pe,"href","/docs/transformers/main/en/main_classes/trainer#transformers.Trainer.push_to_hub")},m(_,O){y(m,_,O),p(_,g,O),y(f,_,O),p(_,$,O),p(_,q,O),a(q,x),p(_,P,O),p(_,T,O),a(T,v),a(v,F),a(v,C),a(C,I),a(v,Y),a(v,W),a(W,z),a(v,V),a(v,J),a(J,U),a(v,H),a(v,S),a(S,R),a(v,d),a(T,D),a(T,M),a(M,B),a(M,G),a(G,K),a(M,je),a(M,le),a(le,re),a(M,he),a(T,N),a(T,A),a(A,ue),a(A,me),a(me,ye),a(A,oe),p(_,de,O),y(Q,_,O),p(_,we,O),p(_,ae,O),a(ae,ie),a(ae,pe),a(pe,fe),a(ae,_e),p(_,Ee,O),y(ne,_,O),De=!0},p(_,O){const ce={};O&2&&(ce.$$scope={dirty:O,ctx:_}),m.$set(ce)},i(_){De||(w(m.$$.fragment,_),w(f.$$.fragment,_),w(Q.$$.fragment,_),w(ne.$$.fragment,_),De=!0)},o(_){E(m.$$.fragment,_),E(f.$$.fragment,_),E(Q.$$.fragment,_),E(ne.$$.fragment,_),De=!1},d(_){k(m,_),_&&t(g),k(f,_),_&&t($),_&&t(q),_&&t(P),_&&t(T),_&&t(de),k(Q,_),_&&t(we),_&&t(ae),_&&t(Ee),k(ne,_)}}}function mr(ee){let m,g;return m=new ar({props:{$$slots:{default:[ur]},$$scope:{ctx:ee}}}),{c(){b(m.$$.fragment)},l(f){j(m.$$.fragment,f)},m(f,$){y(m,f,$),g=!0},p(f,$){const q={};$&2&&(q.$$scope={dirty:$,ctx:f}),m.$set(q)},i(f){g||(w(m.$$.fragment,f),g=!0)},o(f){E(m.$$.fragment,f),g=!1},d(f){k(m,f)}}}function fr(ee){let m,g,f,$,q;return{c(){m=n("p"),g=s("For a more in-depth example of how to finetune a model for audio classification, take a look at the corresponding "),f=n("a"),$=s("PyTorch notebook"),q=s("."),this.h()},l(x){m=r(x,"P",{});var P=i(m);g=l(P,"For a more in-depth example of how to finetune a model for audio classification, take a look at the corresponding "),f=r(P,"A",{href:!0,rel:!0});var T=i(f);$=l(T,"PyTorch notebook"),T.forEach(t),q=l(P,"."),P.forEach(t),this.h()},h(){h(f,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb"),h(f,"rel","nofollow")},m(x,P){p(x,m,P),a(m,g),a(m,f),a(f,$),a(m,q)},d(x){x&&t(m)}}}function hr(ee){let m,g,f,$,q,x,P,T,v,F,C,I,Y,W,z,V,J,U,H,S,R;return P=new L({props:{code:`from transformers import AutoFeatureExtractor

feature_extractor = AutoFeatureExtractor.from_pretrained("stevhliu/my_awesome_minds_model")
inputs = feature_extractor(dataset[0]["audio"]["array"], sampling_rate=sampling_rate, return_tensors="pt")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_minds_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = feature_extractor(dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;array&quot;</span>], sampling_rate=sampling_rate, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`}}),I=new L({props:{code:`from transformers import AutoModelForAudioClassification

model = AutoModelForAudioClassification.from_pretrained("stevhliu/my_awesome_minds_model")
with torch.no_grad():
    logits = model(**inputs).logits`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForAudioClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForAudioClassification.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_minds_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>    logits = model(**inputs).logits`}}),S=new L({props:{code:`import torch

predicted_class_ids = torch.argmax(logits).item()
predicted_label = model.config.id2label[predicted_class_ids]
predicted_label`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_ids = torch.argmax(logits).item()
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label = model.config.id2label[predicted_class_ids]
<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_label
<span class="hljs-string">&#x27;cash_deposit&#x27;</span>`}}),{c(){m=n("p"),g=s("Load a feature extractor to preprocess the audio file and return the "),f=n("code"),$=s("input"),q=s(" as PyTorch tensors:"),x=c(),b(P.$$.fragment),T=c(),v=n("p"),F=s("Pass your inputs to the model and return the logits:"),C=c(),b(I.$$.fragment),Y=c(),W=n("p"),z=s("Get the class with the highest probability, and use the model\u2019s "),V=n("code"),J=s("id2label"),U=s(" mapping to convert it to a label:"),H=c(),b(S.$$.fragment)},l(d){m=r(d,"P",{});var D=i(m);g=l(D,"Load a feature extractor to preprocess the audio file and return the "),f=r(D,"CODE",{});var M=i(f);$=l(M,"input"),M.forEach(t),q=l(D," as PyTorch tensors:"),D.forEach(t),x=u(d),j(P.$$.fragment,d),T=u(d),v=r(d,"P",{});var B=i(v);F=l(B,"Pass your inputs to the model and return the logits:"),B.forEach(t),C=u(d),j(I.$$.fragment,d),Y=u(d),W=r(d,"P",{});var G=i(W);z=l(G,"Get the class with the highest probability, and use the model\u2019s "),V=r(G,"CODE",{});var K=i(V);J=l(K,"id2label"),K.forEach(t),U=l(G," mapping to convert it to a label:"),G.forEach(t),H=u(d),j(S.$$.fragment,d)},m(d,D){p(d,m,D),a(m,g),a(m,f),a(f,$),a(m,q),p(d,x,D),y(P,d,D),p(d,T,D),p(d,v,D),a(v,F),p(d,C,D),y(I,d,D),p(d,Y,D),p(d,W,D),a(W,z),a(W,V),a(V,J),a(W,U),p(d,H,D),y(S,d,D),R=!0},p:or,i(d){R||(w(P.$$.fragment,d),w(I.$$.fragment,d),w(S.$$.fragment,d),R=!0)},o(d){E(P.$$.fragment,d),E(I.$$.fragment,d),E(S.$$.fragment,d),R=!1},d(d){d&&t(m),d&&t(x),k(P,d),d&&t(T),d&&t(v),d&&t(C),k(I,d),d&&t(Y),d&&t(W),d&&t(H),k(S,d)}}}function dr(ee){let m,g;return m=new ar({props:{$$slots:{default:[hr]},$$scope:{ctx:ee}}}),{c(){b(m.$$.fragment)},l(f){j(m.$$.fragment,f)},m(f,$){y(m,f,$),g=!0},p(f,$){const q={};$&2&&(q.$$scope={dirty:$,ctx:f}),m.$set(q)},i(f){g||(w(m.$$.fragment,f),g=!0)},o(f){E(m.$$.fragment,f),g=!1},d(f){k(m,f)}}}function _r(ee){let m,g,f,$,q,x,P,T,v,F,C,I,Y,W,z,V,J,U,H,S,R,d,D,M,B,G,K,je,le,re,he,N,A,ue,me,ye,oe,de,Q,we,ae,ie,pe,fe,_e,Ee,ne,De,_,O,ce,X,xa,Je,ke,Ke,Z,Aa,Ce,Ie,qa,ge,Ta,bs,bt,Qe,jt,Pa,js,yt,Xe,wt,te,ys,Ra,ws,Es,Ga,ks,xs,Ba,As,qs,Ja,Ts,Ps,Ze,Ss,Ds,Et,ea,kt,Sa,Cs,xt,aa,At,Da,Is,qt,Fe,Me,Ka,Fs,Ms,Qa,Os,Ls,Ws,Ca,Xa,Hs,Ns,Tt,Ia,Vs,Pt,ta,St,Fa,Ys,Dt,sa,Ct,qe,Oe,Za,la,zs,et,Us,It,Ma,Rs,Ft,na,Mt,Le,Gs,ra,Bs,Js,Ot,oa,Lt,Oa,Ks,Wt,xe,ia,Qs,at,Xs,Zs,el,pa,al,ca,tl,sl,ll,tt,nl,Ht,ua,Nt,se,rl,ma,ol,il,st,pl,cl,lt,ul,ml,nt,fl,hl,rt,dl,_l,Vt,fa,Yt,Te,We,ot,ha,gl,it,$l,zt,$e,vl,da,bl,jl,_a,yl,wl,ga,El,kl,Ut,$a,Rt,He,xl,va,Al,ql,Gt,ba,Bt,Ne,Tl,pt,Pl,Sl,Jt,Pe,Ve,ct,ja,Dl,ut,Cl,Kt,Ye,Qt,ze,Xt,Se,Ue,mt,ya,Il,ft,Fl,Zt,La,Ml,es,Wa,Ol,as,wa,ts,Ae,Ll,Ha,Wl,Hl,ht,Nl,Vl,ss,Ea,ls,Re,Yl,dt,zl,Ul,ns,Ge,rs;return x=new Ua({}),C=new ir({props:{id:"KWwzcmG98Ds"}}),N=new Gl({props:{$$slots:{default:[pr]},$$scope:{ctx:ee}}}),oe=new L({props:{code:"pip install transformers datasets evaluate",highlighted:"pip install transformers datasets evaluate"}}),ie=new L({props:{code:`from huggingface_hub import notebook_login

notebook_login()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> notebook_login

<span class="hljs-meta">&gt;&gt;&gt; </span>notebook_login()`}}),ne=new Ua({}),ke=new L({props:{code:`from datasets import load_dataset, Audio

minds = load_dataset("PolyAI/minds14", name="en-US", split="train")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-meta">&gt;&gt;&gt; </span>minds = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, name=<span class="hljs-string">&quot;en-US&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)`}}),Qe=new L({props:{code:"minds = minds.train_test_split(test_size=0.2)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.train_test_split(test_size=<span class="hljs-number">0.2</span>)'}}),Xe=new L({props:{code:"minds",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds
DatasetDict({
    train: Dataset({
        features: [<span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;audio&#x27;</span>, <span class="hljs-string">&#x27;transcription&#x27;</span>, <span class="hljs-string">&#x27;english_transcription&#x27;</span>, <span class="hljs-string">&#x27;intent_class&#x27;</span>, <span class="hljs-string">&#x27;lang_id&#x27;</span>],
        num_rows: <span class="hljs-number">450</span>
    })
    test: Dataset({
        features: [<span class="hljs-string">&#x27;path&#x27;</span>, <span class="hljs-string">&#x27;audio&#x27;</span>, <span class="hljs-string">&#x27;transcription&#x27;</span>, <span class="hljs-string">&#x27;english_transcription&#x27;</span>, <span class="hljs-string">&#x27;intent_class&#x27;</span>, <span class="hljs-string">&#x27;lang_id&#x27;</span>],
        num_rows: <span class="hljs-number">113</span>
    })
})`}}),ea=new L({props:{code:'minds = minds.remove_columns(["path", "transcription", "english_transcription", "lang_id"])',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.remove_columns([<span class="hljs-string">&quot;path&quot;</span>, <span class="hljs-string">&quot;transcription&quot;</span>, <span class="hljs-string">&quot;english_transcription&quot;</span>, <span class="hljs-string">&quot;lang_id&quot;</span>])'}}),aa=new L({props:{code:'minds["train"][0]',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;audio&#x27;</span>: {<span class="hljs-string">&#x27;array&#x27;</span>: array([ <span class="hljs-number">0.</span>        ,  <span class="hljs-number">0.</span>        ,  <span class="hljs-number">0.</span>        , ..., -<span class="hljs-number">0.00048828</span>,
         -<span class="hljs-number">0.00024414</span>, -<span class="hljs-number">0.00024414</span>], dtype=float32),
  <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602b9a5fbb1e6d0fbce91f52.wav&#x27;</span>,
  <span class="hljs-string">&#x27;sampling_rate&#x27;</span>: <span class="hljs-number">8000</span>},
 <span class="hljs-string">&#x27;intent_class&#x27;</span>: <span class="hljs-number">2</span>}`}}),ta=new L({props:{code:`labels = minds["train"].features["intent_class"].names
label2id, id2label = dict(), dict()
for i, label in enumerate(labels):
    label2id[label] = str(i)
    id2label[str(i)] = label`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>labels = minds[<span class="hljs-string">&quot;train&quot;</span>].features[<span class="hljs-string">&quot;intent_class&quot;</span>].names
<span class="hljs-meta">&gt;&gt;&gt; </span>label2id, id2label = <span class="hljs-built_in">dict</span>(), <span class="hljs-built_in">dict</span>()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> i, label <span class="hljs-keyword">in</span> <span class="hljs-built_in">enumerate</span>(labels):
<span class="hljs-meta">... </span>    label2id[label] = <span class="hljs-built_in">str</span>(i)
<span class="hljs-meta">... </span>    id2label[<span class="hljs-built_in">str</span>(i)] = label`}}),sa=new L({props:{code:"id2label[str(2)]",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>id2label[<span class="hljs-built_in">str</span>(<span class="hljs-number">2</span>)]
<span class="hljs-string">&#x27;app_error&#x27;</span>`}}),la=new Ua({}),na=new L({props:{code:`from transformers import AutoFeatureExtractor

feature_extractor = AutoFeatureExtractor.from_pretrained("facebook/wav2vec2-base")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoFeatureExtractor

<span class="hljs-meta">&gt;&gt;&gt; </span>feature_extractor = AutoFeatureExtractor.from_pretrained(<span class="hljs-string">&quot;facebook/wav2vec2-base&quot;</span>)`}}),oa=new L({props:{code:`minds = minds.cast_column("audio", Audio(sampling_rate=16_000))
minds["train"][0]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16_000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>minds[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">0</span>]
{<span class="hljs-string">&#x27;audio&#x27;</span>: {<span class="hljs-string">&#x27;array&#x27;</span>: array([ <span class="hljs-number">2.2098757e-05</span>,  <span class="hljs-number">4.6582241e-05</span>, -<span class="hljs-number">2.2803260e-05</span>, ...,
         -<span class="hljs-number">2.8419291e-04</span>, -<span class="hljs-number">2.3305941e-04</span>, -<span class="hljs-number">1.1425107e-04</span>], dtype=float32),
  <span class="hljs-string">&#x27;path&#x27;</span>: <span class="hljs-string">&#x27;/root/.cache/huggingface/datasets/downloads/extracted/f14948e0e84be638dd7943ac36518a4cf3324e8b7aa331c5ab11541518e9368c/en-US~APP_ERROR/602b9a5fbb1e6d0fbce91f52.wav&#x27;</span>,
  <span class="hljs-string">&#x27;sampling_rate&#x27;</span>: <span class="hljs-number">16000</span>},
 <span class="hljs-string">&#x27;intent_class&#x27;</span>: <span class="hljs-number">2</span>}`}}),ua=new L({props:{code:`def preprocess_function(examples):
    audio_arrays = [x["array"] for x in examples["audio"]]
    inputs = feature_extractor(
        audio_arrays, sampling_rate=feature_extractor.sampling_rate, max_length=16000, truncation=True
    )
    return inputs`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_function</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    audio_arrays = [x[<span class="hljs-string">&quot;array&quot;</span>] <span class="hljs-keyword">for</span> x <span class="hljs-keyword">in</span> examples[<span class="hljs-string">&quot;audio&quot;</span>]]
<span class="hljs-meta">... </span>    inputs = feature_extractor(
<span class="hljs-meta">... </span>        audio_arrays, sampling_rate=feature_extractor.sampling_rate, max_length=<span class="hljs-number">16000</span>, truncation=<span class="hljs-literal">True</span>
<span class="hljs-meta">... </span>    )
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> inputs`}}),fa=new L({props:{code:`encoded_minds = minds.map(preprocess_function, remove_columns="audio", batched=True)
encoded_minds = encoded_minds.rename_column("intent_class", "label")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_minds = minds.<span class="hljs-built_in">map</span>(preprocess_function, remove_columns=<span class="hljs-string">&quot;audio&quot;</span>, batched=<span class="hljs-literal">True</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_minds = encoded_minds.rename_column(<span class="hljs-string">&quot;intent_class&quot;</span>, <span class="hljs-string">&quot;label&quot;</span>)`}}),ha=new Ua({}),$a=new L({props:{code:`import evaluate

accuracy = evaluate.load("accuracy")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> evaluate

<span class="hljs-meta">&gt;&gt;&gt; </span>accuracy = evaluate.load(<span class="hljs-string">&quot;accuracy&quot;</span>)`}}),ba=new L({props:{code:`import numpy as np


def compute_metrics(eval_pred):
    predictions = np.argmax(eval_pred.predictions, axis=1)
    return accuracy.compute(predictions=predictions, references=eval_pred.label_ids)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> numpy <span class="hljs-keyword">as</span> np


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">compute_metrics</span>(<span class="hljs-params">eval_pred</span>):
<span class="hljs-meta">... </span>    predictions = np.argmax(eval_pred.predictions, axis=<span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> accuracy.compute(predictions=predictions, references=eval_pred.label_ids)`}}),ja=new Ua({}),Ye=new er({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[mr]},$$scope:{ctx:ee}}}),ze=new Gl({props:{$$slots:{default:[fr]},$$scope:{ctx:ee}}}),ya=new Ua({}),wa=new L({props:{code:`from datasets import load_dataset, Audio

dataset = load_dataset("PolyAI/minds14", name="en-US", split="train")
dataset = dataset.cast_column("audio", Audio(sampling_rate=16000))
sampling_rate = dataset.features["audio"].sampling_rate
audio_file = dataset[0]["audio"]["path"]`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset, Audio

<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = load_dataset(<span class="hljs-string">&quot;PolyAI/minds14&quot;</span>, name=<span class="hljs-string">&quot;en-US&quot;</span>, split=<span class="hljs-string">&quot;train&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset = dataset.cast_column(<span class="hljs-string">&quot;audio&quot;</span>, Audio(sampling_rate=<span class="hljs-number">16000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>sampling_rate = dataset.features[<span class="hljs-string">&quot;audio&quot;</span>].sampling_rate
<span class="hljs-meta">&gt;&gt;&gt; </span>audio_file = dataset[<span class="hljs-number">0</span>][<span class="hljs-string">&quot;audio&quot;</span>][<span class="hljs-string">&quot;path&quot;</span>]`}}),Ea=new L({props:{code:`from transformers import pipeline

classifier = pipeline("audio-classification", model="stevhliu/my_awesome_minds_model")
classifier(audio_file)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

<span class="hljs-meta">&gt;&gt;&gt; </span>classifier = pipeline(<span class="hljs-string">&quot;audio-classification&quot;</span>, model=<span class="hljs-string">&quot;stevhliu/my_awesome_minds_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(audio_file)
[
    {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.09766869246959686</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;cash_deposit&#x27;</span>},
    {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.07998877018690109</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;app_error&#x27;</span>},
    {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0781070664525032</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;joint_account&#x27;</span>},
    {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.07667109370231628</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;pay_bill&#x27;</span>},
    {<span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.0755252093076706</span>, <span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;balance&#x27;</span>}
]`}}),Ge=new er({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[dr]},$$scope:{ctx:ee}}}),{c(){m=n("meta"),g=c(),f=n("h1"),$=n("a"),q=n("span"),b(x.$$.fragment),P=c(),T=n("span"),v=s("Audio classification"),F=c(),b(C.$$.fragment),I=c(),Y=n("p"),W=s("Audio classification - just like with text - assigns a class label output from the input data. The only difference is instead of text inputs, you have raw audio waveforms. Some practical applications of audio classification include identifying speaker intent, language classification, and even animal species by their sounds."),z=c(),V=n("p"),J=s("This guide will show you how to:"),U=c(),H=n("ol"),S=n("li"),R=s("Finetune "),d=n("a"),D=s("Wav2Vec2"),M=s(" on the "),B=n("a"),G=s("MInDS-14"),K=s(" dataset to classify speaker intent."),je=c(),le=n("li"),re=s("Use your finetuned model for inference."),he=c(),b(N.$$.fragment),A=c(),ue=n("p"),me=s("Before you begin, make sure you have all the necessary libraries installed:"),ye=c(),b(oe.$$.fragment),de=c(),Q=n("p"),we=s("We encourage you to login to your Hugging Face account so you can upload and share your model with the community. When prompted, enter your token to login:"),ae=c(),b(ie.$$.fragment),pe=c(),fe=n("h2"),_e=n("a"),Ee=n("span"),b(ne.$$.fragment),De=c(),_=n("span"),O=s("Load MInDS-14 dataset"),ce=c(),X=n("p"),xa=s("Start by loading the MInDS-14 dataset from the \u{1F917} Datasets library:"),Je=c(),b(ke.$$.fragment),Ke=c(),Z=n("p"),Aa=s("Split the dataset\u2019s "),Ce=n("code"),Ie=s("train"),qa=s(" split into a smaller train and test set with the "),ge=n("a"),Ta=s("train_test_split"),bs=s(" method. This\u2019ll give you a chance to experiment and make sure everything works before spending more time on the full dataset."),bt=c(),b(Qe.$$.fragment),jt=c(),Pa=n("p"),js=s("Then take a look at the dataset:"),yt=c(),b(Xe.$$.fragment),wt=c(),te=n("p"),ys=s("While the dataset contains a lot of useful information, like "),Ra=n("code"),ws=s("lang_id"),Es=s(" and "),Ga=n("code"),ks=s("english_transcription"),xs=s(", you\u2019ll focus on the "),Ba=n("code"),As=s("audio"),qs=s(" and "),Ja=n("code"),Ts=s("intent_class"),Ps=s(" in this guide. Remove the other columns with the "),Ze=n("a"),Ss=s("remove_columns"),Ds=s(" method:"),Et=c(),b(ea.$$.fragment),kt=c(),Sa=n("p"),Cs=s("Take a look at an example now:"),xt=c(),b(aa.$$.fragment),At=c(),Da=n("p"),Is=s("There are two fields:"),qt=c(),Fe=n("ul"),Me=n("li"),Ka=n("code"),Fs=s("audio"),Ms=s(": a 1-dimensional "),Qa=n("code"),Os=s("array"),Ls=s(" of the speech signal that must be called to load and resample the audio file."),Ws=c(),Ca=n("li"),Xa=n("code"),Hs=s("intent_class"),Ns=s(": represents the class id of the speaker\u2019s intent."),Tt=c(),Ia=n("p"),Vs=s("To make it easier for the model to get the label name from the label id, create a dictionary that maps the label name to an integer and vice versa:"),Pt=c(),b(ta.$$.fragment),St=c(),Fa=n("p"),Ys=s("Now you can convert the label id to a label name:"),Dt=c(),b(sa.$$.fragment),Ct=c(),qe=n("h2"),Oe=n("a"),Za=n("span"),b(la.$$.fragment),zs=c(),et=n("span"),Us=s("Preprocess"),It=c(),Ma=n("p"),Rs=s("The next step is to load a Wav2Vec2 feature extractor to process the audio signal:"),Ft=c(),b(na.$$.fragment),Mt=c(),Le=n("p"),Gs=s("The MInDS-14 dataset has a sampling rate of 8000khz (you can find this information in it\u2019s "),ra=n("a"),Bs=s("dataset card"),Js=s("), which means you\u2019ll need to resample the dataset to 16000kHz to use the pretrained Wav2Vec2 model:"),Ot=c(),b(oa.$$.fragment),Lt=c(),Oa=n("p"),Ks=s("Now create a preprocessing function that:"),Wt=c(),xe=n("ol"),ia=n("li"),Qs=s("Calls the "),at=n("code"),Xs=s("audio"),Zs=s(" column to load, and if necessary, resample the audio file."),el=c(),pa=n("li"),al=s("Checks if the sampling rate of the audio file matches the sampling rate of the audio data a model was pretrained with. You can find this information in the Wav2Vec2 "),ca=n("a"),tl=s("model card"),sl=s("."),ll=c(),tt=n("li"),nl=s("Set a maximum input length to batch longer inputs without truncating them."),Ht=c(),b(ua.$$.fragment),Nt=c(),se=n("p"),rl=s("To apply the preprocessing function over the entire dataset, use \u{1F917} Datasets "),ma=n("a"),ol=s("map"),il=s(" function. You can speed up "),st=n("code"),pl=s("map"),cl=s(" by setting "),lt=n("code"),ul=s("batched=True"),ml=s(" to process multiple elements of the dataset at once. Remove the columns you don\u2019t need, and rename "),nt=n("code"),fl=s("intent_class"),hl=s(" to "),rt=n("code"),dl=s("label"),_l=s(" because that\u2019s the name the model expects:"),Vt=c(),b(fa.$$.fragment),Yt=c(),Te=n("h2"),We=n("a"),ot=n("span"),b(ha.$$.fragment),gl=c(),it=n("span"),$l=s("Evaluate"),zt=c(),$e=n("p"),vl=s("Including a metric during training is often helpful for evaluating your model\u2019s performance. You can quickly load a evaluation method with the \u{1F917} "),da=n("a"),bl=s("Evaluate"),jl=s(" library. For this task, load the "),_a=n("a"),yl=s("accuracy"),wl=s(" metric (see the \u{1F917} Evaluate "),ga=n("a"),El=s("quick tour"),kl=s(" to learn more about how to load and compute a metric):"),Ut=c(),b($a.$$.fragment),Rt=c(),He=n("p"),xl=s("Then create a function that passes your predictions and labels to "),va=n("a"),Al=s("compute"),ql=s(" to calculate the accuracy:"),Gt=c(),b(ba.$$.fragment),Bt=c(),Ne=n("p"),Tl=s("Your "),pt=n("code"),Pl=s("compute_metrics"),Sl=s(" function is ready to go now, and you\u2019ll return to it when you setup your training."),Jt=c(),Pe=n("h2"),Ve=n("a"),ct=n("span"),b(ja.$$.fragment),Dl=c(),ut=n("span"),Cl=s("Train"),Kt=c(),b(Ye.$$.fragment),Qt=c(),b(ze.$$.fragment),Xt=c(),Se=n("h2"),Ue=n("a"),mt=n("span"),b(ya.$$.fragment),Il=c(),ft=n("span"),Fl=s("Inference"),Zt=c(),La=n("p"),Ml=s("Great, now that you\u2019ve finetuned a model, you can use it for inference!"),es=c(),Wa=n("p"),Ol=s("Load an audio file you\u2019d like to run inference on. Remember to resample the sampling rate of the audio file to match the sampling rate of the model if you need to!"),as=c(),b(wa.$$.fragment),ts=c(),Ae=n("p"),Ll=s("The simplest way to try out your finetuned model for inference is to use it in a "),Ha=n("a"),Wl=s("pipeline()"),Hl=s(". Instantiate a "),ht=n("code"),Nl=s("pipeline"),Vl=s(" for audio classification with your model, and pass your audio file to it:"),ss=c(),b(Ea.$$.fragment),ls=c(),Re=n("p"),Yl=s("You can also manually replicate the results of the "),dt=n("code"),zl=s("pipeline"),Ul=s(" if you\u2019d like:"),ns=c(),b(Ge.$$.fragment),this.h()},l(e){const o=nr('[data-svelte="svelte-1phssyn"]',document.head);m=r(o,"META",{name:!0,content:!0}),o.forEach(t),g=u(e),f=r(e,"H1",{class:!0});var ka=i(f);$=r(ka,"A",{id:!0,class:!0,href:!0});var _t=i($);q=r(_t,"SPAN",{});var gt=i(q);j(x.$$.fragment,gt),gt.forEach(t),_t.forEach(t),P=u(ka),T=r(ka,"SPAN",{});var $t=i(T);v=l($t,"Audio classification"),$t.forEach(t),ka.forEach(t),F=u(e),j(C.$$.fragment,e),I=u(e),Y=r(e,"P",{});var Bl=i(Y);W=l(Bl,"Audio classification - just like with text - assigns a class label output from the input data. The only difference is instead of text inputs, you have raw audio waveforms. Some practical applications of audio classification include identifying speaker intent, language classification, and even animal species by their sounds."),Bl.forEach(t),z=u(e),V=r(e,"P",{});var Jl=i(V);J=l(Jl,"This guide will show you how to:"),Jl.forEach(t),U=u(e),H=r(e,"OL",{});var os=i(H);S=r(os,"LI",{});var Na=i(S);R=l(Na,"Finetune "),d=r(Na,"A",{href:!0,rel:!0});var Kl=i(d);D=l(Kl,"Wav2Vec2"),Kl.forEach(t),M=l(Na," on the "),B=r(Na,"A",{href:!0,rel:!0});var Ql=i(B);G=l(Ql,"MInDS-14"),Ql.forEach(t),K=l(Na," dataset to classify speaker intent."),Na.forEach(t),je=u(os),le=r(os,"LI",{});var Xl=i(le);re=l(Xl,"Use your finetuned model for inference."),Xl.forEach(t),os.forEach(t),he=u(e),j(N.$$.fragment,e),A=u(e),ue=r(e,"P",{});var Zl=i(ue);me=l(Zl,"Before you begin, make sure you have all the necessary libraries installed:"),Zl.forEach(t),ye=u(e),j(oe.$$.fragment,e),de=u(e),Q=r(e,"P",{});var en=i(Q);we=l(en,"We encourage you to login to your Hugging Face account so you can upload and share your model with the community. When prompted, enter your token to login:"),en.forEach(t),ae=u(e),j(ie.$$.fragment,e),pe=u(e),fe=r(e,"H2",{class:!0});var is=i(fe);_e=r(is,"A",{id:!0,class:!0,href:!0});var an=i(_e);Ee=r(an,"SPAN",{});var tn=i(Ee);j(ne.$$.fragment,tn),tn.forEach(t),an.forEach(t),De=u(is),_=r(is,"SPAN",{});var sn=i(_);O=l(sn,"Load MInDS-14 dataset"),sn.forEach(t),is.forEach(t),ce=u(e),X=r(e,"P",{});var ln=i(X);xa=l(ln,"Start by loading the MInDS-14 dataset from the \u{1F917} Datasets library:"),ln.forEach(t),Je=u(e),j(ke.$$.fragment,e),Ke=u(e),Z=r(e,"P",{});var Va=i(Z);Aa=l(Va,"Split the dataset\u2019s "),Ce=r(Va,"CODE",{});var nn=i(Ce);Ie=l(nn,"train"),nn.forEach(t),qa=l(Va," split into a smaller train and test set with the "),ge=r(Va,"A",{href:!0,rel:!0});var rn=i(ge);Ta=l(rn,"train_test_split"),rn.forEach(t),bs=l(Va," method. This\u2019ll give you a chance to experiment and make sure everything works before spending more time on the full dataset."),Va.forEach(t),bt=u(e),j(Qe.$$.fragment,e),jt=u(e),Pa=r(e,"P",{});var on=i(Pa);js=l(on,"Then take a look at the dataset:"),on.forEach(t),yt=u(e),j(Xe.$$.fragment,e),wt=u(e),te=r(e,"P",{});var ve=i(te);ys=l(ve,"While the dataset contains a lot of useful information, like "),Ra=r(ve,"CODE",{});var pn=i(Ra);ws=l(pn,"lang_id"),pn.forEach(t),Es=l(ve," and "),Ga=r(ve,"CODE",{});var cn=i(Ga);ks=l(cn,"english_transcription"),cn.forEach(t),xs=l(ve,", you\u2019ll focus on the "),Ba=r(ve,"CODE",{});var un=i(Ba);As=l(un,"audio"),un.forEach(t),qs=l(ve," and "),Ja=r(ve,"CODE",{});var mn=i(Ja);Ts=l(mn,"intent_class"),mn.forEach(t),Ps=l(ve," in this guide. Remove the other columns with the "),Ze=r(ve,"A",{href:!0,rel:!0});var fn=i(Ze);Ss=l(fn,"remove_columns"),fn.forEach(t),Ds=l(ve," method:"),ve.forEach(t),Et=u(e),j(ea.$$.fragment,e),kt=u(e),Sa=r(e,"P",{});var hn=i(Sa);Cs=l(hn,"Take a look at an example now:"),hn.forEach(t),xt=u(e),j(aa.$$.fragment,e),At=u(e),Da=r(e,"P",{});var dn=i(Da);Is=l(dn,"There are two fields:"),dn.forEach(t),qt=u(e),Fe=r(e,"UL",{});var ps=i(Fe);Me=r(ps,"LI",{});var vt=i(Me);Ka=r(vt,"CODE",{});var _n=i(Ka);Fs=l(_n,"audio"),_n.forEach(t),Ms=l(vt,": a 1-dimensional "),Qa=r(vt,"CODE",{});var gn=i(Qa);Os=l(gn,"array"),gn.forEach(t),Ls=l(vt," of the speech signal that must be called to load and resample the audio file."),vt.forEach(t),Ws=u(ps),Ca=r(ps,"LI",{});var Rl=i(Ca);Xa=r(Rl,"CODE",{});var $n=i(Xa);Hs=l($n,"intent_class"),$n.forEach(t),Ns=l(Rl,": represents the class id of the speaker\u2019s intent."),Rl.forEach(t),ps.forEach(t),Tt=u(e),Ia=r(e,"P",{});var vn=i(Ia);Vs=l(vn,"To make it easier for the model to get the label name from the label id, create a dictionary that maps the label name to an integer and vice versa:"),vn.forEach(t),Pt=u(e),j(ta.$$.fragment,e),St=u(e),Fa=r(e,"P",{});var bn=i(Fa);Ys=l(bn,"Now you can convert the label id to a label name:"),bn.forEach(t),Dt=u(e),j(sa.$$.fragment,e),Ct=u(e),qe=r(e,"H2",{class:!0});var cs=i(qe);Oe=r(cs,"A",{id:!0,class:!0,href:!0});var jn=i(Oe);Za=r(jn,"SPAN",{});var yn=i(Za);j(la.$$.fragment,yn),yn.forEach(t),jn.forEach(t),zs=u(cs),et=r(cs,"SPAN",{});var wn=i(et);Us=l(wn,"Preprocess"),wn.forEach(t),cs.forEach(t),It=u(e),Ma=r(e,"P",{});var En=i(Ma);Rs=l(En,"The next step is to load a Wav2Vec2 feature extractor to process the audio signal:"),En.forEach(t),Ft=u(e),j(na.$$.fragment,e),Mt=u(e),Le=r(e,"P",{});var us=i(Le);Gs=l(us,"The MInDS-14 dataset has a sampling rate of 8000khz (you can find this information in it\u2019s "),ra=r(us,"A",{href:!0,rel:!0});var kn=i(ra);Bs=l(kn,"dataset card"),kn.forEach(t),Js=l(us,"), which means you\u2019ll need to resample the dataset to 16000kHz to use the pretrained Wav2Vec2 model:"),us.forEach(t),Ot=u(e),j(oa.$$.fragment,e),Lt=u(e),Oa=r(e,"P",{});var xn=i(Oa);Ks=l(xn,"Now create a preprocessing function that:"),xn.forEach(t),Wt=u(e),xe=r(e,"OL",{});var Ya=i(xe);ia=r(Ya,"LI",{});var ms=i(ia);Qs=l(ms,"Calls the "),at=r(ms,"CODE",{});var An=i(at);Xs=l(An,"audio"),An.forEach(t),Zs=l(ms," column to load, and if necessary, resample the audio file."),ms.forEach(t),el=u(Ya),pa=r(Ya,"LI",{});var fs=i(pa);al=l(fs,"Checks if the sampling rate of the audio file matches the sampling rate of the audio data a model was pretrained with. You can find this information in the Wav2Vec2 "),ca=r(fs,"A",{href:!0,rel:!0});var qn=i(ca);tl=l(qn,"model card"),qn.forEach(t),sl=l(fs,"."),fs.forEach(t),ll=u(Ya),tt=r(Ya,"LI",{});var Tn=i(tt);nl=l(Tn,"Set a maximum input length to batch longer inputs without truncating them."),Tn.forEach(t),Ya.forEach(t),Ht=u(e),j(ua.$$.fragment,e),Nt=u(e),se=r(e,"P",{});var be=i(se);rl=l(be,"To apply the preprocessing function over the entire dataset, use \u{1F917} Datasets "),ma=r(be,"A",{href:!0,rel:!0});var Pn=i(ma);ol=l(Pn,"map"),Pn.forEach(t),il=l(be," function. You can speed up "),st=r(be,"CODE",{});var Sn=i(st);pl=l(Sn,"map"),Sn.forEach(t),cl=l(be," by setting "),lt=r(be,"CODE",{});var Dn=i(lt);ul=l(Dn,"batched=True"),Dn.forEach(t),ml=l(be," to process multiple elements of the dataset at once. Remove the columns you don\u2019t need, and rename "),nt=r(be,"CODE",{});var Cn=i(nt);fl=l(Cn,"intent_class"),Cn.forEach(t),hl=l(be," to "),rt=r(be,"CODE",{});var In=i(rt);dl=l(In,"label"),In.forEach(t),_l=l(be," because that\u2019s the name the model expects:"),be.forEach(t),Vt=u(e),j(fa.$$.fragment,e),Yt=u(e),Te=r(e,"H2",{class:!0});var hs=i(Te);We=r(hs,"A",{id:!0,class:!0,href:!0});var Fn=i(We);ot=r(Fn,"SPAN",{});var Mn=i(ot);j(ha.$$.fragment,Mn),Mn.forEach(t),Fn.forEach(t),gl=u(hs),it=r(hs,"SPAN",{});var On=i(it);$l=l(On,"Evaluate"),On.forEach(t),hs.forEach(t),zt=u(e),$e=r(e,"P",{});var Be=i($e);vl=l(Be,"Including a metric during training is often helpful for evaluating your model\u2019s performance. You can quickly load a evaluation method with the \u{1F917} "),da=r(Be,"A",{href:!0,rel:!0});var Ln=i(da);bl=l(Ln,"Evaluate"),Ln.forEach(t),jl=l(Be," library. For this task, load the "),_a=r(Be,"A",{href:!0,rel:!0});var Wn=i(_a);yl=l(Wn,"accuracy"),Wn.forEach(t),wl=l(Be," metric (see the \u{1F917} Evaluate "),ga=r(Be,"A",{href:!0,rel:!0});var Hn=i(ga);El=l(Hn,"quick tour"),Hn.forEach(t),kl=l(Be," to learn more about how to load and compute a metric):"),Be.forEach(t),Ut=u(e),j($a.$$.fragment,e),Rt=u(e),He=r(e,"P",{});var ds=i(He);xl=l(ds,"Then create a function that passes your predictions and labels to "),va=r(ds,"A",{href:!0,rel:!0});var Nn=i(va);Al=l(Nn,"compute"),Nn.forEach(t),ql=l(ds," to calculate the accuracy:"),ds.forEach(t),Gt=u(e),j(ba.$$.fragment,e),Bt=u(e),Ne=r(e,"P",{});var _s=i(Ne);Tl=l(_s,"Your "),pt=r(_s,"CODE",{});var Vn=i(pt);Pl=l(Vn,"compute_metrics"),Vn.forEach(t),Sl=l(_s," function is ready to go now, and you\u2019ll return to it when you setup your training."),_s.forEach(t),Jt=u(e),Pe=r(e,"H2",{class:!0});var gs=i(Pe);Ve=r(gs,"A",{id:!0,class:!0,href:!0});var Yn=i(Ve);ct=r(Yn,"SPAN",{});var zn=i(ct);j(ja.$$.fragment,zn),zn.forEach(t),Yn.forEach(t),Dl=u(gs),ut=r(gs,"SPAN",{});var Un=i(ut);Cl=l(Un,"Train"),Un.forEach(t),gs.forEach(t),Kt=u(e),j(Ye.$$.fragment,e),Qt=u(e),j(ze.$$.fragment,e),Xt=u(e),Se=r(e,"H2",{class:!0});var $s=i(Se);Ue=r($s,"A",{id:!0,class:!0,href:!0});var Rn=i(Ue);mt=r(Rn,"SPAN",{});var Gn=i(mt);j(ya.$$.fragment,Gn),Gn.forEach(t),Rn.forEach(t),Il=u($s),ft=r($s,"SPAN",{});var Bn=i(ft);Fl=l(Bn,"Inference"),Bn.forEach(t),$s.forEach(t),Zt=u(e),La=r(e,"P",{});var Jn=i(La);Ml=l(Jn,"Great, now that you\u2019ve finetuned a model, you can use it for inference!"),Jn.forEach(t),es=u(e),Wa=r(e,"P",{});var Kn=i(Wa);Ol=l(Kn,"Load an audio file you\u2019d like to run inference on. Remember to resample the sampling rate of the audio file to match the sampling rate of the model if you need to!"),Kn.forEach(t),as=u(e),j(wa.$$.fragment,e),ts=u(e),Ae=r(e,"P",{});var za=i(Ae);Ll=l(za,"The simplest way to try out your finetuned model for inference is to use it in a "),Ha=r(za,"A",{href:!0});var Qn=i(Ha);Wl=l(Qn,"pipeline()"),Qn.forEach(t),Hl=l(za,". Instantiate a "),ht=r(za,"CODE",{});var Xn=i(ht);Nl=l(Xn,"pipeline"),Xn.forEach(t),Vl=l(za," for audio classification with your model, and pass your audio file to it:"),za.forEach(t),ss=u(e),j(Ea.$$.fragment,e),ls=u(e),Re=r(e,"P",{});var vs=i(Re);Yl=l(vs,"You can also manually replicate the results of the "),dt=r(vs,"CODE",{});var Zn=i(dt);zl=l(Zn,"pipeline"),Zn.forEach(t),Ul=l(vs," if you\u2019d like:"),vs.forEach(t),ns=u(e),j(Ge.$$.fragment,e),this.h()},h(){h(m,"name","hf:doc:metadata"),h(m,"content",JSON.stringify(gr)),h($,"id","audio-classification"),h($,"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"),h($,"href","#audio-classification"),h(f,"class","relative group"),h(d,"href","https://huggingface.co/facebook/wav2vec2-base"),h(d,"rel","nofollow"),h(B,"href","https://huggingface.co/datasets/PolyAI/minds14"),h(B,"rel","nofollow"),h(_e,"id","load-minds14-dataset"),h(_e,"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"),h(_e,"href","#load-minds14-dataset"),h(fe,"class","relative group"),h(ge,"href","https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.train_test_split"),h(ge,"rel","nofollow"),h(Ze,"href","https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.remove_columns"),h(Ze,"rel","nofollow"),h(Oe,"id","preprocess"),h(Oe,"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"),h(Oe,"href","#preprocess"),h(qe,"class","relative group"),h(ra,"href","https://huggingface.co/datasets/PolyAI/minds14"),h(ra,"rel","nofollow"),h(ca,"href","https://huggingface.co/facebook/wav2vec2-base"),h(ca,"rel","nofollow"),h(ma,"href","https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.map"),h(ma,"rel","nofollow"),h(We,"id","evaluate"),h(We,"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"),h(We,"href","#evaluate"),h(Te,"class","relative group"),h(da,"href","https://huggingface.co/docs/evaluate/index"),h(da,"rel","nofollow"),h(_a,"href","https://huggingface.co/spaces/evaluate-metric/accuracy"),h(_a,"rel","nofollow"),h(ga,"href","https://huggingface.co/docs/evaluate/a_quick_tour"),h(ga,"rel","nofollow"),h(va,"href","https://huggingface.co/docs/evaluate/main/en/package_reference/main_classes#evaluate.EvaluationModule.compute"),h(va,"rel","nofollow"),h(Ve,"id","train"),h(Ve,"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"),h(Ve,"href","#train"),h(Pe,"class","relative group"),h(Ue,"id","inference"),h(Ue,"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"),h(Ue,"href","#inference"),h(Se,"class","relative group"),h(Ha,"href","/docs/transformers/main/en/main_classes/pipelines#transformers.pipeline")},m(e,o){a(document.head,m),p(e,g,o),p(e,f,o),a(f,$),a($,q),y(x,q,null),a(f,P),a(f,T),a(T,v),p(e,F,o),y(C,e,o),p(e,I,o),p(e,Y,o),a(Y,W),p(e,z,o),p(e,V,o),a(V,J),p(e,U,o),p(e,H,o),a(H,S),a(S,R),a(S,d),a(d,D),a(S,M),a(S,B),a(B,G),a(S,K),a(H,je),a(H,le),a(le,re),p(e,he,o),y(N,e,o),p(e,A,o),p(e,ue,o),a(ue,me),p(e,ye,o),y(oe,e,o),p(e,de,o),p(e,Q,o),a(Q,we),p(e,ae,o),y(ie,e,o),p(e,pe,o),p(e,fe,o),a(fe,_e),a(_e,Ee),y(ne,Ee,null),a(fe,De),a(fe,_),a(_,O),p(e,ce,o),p(e,X,o),a(X,xa),p(e,Je,o),y(ke,e,o),p(e,Ke,o),p(e,Z,o),a(Z,Aa),a(Z,Ce),a(Ce,Ie),a(Z,qa),a(Z,ge),a(ge,Ta),a(Z,bs),p(e,bt,o),y(Qe,e,o),p(e,jt,o),p(e,Pa,o),a(Pa,js),p(e,yt,o),y(Xe,e,o),p(e,wt,o),p(e,te,o),a(te,ys),a(te,Ra),a(Ra,ws),a(te,Es),a(te,Ga),a(Ga,ks),a(te,xs),a(te,Ba),a(Ba,As),a(te,qs),a(te,Ja),a(Ja,Ts),a(te,Ps),a(te,Ze),a(Ze,Ss),a(te,Ds),p(e,Et,o),y(ea,e,o),p(e,kt,o),p(e,Sa,o),a(Sa,Cs),p(e,xt,o),y(aa,e,o),p(e,At,o),p(e,Da,o),a(Da,Is),p(e,qt,o),p(e,Fe,o),a(Fe,Me),a(Me,Ka),a(Ka,Fs),a(Me,Ms),a(Me,Qa),a(Qa,Os),a(Me,Ls),a(Fe,Ws),a(Fe,Ca),a(Ca,Xa),a(Xa,Hs),a(Ca,Ns),p(e,Tt,o),p(e,Ia,o),a(Ia,Vs),p(e,Pt,o),y(ta,e,o),p(e,St,o),p(e,Fa,o),a(Fa,Ys),p(e,Dt,o),y(sa,e,o),p(e,Ct,o),p(e,qe,o),a(qe,Oe),a(Oe,Za),y(la,Za,null),a(qe,zs),a(qe,et),a(et,Us),p(e,It,o),p(e,Ma,o),a(Ma,Rs),p(e,Ft,o),y(na,e,o),p(e,Mt,o),p(e,Le,o),a(Le,Gs),a(Le,ra),a(ra,Bs),a(Le,Js),p(e,Ot,o),y(oa,e,o),p(e,Lt,o),p(e,Oa,o),a(Oa,Ks),p(e,Wt,o),p(e,xe,o),a(xe,ia),a(ia,Qs),a(ia,at),a(at,Xs),a(ia,Zs),a(xe,el),a(xe,pa),a(pa,al),a(pa,ca),a(ca,tl),a(pa,sl),a(xe,ll),a(xe,tt),a(tt,nl),p(e,Ht,o),y(ua,e,o),p(e,Nt,o),p(e,se,o),a(se,rl),a(se,ma),a(ma,ol),a(se,il),a(se,st),a(st,pl),a(se,cl),a(se,lt),a(lt,ul),a(se,ml),a(se,nt),a(nt,fl),a(se,hl),a(se,rt),a(rt,dl),a(se,_l),p(e,Vt,o),y(fa,e,o),p(e,Yt,o),p(e,Te,o),a(Te,We),a(We,ot),y(ha,ot,null),a(Te,gl),a(Te,it),a(it,$l),p(e,zt,o),p(e,$e,o),a($e,vl),a($e,da),a(da,bl),a($e,jl),a($e,_a),a(_a,yl),a($e,wl),a($e,ga),a(ga,El),a($e,kl),p(e,Ut,o),y($a,e,o),p(e,Rt,o),p(e,He,o),a(He,xl),a(He,va),a(va,Al),a(He,ql),p(e,Gt,o),y(ba,e,o),p(e,Bt,o),p(e,Ne,o),a(Ne,Tl),a(Ne,pt),a(pt,Pl),a(Ne,Sl),p(e,Jt,o),p(e,Pe,o),a(Pe,Ve),a(Ve,ct),y(ja,ct,null),a(Pe,Dl),a(Pe,ut),a(ut,Cl),p(e,Kt,o),y(Ye,e,o),p(e,Qt,o),y(ze,e,o),p(e,Xt,o),p(e,Se,o),a(Se,Ue),a(Ue,mt),y(ya,mt,null),a(Se,Il),a(Se,ft),a(ft,Fl),p(e,Zt,o),p(e,La,o),a(La,Ml),p(e,es,o),p(e,Wa,o),a(Wa,Ol),p(e,as,o),y(wa,e,o),p(e,ts,o),p(e,Ae,o),a(Ae,Ll),a(Ae,Ha),a(Ha,Wl),a(Ae,Hl),a(Ae,ht),a(ht,Nl),a(Ae,Vl),p(e,ss,o),y(Ea,e,o),p(e,ls,o),p(e,Re,o),a(Re,Yl),a(Re,dt),a(dt,zl),a(Re,Ul),p(e,ns,o),y(Ge,e,o),rs=!0},p(e,[o]){const ka={};o&2&&(ka.$$scope={dirty:o,ctx:e}),N.$set(ka);const _t={};o&2&&(_t.$$scope={dirty:o,ctx:e}),Ye.$set(_t);const gt={};o&2&&(gt.$$scope={dirty:o,ctx:e}),ze.$set(gt);const $t={};o&2&&($t.$$scope={dirty:o,ctx:e}),Ge.$set($t)},i(e){rs||(w(x.$$.fragment,e),w(C.$$.fragment,e),w(N.$$.fragment,e),w(oe.$$.fragment,e),w(ie.$$.fragment,e),w(ne.$$.fragment,e),w(ke.$$.fragment,e),w(Qe.$$.fragment,e),w(Xe.$$.fragment,e),w(ea.$$.fragment,e),w(aa.$$.fragment,e),w(ta.$$.fragment,e),w(sa.$$.fragment,e),w(la.$$.fragment,e),w(na.$$.fragment,e),w(oa.$$.fragment,e),w(ua.$$.fragment,e),w(fa.$$.fragment,e),w(ha.$$.fragment,e),w($a.$$.fragment,e),w(ba.$$.fragment,e),w(ja.$$.fragment,e),w(Ye.$$.fragment,e),w(ze.$$.fragment,e),w(ya.$$.fragment,e),w(wa.$$.fragment,e),w(Ea.$$.fragment,e),w(Ge.$$.fragment,e),rs=!0)},o(e){E(x.$$.fragment,e),E(C.$$.fragment,e),E(N.$$.fragment,e),E(oe.$$.fragment,e),E(ie.$$.fragment,e),E(ne.$$.fragment,e),E(ke.$$.fragment,e),E(Qe.$$.fragment,e),E(Xe.$$.fragment,e),E(ea.$$.fragment,e),E(aa.$$.fragment,e),E(ta.$$.fragment,e),E(sa.$$.fragment,e),E(la.$$.fragment,e),E(na.$$.fragment,e),E(oa.$$.fragment,e),E(ua.$$.fragment,e),E(fa.$$.fragment,e),E(ha.$$.fragment,e),E($a.$$.fragment,e),E(ba.$$.fragment,e),E(ja.$$.fragment,e),E(Ye.$$.fragment,e),E(ze.$$.fragment,e),E(ya.$$.fragment,e),E(wa.$$.fragment,e),E(Ea.$$.fragment,e),E(Ge.$$.fragment,e),rs=!1},d(e){t(m),e&&t(g),e&&t(f),k(x),e&&t(F),k(C,e),e&&t(I),e&&t(Y),e&&t(z),e&&t(V),e&&t(U),e&&t(H),e&&t(he),k(N,e),e&&t(A),e&&t(ue),e&&t(ye),k(oe,e),e&&t(de),e&&t(Q),e&&t(ae),k(ie,e),e&&t(pe),e&&t(fe),k(ne),e&&t(ce),e&&t(X),e&&t(Je),k(ke,e),e&&t(Ke),e&&t(Z),e&&t(bt),k(Qe,e),e&&t(jt),e&&t(Pa),e&&t(yt),k(Xe,e),e&&t(wt),e&&t(te),e&&t(Et),k(ea,e),e&&t(kt),e&&t(Sa),e&&t(xt),k(aa,e),e&&t(At),e&&t(Da),e&&t(qt),e&&t(Fe),e&&t(Tt),e&&t(Ia),e&&t(Pt),k(ta,e),e&&t(St),e&&t(Fa),e&&t(Dt),k(sa,e),e&&t(Ct),e&&t(qe),k(la),e&&t(It),e&&t(Ma),e&&t(Ft),k(na,e),e&&t(Mt),e&&t(Le),e&&t(Ot),k(oa,e),e&&t(Lt),e&&t(Oa),e&&t(Wt),e&&t(xe),e&&t(Ht),k(ua,e),e&&t(Nt),e&&t(se),e&&t(Vt),k(fa,e),e&&t(Yt),e&&t(Te),k(ha),e&&t(zt),e&&t($e),e&&t(Ut),k($a,e),e&&t(Rt),e&&t(He),e&&t(Gt),k(ba,e),e&&t(Bt),e&&t(Ne),e&&t(Jt),e&&t(Pe),k(ja),e&&t(Kt),k(Ye,e),e&&t(Qt),k(ze,e),e&&t(Xt),e&&t(Se),k(ya),e&&t(Zt),e&&t(La),e&&t(es),e&&t(Wa),e&&t(as),k(wa,e),e&&t(ts),e&&t(Ae),e&&t(ss),k(Ea,e),e&&t(ls),e&&t(Re),e&&t(ns),k(Ge,e)}}}const gr={local:"audio-classification",sections:[{local:"load-minds14-dataset",title:"Load MInDS-14 dataset"},{local:"preprocess",title:"Preprocess"},{local:"evaluate",title:"Evaluate"},{local:"train",title:"Train"},{local:"inference",title:"Inference"}],title:"Audio classification"};function $r(ee){return rr(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class kr extends tr{constructor(m){super();sr(this,m,$r,_r,lr,{})}}export{kr as default,gr as metadata};
