import{s as rt,o as ot,n as We}from"../chunks/scheduler.9bc65507.js";import{S as ct,i as mt,g as c,s as l,r as u,A as ut,h as m,f as t,c as n,j as lt,u as h,x as j,k as nt,y as ht,a,v as d,d as f,t as g,w as y,m as dt,n as ft}from"../chunks/index.707bf1b6.js";import{T as Ze}from"../chunks/Tip.c2ecdbf4.js";import{Y as gt}from"../chunks/Youtube.e1129c6f.js";import{C as _}from"../chunks/CodeBlock.54a9f38d.js";import{D as yt}from"../chunks/DocNotebookDropdown.41f65cb5.js";import{F as pt,M as it}from"../chunks/Markdown.fef84341.js";import{H as Cs}from"../chunks/Heading.342b1fa6.js";function Mt(W){let p,b,i='<a href="../model_doc/audio-spectrogram-transformer">Audio Spectrogram Transformer</a>, <a href="../model_doc/data2vec-audio">Data2VecAudio</a>, <a href="../model_doc/hubert">Hubert</a>, <a href="../model_doc/sew">SEW</a>, <a href="../model_doc/sew-d">SEW-D</a>, <a href="../model_doc/unispeech">UniSpeech</a>, <a href="../model_doc/unispeech-sat">UniSpeechSat</a>, <a href="../model_doc/wav2vec2">Wav2Vec2</a>, <a href="../model_doc/wav2vec2-bert">Wav2Vec2-BERT</a>, <a href="../model_doc/wav2vec2-conformer">Wav2Vec2-Conformer</a>, <a href="../model_doc/wavlm">WavLM</a>, <a href="../model_doc/whisper">Whisper</a>';return{c(){p=dt(`The task illustrated in this tutorial is supported by the following model architectures:

`),b=c("p"),b.innerHTML=i},l(M){p=ft(M,`The task illustrated in this tutorial is supported by the following model architectures:

`),b=m(M,"P",{"data-svelte-h":!0}),j(b)!=="svelte-galivs"&&(b.innerHTML=i)},m(M,$){a(M,p,$),a(M,b,$)},p:We,d(M){M&&(t(p),t(b))}}}function bt(W){let p,b='If you aren’t familiar with finetuning a model with the <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer">Trainer</a>, take a look at the basic tutorial <a href="../training#train-with-pytorch-trainer">here</a>!';return{c(){p=c("p"),p.innerHTML=b},l(i){p=m(i,"P",{"data-svelte-h":!0}),j(p)!=="svelte-15s4um0"&&(p.innerHTML=b)},m(i,M){a(i,p,M)},p:We,d(i){i&&t(p)}}}function jt(W){let p,b,i,M='You’re ready to start training your model now! Load Wav2Vec2 with <a href="/docs/transformers/main/en/model_doc/auto#transformers.AutoModelForAudioClassification">AutoModelForAudioClassification</a> along with the number of expected labels, and the label mappings:',$,v,Z,k,U="At this point, only three steps remain:",C,J,V='<li>Define your training hyperparameters in <a href="/docs/transformers/main/en/main_classes/trainer#transformers.TrainingArguments">TrainingArguments</a>. The only required parameter is <code>output_dir</code> which specifies where to save your model. You’ll push this model to the Hub by setting <code>push_to_hub=True</code> (you need to be signed in to Hugging Face to upload your model). At the end of each epoch, the <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer">Trainer</a> will evaluate the accuracy and save the training checkpoint.</li> <li>Pass the training arguments to <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer">Trainer</a> along with the model, dataset, tokenizer, data collator, and <code>compute_metrics</code> function.</li> <li>Call <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer.train">train()</a> to finetune your model.</li>',I,T,X,o,x='Once training is completed, share your model to the Hub with the <a href="/docs/transformers/main/en/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> method so everyone can use your model:',H,G,R;return p=new Ze({props:{$$slots:{default:[bt]},$$scope:{ctx:W}}}),v=new _({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckF1ZGlvQ2xhc3NpZmljYXRpb24lMkMlMjBUcmFpbmluZ0FyZ3VtZW50cyUyQyUyMFRyYWluZXIlMEElMEFudW1fbGFiZWxzJTIwJTNEJTIwbGVuKGlkMmxhYmVsKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsRm9yQXVkaW9DbGFzc2lmaWNhdGlvbi5mcm9tX3ByZXRyYWluZWQoJTBBJTIwJTIwJTIwJTIwJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlJTIyJTJDJTIwbnVtX2xhYmVscyUzRG51bV9sYWJlbHMlMkMlMjBsYWJlbDJpZCUzRGxhYmVsMmlkJTJDJTIwaWQybGFiZWwlM0RpZDJsYWJlbCUwQSk=",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>)`,wrap:!1}}),T=new _({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX21pbmRfbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjBldmFsdWF0aW9uX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBsZWFybmluZ19yYXRlJTNEM2UtNSUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfdHJhaW5fYmF0Y2hfc2l6ZSUzRDMyJTJDJTBBJTIwJTIwJTIwJTIwZ3JhZGllbnRfYWNjdW11bGF0aW9uX3N0ZXBzJTNENCUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEMzIlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNEMTAlMkMlMEElMjAlMjAlMjAlMjB3YXJtdXBfcmF0aW8lM0QwLjElMkMlMEElMjAlMjAlMjAlMjBsb2dnaW5nX3N0ZXBzJTNEMTAlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMG1ldHJpY19mb3JfYmVzdF9tb2RlbCUzRCUyMmFjY3VyYWN5JTIyJTJDJTBBJTIwJTIwJTIwJTIwcHVzaF90b19odWIlM0RUcnVlJTJDJTBBKSUwQSUwQXRyYWluZXIlMjAlM0QlMjBUcmFpbmVyKCUwQSUyMCUyMCUyMCUyMG1vZGVsJTNEbW9kZWwlMkMlMEElMjAlMjAlMjAlMjBhcmdzJTNEdHJhaW5pbmdfYXJncyUyQyUwQSUyMCUyMCUyMCUyMHRyYWluX2RhdGFzZXQlM0RlbmNvZGVkX21pbmRzJTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RlbmNvZGVkX21pbmRzJTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRGZlYXR1cmVfZXh0cmFjdG9yJTJDJTBBJTIwJTIwJTIwJTIwY29tcHV0ZV9tZXRyaWNzJTNEY29tcHV0ZV9tZXRyaWNzJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",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()`,wrap:!1}}),G=new _({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){u(p.$$.fragment),b=l(),i=c("p"),i.innerHTML=M,$=l(),u(v.$$.fragment),Z=l(),k=c("p"),k.textContent=U,C=l(),J=c("ol"),J.innerHTML=V,I=l(),u(T.$$.fragment),X=l(),o=c("p"),o.innerHTML=x,H=l(),u(G.$$.fragment)},l(r){h(p.$$.fragment,r),b=n(r),i=m(r,"P",{"data-svelte-h":!0}),j(i)!=="svelte-o6zfw2"&&(i.innerHTML=M),$=n(r),h(v.$$.fragment,r),Z=n(r),k=m(r,"P",{"data-svelte-h":!0}),j(k)!=="svelte-l42k0i"&&(k.textContent=U),C=n(r),J=m(r,"OL",{"data-svelte-h":!0}),j(J)!=="svelte-18vvra9"&&(J.innerHTML=V),I=n(r),h(T.$$.fragment,r),X=n(r),o=m(r,"P",{"data-svelte-h":!0}),j(o)!=="svelte-1v13hlo"&&(o.innerHTML=x),H=n(r),h(G.$$.fragment,r)},m(r,w){d(p,r,w),a(r,b,w),a(r,i,w),a(r,$,w),d(v,r,w),a(r,Z,w),a(r,k,w),a(r,C,w),a(r,J,w),a(r,I,w),d(T,r,w),a(r,X,w),a(r,o,w),a(r,H,w),d(G,r,w),R=!0},p(r,w){const Is={};w&2&&(Is.$$scope={dirty:w,ctx:r}),p.$set(Is)},i(r){R||(f(p.$$.fragment,r),f(v.$$.fragment,r),f(T.$$.fragment,r),f(G.$$.fragment,r),R=!0)},o(r){g(p.$$.fragment,r),g(v.$$.fragment,r),g(T.$$.fragment,r),g(G.$$.fragment,r),R=!1},d(r){r&&(t(b),t(i),t($),t(Z),t(k),t(C),t(J),t(I),t(X),t(o),t(H)),y(p,r),y(v,r),y(T,r),y(G,r)}}}function $t(W){let p,b;return p=new it({props:{$$slots:{default:[jt]},$$scope:{ctx:W}}}),{c(){u(p.$$.fragment)},l(i){h(p.$$.fragment,i)},m(i,M){d(p,i,M),b=!0},p(i,M){const $={};M&2&&($.$$scope={dirty:M,ctx:i}),p.$set($)},i(i){b||(f(p.$$.fragment,i),b=!0)},o(i){g(p.$$.fragment,i),b=!1},d(i){y(p,i)}}}function wt(W){let p,b='For a more in-depth example of how to finetune a model for audio classification, take a look at the corresponding <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb" rel="nofollow">PyTorch notebook</a>.';return{c(){p=c("p"),p.innerHTML=b},l(i){p=m(i,"P",{"data-svelte-h":!0}),j(p)!=="svelte-1zzytb"&&(p.innerHTML=b)},m(i,M){a(i,p,M)},p:We,d(i){i&&t(p)}}}function Jt(W){let p,b="Load a feature extractor to preprocess the audio file and return the <code>input</code> as PyTorch tensors:",i,M,$,v,Z="Pass your inputs to the model and return the logits:",k,U,C,J,V="Get the class with the highest probability, and use the model’s <code>id2label</code> mapping to convert it to a label:",I,T,X;return M=new _({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyc3RldmhsaXUlMkZteV9hd2Vzb21lX21pbmRzX21vZGVsJTIyKSUwQWlucHV0cyUyMCUzRCUyMGZlYXR1cmVfZXh0cmFjdG9yKGRhdGFzZXQlNUIwJTVEJTVCJTIyYXVkaW8lMjIlNUQlNUIlMjJhcnJheSUyMiU1RCUyQyUyMHNhbXBsaW5nX3JhdGUlM0RzYW1wbGluZ19yYXRlJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMik=",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>)`,wrap:!1}}),U=new _({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvckF1ZGlvQ2xhc3NpZmljYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvckF1ZGlvQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnN0ZXZobGl1JTJGbXlfYXdlc29tZV9taW5kc19tb2RlbCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cw==",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`,wrap:!1}}),T=new _({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFwcmVkaWN0ZWRfY2xhc3NfaWRzJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cykuaXRlbSgpJTBBcHJlZGljdGVkX2xhYmVsJTIwJTNEJTIwbW9kZWwuY29uZmlnLmlkMmxhYmVsJTVCcHJlZGljdGVkX2NsYXNzX2lkcyU1RCUwQXByZWRpY3RlZF9sYWJlbA==",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>`,wrap:!1}}),{c(){p=c("p"),p.innerHTML=b,i=l(),u(M.$$.fragment),$=l(),v=c("p"),v.textContent=Z,k=l(),u(U.$$.fragment),C=l(),J=c("p"),J.innerHTML=V,I=l(),u(T.$$.fragment)},l(o){p=m(o,"P",{"data-svelte-h":!0}),j(p)!=="svelte-eon9oh"&&(p.innerHTML=b),i=n(o),h(M.$$.fragment,o),$=n(o),v=m(o,"P",{"data-svelte-h":!0}),j(v)!=="svelte-1at92g"&&(v.textContent=Z),k=n(o),h(U.$$.fragment,o),C=n(o),J=m(o,"P",{"data-svelte-h":!0}),j(J)!=="svelte-1w2ymk2"&&(J.innerHTML=V),I=n(o),h(T.$$.fragment,o)},m(o,x){a(o,p,x),a(o,i,x),d(M,o,x),a(o,$,x),a(o,v,x),a(o,k,x),d(U,o,x),a(o,C,x),a(o,J,x),a(o,I,x),d(T,o,x),X=!0},p:We,i(o){X||(f(M.$$.fragment,o),f(U.$$.fragment,o),f(T.$$.fragment,o),X=!0)},o(o){g(M.$$.fragment,o),g(U.$$.fragment,o),g(T.$$.fragment,o),X=!1},d(o){o&&(t(p),t(i),t($),t(v),t(k),t(C),t(J),t(I)),y(M,o),y(U,o),y(T,o)}}}function Tt(W){let p,b;return p=new it({props:{$$slots:{default:[Jt]},$$scope:{ctx:W}}}),{c(){u(p.$$.fragment)},l(i){h(p.$$.fragment,i)},m(i,M){d(p,i,M),b=!0},p(i,M){const $={};M&2&&($.$$scope={dirty:M,ctx:i}),p.$set($)},i(i){b||(f(p.$$.fragment,i),b=!0)},o(i){g(p.$$.fragment,i),b=!1},d(i){y(p,i)}}}function _t(W){let p,b,i,M,$,v,Z,k,U,C,J,V="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.",I,T,X="This guide will show you how to:",o,x,H='<li>Finetune <a href="https://huggingface.co/facebook/wav2vec2-base" rel="nofollow">Wav2Vec2</a> on the <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">MInDS-14</a> dataset to classify speaker intent.</li> <li>Use your finetuned model for inference.</li>',G,R,r,w,Is="Before you begin, make sure you have all the necessary libraries installed:",Xs,B,Gs,E,Ce="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:",Vs,z,Ys,A,Fs,Q,Ie="Start by loading the MInDS-14 dataset from the 🤗 Datasets library:",Ns,q,Hs,S,Re='Split the dataset’s <code>train</code> split into a smaller train and test set with the <a href="https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.train_test_split" rel="nofollow">train_test_split</a> method. This’ll give you a chance to experiment and make sure everything works before spending more time on the full dataset.',Bs,L,Es,P,Xe="Then take a look at the dataset:",zs,D,As,K,Ge='While the dataset contains a lot of useful information, like <code>lang_id</code> and <code>english_transcription</code>, you’ll focus on the <code>audio</code> and <code>intent_class</code> in this guide. Remove the other columns with the <a href="https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.remove_columns" rel="nofollow">remove_columns</a> method:',Qs,O,qs,ss,Ve="Take a look at an example now:",Ss,es,Ls,ts,Ye="There are two fields:",Ps,as,Fe="<li><code>audio</code>: a 1-dimensional <code>array</code> of the speech signal that must be called to load and resample the audio file.</li> <li><code>intent_class</code>: represents the class id of the speaker’s intent.</li>",Ds,ls,Ne="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:",Ks,ns,Os,ps,He="Now you can convert the label id to a label name:",se,is,ee,rs,te,os,Be="The next step is to load a Wav2Vec2 feature extractor to process the audio signal:",ae,cs,le,ms,Ee='The MInDS-14 dataset has a sampling rate of 8000khz (you can find this information in it’s <a href="https://huggingface.co/datasets/PolyAI/minds14" rel="nofollow">dataset card</a>), which means you’ll need to resample the dataset to 16000kHz to use the pretrained Wav2Vec2 model:',ne,us,pe,hs,ze="Now create a preprocessing function that:",ie,ds,Ae='<li>Calls the <code>audio</code> column to load, and if necessary, resample the audio file.</li> <li>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 <a href="https://huggingface.co/facebook/wav2vec2-base" rel="nofollow">model card</a>.</li> <li>Set a maximum input length to batch longer inputs without truncating them.</li>',re,fs,oe,gs,Qe='To apply the preprocessing function over the entire dataset, use 🤗 Datasets <a href="https://huggingface.co/docs/datasets/main/en/package_reference/main_classes#datasets.Dataset.map" rel="nofollow">map</a> function. You can speed up <code>map</code> by setting <code>batched=True</code> to process multiple elements of the dataset at once. Remove the columns you don’t need, and rename <code>intent_class</code> to <code>label</code> because that’s the name the model expects:',ce,ys,me,Ms,ue,bs,qe='Including a metric during training is often helpful for evaluating your model’s performance. You can quickly load a evaluation method with the 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> library. For this task, load the <a href="https://huggingface.co/spaces/evaluate-metric/accuracy" rel="nofollow">accuracy</a> metric (see the 🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">quick tour</a> to learn more about how to load and compute a metric):',he,js,de,$s,Se='Then create a function that passes your predictions and labels to <a href="https://huggingface.co/docs/evaluate/main/en/package_reference/main_classes#evaluate.EvaluationModule.compute" rel="nofollow">compute</a> to calculate the accuracy:',fe,ws,ge,Js,Le="Your <code>compute_metrics</code> function is ready to go now, and you’ll return to it when you setup your training.",ye,Ts,Me,Y,be,F,je,_s,$e,xs,Pe="Great, now that you’ve finetuned a model, you can use it for inference!",we,vs,De="Load an audio file you’d 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!",Je,Us,Te,ks,Ke='The simplest way to try out your finetuned model for inference is to use it in a <a href="/docs/transformers/main/en/main_classes/pipelines#transformers.pipeline">pipeline()</a>. Instantiate a <code>pipeline</code> for audio classification with your model, and pass your audio file to it:',_e,Ws,xe,Zs,Oe="You can also manually replicate the results of the <code>pipeline</code> if you’d like:",ve,N,Ue,Rs,ke;return $=new Cs({props:{title:"Audio classification",local:"audio-classification",headingTag:"h1"}}),Z=new yt({props:{classNames:"absolute z-10 right-0 top-0",options:[{label:"Mixed",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/audio_classification.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/audio_classification.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/audio_classification.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/audio_classification.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/pytorch/audio_classification.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tensorflow/audio_classification.ipynb"}]}}),U=new gt({props:{id:"KWwzcmG98Ds"}}),R=new Ze({props:{$$slots:{default:[Mt]},$$scope:{ctx:W}}}),B=new _({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate",wrap:!1}}),z=new _({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMG5vdGVib29rX2xvZ2luJTBBJTBBbm90ZWJvb2tfbG9naW4oKQ==",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()`,wrap:!1}}),A=new Cs({props:{title:"Load MInDS-14 dataset",local:"load-minds-14-dataset",headingTag:"h2"}}),q=new _({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEFtaW5kcyUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJQb2x5QUklMkZtaW5kczE0JTIyJTJDJTIwbmFtZSUzRCUyMmVuLVVTJTIyJTJDJTIwc3BsaXQlM0QlMjJ0cmFpbiUyMik=",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>)`,wrap:!1}}),L=new _({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy50cmFpbl90ZXN0X3NwbGl0KHRlc3Rfc2l6ZSUzRDAuMik=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>minds = minds.train_test_split(test_size=<span class="hljs-number">0.2</span>)',wrap:!1}}),D=new _({props:{code:"bWluZHM=",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>
    })
})`,wrap:!1}}),O=new _({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy5yZW1vdmVfY29sdW1ucyglNUIlMjJwYXRoJTIyJTJDJTIwJTIydHJhbnNjcmlwdGlvbiUyMiUyQyUyMCUyMmVuZ2xpc2hfdHJhbnNjcmlwdGlvbiUyMiUyQyUyMCUyMmxhbmdfaWQlMjIlNUQp",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>])',wrap:!1}}),es=new _({props:{code:"bWluZHMlNUIlMjJ0cmFpbiUyMiU1RCU1QjAlNUQ=",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>}`,wrap:!1}}),ns=new _({props:{code:"bGFiZWxzJTIwJTNEJTIwbWluZHMlNUIlMjJ0cmFpbiUyMiU1RC5mZWF0dXJlcyU1QiUyMmludGVudF9jbGFzcyUyMiU1RC5uYW1lcyUwQWxhYmVsMmlkJTJDJTIwaWQybGFiZWwlMjAlM0QlMjBkaWN0KCklMkMlMjBkaWN0KCklMEFmb3IlMjBpJTJDJTIwbGFiZWwlMjBpbiUyMGVudW1lcmF0ZShsYWJlbHMpJTNBJTBBJTIwJTIwJTIwJTIwbGFiZWwyaWQlNUJsYWJlbCU1RCUyMCUzRCUyMHN0cihpKSUwQSUyMCUyMCUyMCUyMGlkMmxhYmVsJTVCc3RyKGkpJTVEJTIwJTNEJTIwbGFiZWw=",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`,wrap:!1}}),is=new _({props:{code:"aWQybGFiZWwlNUJzdHIoMiklNUQ=",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>`,wrap:!1}}),rs=new Cs({props:{title:"Preprocess",local:"preprocess",headingTag:"h2"}}),cs=new _({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9GZWF0dXJlRXh0cmFjdG9yJTBBJTBBZmVhdHVyZV9leHRyYWN0b3IlMjAlM0QlMjBBdXRvRmVhdHVyZUV4dHJhY3Rvci5mcm9tX3ByZXRyYWluZWQoJTIyZmFjZWJvb2slMkZ3YXYydmVjMi1iYXNlJTIyKQ==",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>)`,wrap:!1}}),us=new _({props:{code:"bWluZHMlMjAlM0QlMjBtaW5kcy5jYXN0X2NvbHVtbiglMjJhdWRpbyUyMiUyQyUyMEF1ZGlvKHNhbXBsaW5nX3JhdGUlM0QxNl8wMDApKSUwQW1pbmRzJTVCJTIydHJhaW4lMjIlNUQlNUIwJTVE",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>}`,wrap:!1}}),fs=new _({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc19mdW5jdGlvbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjBhdWRpb19hcnJheXMlMjAlM0QlMjAlNUJ4JTVCJTIyYXJyYXklMjIlNUQlMjBmb3IlMjB4JTIwaW4lMjBleGFtcGxlcyU1QiUyMmF1ZGlvJTIyJTVEJTVEJTBBJTIwJTIwJTIwJTIwaW5wdXRzJTIwJTNEJTIwZmVhdHVyZV9leHRyYWN0b3IoJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXVkaW9fYXJyYXlzJTJDJTIwc2FtcGxpbmdfcmF0ZSUzRGZlYXR1cmVfZXh0cmFjdG9yLnNhbXBsaW5nX3JhdGUlMkMlMjBtYXhfbGVuZ3RoJTNEMTYwMDAlMkMlMjB0cnVuY2F0aW9uJTNEVHJ1ZSUwQSUyMCUyMCUyMCUyMCklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBpbnB1dHM=",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`,wrap:!1}}),ys=new _({props:{code:"ZW5jb2RlZF9taW5kcyUyMCUzRCUyMG1pbmRzLm1hcChwcmVwcm9jZXNzX2Z1bmN0aW9uJTJDJTIwcmVtb3ZlX2NvbHVtbnMlM0QlMjJhdWRpbyUyMiUyQyUyMGJhdGNoZWQlM0RUcnVlKSUwQWVuY29kZWRfbWluZHMlMjAlM0QlMjBlbmNvZGVkX21pbmRzLnJlbmFtZV9jb2x1bW4oJTIyaW50ZW50X2NsYXNzJTIyJTJDJTIwJTIybGFiZWwlMjIp",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>)`,wrap:!1}}),Ms=new Cs({props:{title:"Evaluate",local:"evaluate",headingTag:"h2"}}),js=new _({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEElMEFhY2N1cmFjeSUyMCUzRCUyMGV2YWx1YXRlLmxvYWQoJTIyYWNjdXJhY3klMjIp",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>)`,wrap:!1}}),ws=new _({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBJTBBZGVmJTIwY29tcHV0ZV9tZXRyaWNzKGV2YWxfcHJlZCklM0ElMEElMjAlMjAlMjAlMjBwcmVkaWN0aW9ucyUyMCUzRCUyMG5wLmFyZ21heChldmFsX3ByZWQucHJlZGljdGlvbnMlMkMlMjBheGlzJTNEMSklMEElMjAlMjAlMjAlMjByZXR1cm4lMjBhY2N1cmFjeS5jb21wdXRlKHByZWRpY3Rpb25zJTNEcHJlZGljdGlvbnMlMkMlMjByZWZlcmVuY2VzJTNEZXZhbF9wcmVkLmxhYmVsX2lkcyk=",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)`,wrap:!1}}),Ts=new Cs({props:{title:"Train",local:"train",headingTag:"h2"}}),Y=new pt({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[$t]},$$scope:{ctx:W}}}),F=new Ze({props:{$$slots:{default:[wt]},$$scope:{ctx:W}}}),_s=new Cs({props:{title:"Inference",local:"inference",headingTag:"h2"}}),Us=new _({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTJDJTIwQXVkaW8lMEElMEFkYXRhc2V0JTIwJTNEJTIwbG9hZF9kYXRhc2V0KCUyMlBvbHlBSSUyRm1pbmRzMTQlMjIlMkMlMjBuYW1lJTNEJTIyZW4tVVMlMjIlMkMlMjBzcGxpdCUzRCUyMnRyYWluJTIyKSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0LmNhc3RfY29sdW1uKCUyMmF1ZGlvJTIyJTJDJTIwQXVkaW8oc2FtcGxpbmdfcmF0ZSUzRDE2MDAwKSklMEFzYW1wbGluZ19yYXRlJTIwJTNEJTIwZGF0YXNldC5mZWF0dXJlcyU1QiUyMmF1ZGlvJTIyJTVELnNhbXBsaW5nX3JhdGUlMEFhdWRpb19maWxlJTIwJTNEJTIwZGF0YXNldCU1QjAlNUQlNUIlMjJhdWRpbyUyMiU1RCU1QiUyMnBhdGglMjIlNUQ=",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>]`,wrap:!1}}),Ws=new _({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKCUyMmF1ZGlvLWNsYXNzaWZpY2F0aW9uJTIyJTJDJTIwbW9kZWwlM0QlMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfbWluZHNfbW9kZWwlMjIpJTBBY2xhc3NpZmllcihhdWRpb19maWxlKQ==",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>}
]`,wrap:!1}}),N=new pt({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[Tt]},$$scope:{ctx:W}}}),{c(){p=c("meta"),b=l(),i=c("p"),M=l(),u($.$$.fragment),v=l(),u(Z.$$.fragment),k=l(),u(U.$$.fragment),C=l(),J=c("p"),J.textContent=V,I=l(),T=c("p"),T.textContent=X,o=l(),x=c("ol"),x.innerHTML=H,G=l(),u(R.$$.fragment),r=l(),w=c("p"),w.textContent=Is,Xs=l(),u(B.$$.fragment),Gs=l(),E=c("p"),E.textContent=Ce,Vs=l(),u(z.$$.fragment),Ys=l(),u(A.$$.fragment),Fs=l(),Q=c("p"),Q.textContent=Ie,Ns=l(),u(q.$$.fragment),Hs=l(),S=c("p"),S.innerHTML=Re,Bs=l(),u(L.$$.fragment),Es=l(),P=c("p"),P.textContent=Xe,zs=l(),u(D.$$.fragment),As=l(),K=c("p"),K.innerHTML=Ge,Qs=l(),u(O.$$.fragment),qs=l(),ss=c("p"),ss.textContent=Ve,Ss=l(),u(es.$$.fragment),Ls=l(),ts=c("p"),ts.textContent=Ye,Ps=l(),as=c("ul"),as.innerHTML=Fe,Ds=l(),ls=c("p"),ls.textContent=Ne,Ks=l(),u(ns.$$.fragment),Os=l(),ps=c("p"),ps.textContent=He,se=l(),u(is.$$.fragment),ee=l(),u(rs.$$.fragment),te=l(),os=c("p"),os.textContent=Be,ae=l(),u(cs.$$.fragment),le=l(),ms=c("p"),ms.innerHTML=Ee,ne=l(),u(us.$$.fragment),pe=l(),hs=c("p"),hs.textContent=ze,ie=l(),ds=c("ol"),ds.innerHTML=Ae,re=l(),u(fs.$$.fragment),oe=l(),gs=c("p"),gs.innerHTML=Qe,ce=l(),u(ys.$$.fragment),me=l(),u(Ms.$$.fragment),ue=l(),bs=c("p"),bs.innerHTML=qe,he=l(),u(js.$$.fragment),de=l(),$s=c("p"),$s.innerHTML=Se,fe=l(),u(ws.$$.fragment),ge=l(),Js=c("p"),Js.innerHTML=Le,ye=l(),u(Ts.$$.fragment),Me=l(),u(Y.$$.fragment),be=l(),u(F.$$.fragment),je=l(),u(_s.$$.fragment),$e=l(),xs=c("p"),xs.textContent=Pe,we=l(),vs=c("p"),vs.textContent=De,Je=l(),u(Us.$$.fragment),Te=l(),ks=c("p"),ks.innerHTML=Ke,_e=l(),u(Ws.$$.fragment),xe=l(),Zs=c("p"),Zs.innerHTML=Oe,ve=l(),u(N.$$.fragment),Ue=l(),Rs=c("p"),this.h()},l(s){const e=ut("svelte-u9bgzb",document.head);p=m(e,"META",{name:!0,content:!0}),e.forEach(t),b=n(s),i=m(s,"P",{}),lt(i).forEach(t),M=n(s),h($.$$.fragment,s),v=n(s),h(Z.$$.fragment,s),k=n(s),h(U.$$.fragment,s),C=n(s),J=m(s,"P",{"data-svelte-h":!0}),j(J)!=="svelte-n3q9of"&&(J.textContent=V),I=n(s),T=m(s,"P",{"data-svelte-h":!0}),j(T)!=="svelte-1aff4p7"&&(T.textContent=X),o=n(s),x=m(s,"OL",{"data-svelte-h":!0}),j(x)!=="svelte-3izmna"&&(x.innerHTML=H),G=n(s),h(R.$$.fragment,s),r=n(s),w=m(s,"P",{"data-svelte-h":!0}),j(w)!=="svelte-1c9nexd"&&(w.textContent=Is),Xs=n(s),h(B.$$.fragment,s),Gs=n(s),E=m(s,"P",{"data-svelte-h":!0}),j(E)!=="svelte-k76o1m"&&(E.textContent=Ce),Vs=n(s),h(z.$$.fragment,s),Ys=n(s),h(A.$$.fragment,s),Fs=n(s),Q=m(s,"P",{"data-svelte-h":!0}),j(Q)!=="svelte-19euwd1"&&(Q.textContent=Ie),Ns=n(s),h(q.$$.fragment,s),Hs=n(s),S=m(s,"P",{"data-svelte-h":!0}),j(S)!=="svelte-q8usl3"&&(S.innerHTML=Re),Bs=n(s),h(L.$$.fragment,s),Es=n(s),P=m(s,"P",{"data-svelte-h":!0}),j(P)!=="svelte-2twqg0"&&(P.textContent=Xe),zs=n(s),h(D.$$.fragment,s),As=n(s),K=m(s,"P",{"data-svelte-h":!0}),j(K)!=="svelte-tx7o5u"&&(K.innerHTML=Ge),Qs=n(s),h(O.$$.fragment,s),qs=n(s),ss=m(s,"P",{"data-svelte-h":!0}),j(ss)!=="svelte-18u35un"&&(ss.textContent=Ve),Ss=n(s),h(es.$$.fragment,s),Ls=n(s),ts=m(s,"P",{"data-svelte-h":!0}),j(ts)!=="svelte-bf7elb"&&(ts.textContent=Ye),Ps=n(s),as=m(s,"UL",{"data-svelte-h":!0}),j(as)!=="svelte-10l8u4b"&&(as.innerHTML=Fe),Ds=n(s),ls=m(s,"P",{"data-svelte-h":!0}),j(ls)!=="svelte-c16zyh"&&(ls.textContent=Ne),Ks=n(s),h(ns.$$.fragment,s),Os=n(s),ps=m(s,"P",{"data-svelte-h":!0}),j(ps)!=="svelte-1e9n4a3"&&(ps.textContent=He),se=n(s),h(is.$$.fragment,s),ee=n(s),h(rs.$$.fragment,s),te=n(s),os=m(s,"P",{"data-svelte-h":!0}),j(os)!=="svelte-f9h4ad"&&(os.textContent=Be),ae=n(s),h(cs.$$.fragment,s),le=n(s),ms=m(s,"P",{"data-svelte-h":!0}),j(ms)!=="svelte-3ohz7q"&&(ms.innerHTML=Ee),ne=n(s),h(us.$$.fragment,s),pe=n(s),hs=m(s,"P",{"data-svelte-h":!0}),j(hs)!=="svelte-8cflje"&&(hs.textContent=ze),ie=n(s),ds=m(s,"OL",{"data-svelte-h":!0}),j(ds)!=="svelte-fvrg6s"&&(ds.innerHTML=Ae),re=n(s),h(fs.$$.fragment,s),oe=n(s),gs=m(s,"P",{"data-svelte-h":!0}),j(gs)!=="svelte-cbz02z"&&(gs.innerHTML=Qe),ce=n(s),h(ys.$$.fragment,s),me=n(s),h(Ms.$$.fragment,s),ue=n(s),bs=m(s,"P",{"data-svelte-h":!0}),j(bs)!=="svelte-j1ipe9"&&(bs.innerHTML=qe),he=n(s),h(js.$$.fragment,s),de=n(s),$s=m(s,"P",{"data-svelte-h":!0}),j($s)!=="svelte-14irt3v"&&($s.innerHTML=Se),fe=n(s),h(ws.$$.fragment,s),ge=n(s),Js=m(s,"P",{"data-svelte-h":!0}),j(Js)!=="svelte-183aynn"&&(Js.innerHTML=Le),ye=n(s),h(Ts.$$.fragment,s),Me=n(s),h(Y.$$.fragment,s),be=n(s),h(F.$$.fragment,s),je=n(s),h(_s.$$.fragment,s),$e=n(s),xs=m(s,"P",{"data-svelte-h":!0}),j(xs)!=="svelte-633ppb"&&(xs.textContent=Pe),we=n(s),vs=m(s,"P",{"data-svelte-h":!0}),j(vs)!=="svelte-1j24vrm"&&(vs.textContent=De),Je=n(s),h(Us.$$.fragment,s),Te=n(s),ks=m(s,"P",{"data-svelte-h":!0}),j(ks)!=="svelte-okhx35"&&(ks.innerHTML=Ke),_e=n(s),h(Ws.$$.fragment,s),xe=n(s),Zs=m(s,"P",{"data-svelte-h":!0}),j(Zs)!=="svelte-1njl8vm"&&(Zs.innerHTML=Oe),ve=n(s),h(N.$$.fragment,s),Ue=n(s),Rs=m(s,"P",{}),lt(Rs).forEach(t),this.h()},h(){nt(p,"name","hf:doc:metadata"),nt(p,"content",xt)},m(s,e){ht(document.head,p),a(s,b,e),a(s,i,e),a(s,M,e),d($,s,e),a(s,v,e),d(Z,s,e),a(s,k,e),d(U,s,e),a(s,C,e),a(s,J,e),a(s,I,e),a(s,T,e),a(s,o,e),a(s,x,e),a(s,G,e),d(R,s,e),a(s,r,e),a(s,w,e),a(s,Xs,e),d(B,s,e),a(s,Gs,e),a(s,E,e),a(s,Vs,e),d(z,s,e),a(s,Ys,e),d(A,s,e),a(s,Fs,e),a(s,Q,e),a(s,Ns,e),d(q,s,e),a(s,Hs,e),a(s,S,e),a(s,Bs,e),d(L,s,e),a(s,Es,e),a(s,P,e),a(s,zs,e),d(D,s,e),a(s,As,e),a(s,K,e),a(s,Qs,e),d(O,s,e),a(s,qs,e),a(s,ss,e),a(s,Ss,e),d(es,s,e),a(s,Ls,e),a(s,ts,e),a(s,Ps,e),a(s,as,e),a(s,Ds,e),a(s,ls,e),a(s,Ks,e),d(ns,s,e),a(s,Os,e),a(s,ps,e),a(s,se,e),d(is,s,e),a(s,ee,e),d(rs,s,e),a(s,te,e),a(s,os,e),a(s,ae,e),d(cs,s,e),a(s,le,e),a(s,ms,e),a(s,ne,e),d(us,s,e),a(s,pe,e),a(s,hs,e),a(s,ie,e),a(s,ds,e),a(s,re,e),d(fs,s,e),a(s,oe,e),a(s,gs,e),a(s,ce,e),d(ys,s,e),a(s,me,e),d(Ms,s,e),a(s,ue,e),a(s,bs,e),a(s,he,e),d(js,s,e),a(s,de,e),a(s,$s,e),a(s,fe,e),d(ws,s,e),a(s,ge,e),a(s,Js,e),a(s,ye,e),d(Ts,s,e),a(s,Me,e),d(Y,s,e),a(s,be,e),d(F,s,e),a(s,je,e),d(_s,s,e),a(s,$e,e),a(s,xs,e),a(s,we,e),a(s,vs,e),a(s,Je,e),d(Us,s,e),a(s,Te,e),a(s,ks,e),a(s,_e,e),d(Ws,s,e),a(s,xe,e),a(s,Zs,e),a(s,ve,e),d(N,s,e),a(s,Ue,e),a(s,Rs,e),ke=!0},p(s,[e]){const st={};e&2&&(st.$$scope={dirty:e,ctx:s}),R.$set(st);const et={};e&2&&(et.$$scope={dirty:e,ctx:s}),Y.$set(et);const tt={};e&2&&(tt.$$scope={dirty:e,ctx:s}),F.$set(tt);const at={};e&2&&(at.$$scope={dirty:e,ctx:s}),N.$set(at)},i(s){ke||(f($.$$.fragment,s),f(Z.$$.fragment,s),f(U.$$.fragment,s),f(R.$$.fragment,s),f(B.$$.fragment,s),f(z.$$.fragment,s),f(A.$$.fragment,s),f(q.$$.fragment,s),f(L.$$.fragment,s),f(D.$$.fragment,s),f(O.$$.fragment,s),f(es.$$.fragment,s),f(ns.$$.fragment,s),f(is.$$.fragment,s),f(rs.$$.fragment,s),f(cs.$$.fragment,s),f(us.$$.fragment,s),f(fs.$$.fragment,s),f(ys.$$.fragment,s),f(Ms.$$.fragment,s),f(js.$$.fragment,s),f(ws.$$.fragment,s),f(Ts.$$.fragment,s),f(Y.$$.fragment,s),f(F.$$.fragment,s),f(_s.$$.fragment,s),f(Us.$$.fragment,s),f(Ws.$$.fragment,s),f(N.$$.fragment,s),ke=!0)},o(s){g($.$$.fragment,s),g(Z.$$.fragment,s),g(U.$$.fragment,s),g(R.$$.fragment,s),g(B.$$.fragment,s),g(z.$$.fragment,s),g(A.$$.fragment,s),g(q.$$.fragment,s),g(L.$$.fragment,s),g(D.$$.fragment,s),g(O.$$.fragment,s),g(es.$$.fragment,s),g(ns.$$.fragment,s),g(is.$$.fragment,s),g(rs.$$.fragment,s),g(cs.$$.fragment,s),g(us.$$.fragment,s),g(fs.$$.fragment,s),g(ys.$$.fragment,s),g(Ms.$$.fragment,s),g(js.$$.fragment,s),g(ws.$$.fragment,s),g(Ts.$$.fragment,s),g(Y.$$.fragment,s),g(F.$$.fragment,s),g(_s.$$.fragment,s),g(Us.$$.fragment,s),g(Ws.$$.fragment,s),g(N.$$.fragment,s),ke=!1},d(s){s&&(t(b),t(i),t(M),t(v),t(k),t(C),t(J),t(I),t(T),t(o),t(x),t(G),t(r),t(w),t(Xs),t(Gs),t(E),t(Vs),t(Ys),t(Fs),t(Q),t(Ns),t(Hs),t(S),t(Bs),t(Es),t(P),t(zs),t(As),t(K),t(Qs),t(qs),t(ss),t(Ss),t(Ls),t(ts),t(Ps),t(as),t(Ds),t(ls),t(Ks),t(Os),t(ps),t(se),t(ee),t(te),t(os),t(ae),t(le),t(ms),t(ne),t(pe),t(hs),t(ie),t(ds),t(re),t(oe),t(gs),t(ce),t(me),t(ue),t(bs),t(he),t(de),t($s),t(fe),t(ge),t(Js),t(ye),t(Me),t(be),t(je),t($e),t(xs),t(we),t(vs),t(Je),t(Te),t(ks),t(_e),t(xe),t(Zs),t(ve),t(Ue),t(Rs)),t(p),y($,s),y(Z,s),y(U,s),y(R,s),y(B,s),y(z,s),y(A,s),y(q,s),y(L,s),y(D,s),y(O,s),y(es,s),y(ns,s),y(is,s),y(rs,s),y(cs,s),y(us,s),y(fs,s),y(ys,s),y(Ms,s),y(js,s),y(ws,s),y(Ts,s),y(Y,s),y(F,s),y(_s,s),y(Us,s),y(Ws,s),y(N,s)}}}const xt='{"title":"Audio classification","local":"audio-classification","sections":[{"title":"Load MInDS-14 dataset","local":"load-minds-14-dataset","sections":[],"depth":2},{"title":"Preprocess","local":"preprocess","sections":[],"depth":2},{"title":"Evaluate","local":"evaluate","sections":[],"depth":2},{"title":"Train","local":"train","sections":[],"depth":2},{"title":"Inference","local":"inference","sections":[],"depth":2}],"depth":1}';function vt(W){return ot(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Gt extends ct{constructor(p){super(),mt(this,p,vt,_t,rt,{})}}export{Gt as component};
