import{s as na,o as ia,n as ms}from"../chunks/scheduler.9bc65507.js";import{S as pa,i as ra,g as p,s as l,u,A as oa,h as r,f as e,c as n,j as W,v as d,y as h,k as $,o as v,a,w as f,d as g,t as y,x as b,m as ca,n as ma}from"../chunks/index.78c82d43.js";import{T as ys}from"../chunks/Tip.87d55b76.js";import{Y as ha}from"../chunks/Youtube.b19762b6.js";import{I as ee}from"../chunks/IconCopyLink.bedaa44d.js";import{C as T}from"../chunks/CodeBlock.73e038be.js";import{D as ua}from"../chunks/DocNotebookDropdown.31840a23.js";import{F as aa,M as la}from"../chunks/Markdown.1b9b4e1c.js";function da(X){let i,j,o='<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-conformer">Wav2Vec2-Conformer</a>, <a href="../model_doc/wavlm">WavLM</a>, <a href="../model_doc/whisper">Whisper</a>';return{c(){i=ca(`The task illustrated in this tutorial is supported by the following model architectures:

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

`),j=r(M,"P",{"data-svelte-h":!0}),h(j)!=="svelte-1x7pfyj"&&(j.innerHTML=o)},m(M,w){a(M,i,w),a(M,j,w)},p:ms,d(M){M&&(e(i),e(j))}}}function fa(X){let i,j='If you aren’t familiar with finetuning a model with the <a href="/docs/transformers/v4.34.0/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(){i=p("p"),i.innerHTML=j},l(o){i=r(o,"P",{"data-svelte-h":!0}),h(i)!=="svelte-1ufp0ay"&&(i.innerHTML=j)},m(o,M){a(o,i,M)},p:ms,d(o){o&&e(i)}}}function ga(X){let i,j,o,M='You’re ready to start training your model now! Load Wav2Vec2 with <a href="/docs/transformers/v4.34.0/en/model_doc/auto#transformers.AutoModelForAudioClassification">AutoModelForAudioClassification</a> along with the number of expected labels, and the label mappings:',w,J,V,k,G="At this point, only three steps remain:",R,Z,E='<li>Define your training hyperparameters in <a href="/docs/transformers/v4.34.0/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/v4.34.0/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/v4.34.0/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/v4.34.0/en/main_classes/trainer#transformers.Trainer.train">train()</a> to finetune your model.</li>',C,U,I,m,x='Once training is completed, share your model to the Hub with the <a href="/docs/transformers/v4.34.0/en/main_classes/trainer#transformers.Trainer.push_to_hub">push_to_hub()</a> method so everyone can use your model:',st,N,Y;return i=new ys({props:{$$slots:{default:[fa]},$$scope:{ctx:X}}}),J=new T({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}}),U=new T({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}}),N=new T({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()',wrap:!1}}),{c(){u(i.$$.fragment),j=l(),o=p("p"),o.innerHTML=M,w=l(),u(J.$$.fragment),V=l(),k=p("p"),k.textContent=G,R=l(),Z=p("ol"),Z.innerHTML=E,C=l(),u(U.$$.fragment),I=l(),m=p("p"),m.innerHTML=x,st=l(),u(N.$$.fragment)},l(c){d(i.$$.fragment,c),j=n(c),o=r(c,"P",{"data-svelte-h":!0}),h(o)!=="svelte-tfi5jw"&&(o.innerHTML=M),w=n(c),d(J.$$.fragment,c),V=n(c),k=r(c,"P",{"data-svelte-h":!0}),h(k)!=="svelte-l42k0i"&&(k.textContent=G),R=n(c),Z=r(c,"OL",{"data-svelte-h":!0}),h(Z)!=="svelte-777kp9"&&(Z.innerHTML=E),C=n(c),d(U.$$.fragment,c),I=n(c),m=r(c,"P",{"data-svelte-h":!0}),h(m)!=="svelte-cv8z08"&&(m.innerHTML=x),st=n(c),d(N.$$.fragment,c)},m(c,_){f(i,c,_),a(c,j,_),a(c,o,_),a(c,w,_),f(J,c,_),a(c,V,_),a(c,k,_),a(c,R,_),a(c,Z,_),a(c,C,_),f(U,c,_),a(c,I,_),a(c,m,_),a(c,st,_),f(N,c,_),Y=!0},p(c,_){const F={};_&2&&(F.$$scope={dirty:_,ctx:c}),i.$set(F)},i(c){Y||(g(i.$$.fragment,c),g(J.$$.fragment,c),g(U.$$.fragment,c),g(N.$$.fragment,c),Y=!0)},o(c){y(i.$$.fragment,c),y(J.$$.fragment,c),y(U.$$.fragment,c),y(N.$$.fragment,c),Y=!1},d(c){c&&(e(j),e(o),e(w),e(V),e(k),e(R),e(Z),e(C),e(I),e(m),e(st)),b(i,c),b(J,c),b(U,c),b(N,c)}}}function ya(X){let i,j;return i=new la({props:{$$slots:{default:[ga]},$$scope:{ctx:X}}}),{c(){u(i.$$.fragment)},l(o){d(i.$$.fragment,o)},m(o,M){f(i,o,M),j=!0},p(o,M){const w={};M&2&&(w.$$scope={dirty:M,ctx:o}),i.$set(w)},i(o){j||(g(i.$$.fragment,o),j=!0)},o(o){y(i.$$.fragment,o),j=!1},d(o){b(i,o)}}}function ba(X){let i,j='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(){i=p("p"),i.innerHTML=j},l(o){i=r(o,"P",{"data-svelte-h":!0}),h(i)!=="svelte-1zzytb"&&(i.innerHTML=j)},m(o,M){a(o,i,M)},p:ms,d(o){o&&e(i)}}}function Ma(X){let i,j="Load a feature extractor to preprocess the audio file and return the <code>input</code> as PyTorch tensors:",o,M,w,J,V="Pass your inputs to the model and return the logits:",k,G,R,Z,E="Get the class with the highest probability, and use the model’s <code>id2label</code> mapping to convert it to a label:",C,U,I;return M=new T({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}}),G=new T({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}}),U=new T({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(){i=p("p"),i.innerHTML=j,o=l(),u(M.$$.fragment),w=l(),J=p("p"),J.textContent=V,k=l(),u(G.$$.fragment),R=l(),Z=p("p"),Z.innerHTML=E,C=l(),u(U.$$.fragment)},l(m){i=r(m,"P",{"data-svelte-h":!0}),h(i)!=="svelte-eon9oh"&&(i.innerHTML=j),o=n(m),d(M.$$.fragment,m),w=n(m),J=r(m,"P",{"data-svelte-h":!0}),h(J)!=="svelte-1at92g"&&(J.textContent=V),k=n(m),d(G.$$.fragment,m),R=n(m),Z=r(m,"P",{"data-svelte-h":!0}),h(Z)!=="svelte-1w2ymk2"&&(Z.innerHTML=E),C=n(m),d(U.$$.fragment,m)},m(m,x){a(m,i,x),a(m,o,x),f(M,m,x),a(m,w,x),a(m,J,x),a(m,k,x),f(G,m,x),a(m,R,x),a(m,Z,x),a(m,C,x),f(U,m,x),I=!0},p:ms,i(m){I||(g(M.$$.fragment,m),g(G.$$.fragment,m),g(U.$$.fragment,m),I=!0)},o(m){y(M.$$.fragment,m),y(G.$$.fragment,m),y(U.$$.fragment,m),I=!1},d(m){m&&(e(i),e(o),e(w),e(J),e(k),e(R),e(Z),e(C)),b(M,m),b(G,m),b(U,m)}}}function ja(X){let i,j;return i=new la({props:{$$slots:{default:[Ma]},$$scope:{ctx:X}}}),{c(){u(i.$$.fragment)},l(o){d(i.$$.fragment,o)},m(o,M){f(i,o,M),j=!0},p(o,M){const w={};M&2&&(w.$$scope={dirty:M,ctx:o}),i.$set(w)},i(o){j||(g(i.$$.fragment,o),j=!0)},o(o){y(i.$$.fragment,o),j=!1},d(o){b(i,o)}}}function wa(X){let i,j,o,M,w,J,V,k,G,R,Z="Audio classification",E,C,U,I,m,x,st="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.",N,Y,c="This guide will show you how to:",_,F,bs='<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>',ce,q,me,at,Ms="Before you begin, make sure you have all the necessary libraries installed:",he,lt,ue,nt,js="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:",de,it,fe,H,S,se,pt,hs,Lt,ws="Load MInDS-14 dataset",ge,rt,$s="Start by loading the MInDS-14 dataset from the 🤗 Datasets library:",ye,ot,be,ct,vs='Split the dataset’s <code>train</code> split into a smaller train and test set with the <a href="https://huggingface.co/docs/datasets/v2.14.5/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.',Me,mt,je,ht,Js="Then take a look at the dataset:",we,ut,$e,dt,_s='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/v2.14.5/en/package_reference/main_classes#datasets.Dataset.remove_columns" rel="nofollow">remove_columns</a> method:',ve,ft,Je,gt,Ts="Take a look at an example now:",_e,yt,Te,bt,xs="There are two fields:",xe,Mt,ks="<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>",ke,jt,Us="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:",Ue,wt,We,$t,Ws="Now you can convert the label id to a label name:",Ze,vt,Ce,B,P,ae,Jt,us,Dt,Zs="Preprocess",Ie,_t,Cs="The next step is to load a Wav2Vec2 feature extractor to process the audio signal:",Xe,Tt,Re,xt,Is='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:',Ge,kt,Ve,Ut,Xs="Now create a preprocessing function that:",Ne,Wt,Rs='<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>',Ye,Zt,Ee,Ct,Gs='To apply the preprocessing function over the entire dataset, use 🤗 Datasets <a href="https://huggingface.co/docs/datasets/v2.14.5/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:',Fe,It,He,A,L,le,Xt,ds,Kt,Vs="Evaluate",Be,Rt,Ns='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):',Ae,Gt,ze,Vt,Ys='Then create a function that passes your predictions and labels to <a href="https://huggingface.co/docs/evaluate/v0.4.0/en/package_reference/main_classes#evaluate.EvaluationModule.compute" rel="nofollow">compute</a> to calculate the accuracy:',Qe,Nt,qe,Yt,Es="Your <code>compute_metrics</code> function is ready to go now, and you’ll return to it when you setup your training.",Se,z,D,ne,Et,fs,Ot,Fs="Train",Pe,K,Le,O,De,Q,tt,ie,Ft,gs,te,Hs="Inference",Ke,Ht,Bs="Great, now that you’ve finetuned a model, you can use it for inference!",Oe,Bt,As="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!",ts,At,es,zt,zs='The simplest way to try out your finetuned model for inference is to use it in a <a href="/docs/transformers/v4.34.0/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:',ss,Qt,as,qt,Qs="You can also manually replicate the results of the <code>pipeline</code> if you’d like:",ls,et,ns,pe,is;return k=new ee({}),C=new ua({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"}]}}),I=new ha({props:{id:"KWwzcmG98Ds"}}),q=new ys({props:{$$slots:{default:[da]},$$scope:{ctx:X}}}),lt=new T({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate",wrap:!1}}),it=new T({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}}),pt=new ee({}),ot=new T({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}}),mt=new T({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}}),ut=new T({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}}),ft=new T({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}}),yt=new T({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}}),wt=new T({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}}),vt=new T({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}}),Jt=new ee({}),Tt=new T({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}}),kt=new T({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}}),Zt=new T({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}}),It=new T({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}}),Xt=new ee({}),Gt=new T({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}}),Nt=new T({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}}),Et=new ee({}),K=new aa({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[ya]},$$scope:{ctx:X}}}),O=new ys({props:{$$slots:{default:[ba]},$$scope:{ctx:X}}}),Ft=new ee({}),At=new T({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}}),Qt=new T({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}}),et=new aa({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[ja]},$$scope:{ctx:X}}}),{c(){i=p("meta"),j=l(),o=p("p"),M=l(),w=p("h1"),J=p("a"),V=p("span"),u(k.$$.fragment),G=l(),R=p("span"),R.textContent=Z,E=l(),u(C.$$.fragment),U=l(),u(I.$$.fragment),m=l(),x=p("p"),x.textContent=st,N=l(),Y=p("p"),Y.textContent=c,_=l(),F=p("ol"),F.innerHTML=bs,ce=l(),u(q.$$.fragment),me=l(),at=p("p"),at.textContent=Ms,he=l(),u(lt.$$.fragment),ue=l(),nt=p("p"),nt.textContent=js,de=l(),u(it.$$.fragment),fe=l(),H=p("h2"),S=p("a"),se=p("span"),u(pt.$$.fragment),hs=l(),Lt=p("span"),Lt.textContent=ws,ge=l(),rt=p("p"),rt.textContent=$s,ye=l(),u(ot.$$.fragment),be=l(),ct=p("p"),ct.innerHTML=vs,Me=l(),u(mt.$$.fragment),je=l(),ht=p("p"),ht.textContent=Js,we=l(),u(ut.$$.fragment),$e=l(),dt=p("p"),dt.innerHTML=_s,ve=l(),u(ft.$$.fragment),Je=l(),gt=p("p"),gt.textContent=Ts,_e=l(),u(yt.$$.fragment),Te=l(),bt=p("p"),bt.textContent=xs,xe=l(),Mt=p("ul"),Mt.innerHTML=ks,ke=l(),jt=p("p"),jt.textContent=Us,Ue=l(),u(wt.$$.fragment),We=l(),$t=p("p"),$t.textContent=Ws,Ze=l(),u(vt.$$.fragment),Ce=l(),B=p("h2"),P=p("a"),ae=p("span"),u(Jt.$$.fragment),us=l(),Dt=p("span"),Dt.textContent=Zs,Ie=l(),_t=p("p"),_t.textContent=Cs,Xe=l(),u(Tt.$$.fragment),Re=l(),xt=p("p"),xt.innerHTML=Is,Ge=l(),u(kt.$$.fragment),Ve=l(),Ut=p("p"),Ut.textContent=Xs,Ne=l(),Wt=p("ol"),Wt.innerHTML=Rs,Ye=l(),u(Zt.$$.fragment),Ee=l(),Ct=p("p"),Ct.innerHTML=Gs,Fe=l(),u(It.$$.fragment),He=l(),A=p("h2"),L=p("a"),le=p("span"),u(Xt.$$.fragment),ds=l(),Kt=p("span"),Kt.textContent=Vs,Be=l(),Rt=p("p"),Rt.innerHTML=Ns,Ae=l(),u(Gt.$$.fragment),ze=l(),Vt=p("p"),Vt.innerHTML=Ys,Qe=l(),u(Nt.$$.fragment),qe=l(),Yt=p("p"),Yt.innerHTML=Es,Se=l(),z=p("h2"),D=p("a"),ne=p("span"),u(Et.$$.fragment),fs=l(),Ot=p("span"),Ot.textContent=Fs,Pe=l(),u(K.$$.fragment),Le=l(),u(O.$$.fragment),De=l(),Q=p("h2"),tt=p("a"),ie=p("span"),u(Ft.$$.fragment),gs=l(),te=p("span"),te.textContent=Hs,Ke=l(),Ht=p("p"),Ht.textContent=Bs,Oe=l(),Bt=p("p"),Bt.textContent=As,ts=l(),u(At.$$.fragment),es=l(),zt=p("p"),zt.innerHTML=zs,ss=l(),u(Qt.$$.fragment),as=l(),qt=p("p"),qt.innerHTML=Qs,ls=l(),u(et.$$.fragment),ns=l(),pe=p("p"),this.h()},l(t){const s=oa("svelte-1phssyn",document.head);i=r(s,"META",{name:!0,content:!0}),s.forEach(e),j=n(t),o=r(t,"P",{}),W(o).forEach(e),M=n(t),w=r(t,"H1",{class:!0});var St=W(w);J=r(St,"A",{id:!0,class:!0,href:!0});var re=W(J);V=r(re,"SPAN",{});var oe=W(V);d(k.$$.fragment,oe),oe.forEach(e),re.forEach(e),G=n(St),R=r(St,"SPAN",{"data-svelte-h":!0}),h(R)!=="svelte-v57evn"&&(R.textContent=Z),St.forEach(e),E=n(t),d(C.$$.fragment,t),U=n(t),d(I.$$.fragment,t),m=n(t),x=r(t,"P",{"data-svelte-h":!0}),h(x)!=="svelte-n3q9of"&&(x.textContent=st),N=n(t),Y=r(t,"P",{"data-svelte-h":!0}),h(Y)!=="svelte-1aff4p7"&&(Y.textContent=c),_=n(t),F=r(t,"OL",{"data-svelte-h":!0}),h(F)!=="svelte-3izmna"&&(F.innerHTML=bs),ce=n(t),d(q.$$.fragment,t),me=n(t),at=r(t,"P",{"data-svelte-h":!0}),h(at)!=="svelte-1c9nexd"&&(at.textContent=Ms),he=n(t),d(lt.$$.fragment,t),ue=n(t),nt=r(t,"P",{"data-svelte-h":!0}),h(nt)!=="svelte-k76o1m"&&(nt.textContent=js),de=n(t),d(it.$$.fragment,t),fe=n(t),H=r(t,"H2",{class:!0});var Pt=W(H);S=r(Pt,"A",{id:!0,class:!0,href:!0});var qs=W(S);se=r(qs,"SPAN",{});var Ss=W(se);d(pt.$$.fragment,Ss),Ss.forEach(e),qs.forEach(e),hs=n(Pt),Lt=r(Pt,"SPAN",{"data-svelte-h":!0}),h(Lt)!=="svelte-sjpygq"&&(Lt.textContent=ws),Pt.forEach(e),ge=n(t),rt=r(t,"P",{"data-svelte-h":!0}),h(rt)!=="svelte-19euwd1"&&(rt.textContent=$s),ye=n(t),d(ot.$$.fragment,t),be=n(t),ct=r(t,"P",{"data-svelte-h":!0}),h(ct)!=="svelte-13sluwq"&&(ct.innerHTML=vs),Me=n(t),d(mt.$$.fragment,t),je=n(t),ht=r(t,"P",{"data-svelte-h":!0}),h(ht)!=="svelte-2twqg0"&&(ht.textContent=Js),we=n(t),d(ut.$$.fragment,t),$e=n(t),dt=r(t,"P",{"data-svelte-h":!0}),h(dt)!=="svelte-okbh69"&&(dt.innerHTML=_s),ve=n(t),d(ft.$$.fragment,t),Je=n(t),gt=r(t,"P",{"data-svelte-h":!0}),h(gt)!=="svelte-18u35un"&&(gt.textContent=Ts),_e=n(t),d(yt.$$.fragment,t),Te=n(t),bt=r(t,"P",{"data-svelte-h":!0}),h(bt)!=="svelte-bf7elb"&&(bt.textContent=xs),xe=n(t),Mt=r(t,"UL",{"data-svelte-h":!0}),h(Mt)!=="svelte-10l8u4b"&&(Mt.innerHTML=ks),ke=n(t),jt=r(t,"P",{"data-svelte-h":!0}),h(jt)!=="svelte-c16zyh"&&(jt.textContent=Us),Ue=n(t),d(wt.$$.fragment,t),We=n(t),$t=r(t,"P",{"data-svelte-h":!0}),h($t)!=="svelte-1e9n4a3"&&($t.textContent=Ws),Ze=n(t),d(vt.$$.fragment,t),Ce=n(t),B=r(t,"H2",{class:!0});var ps=W(B);P=r(ps,"A",{id:!0,class:!0,href:!0});var Ps=W(P);ae=r(Ps,"SPAN",{});var Ls=W(ae);d(Jt.$$.fragment,Ls),Ls.forEach(e),Ps.forEach(e),us=n(ps),Dt=r(ps,"SPAN",{"data-svelte-h":!0}),h(Dt)!=="svelte-1cg9qj"&&(Dt.textContent=Zs),ps.forEach(e),Ie=n(t),_t=r(t,"P",{"data-svelte-h":!0}),h(_t)!=="svelte-f9h4ad"&&(_t.textContent=Cs),Xe=n(t),d(Tt.$$.fragment,t),Re=n(t),xt=r(t,"P",{"data-svelte-h":!0}),h(xt)!=="svelte-3ohz7q"&&(xt.innerHTML=Is),Ge=n(t),d(kt.$$.fragment,t),Ve=n(t),Ut=r(t,"P",{"data-svelte-h":!0}),h(Ut)!=="svelte-8cflje"&&(Ut.textContent=Xs),Ne=n(t),Wt=r(t,"OL",{"data-svelte-h":!0}),h(Wt)!=="svelte-fvrg6s"&&(Wt.innerHTML=Rs),Ye=n(t),d(Zt.$$.fragment,t),Ee=n(t),Ct=r(t,"P",{"data-svelte-h":!0}),h(Ct)!=="svelte-rgqbok"&&(Ct.innerHTML=Gs),Fe=n(t),d(It.$$.fragment,t),He=n(t),A=r(t,"H2",{class:!0});var rs=W(A);L=r(rs,"A",{id:!0,class:!0,href:!0});var Ds=W(L);le=r(Ds,"SPAN",{});var Ks=W(le);d(Xt.$$.fragment,Ks),Ks.forEach(e),Ds.forEach(e),ds=n(rs),Kt=r(rs,"SPAN",{"data-svelte-h":!0}),h(Kt)!=="svelte-sh8s6s"&&(Kt.textContent=Vs),rs.forEach(e),Be=n(t),Rt=r(t,"P",{"data-svelte-h":!0}),h(Rt)!=="svelte-j1ipe9"&&(Rt.innerHTML=Ns),Ae=n(t),d(Gt.$$.fragment,t),ze=n(t),Vt=r(t,"P",{"data-svelte-h":!0}),h(Vt)!=="svelte-14oy2j6"&&(Vt.innerHTML=Ys),Qe=n(t),d(Nt.$$.fragment,t),qe=n(t),Yt=r(t,"P",{"data-svelte-h":!0}),h(Yt)!=="svelte-183aynn"&&(Yt.innerHTML=Es),Se=n(t),z=r(t,"H2",{class:!0});var os=W(z);D=r(os,"A",{id:!0,class:!0,href:!0});var Os=W(D);ne=r(Os,"SPAN",{});var ta=W(ne);d(Et.$$.fragment,ta),ta.forEach(e),Os.forEach(e),fs=n(os),Ot=r(os,"SPAN",{"data-svelte-h":!0}),h(Ot)!=="svelte-5arm0l"&&(Ot.textContent=Fs),os.forEach(e),Pe=n(t),d(K.$$.fragment,t),Le=n(t),d(O.$$.fragment,t),De=n(t),Q=r(t,"H2",{class:!0});var cs=W(Q);tt=r(cs,"A",{id:!0,class:!0,href:!0});var ea=W(tt);ie=r(ea,"SPAN",{});var sa=W(ie);d(Ft.$$.fragment,sa),sa.forEach(e),ea.forEach(e),gs=n(cs),te=r(cs,"SPAN",{"data-svelte-h":!0}),h(te)!=="svelte-199uz7g"&&(te.textContent=Hs),cs.forEach(e),Ke=n(t),Ht=r(t,"P",{"data-svelte-h":!0}),h(Ht)!=="svelte-633ppb"&&(Ht.textContent=Bs),Oe=n(t),Bt=r(t,"P",{"data-svelte-h":!0}),h(Bt)!=="svelte-1j24vrm"&&(Bt.textContent=As),ts=n(t),d(At.$$.fragment,t),es=n(t),zt=r(t,"P",{"data-svelte-h":!0}),h(zt)!=="svelte-hcbdil"&&(zt.innerHTML=zs),ss=n(t),d(Qt.$$.fragment,t),as=n(t),qt=r(t,"P",{"data-svelte-h":!0}),h(qt)!=="svelte-1njl8vm"&&(qt.innerHTML=Qs),ls=n(t),d(et.$$.fragment,t),ns=n(t),pe=r(t,"P",{}),W(pe).forEach(e),this.h()},h(){$(i,"name","hf:doc:metadata"),$(i,"content",JSON.stringify($a)),$(J,"id","audio-classification"),$(J,"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"),$(J,"href","#audio-classification"),$(w,"class","relative group"),$(S,"id","load-minds14-dataset"),$(S,"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"),$(S,"href","#load-minds14-dataset"),$(H,"class","relative group"),$(P,"id","preprocess"),$(P,"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"),$(P,"href","#preprocess"),$(B,"class","relative group"),$(L,"id","evaluate"),$(L,"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"),$(L,"href","#evaluate"),$(A,"class","relative group"),$(D,"id","train"),$(D,"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"),$(D,"href","#train"),$(z,"class","relative group"),$(tt,"id","inference"),$(tt,"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"),$(tt,"href","#inference"),$(Q,"class","relative group")},m(t,s){v(document.head,i),a(t,j,s),a(t,o,s),a(t,M,s),a(t,w,s),v(w,J),v(J,V),f(k,V,null),v(w,G),v(w,R),a(t,E,s),f(C,t,s),a(t,U,s),f(I,t,s),a(t,m,s),a(t,x,s),a(t,N,s),a(t,Y,s),a(t,_,s),a(t,F,s),a(t,ce,s),f(q,t,s),a(t,me,s),a(t,at,s),a(t,he,s),f(lt,t,s),a(t,ue,s),a(t,nt,s),a(t,de,s),f(it,t,s),a(t,fe,s),a(t,H,s),v(H,S),v(S,se),f(pt,se,null),v(H,hs),v(H,Lt),a(t,ge,s),a(t,rt,s),a(t,ye,s),f(ot,t,s),a(t,be,s),a(t,ct,s),a(t,Me,s),f(mt,t,s),a(t,je,s),a(t,ht,s),a(t,we,s),f(ut,t,s),a(t,$e,s),a(t,dt,s),a(t,ve,s),f(ft,t,s),a(t,Je,s),a(t,gt,s),a(t,_e,s),f(yt,t,s),a(t,Te,s),a(t,bt,s),a(t,xe,s),a(t,Mt,s),a(t,ke,s),a(t,jt,s),a(t,Ue,s),f(wt,t,s),a(t,We,s),a(t,$t,s),a(t,Ze,s),f(vt,t,s),a(t,Ce,s),a(t,B,s),v(B,P),v(P,ae),f(Jt,ae,null),v(B,us),v(B,Dt),a(t,Ie,s),a(t,_t,s),a(t,Xe,s),f(Tt,t,s),a(t,Re,s),a(t,xt,s),a(t,Ge,s),f(kt,t,s),a(t,Ve,s),a(t,Ut,s),a(t,Ne,s),a(t,Wt,s),a(t,Ye,s),f(Zt,t,s),a(t,Ee,s),a(t,Ct,s),a(t,Fe,s),f(It,t,s),a(t,He,s),a(t,A,s),v(A,L),v(L,le),f(Xt,le,null),v(A,ds),v(A,Kt),a(t,Be,s),a(t,Rt,s),a(t,Ae,s),f(Gt,t,s),a(t,ze,s),a(t,Vt,s),a(t,Qe,s),f(Nt,t,s),a(t,qe,s),a(t,Yt,s),a(t,Se,s),a(t,z,s),v(z,D),v(D,ne),f(Et,ne,null),v(z,fs),v(z,Ot),a(t,Pe,s),f(K,t,s),a(t,Le,s),f(O,t,s),a(t,De,s),a(t,Q,s),v(Q,tt),v(tt,ie),f(Ft,ie,null),v(Q,gs),v(Q,te),a(t,Ke,s),a(t,Ht,s),a(t,Oe,s),a(t,Bt,s),a(t,ts,s),f(At,t,s),a(t,es,s),a(t,zt,s),a(t,ss,s),f(Qt,t,s),a(t,as,s),a(t,qt,s),a(t,ls,s),f(et,t,s),a(t,ns,s),a(t,pe,s),is=!0},p(t,[s]){const St={};s&2&&(St.$$scope={dirty:s,ctx:t}),q.$set(St);const re={};s&2&&(re.$$scope={dirty:s,ctx:t}),K.$set(re);const oe={};s&2&&(oe.$$scope={dirty:s,ctx:t}),O.$set(oe);const Pt={};s&2&&(Pt.$$scope={dirty:s,ctx:t}),et.$set(Pt)},i(t){is||(g(k.$$.fragment,t),g(C.$$.fragment,t),g(I.$$.fragment,t),g(q.$$.fragment,t),g(lt.$$.fragment,t),g(it.$$.fragment,t),g(pt.$$.fragment,t),g(ot.$$.fragment,t),g(mt.$$.fragment,t),g(ut.$$.fragment,t),g(ft.$$.fragment,t),g(yt.$$.fragment,t),g(wt.$$.fragment,t),g(vt.$$.fragment,t),g(Jt.$$.fragment,t),g(Tt.$$.fragment,t),g(kt.$$.fragment,t),g(Zt.$$.fragment,t),g(It.$$.fragment,t),g(Xt.$$.fragment,t),g(Gt.$$.fragment,t),g(Nt.$$.fragment,t),g(Et.$$.fragment,t),g(K.$$.fragment,t),g(O.$$.fragment,t),g(Ft.$$.fragment,t),g(At.$$.fragment,t),g(Qt.$$.fragment,t),g(et.$$.fragment,t),is=!0)},o(t){y(k.$$.fragment,t),y(C.$$.fragment,t),y(I.$$.fragment,t),y(q.$$.fragment,t),y(lt.$$.fragment,t),y(it.$$.fragment,t),y(pt.$$.fragment,t),y(ot.$$.fragment,t),y(mt.$$.fragment,t),y(ut.$$.fragment,t),y(ft.$$.fragment,t),y(yt.$$.fragment,t),y(wt.$$.fragment,t),y(vt.$$.fragment,t),y(Jt.$$.fragment,t),y(Tt.$$.fragment,t),y(kt.$$.fragment,t),y(Zt.$$.fragment,t),y(It.$$.fragment,t),y(Xt.$$.fragment,t),y(Gt.$$.fragment,t),y(Nt.$$.fragment,t),y(Et.$$.fragment,t),y(K.$$.fragment,t),y(O.$$.fragment,t),y(Ft.$$.fragment,t),y(At.$$.fragment,t),y(Qt.$$.fragment,t),y(et.$$.fragment,t),is=!1},d(t){t&&(e(j),e(o),e(M),e(w),e(E),e(U),e(m),e(x),e(N),e(Y),e(_),e(F),e(ce),e(me),e(at),e(he),e(ue),e(nt),e(de),e(fe),e(H),e(ge),e(rt),e(ye),e(be),e(ct),e(Me),e(je),e(ht),e(we),e($e),e(dt),e(ve),e(Je),e(gt),e(_e),e(Te),e(bt),e(xe),e(Mt),e(ke),e(jt),e(Ue),e(We),e($t),e(Ze),e(Ce),e(B),e(Ie),e(_t),e(Xe),e(Re),e(xt),e(Ge),e(Ve),e(Ut),e(Ne),e(Wt),e(Ye),e(Ee),e(Ct),e(Fe),e(He),e(A),e(Be),e(Rt),e(Ae),e(ze),e(Vt),e(Qe),e(qe),e(Yt),e(Se),e(z),e(Pe),e(Le),e(De),e(Q),e(Ke),e(Ht),e(Oe),e(Bt),e(ts),e(es),e(zt),e(ss),e(as),e(qt),e(ls),e(ns),e(pe)),e(i),b(k),b(C,t),b(I,t),b(q,t),b(lt,t),b(it,t),b(pt),b(ot,t),b(mt,t),b(ut,t),b(ft,t),b(yt,t),b(wt,t),b(vt,t),b(Jt),b(Tt,t),b(kt,t),b(Zt,t),b(It,t),b(Xt),b(Gt,t),b(Nt,t),b(Et),b(K,t),b(O,t),b(Ft),b(At,t),b(Qt,t),b(et,t)}}}const $a={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 va(X){return ia(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ca extends pa{constructor(i){super(),ra(this,i,va,wa,na,{})}}export{Ca as component};
