import{s as Es,o as Hs,n as he}from"../chunks/scheduler.889ebb13.js";import{S as Ns,i as Bs,g as h,s as o,u as $,A as Ys,h as d,f as t,c as i,j as N,v as y,y as w,k as V,o as I,a,w as b,d as M,t as g,x as j,m as Vs,n as Is}from"../chunks/index.8980e686.js";import{T as bt}from"../chunks/Tip.7191df11.js";import{Y as zs}from"../chunks/Youtube.532e53e0.js";import{I as nt}from"../chunks/IconCopyLink.357761cd.js";import{C}from"../chunks/CodeBlock.25fc3430.js";import{D as Fs}from"../chunks/DocNotebookDropdown.f8a50280.js";import{F as ps,M as rt}from"../chunks/Markdown.31057263.js";function Qs(v){let s,c,l='<a href="../model_doc/albert">ALBERT</a>, <a href="../model_doc/bart">BART</a>, <a href="../model_doc/bert">BERT</a>, <a href="../model_doc/big_bird">BigBird</a>, <a href="../model_doc/bigbird_pegasus">BigBird-Pegasus</a>, <a href="../model_doc/bloom">BLOOM</a>, <a href="../model_doc/camembert">CamemBERT</a>, <a href="../model_doc/canine">CANINE</a>, <a href="../model_doc/convbert">ConvBERT</a>, <a href="../model_doc/ctrl">CTRL</a>, <a href="../model_doc/data2vec-text">Data2VecText</a>, <a href="../model_doc/deberta">DeBERTa</a>, <a href="../model_doc/deberta-v2">DeBERTa-v2</a>, <a href="../model_doc/distilbert">DistilBERT</a>, <a href="../model_doc/electra">ELECTRA</a>, <a href="../model_doc/ernie">ERNIE</a>, <a href="../model_doc/ernie_m">ErnieM</a>, <a href="../model_doc/esm">ESM</a>, <a href="../model_doc/flaubert">FlauBERT</a>, <a href="../model_doc/fnet">FNet</a>, <a href="../model_doc/funnel">Funnel Transformer</a>, <a href="../model_doc/gpt-sw3">GPT-Sw3</a>, <a href="../model_doc/gpt2">OpenAI GPT-2</a>, <a href="../model_doc/gpt_neo">GPT Neo</a>, <a href="../model_doc/gptj">GPT-J</a>, <a href="../model_doc/ibert">I-BERT</a>, <a href="../model_doc/layoutlm">LayoutLM</a>, <a href="../model_doc/layoutlmv2">LayoutLMv2</a>, <a href="../model_doc/layoutlmv3">LayoutLMv3</a>, <a href="../model_doc/led">LED</a>, <a href="../model_doc/lilt">LiLT</a>, <a href="../model_doc/llama">LLaMA</a>, <a href="../model_doc/longformer">Longformer</a>, <a href="../model_doc/luke">LUKE</a>, <a href="../model_doc/markuplm">MarkupLM</a>, <a href="../model_doc/mbart">mBART</a>, <a href="../model_doc/mega">MEGA</a>, <a href="../model_doc/megatron-bert">Megatron-BERT</a>, <a href="../model_doc/mobilebert">MobileBERT</a>, <a href="../model_doc/mpnet">MPNet</a>, <a href="../model_doc/mvp">MVP</a>, <a href="../model_doc/nezha">Nezha</a>, <a href="../model_doc/nystromformer">Nyströmformer</a>, <a href="../model_doc/openai-gpt">OpenAI GPT</a>, <a href="../model_doc/opt">OPT</a>, <a href="../model_doc/perceiver">Perceiver</a>, <a href="../model_doc/plbart">PLBart</a>, <a href="../model_doc/qdqbert">QDQBert</a>, <a href="../model_doc/reformer">Reformer</a>, <a href="../model_doc/rembert">RemBERT</a>, <a href="../model_doc/roberta">RoBERTa</a>, <a href="../model_doc/roberta-prelayernorm">RoBERTa-PreLayerNorm</a>, <a href="../model_doc/roc_bert">RoCBert</a>, <a href="../model_doc/roformer">RoFormer</a>, <a href="../model_doc/squeezebert">SqueezeBERT</a>, <a href="../model_doc/tapas">TAPAS</a>, <a href="../model_doc/transfo-xl">Transformer-XL</a>, <a href="../model_doc/xlm">XLM</a>, <a href="../model_doc/xlm-roberta">XLM-RoBERTa</a>, <a href="../model_doc/xlm-roberta-xl">XLM-RoBERTa-XL</a>, <a href="../model_doc/xlnet">XLNet</a>, <a href="../model_doc/xmod">X-MOD</a>, <a href="../model_doc/yoso">YOSO</a>';return{c(){s=Vs(`이 튜토리얼에서 설명하는 작업은 다음 모델 아키텍처에 의해 지원됩니다:

`),c=h("p"),c.innerHTML=l},l(m){s=Is(m,`이 튜토리얼에서 설명하는 작업은 다음 모델 아키텍처에 의해 지원됩니다:

`),c=d(m,"P",{"data-svelte-h":!0}),w(c)!=="svelte-ueqi4z"&&(c.innerHTML=l)},m(m,u){a(m,s,u),a(m,c,u)},p:he,d(m){m&&(t(s),t(c))}}}function Ls(v){let s,c;return s=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvcldpdGhQYWRkaW5nJTBBJTBBZGF0YV9jb2xsYXRvciUyMCUzRCUyMERhdGFDb2xsYXRvcldpdGhQYWRkaW5nKHRva2VuaXplciUzRHRva2VuaXplcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorWithPadding

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorWithPadding(tokenizer=tokenizer)`}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p:he,i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function Ss(v){let s,c;return s=new rt({props:{$$slots:{default:[Ls]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p(l,m){const u={};m&2&&(u.$$scope={dirty:m,ctx:l}),s.$set(u)},i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function As(v){let s,c;return s=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMERhdGFDb2xsYXRvcldpdGhQYWRkaW5nJTBBJTBBZGF0YV9jb2xsYXRvciUyMCUzRCUyMERhdGFDb2xsYXRvcldpdGhQYWRkaW5nKHRva2VuaXplciUzRHRva2VuaXplciUyQyUyMHJldHVybl90ZW5zb3JzJTNEJTIydGYlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorWithPadding

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p:he,i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function qs(v){let s,c;return s=new rt({props:{$$slots:{default:[As]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p(l,m){const u={};m&2&&(u.$$scope={dirty:m,ctx:l}),s.$set(u)},i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function Ps(v){let s,c='<code>Trainer</code>를 사용하여 모델을 파인 튜닝하는 방법에 익숙하지 않은 경우, <a href="../training#train-with-pytorch-trainer">여기</a>의 기본 튜토리얼을 확인하세요!';return{c(){s=h("p"),s.innerHTML=c},l(l){s=d(l,"P",{"data-svelte-h":!0}),w(s)!=="svelte-1wclifr"&&(s.innerHTML=c)},m(l,m){a(l,s,m)},p:he,d(l){l&&t(s)}}}function Ds(v){let s,c="<code>Trainer</code>는 <code>tokenizer</code>를 전달하면 기본적으로 동적 매핑을 적용합니다. 이 경우, 명시적으로 데이터 수집기를 지정할 필요가 없습니다.";return{c(){s=h("p"),s.innerHTML=c},l(l){s=d(l,"P",{"data-svelte-h":!0}),w(s)!=="svelte-1wp2ucv"&&(s.innerHTML=c)},m(l,m){a(l,s,m)},p:he,d(l){l&&t(s)}}}function Ks(v){let s,c,l,m="이제 모델을 훈련시킬 준비가 되었습니다! <code>AutoModelForSequenceClassification</code>로 DistilBERT를 가쳐오고 예상되는 레이블 수와 레이블 매핑을 지정하세요:",u,J,E,U,X="이제 세 단계만 거치면 끝입니다:",W,x,Y="<li><code>TrainingArguments</code>에서 하이퍼파라미터를 정의하세요. <code>output_dir</code>는 모델을 저장할 위치를 지정하는 유일한 파라미터입니다. 이 모델을 Hub에 업로드하기 위해 <code>push_to_hub=True</code>를 설정합니다. (모델을 업로드하기 위해 Hugging Face에 로그인해야합니다.) 각 에폭이 끝날 때마다, <code>Trainer</code>는 정확도를 평가하고 훈련 체크포인트를 저장합니다.</li> <li><code>Trainer</code>에 훈련 인수와 모델, 데이터셋, 토크나이저, 데이터 수집기 및 <code>compute_metrics</code> 함수를 전달하세요.</li> <li><code>train()</code>를 호출하여 모델은 파인 튜닝하세요.</li>",Z,k,R,p,_,z,O="훈련이 완료되면, <code>push_to_hub()</code> 메소드를 사용하여 모델을 Hub에 공유할 수 있습니다.",H,K,P;return s=new bt({props:{$$slots:{default:[Ps]},$$scope:{ctx:v}}}),J=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMkMlMjBUcmFpbmluZ0FyZ3VtZW50cyUyQyUyMFRyYWluZXIlMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUwQSUyMCUyMCUyMCUyMCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkJTIyJTJDJTIwbnVtX2xhYmVscyUzRDIlMkMlMjBpZDJsYWJlbCUzRGlkMmxhYmVsJTJDJTIwbGFiZWwyaWQlM0RsYWJlbDJpZCUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, num_labels=<span class="hljs-number">2</span>, id2label=id2label, label2id=label2id
<span class="hljs-meta">... </span>)`}}),k=new C({props:{code:"dHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKCUwQSUyMCUyMCUyMCUyMG91dHB1dF9kaXIlM0QlMjJteV9hd2Vzb21lX21vZGVsJTIyJTJDJTBBJTIwJTIwJTIwJTIwbGVhcm5pbmdfcmF0ZSUzRDJlLTUlMkMlMEElMjAlMjAlMjAlMjBwZXJfZGV2aWNlX3RyYWluX2JhdGNoX3NpemUlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMHBlcl9kZXZpY2VfZXZhbF9iYXRjaF9zaXplJTNEMTYlMkMlMEElMjAlMjAlMjAlMjBudW1fdHJhaW5fZXBvY2hzJTNEMiUyQyUwQSUyMCUyMCUyMCUyMHdlaWdodF9kZWNheSUzRDAuMDElMkMlMEElMjAlMjAlMjAlMjBldmFsdWF0aW9uX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBzYXZlX3N0cmF0ZWd5JTNEJTIyZXBvY2glMjIlMkMlMEElMjAlMjAlMjAlMjBsb2FkX2Jlc3RfbW9kZWxfYXRfZW5kJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMHB1c2hfdG9faHViJTNEVHJ1ZSUyQyUwQSklMEElMEF0cmFpbmVyJTIwJTNEJTIwVHJhaW5lciglMEElMjAlMjAlMjAlMjBtb2RlbCUzRG1vZGVsJTJDJTBBJTIwJTIwJTIwJTIwYXJncyUzRHRyYWluaW5nX2FyZ3MlMkMlMEElMjAlMjAlMjAlMjB0cmFpbl9kYXRhc2V0JTNEdG9rZW5pemVkX2ltZGIlNUIlMjJ0cmFpbiUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMGV2YWxfZGF0YXNldCUzRHRva2VuaXplZF9pbWRiJTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHRva2VuaXplciUzRHRva2VuaXplciUyQyUwQSUyMCUyMCUyMCUyMGRhdGFfY29sbGF0b3IlM0RkYXRhX2NvbGxhdG9yJTJDJTBBJTIwJTIwJTIwJTIwY29tcHV0ZV9tZXRyaWNzJTNEY29tcHV0ZV9tZXRyaWNzJTJDJTBBKSUwQSUwQXRyYWluZXIudHJhaW4oKQ==",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_model&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">2e-5</span>,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">2</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</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>    load_best_model_at_end=<span class="hljs-literal">True</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=tokenized_imdb[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=tokenized_imdb[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`}}),p=new bt({props:{$$slots:{default:[Ds]},$$scope:{ctx:v}}}),K=new C({props:{code:"dHJhaW5lci5wdXNoX3RvX2h1Yigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.push_to_hub()'}}),{c(){$(s.$$.fragment),c=o(),l=h("p"),l.innerHTML=m,u=o(),$(J.$$.fragment),E=o(),U=h("p"),U.textContent=X,W=o(),x=h("ol"),x.innerHTML=Y,Z=o(),$(k.$$.fragment),R=o(),$(p.$$.fragment),_=o(),z=h("p"),z.innerHTML=O,H=o(),$(K.$$.fragment)},l(f){y(s.$$.fragment,f),c=i(f),l=d(f,"P",{"data-svelte-h":!0}),w(l)!=="svelte-1dpm8jo"&&(l.innerHTML=m),u=i(f),y(J.$$.fragment,f),E=i(f),U=d(f,"P",{"data-svelte-h":!0}),w(U)!=="svelte-14zzcxs"&&(U.textContent=X),W=i(f),x=d(f,"OL",{"data-svelte-h":!0}),w(x)!=="svelte-637r6p"&&(x.innerHTML=Y),Z=i(f),y(k.$$.fragment,f),R=i(f),y(p.$$.fragment,f),_=i(f),z=d(f,"P",{"data-svelte-h":!0}),w(z)!=="svelte-1aylhkm"&&(z.innerHTML=O),H=i(f),y(K.$$.fragment,f)},m(f,G){b(s,f,G),a(f,c,G),a(f,l,G),a(f,u,G),b(J,f,G),a(f,E,G),a(f,U,G),a(f,W,G),a(f,x,G),a(f,Z,G),b(k,f,G),a(f,R,G),b(p,f,G),a(f,_,G),a(f,z,G),a(f,H,G),b(K,f,G),P=!0},p(f,G){const ee={};G&2&&(ee.$$scope={dirty:G,ctx:f}),s.$set(ee);const B={};G&2&&(B.$$scope={dirty:G,ctx:f}),p.$set(B)},i(f){P||(M(s.$$.fragment,f),M(J.$$.fragment,f),M(k.$$.fragment,f),M(p.$$.fragment,f),M(K.$$.fragment,f),P=!0)},o(f){g(s.$$.fragment,f),g(J.$$.fragment,f),g(k.$$.fragment,f),g(p.$$.fragment,f),g(K.$$.fragment,f),P=!1},d(f){f&&(t(c),t(l),t(u),t(E),t(U),t(W),t(x),t(Z),t(R),t(_),t(z),t(H)),j(s,f),j(J,f),j(k,f),j(p,f),j(K,f)}}}function Os(v){let s,c;return s=new rt({props:{$$slots:{default:[Ks]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p(l,m){const u={};m&2&&(u.$$scope={dirty:m,ctx:l}),s.$set(u)},i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function el(v){let s,c='Keras를 사용하여 모델을 파인 튜닝하는 방법에 익숙하지 않은 경우, <a href="../training#train-a-tensorflow-model-with-keras">여기</a>의 기본 튜토리얼을 확인하세요!';return{c(){s=h("p"),s.innerHTML=c},l(l){s=d(l,"P",{"data-svelte-h":!0}),w(s)!=="svelte-nkj0lu"&&(s.innerHTML=c)},m(l,m){a(l,s,m)},p:he,d(l){l&&t(s)}}}function tl(v){let s,c,l,m,u,J="그런 다음 <code>TFAutoModelForSequenceClassification</code>을 사용하여 DistilBERT를 로드하고, 예상되는 레이블 수와 레이블 매핑을 로드할 수 있습니다:",E,U,X,W,x="<code>prepare_tf_dataset()</code>을 사용하여 데이터셋을 <code>tf.data.Dataset</code> 형식으로 변환합니다:",Y,Z,k,R,p='<a href="https://keras.io/api/models/model_training_apis/#compile-method" rel="nofollow"><code>compile</code></a>를 사용하여 훈련할 모델을 구성합니다:',_,z,O,H,K='훈련을 시작하기 전에 설정해야할 마지막 두 가지는 예측에서 정확도를 계산하고, 모델을 Hub에 업로드할 방법을 제공하는 것입니다. 모두 <a href="../main_classes/keras_callbacks">Keras callbacks</a>를 사용하여 수행됩니다.',P,f,G="<code>KerasMetricCallback</code>에 <code>compute_metrics</code>를 전달하여 정확도를 높입니다.",ee,B,le,Q,pt="<code>PushToHubCallback</code>에서 모델과 토크나이저를 업로드할 위치를 지정합니다:",ae,L,ne,S,ot="그런 다음 콜백을 함께 묶습니다:",re,A,pe,F,te='드디어, 모델 훈련을 시작할 준비가 되었습니다! <a href="https://keras.io/api/models/model_training_apis/#fit-method" rel="nofollow"><code>fit</code></a>에 훈련 데이터셋, 검증 데이터셋, 에폭의 수 및 콜백을 전달하여 파인 튜닝합니다:',se,q,de,D,it="훈련이 완료되면, 모델이 자동으로 Hub에 업로드되어 모든 사람이 사용할 수 있습니다!",oe;return s=new bt({props:{$$slots:{default:[el]},$$scope:{ctx:v}}}),l=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGNyZWF0ZV9vcHRpbWl6ZXIlMEFpbXBvcnQlMjB0ZW5zb3JmbG93JTIwYXMlMjB0ZiUwQSUwQWJhdGNoX3NpemUlMjAlM0QlMjAxNiUwQW51bV9lcG9jaHMlMjAlM0QlMjA1JTBBYmF0Y2hlc19wZXJfZXBvY2glMjAlM0QlMjBsZW4odG9rZW5pemVkX2ltZGIlNUIlMjJ0cmFpbiUyMiU1RCklMjAlMkYlMkYlMjBiYXRjaF9zaXplJTBBdG90YWxfdHJhaW5fc3RlcHMlMjAlM0QlMjBpbnQoYmF0Y2hlc19wZXJfZXBvY2glMjAqJTIwbnVtX2Vwb2NocyklMEFvcHRpbWl6ZXIlMkMlMjBzY2hlZHVsZSUyMCUzRCUyMGNyZWF0ZV9vcHRpbWl6ZXIoaW5pdF9sciUzRDJlLTUlMkMlMjBudW1fd2FybXVwX3N0ZXBzJTNEMCUyQyUyMG51bV90cmFpbl9zdGVwcyUzRHRvdGFsX3RyYWluX3N0ZXBzKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size = <span class="hljs-number">16</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_epochs = <span class="hljs-number">5</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>batches_per_epoch = <span class="hljs-built_in">len</span>(tokenized_imdb[<span class="hljs-string">&quot;train&quot;</span>]) // batch_size
<span class="hljs-meta">&gt;&gt;&gt; </span>total_train_steps = <span class="hljs-built_in">int</span>(batches_per_epoch * num_epochs)
<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer, schedule = create_optimizer(init_lr=<span class="hljs-number">2e-5</span>, num_warmup_steps=<span class="hljs-number">0</span>, num_train_steps=total_train_steps)`}}),U=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwVEZBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMEElMjAlMjAlMjAlMjAlMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMiUyQyUyMG51bV9sYWJlbHMlM0QyJTJDJTIwaWQybGFiZWwlM0RpZDJsYWJlbCUyQyUyMGxhYmVsMmlkJTNEbGFiZWwyaWQlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSequenceClassification.from_pretrained(
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, num_labels=<span class="hljs-number">2</span>, id2label=id2label, label2id=label2id
<span class="hljs-meta">... </span>)`}}),Z=new C({props:{code:"dGZfdHJhaW5fc2V0JTIwJTNEJTIwbW9kZWwucHJlcGFyZV90Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMHRva2VuaXplZF9pbWRiJTVCJTIydHJhaW4lMjIlNUQlMkMlMEElMjAlMjAlMjAlMjBzaHVmZmxlJTNEVHJ1ZSUyQyUwQSUyMCUyMCUyMCUyMGJhdGNoX3NpemUlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMGNvbGxhdGVfZm4lM0RkYXRhX2NvbGxhdG9yJTJDJTBBKSUwQSUwQXRmX3ZhbGlkYXRpb25fc2V0JTIwJTNEJTIwbW9kZWwucHJlcGFyZV90Zl9kYXRhc2V0KCUwQSUyMCUyMCUyMCUyMHRva2VuaXplZF9pbWRiJTVCJTIydGVzdCUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHNodWZmbGUlM0RGYWxzZSUyQyUwQSUyMCUyMCUyMCUyMGJhdGNoX3NpemUlM0QxNiUyQyUwQSUyMCUyMCUyMCUyMGNvbGxhdGVfZm4lM0RkYXRhX2NvbGxhdG9yJTJDJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    tokenized_imdb[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_validation_set = model.prepare_tf_dataset(
<span class="hljs-meta">... </span>    tokenized_imdb[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`}}),z=new C({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFtb2RlbC5jb21waWxlKG9wdGltaXplciUzRG9wdGltaXplcik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)`}}),B=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5rZXJhc19jYWxsYmFja3MlMjBpbXBvcnQlMjBLZXJhc01ldHJpY0NhbGxiYWNrJTBBJTBBbWV0cmljX2NhbGxiYWNrJTIwJTNEJTIwS2VyYXNNZXRyaWNDYWxsYmFjayhtZXRyaWNfZm4lM0Rjb21wdXRlX21ldHJpY3MlMkMlMjBldmFsX2RhdGFzZXQlM0R0Zl92YWxpZGF0aW9uX3NldCk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.keras_callbacks <span class="hljs-keyword">import</span> KerasMetricCallback

<span class="hljs-meta">&gt;&gt;&gt; </span>metric_callback = KerasMetricCallback(metric_fn=compute_metrics, eval_dataset=tf_validation_set)`}}),L=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycy5rZXJhc19jYWxsYmFja3MlMjBpbXBvcnQlMjBQdXNoVG9IdWJDYWxsYmFjayUwQSUwQXB1c2hfdG9faHViX2NhbGxiYWNrJTIwJTNEJTIwUHVzaFRvSHViQ2FsbGJhY2soJTBBJTIwJTIwJTIwJTIwb3V0cHV0X2RpciUzRCUyMm15X2F3ZXNvbWVfbW9kZWwlMjIlMkMlMEElMjAlMjAlMjAlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIlMkMlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers.keras_callbacks <span class="hljs-keyword">import</span> PushToHubCallback

<span class="hljs-meta">&gt;&gt;&gt; </span>push_to_hub_callback = PushToHubCallback(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;my_awesome_model&quot;</span>,
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>)`}}),A=new C({props:{code:"Y2FsbGJhY2tzJTIwJTNEJTIwJTVCbWV0cmljX2NhbGxiYWNrJTJDJTIwcHVzaF90b19odWJfY2FsbGJhY2slNUQ=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>callbacks = [metric_callback, push_to_hub_callback]'}}),q=new C({props:{code:"bW9kZWwuZml0KHglM0R0Zl90cmFpbl9zZXQlMkMlMjB2YWxpZGF0aW9uX2RhdGElM0R0Zl92YWxpZGF0aW9uX3NldCUyQyUyMGVwb2NocyUzRDMlMkMlMjBjYWxsYmFja3MlM0RjYWxsYmFja3Mp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_validation_set, epochs=<span class="hljs-number">3</span>, callbacks=callbacks)'}}),{c(){$(s.$$.fragment),c=Vs(`
TensorFlow에서 모델을 파인 튜닝하려면, 먼저 옵티마이저 함수와 학습률 스케쥴, 그리고 일부 훈련 하이퍼파라미터를 설정해야 합니다:

	`),$(l.$$.fragment),m=o(),u=h("p"),u.innerHTML=J,E=o(),$(U.$$.fragment),X=o(),W=h("p"),W.innerHTML=x,Y=o(),$(Z.$$.fragment),k=o(),R=h("p"),R.innerHTML=p,_=o(),$(z.$$.fragment),O=o(),H=h("p"),H.innerHTML=K,P=o(),f=h("p"),f.innerHTML=G,ee=o(),$(B.$$.fragment),le=o(),Q=h("p"),Q.innerHTML=pt,ae=o(),$(L.$$.fragment),ne=o(),S=h("p"),S.textContent=ot,re=o(),$(A.$$.fragment),pe=o(),F=h("p"),F.innerHTML=te,se=o(),$(q.$$.fragment),de=o(),D=h("p"),D.textContent=it},l(n){y(s.$$.fragment,n),c=Is(n,`
TensorFlow에서 모델을 파인 튜닝하려면, 먼저 옵티마이저 함수와 학습률 스케쥴, 그리고 일부 훈련 하이퍼파라미터를 설정해야 합니다:

	`),y(l.$$.fragment,n),m=i(n),u=d(n,"P",{"data-svelte-h":!0}),w(u)!=="svelte-1lnro8f"&&(u.innerHTML=J),E=i(n),y(U.$$.fragment,n),X=i(n),W=d(n,"P",{"data-svelte-h":!0}),w(W)!=="svelte-1hxq7ff"&&(W.innerHTML=x),Y=i(n),y(Z.$$.fragment,n),k=i(n),R=d(n,"P",{"data-svelte-h":!0}),w(R)!=="svelte-qrlpiv"&&(R.innerHTML=p),_=i(n),y(z.$$.fragment,n),O=i(n),H=d(n,"P",{"data-svelte-h":!0}),w(H)!=="svelte-i81jhu"&&(H.innerHTML=K),P=i(n),f=d(n,"P",{"data-svelte-h":!0}),w(f)!=="svelte-6lp9q9"&&(f.innerHTML=G),ee=i(n),y(B.$$.fragment,n),le=i(n),Q=d(n,"P",{"data-svelte-h":!0}),w(Q)!=="svelte-1ilfuc9"&&(Q.innerHTML=pt),ae=i(n),y(L.$$.fragment,n),ne=i(n),S=d(n,"P",{"data-svelte-h":!0}),w(S)!=="svelte-90s2we"&&(S.textContent=ot),re=i(n),y(A.$$.fragment,n),pe=i(n),F=d(n,"P",{"data-svelte-h":!0}),w(F)!=="svelte-1ub0tax"&&(F.innerHTML=te),se=i(n),y(q.$$.fragment,n),de=i(n),D=d(n,"P",{"data-svelte-h":!0}),w(D)!=="svelte-14vf2pa"&&(D.textContent=it)},m(n,T){b(s,n,T),a(n,c,T),b(l,n,T),a(n,m,T),a(n,u,T),a(n,E,T),b(U,n,T),a(n,X,T),a(n,W,T),a(n,Y,T),b(Z,n,T),a(n,k,T),a(n,R,T),a(n,_,T),b(z,n,T),a(n,O,T),a(n,H,T),a(n,P,T),a(n,f,T),a(n,ee,T),b(B,n,T),a(n,le,T),a(n,Q,T),a(n,ae,T),b(L,n,T),a(n,ne,T),a(n,S,T),a(n,re,T),b(A,n,T),a(n,pe,T),a(n,F,T),a(n,se,T),b(q,n,T),a(n,de,T),a(n,D,T),oe=!0},p(n,T){const _e={};T&2&&(_e.$$scope={dirty:T,ctx:n}),s.$set(_e)},i(n){oe||(M(s.$$.fragment,n),M(l.$$.fragment,n),M(U.$$.fragment,n),M(Z.$$.fragment,n),M(z.$$.fragment,n),M(B.$$.fragment,n),M(L.$$.fragment,n),M(A.$$.fragment,n),M(q.$$.fragment,n),oe=!0)},o(n){g(s.$$.fragment,n),g(l.$$.fragment,n),g(U.$$.fragment,n),g(Z.$$.fragment,n),g(z.$$.fragment,n),g(B.$$.fragment,n),g(L.$$.fragment,n),g(A.$$.fragment,n),g(q.$$.fragment,n),oe=!1},d(n){n&&(t(c),t(m),t(u),t(E),t(X),t(W),t(Y),t(k),t(R),t(_),t(O),t(H),t(P),t(f),t(ee),t(le),t(Q),t(ae),t(ne),t(S),t(re),t(pe),t(F),t(se),t(de),t(D)),j(s,n),j(l,n),j(U,n),j(Z,n),j(z,n),j(B,n),j(L,n),j(A,n),j(q,n)}}}function sl(v){let s,c;return s=new rt({props:{$$slots:{default:[tl]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p(l,m){const u={};m&2&&(u.$$scope={dirty:m,ctx:l}),s.$set(u)},i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function ll(v){let s,c='텍스트 분류를 위한 모델을 파인 튜닝하는 자세한 예제는 다음 <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb" rel="nofollow">PyTorch notebook</a> 또는 <a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb" rel="nofollow">TensorFlow notebook</a>를 참조하세요.';return{c(){s=h("p"),s.innerHTML=c},l(l){s=d(l,"P",{"data-svelte-h":!0}),w(s)!=="svelte-105n05r"&&(s.innerHTML=c)},m(l,m){a(l,s,m)},p:he,d(l){l&&t(s)}}}function al(v){let s,c="텍스트를 토큰화하고 PyTorch 텐서를 반환합니다.",l,m,u,J,E="입력을 모델에 전달하고 <code>logits</code>을 반환합니다:",U,X,W,x,Y="가장 높은 확률을 가진 클래스를 모델의 <code>id2label</code> 매핑을 사용하여 텍스트 레이블로 변환합니다:",Z,k,R;return m=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)`}}),X=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMnN0ZXZobGl1JTJGbXlfYXdlc29tZV9tb2RlbCUyMiklMEF3aXRoJTIwdG9yY2gubm9fZ3JhZCgpJTNBJTBBJTIwJTIwJTIwJTIwbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_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`}}),k=new C({props:{code:"cHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwbG9naXRzLmFyZ21heCgpLml0ZW0oKSUwQW1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = logits.argmax().item()
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;POSITIVE&#x27;</span>`}}),{c(){s=h("p"),s.textContent=c,l=o(),$(m.$$.fragment),u=o(),J=h("p"),J.innerHTML=E,U=o(),$(X.$$.fragment),W=o(),x=h("p"),x.innerHTML=Y,Z=o(),$(k.$$.fragment)},l(p){s=d(p,"P",{"data-svelte-h":!0}),w(s)!=="svelte-1f989ch"&&(s.textContent=c),l=i(p),y(m.$$.fragment,p),u=i(p),J=d(p,"P",{"data-svelte-h":!0}),w(J)!=="svelte-1hjuppo"&&(J.innerHTML=E),U=i(p),y(X.$$.fragment,p),W=i(p),x=d(p,"P",{"data-svelte-h":!0}),w(x)!=="svelte-1jbp04u"&&(x.innerHTML=Y),Z=i(p),y(k.$$.fragment,p)},m(p,_){a(p,s,_),a(p,l,_),b(m,p,_),a(p,u,_),a(p,J,_),a(p,U,_),b(X,p,_),a(p,W,_),a(p,x,_),a(p,Z,_),b(k,p,_),R=!0},p:he,i(p){R||(M(m.$$.fragment,p),M(X.$$.fragment,p),M(k.$$.fragment,p),R=!0)},o(p){g(m.$$.fragment,p),g(X.$$.fragment,p),g(k.$$.fragment,p),R=!1},d(p){p&&(t(s),t(l),t(u),t(J),t(U),t(W),t(x),t(Z)),j(m,p),j(X,p),j(k,p)}}}function nl(v){let s,c;return s=new rt({props:{$$slots:{default:[al]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p(l,m){const u={};m&2&&(u.$$scope={dirty:m,ctx:l}),s.$set(u)},i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function rl(v){let s,c="텍스트를 토큰화하고 TensorFlow 텐서를 반환합니다:",l,m,u,J,E="입력값을 모델에 전달하고 <code>logits</code>을 반환합니다:",U,X,W,x,Y="가장 높은 확률을 가진 클래스를 모델의 <code>id2label</code> 매핑을 사용하여 텍스트 레이블로 변환합니다:",Z,k,R;return m=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfbW9kZWwlMjIpJTBBaW5wdXRzJTIwJTNEJTIwdG9rZW5pemVyKHRleHQlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>inputs = tokenizer(text, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`}}),X=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQW1vZGVsJTIwJTNEJTIwVEZBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJzdGV2aGxpdSUyRm15X2F3ZXNvbWVfbW9kZWwlMjIpJTBBbG9naXRzJTIwJTNEJTIwbW9kZWwoKippbnB1dHMpLmxvZ2l0cw==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;stevhliu/my_awesome_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>logits = model(**inputs).logits`}}),k=new C({props:{code:"cHJlZGljdGVkX2NsYXNzX2lkJTIwJTNEJTIwaW50KHRmLm1hdGguYXJnbWF4KGxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklNUIwJTVEKSUwQW1vZGVsLmNvbmZpZy5pZDJsYWJlbCU1QnByZWRpY3RlZF9jbGFzc19pZCU1RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>predicted_class_id = <span class="hljs-built_in">int</span>(tf.math.argmax(logits, axis=-<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span>model.config.id2label[predicted_class_id]
<span class="hljs-string">&#x27;POSITIVE&#x27;</span>`}}),{c(){s=h("p"),s.textContent=c,l=o(),$(m.$$.fragment),u=o(),J=h("p"),J.innerHTML=E,U=o(),$(X.$$.fragment),W=o(),x=h("p"),x.innerHTML=Y,Z=o(),$(k.$$.fragment)},l(p){s=d(p,"P",{"data-svelte-h":!0}),w(s)!=="svelte-1m12ipr"&&(s.textContent=c),l=i(p),y(m.$$.fragment,p),u=i(p),J=d(p,"P",{"data-svelte-h":!0}),w(J)!=="svelte-tcnp5y"&&(J.innerHTML=E),U=i(p),y(X.$$.fragment,p),W=i(p),x=d(p,"P",{"data-svelte-h":!0}),w(x)!=="svelte-1jbp04u"&&(x.innerHTML=Y),Z=i(p),y(k.$$.fragment,p)},m(p,_){a(p,s,_),a(p,l,_),b(m,p,_),a(p,u,_),a(p,J,_),a(p,U,_),b(X,p,_),a(p,W,_),a(p,x,_),a(p,Z,_),b(k,p,_),R=!0},p:he,i(p){R||(M(m.$$.fragment,p),M(X.$$.fragment,p),M(k.$$.fragment,p),R=!0)},o(p){g(m.$$.fragment,p),g(X.$$.fragment,p),g(k.$$.fragment,p),R=!1},d(p){p&&(t(s),t(l),t(u),t(J),t(U),t(W),t(x),t(Z)),j(m,p),j(X,p),j(k,p)}}}function pl(v){let s,c;return s=new rt({props:{$$slots:{default:[rl]},$$scope:{ctx:v}}}),{c(){$(s.$$.fragment)},l(l){y(s.$$.fragment,l)},m(l,m){b(s,l,m),c=!0},p(l,m){const u={};m&2&&(u.$$scope={dirty:m,ctx:l}),s.$set(u)},i(l){c||(M(s.$$.fragment,l),c=!0)},o(l){g(s.$$.fragment,l),c=!1},d(l){j(s,l)}}}function ol(v){let s,c,l,m,u,J,E,U,X,W,x="텍스트 분류",Y,Z,k,R,p,_,z="텍스트 분류는 자연어 처리의 일종으로, 텍스트에 레이블 또는 클래스를 지정하는 작업입니다. 많은 대기업이 다양한 실용적인 응용 분야에서 텍스트 분류를 운영하고 있습니다. 가장 인기 있는 텍스트 분류 형태 중 하나는 감성 분석으로, 텍스트 시퀀스에 🙂 긍정, 🙁 부정 또는 😐 중립과 같은 레이블을 지정합니다.",O,H,K="이 가이드에서 학습할 내용은:",P,f,G='<li><a href="https://huggingface.co/datasets/imdb" rel="nofollow">IMDb</a> 데이터셋에서 <a href="https://huggingface.co/distilbert-base-uncased" rel="nofollow">DistilBERT</a>를 파인 튜닝하여 영화 리뷰가 긍정적인지 부정적인지 판단합니다.</li> <li>추론을 위해 파인 튜닝 모델을 사용합니다.</li>',ee,B,le,Q,pt="시작하기 전에, 필요한 모든 라이브러리가 설치되어 있는지 확인하세요:",ae,L,ne,S,ot="Hugging Face 계정에 로그인하여 모델을 업로드하고 커뮤니티에 공유하는 것을 권장합니다. 메시지가 표시되면, 토큰을 입력하여 로그인하세요:",re,A,pe,F,te,se,q,de,D,it="IMDb 데이터셋 가져오기",oe,n,T="먼저 🤗 Datasets 라이브러리에서 IMDb 데이터셋을 가져옵니다:",_e,Te,Mt,Je,os="그런 다음 예시를 살펴봅시다:",gt,ve,jt,Ue,is="이 데이터셋에는 두 가지 필드가 있습니다:",wt,ke,cs="<li><code>text</code>: 영화 리뷰 텍스트</li> <li><code>label</code>: <code>0</code>은 부정적인 리뷰, <code>1</code>은 긍정적인 리뷰를 나타냅니다.</li>",_t,ie,ue,ct,Ce,ls,tt,ms="전처리",Tt,Ze,fs="다음 단계는 DistilBERT 토크나이저를 가져와서 <code>text</code> 필드를 전처리하는 것입니다:",Jt,Re,vt,We,hs="<code>text</code>를 토큰화하고 시퀀스가 DistilBERT의 최대 입력 길이보다 길지 않도록 자르기 위한 전처리 함수를 생성하세요:",Ut,xe,kt,Ge,ds="전체 데이터셋에 전처리 함수를 적용하려면, 🤗 Datasets <code>map</code> 함수를 사용하세요. 데이터셋의 여러 요소를 한 번에 처리하기 위해 <code>batched=True</code>로 설정함으로써 데이터셋 <code>map</code>를 더 빠르게 처리할 수 있습니다:",Ct,Xe,Zt,Ve,us="이제 <code>DataCollatorWithPadding</code>를 사용하여 예제 배치를 만들어봅시다. 데이터셋 전체를 최대 길이로 패딩하는 대신, <em>동적 패딩</em>을 사용하여 배치에서 가장 긴 길이에 맞게 문장을 패딩하는 것이 효율적입니다.",Rt,$e,Wt,ce,ye,mt,Ie,as,st,$s="평가하기",xt,Ee,ys='훈련 중 모델의 성능을 평가하기 위해 메트릭을 포함하는 것이 유용합니다. 🤗 <a href="https://huggingface.co/docs/evaluate/index" rel="nofollow">Evaluate</a> 라이브러리를 사용하여 빠르게 평가 방법을 로드할 수 있습니다. 이 작업에서는 <a href="https://huggingface.co/spaces/evaluate-metric/accuracy" rel="nofollow">accuracy</a> 메트릭을 가져옵니다. (메트릭을 가져오고 계산하는 방법에 대해서는 🤗 Evaluate <a href="https://huggingface.co/docs/evaluate/a_quick_tour" rel="nofollow">quick tour</a>를 참조하세요):',Gt,He,Xt,Ne,bs="그런 다음 <code>compute_metrics</code> 함수를 만들어서 예측과 레이블을 계산하여 정확도를 계산하도록 <code>compute</code>를 호출합니다:",Vt,Be,It,Ye,Ms="이제 <code>compute_metrics</code> 함수는 준비되었고, 훈련 과정을 설정할 때 다시 살펴볼 예정입니다.",Et,me,be,ft,ze,ns,lt,gs="훈련",Ht,Fe,js="모델을 훈련하기 전에, <code>id2label</code>와 <code>label2id</code>를 사용하여 예상되는 id와 레이블의 맵을 생성하세요:",Nt,Qe,Bt,Me,Yt,ge,zt,fe,je,ht,Le,rs,at,ws="추론",Ft,Se,_s="좋아요, 이제 모델을 파인 튜닝했으니 추론에 사용할 수 있습니다!",Qt,Ae,Ts="추론을 수행하고자 하는 텍스트를 가져와봅시다:",Lt,qe,St,Pe,Js="파인 튜닝된 모델로 추론을 시도하는 가장 간단한 방법은 <code>pipeline()</code>를 사용하는 것입니다. 모델로 감정 분석을 위한 <code>pipeline</code>을 인스턴스화하고, 텍스트를 전달해보세요:",At,De,qt,Ke,vs="원한다면, <code>pipeline</code>의 결과를 수동으로 복제할 수도 있습니다.",Pt,we,Dt,dt,Kt;return U=new nt({}),Z=new Fs({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/ko/sequence_classification.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/sequence_classification.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/sequence_classification.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/sequence_classification.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/sequence_classification.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/sequence_classification.ipynb"}]}}),R=new zs({props:{id:"leNG9fN9FQU"}}),B=new bt({props:{$$slots:{default:[Qs]},$$scope:{ctx:v}}}),L=new C({props:{code:"cGlwJTIwaW5zdGFsbCUyMHRyYW5zZm9ybWVycyUyMGRhdGFzZXRzJTIwZXZhbHVhdGU=",highlighted:"pip install transformers datasets evaluate"}}),A=new C({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()`}}),q=new nt({}),Te=new C({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBaW1kYiUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJpbWRiJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>imdb = load_dataset(<span class="hljs-string">&quot;imdb&quot;</span>)`}}),ve=new C({props:{code:"aW1kYiU1QiUyMnRlc3QlMjIlNUQlNUIwJTVE",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>imdb[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-number">0</span>]
{
    <span class="hljs-string">&quot;label&quot;</span>: <span class="hljs-number">0</span>,
    <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;I love sci-fi and am willing to put up with a lot. Sci-fi movies/TV are usually underfunded, under-appreciated and misunderstood. I tried to like this, I really did, but it is to good TV sci-fi as Babylon 5 is to Star Trek (the original). Silly prosthetics, cheap cardboard sets, stilted dialogues, CG that doesn&#x27;t match the background, and painfully one-dimensional characters cannot be overcome with a &#x27;sci-fi&#x27; setting. (I&#x27;m sure there are those of you out there who think Babylon 5 is good sci-fi TV. It&#x27;s not. It&#x27;s clichéd and uninspiring.) While US viewers might like emotion and character development, sci-fi is a genre that does not take itself seriously (cf. Star Trek). It may treat important issues, yet not as a serious philosophy. It&#x27;s really difficult to care about the characters here as they are not simply foolish, just missing a spark of life. Their actions and reactions are wooden and predictable, often painful to watch. The makers of Earth KNOW it&#x27;s rubbish as they have to always say \\&quot;Gene Roddenberry&#x27;s Earth...\\&quot; otherwise people would not continue watching. Roddenberry&#x27;s ashes must be turning in their orbit as this dull, cheap, poorly edited (watching it without advert breaks really brings this home) trudging Trabant of a show lumbers into space. Spoiler. So, kill off a main character. And then bring him back as another actor. Jeeez! Dallas all over again.&quot;</span>,
}`}}),Ce=new nt({}),Re=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZCUyMik=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`}}),xe=new C({props:{code:"ZGVmJTIwcHJlcHJvY2Vzc19mdW5jdGlvbihleGFtcGxlcyklM0ElMEElMjAlMjAlMjAlMjByZXR1cm4lMjB0b2tlbml6ZXIoZXhhbXBsZXMlNUIlMjJ0ZXh0JTIyJTVEJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUp",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>    <span class="hljs-keyword">return</span> tokenizer(examples[<span class="hljs-string">&quot;text&quot;</span>], truncation=<span class="hljs-literal">True</span>)`}}),Xe=new C({props:{code:"dG9rZW5pemVkX2ltZGIlMjAlM0QlMjBpbWRiLm1hcChwcmVwcm9jZXNzX2Z1bmN0aW9uJTJDJTIwYmF0Y2hlZCUzRFRydWUp",highlighted:'tokenized_imdb = imdb.<span class="hljs-built_in">map</span>(preprocess_function, batched=<span class="hljs-literal">True</span>)'}}),$e=new ps({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[qs],pytorch:[Ss]},$$scope:{ctx:v}}}),Ie=new nt({}),He=new C({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>)`}}),Be=new C({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBJTBBJTBBZGVmJTIwY29tcHV0ZV9tZXRyaWNzKGV2YWxfcHJlZCklM0ElMEElMjAlMjAlMjAlMjBwcmVkaWN0aW9ucyUyQyUyMGxhYmVscyUyMCUzRCUyMGV2YWxfcHJlZCUwQSUyMCUyMCUyMCUyMHByZWRpY3Rpb25zJTIwJTNEJTIwbnAuYXJnbWF4KHByZWRpY3Rpb25zJTJDJTIwYXhpcyUzRDEpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwYWNjdXJhY3kuY29tcHV0ZShwcmVkaWN0aW9ucyUzRHByZWRpY3Rpb25zJTJDJTIwcmVmZXJlbmNlcyUzRGxhYmVscyk=",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, labels = eval_pred
<span class="hljs-meta">... </span>    predictions = np.argmax(predictions, axis=<span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> accuracy.compute(predictions=predictions, references=labels)`}}),ze=new nt({}),Qe=new C({props:{code:"aWQybGFiZWwlMjAlM0QlMjAlN0IwJTNBJTIwJTIyTkVHQVRJVkUlMjIlMkMlMjAxJTNBJTIwJTIyUE9TSVRJVkUlMjIlN0QlMEFsYWJlbDJpZCUyMCUzRCUyMCU3QiUyMk5FR0FUSVZFJTIyJTNBJTIwMCUyQyUyMCUyMlBPU0lUSVZFJTIyJTNBJTIwMSU3RA==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>id2label = {<span class="hljs-number">0</span>: <span class="hljs-string">&quot;NEGATIVE&quot;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&quot;POSITIVE&quot;</span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>label2id = {<span class="hljs-string">&quot;NEGATIVE&quot;</span>: <span class="hljs-number">0</span>, <span class="hljs-string">&quot;POSITIVE&quot;</span>: <span class="hljs-number">1</span>}`}}),Me=new ps({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[sl],pytorch:[Os]},$$scope:{ctx:v}}}),ge=new bt({props:{$$slots:{default:[ll]},$$scope:{ctx:v}}}),Le=new nt({}),qe=new C({props:{code:"dGV4dCUyMCUzRCUyMCUyMlRoaXMlMjB3YXMlMjBhJTIwbWFzdGVycGllY2UuJTIwTm90JTIwY29tcGxldGVseSUyMGZhaXRoZnVsJTIwdG8lMjB0aGUlMjBib29rcyUyQyUyMGJ1dCUyMGVudGhyYWxsaW5nJTIwZnJvbSUyMGJlZ2lubmluZyUyMHRvJTIwZW5kLiUyME1pZ2h0JTIwYmUlMjBteSUyMGZhdm9yaXRlJTIwb2YlMjB0aGUlMjB0aHJlZS4lMjI=",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>text = <span class="hljs-string">&quot;This was a masterpiece. Not completely faithful to the books, but enthralling from beginning to end. Might be my favorite of the three.&quot;</span>'}}),De=new C({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKCUyMnNlbnRpbWVudC1hbmFseXNpcyUyMiUyQyUyMG1vZGVsJTNEJTIyc3RldmhsaXUlMkZteV9hd2Vzb21lX21vZGVsJTIyKSUwQWNsYXNzaWZpZXIodGV4dCk=",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;sentiment-analysis&quot;</span>, model=<span class="hljs-string">&quot;stevhliu/my_awesome_model&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>classifier(text)
[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9994940757751465</span>}]`}}),we=new ps({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[pl],pytorch:[nl]},$$scope:{ctx:v}}}),{c(){s=h("meta"),c=o(),l=h("p"),m=o(),u=h("h1"),J=h("a"),E=h("span"),$(U.$$.fragment),X=o(),W=h("span"),W.textContent=x,Y=o(),$(Z.$$.fragment),k=o(),$(R.$$.fragment),p=o(),_=h("p"),_.textContent=z,O=o(),H=h("p"),H.textContent=K,P=o(),f=h("ol"),f.innerHTML=G,ee=o(),$(B.$$.fragment),le=o(),Q=h("p"),Q.textContent=pt,ae=o(),$(L.$$.fragment),ne=o(),S=h("p"),S.textContent=ot,re=o(),$(A.$$.fragment),pe=o(),F=h("h2"),te=h("a"),se=h("span"),$(q.$$.fragment),de=o(),D=h("span"),D.textContent=it,oe=o(),n=h("p"),n.textContent=T,_e=o(),$(Te.$$.fragment),Mt=o(),Je=h("p"),Je.textContent=os,gt=o(),$(ve.$$.fragment),jt=o(),Ue=h("p"),Ue.textContent=is,wt=o(),ke=h("ul"),ke.innerHTML=cs,_t=o(),ie=h("h2"),ue=h("a"),ct=h("span"),$(Ce.$$.fragment),ls=o(),tt=h("span"),tt.textContent=ms,Tt=o(),Ze=h("p"),Ze.innerHTML=fs,Jt=o(),$(Re.$$.fragment),vt=o(),We=h("p"),We.innerHTML=hs,Ut=o(),$(xe.$$.fragment),kt=o(),Ge=h("p"),Ge.innerHTML=ds,Ct=o(),$(Xe.$$.fragment),Zt=o(),Ve=h("p"),Ve.innerHTML=us,Rt=o(),$($e.$$.fragment),Wt=o(),ce=h("h2"),ye=h("a"),mt=h("span"),$(Ie.$$.fragment),as=o(),st=h("span"),st.textContent=$s,xt=o(),Ee=h("p"),Ee.innerHTML=ys,Gt=o(),$(He.$$.fragment),Xt=o(),Ne=h("p"),Ne.innerHTML=bs,Vt=o(),$(Be.$$.fragment),It=o(),Ye=h("p"),Ye.innerHTML=Ms,Et=o(),me=h("h2"),be=h("a"),ft=h("span"),$(ze.$$.fragment),ns=o(),lt=h("span"),lt.textContent=gs,Ht=o(),Fe=h("p"),Fe.innerHTML=js,Nt=o(),$(Qe.$$.fragment),Bt=o(),$(Me.$$.fragment),Yt=o(),$(ge.$$.fragment),zt=o(),fe=h("h2"),je=h("a"),ht=h("span"),$(Le.$$.fragment),rs=o(),at=h("span"),at.textContent=ws,Ft=o(),Se=h("p"),Se.textContent=_s,Qt=o(),Ae=h("p"),Ae.textContent=Ts,Lt=o(),$(qe.$$.fragment),St=o(),Pe=h("p"),Pe.innerHTML=Js,At=o(),$(De.$$.fragment),qt=o(),Ke=h("p"),Ke.innerHTML=vs,Pt=o(),$(we.$$.fragment),Dt=o(),dt=h("p"),this.h()},l(e){const r=Ys("svelte-1phssyn",document.head);s=d(r,"META",{name:!0,content:!0}),r.forEach(t),c=i(e),l=d(e,"P",{}),N(l).forEach(t),m=i(e),u=d(e,"H1",{class:!0});var Oe=N(u);J=d(Oe,"A",{id:!0,class:!0,href:!0});var ut=N(J);E=d(ut,"SPAN",{});var $t=N(E);y(U.$$.fragment,$t),$t.forEach(t),ut.forEach(t),X=i(Oe),W=d(Oe,"SPAN",{"data-svelte-h":!0}),w(W)!=="svelte-3qubuy"&&(W.textContent=x),Oe.forEach(t),Y=i(e),y(Z.$$.fragment,e),k=i(e),y(R.$$.fragment,e),p=i(e),_=d(e,"P",{"data-svelte-h":!0}),w(_)!=="svelte-u67xp1"&&(_.textContent=z),O=i(e),H=d(e,"P",{"data-svelte-h":!0}),w(H)!=="svelte-14hiaa1"&&(H.textContent=K),P=i(e),f=d(e,"OL",{"data-svelte-h":!0}),w(f)!=="svelte-17s8h02"&&(f.innerHTML=G),ee=i(e),y(B.$$.fragment,e),le=i(e),Q=d(e,"P",{"data-svelte-h":!0}),w(Q)!=="svelte-1bc8bfk"&&(Q.textContent=pt),ae=i(e),y(L.$$.fragment,e),ne=i(e),S=d(e,"P",{"data-svelte-h":!0}),w(S)!=="svelte-1hhyu5y"&&(S.textContent=ot),re=i(e),y(A.$$.fragment,e),pe=i(e),F=d(e,"H2",{class:!0});var et=N(F);te=d(et,"A",{id:!0,class:!0,href:!0});var yt=N(te);se=d(yt,"SPAN",{});var Us=N(se);y(q.$$.fragment,Us),Us.forEach(t),yt.forEach(t),de=i(et),D=d(et,"SPAN",{"data-svelte-h":!0}),w(D)!=="svelte-aayvho"&&(D.textContent=it),et.forEach(t),oe=i(e),n=d(e,"P",{"data-svelte-h":!0}),w(n)!=="svelte-71u4tm"&&(n.textContent=T),_e=i(e),y(Te.$$.fragment,e),Mt=i(e),Je=d(e,"P",{"data-svelte-h":!0}),w(Je)!=="svelte-18cnd8l"&&(Je.textContent=os),gt=i(e),y(ve.$$.fragment,e),jt=i(e),Ue=d(e,"P",{"data-svelte-h":!0}),w(Ue)!=="svelte-nfqprk"&&(Ue.textContent=is),wt=i(e),ke=d(e,"UL",{"data-svelte-h":!0}),w(ke)!=="svelte-z448yg"&&(ke.innerHTML=cs),_t=i(e),ie=d(e,"H2",{class:!0});var Ot=N(ie);ue=d(Ot,"A",{id:!0,class:!0,href:!0});var ks=N(ue);ct=d(ks,"SPAN",{});var Cs=N(ct);y(Ce.$$.fragment,Cs),Cs.forEach(t),ks.forEach(t),ls=i(Ot),tt=d(Ot,"SPAN",{"data-svelte-h":!0}),w(tt)!=="svelte-1cte2wb"&&(tt.textContent=ms),Ot.forEach(t),Tt=i(e),Ze=d(e,"P",{"data-svelte-h":!0}),w(Ze)!=="svelte-1t0711w"&&(Ze.innerHTML=fs),Jt=i(e),y(Re.$$.fragment,e),vt=i(e),We=d(e,"P",{"data-svelte-h":!0}),w(We)!=="svelte-1lyhad1"&&(We.innerHTML=hs),Ut=i(e),y(xe.$$.fragment,e),kt=i(e),Ge=d(e,"P",{"data-svelte-h":!0}),w(Ge)!=="svelte-y65sjr"&&(Ge.innerHTML=ds),Ct=i(e),y(Xe.$$.fragment,e),Zt=i(e),Ve=d(e,"P",{"data-svelte-h":!0}),w(Ve)!=="svelte-1i6efmb"&&(Ve.innerHTML=us),Rt=i(e),y($e.$$.fragment,e),Wt=i(e),ce=d(e,"H2",{class:!0});var es=N(ce);ye=d(es,"A",{id:!0,class:!0,href:!0});var Zs=N(ye);mt=d(Zs,"SPAN",{});var Rs=N(mt);y(Ie.$$.fragment,Rs),Rs.forEach(t),Zs.forEach(t),as=i(es),st=d(es,"SPAN",{"data-svelte-h":!0}),w(st)!=="svelte-zfi65a"&&(st.textContent=$s),es.forEach(t),xt=i(e),Ee=d(e,"P",{"data-svelte-h":!0}),w(Ee)!=="svelte-16fyv40"&&(Ee.innerHTML=ys),Gt=i(e),y(He.$$.fragment,e),Xt=i(e),Ne=d(e,"P",{"data-svelte-h":!0}),w(Ne)!=="svelte-1wr52zz"&&(Ne.innerHTML=bs),Vt=i(e),y(Be.$$.fragment,e),It=i(e),Ye=d(e,"P",{"data-svelte-h":!0}),w(Ye)!=="svelte-11m7xom"&&(Ye.innerHTML=Ms),Et=i(e),me=d(e,"H2",{class:!0});var ts=N(me);be=d(ts,"A",{id:!0,class:!0,href:!0});var Ws=N(be);ft=d(Ws,"SPAN",{});var xs=N(ft);y(ze.$$.fragment,xs),xs.forEach(t),Ws.forEach(t),ns=i(ts),lt=d(ts,"SPAN",{"data-svelte-h":!0}),w(lt)!=="svelte-tdy10p"&&(lt.textContent=gs),ts.forEach(t),Ht=i(e),Fe=d(e,"P",{"data-svelte-h":!0}),w(Fe)!=="svelte-84b3vk"&&(Fe.innerHTML=js),Nt=i(e),y(Qe.$$.fragment,e),Bt=i(e),y(Me.$$.fragment,e),Yt=i(e),y(ge.$$.fragment,e),zt=i(e),fe=d(e,"H2",{class:!0});var ss=N(fe);je=d(ss,"A",{id:!0,class:!0,href:!0});var Gs=N(je);ht=d(Gs,"SPAN",{});var Xs=N(ht);y(Le.$$.fragment,Xs),Xs.forEach(t),Gs.forEach(t),rs=i(ss),at=d(ss,"SPAN",{"data-svelte-h":!0}),w(at)!=="svelte-8litrx"&&(at.textContent=ws),ss.forEach(t),Ft=i(e),Se=d(e,"P",{"data-svelte-h":!0}),w(Se)!=="svelte-1r6hgyn"&&(Se.textContent=_s),Qt=i(e),Ae=d(e,"P",{"data-svelte-h":!0}),w(Ae)!=="svelte-ej1eir"&&(Ae.textContent=Ts),Lt=i(e),y(qe.$$.fragment,e),St=i(e),Pe=d(e,"P",{"data-svelte-h":!0}),w(Pe)!=="svelte-hpekrl"&&(Pe.innerHTML=Js),At=i(e),y(De.$$.fragment,e),qt=i(e),Ke=d(e,"P",{"data-svelte-h":!0}),w(Ke)!=="svelte-1kfpoxm"&&(Ke.innerHTML=vs),Pt=i(e),y(we.$$.fragment,e),Dt=i(e),dt=d(e,"P",{}),N(dt).forEach(t),this.h()},h(){V(s,"name","hf:doc:metadata"),V(s,"content",JSON.stringify(il)),V(J,"id","text-classification"),V(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"),V(J,"href","#text-classification"),V(u,"class","relative group"),V(te,"id","load-imdb-dataset"),V(te,"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"),V(te,"href","#load-imdb-dataset"),V(F,"class","relative group"),V(ue,"id","preprocess"),V(ue,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),V(ue,"href","#preprocess"),V(ie,"class","relative group"),V(ye,"id","evaluate"),V(ye,"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"),V(ye,"href","#evaluate"),V(ce,"class","relative group"),V(be,"id","train"),V(be,"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"),V(be,"href","#train"),V(me,"class","relative group"),V(je,"id","inference"),V(je,"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"),V(je,"href","#inference"),V(fe,"class","relative group")},m(e,r){I(document.head,s),a(e,c,r),a(e,l,r),a(e,m,r),a(e,u,r),I(u,J),I(J,E),b(U,E,null),I(u,X),I(u,W),a(e,Y,r),b(Z,e,r),a(e,k,r),b(R,e,r),a(e,p,r),a(e,_,r),a(e,O,r),a(e,H,r),a(e,P,r),a(e,f,r),a(e,ee,r),b(B,e,r),a(e,le,r),a(e,Q,r),a(e,ae,r),b(L,e,r),a(e,ne,r),a(e,S,r),a(e,re,r),b(A,e,r),a(e,pe,r),a(e,F,r),I(F,te),I(te,se),b(q,se,null),I(F,de),I(F,D),a(e,oe,r),a(e,n,r),a(e,_e,r),b(Te,e,r),a(e,Mt,r),a(e,Je,r),a(e,gt,r),b(ve,e,r),a(e,jt,r),a(e,Ue,r),a(e,wt,r),a(e,ke,r),a(e,_t,r),a(e,ie,r),I(ie,ue),I(ue,ct),b(Ce,ct,null),I(ie,ls),I(ie,tt),a(e,Tt,r),a(e,Ze,r),a(e,Jt,r),b(Re,e,r),a(e,vt,r),a(e,We,r),a(e,Ut,r),b(xe,e,r),a(e,kt,r),a(e,Ge,r),a(e,Ct,r),b(Xe,e,r),a(e,Zt,r),a(e,Ve,r),a(e,Rt,r),b($e,e,r),a(e,Wt,r),a(e,ce,r),I(ce,ye),I(ye,mt),b(Ie,mt,null),I(ce,as),I(ce,st),a(e,xt,r),a(e,Ee,r),a(e,Gt,r),b(He,e,r),a(e,Xt,r),a(e,Ne,r),a(e,Vt,r),b(Be,e,r),a(e,It,r),a(e,Ye,r),a(e,Et,r),a(e,me,r),I(me,be),I(be,ft),b(ze,ft,null),I(me,ns),I(me,lt),a(e,Ht,r),a(e,Fe,r),a(e,Nt,r),b(Qe,e,r),a(e,Bt,r),b(Me,e,r),a(e,Yt,r),b(ge,e,r),a(e,zt,r),a(e,fe,r),I(fe,je),I(je,ht),b(Le,ht,null),I(fe,rs),I(fe,at),a(e,Ft,r),a(e,Se,r),a(e,Qt,r),a(e,Ae,r),a(e,Lt,r),b(qe,e,r),a(e,St,r),a(e,Pe,r),a(e,At,r),b(De,e,r),a(e,qt,r),a(e,Ke,r),a(e,Pt,r),b(we,e,r),a(e,Dt,r),a(e,dt,r),Kt=!0},p(e,[r]){const Oe={};r&2&&(Oe.$$scope={dirty:r,ctx:e}),B.$set(Oe);const ut={};r&2&&(ut.$$scope={dirty:r,ctx:e}),$e.$set(ut);const $t={};r&2&&($t.$$scope={dirty:r,ctx:e}),Me.$set($t);const et={};r&2&&(et.$$scope={dirty:r,ctx:e}),ge.$set(et);const yt={};r&2&&(yt.$$scope={dirty:r,ctx:e}),we.$set(yt)},i(e){Kt||(M(U.$$.fragment,e),M(Z.$$.fragment,e),M(R.$$.fragment,e),M(B.$$.fragment,e),M(L.$$.fragment,e),M(A.$$.fragment,e),M(q.$$.fragment,e),M(Te.$$.fragment,e),M(ve.$$.fragment,e),M(Ce.$$.fragment,e),M(Re.$$.fragment,e),M(xe.$$.fragment,e),M(Xe.$$.fragment,e),M($e.$$.fragment,e),M(Ie.$$.fragment,e),M(He.$$.fragment,e),M(Be.$$.fragment,e),M(ze.$$.fragment,e),M(Qe.$$.fragment,e),M(Me.$$.fragment,e),M(ge.$$.fragment,e),M(Le.$$.fragment,e),M(qe.$$.fragment,e),M(De.$$.fragment,e),M(we.$$.fragment,e),Kt=!0)},o(e){g(U.$$.fragment,e),g(Z.$$.fragment,e),g(R.$$.fragment,e),g(B.$$.fragment,e),g(L.$$.fragment,e),g(A.$$.fragment,e),g(q.$$.fragment,e),g(Te.$$.fragment,e),g(ve.$$.fragment,e),g(Ce.$$.fragment,e),g(Re.$$.fragment,e),g(xe.$$.fragment,e),g(Xe.$$.fragment,e),g($e.$$.fragment,e),g(Ie.$$.fragment,e),g(He.$$.fragment,e),g(Be.$$.fragment,e),g(ze.$$.fragment,e),g(Qe.$$.fragment,e),g(Me.$$.fragment,e),g(ge.$$.fragment,e),g(Le.$$.fragment,e),g(qe.$$.fragment,e),g(De.$$.fragment,e),g(we.$$.fragment,e),Kt=!1},d(e){e&&(t(c),t(l),t(m),t(u),t(Y),t(k),t(p),t(_),t(O),t(H),t(P),t(f),t(ee),t(le),t(Q),t(ae),t(ne),t(S),t(re),t(pe),t(F),t(oe),t(n),t(_e),t(Mt),t(Je),t(gt),t(jt),t(Ue),t(wt),t(ke),t(_t),t(ie),t(Tt),t(Ze),t(Jt),t(vt),t(We),t(Ut),t(kt),t(Ge),t(Ct),t(Zt),t(Ve),t(Rt),t(Wt),t(ce),t(xt),t(Ee),t(Gt),t(Xt),t(Ne),t(Vt),t(It),t(Ye),t(Et),t(me),t(Ht),t(Fe),t(Nt),t(Bt),t(Yt),t(zt),t(fe),t(Ft),t(Se),t(Qt),t(Ae),t(Lt),t(St),t(Pe),t(At),t(qt),t(Ke),t(Pt),t(Dt),t(dt)),t(s),j(U),j(Z,e),j(R,e),j(B,e),j(L,e),j(A,e),j(q),j(Te,e),j(ve,e),j(Ce),j(Re,e),j(xe,e),j(Xe,e),j($e,e),j(Ie),j(He,e),j(Be,e),j(ze),j(Qe,e),j(Me,e),j(ge,e),j(Le),j(qe,e),j(De,e),j(we,e)}}}const il={local:"text-classification",sections:[{local:"load-imdb-dataset",title:"IMDb 데이터셋 가져오기"},{local:"preprocess",title:"전처리"},{local:"evaluate",title:"평가하기"},{local:"train",title:"훈련"},{local:"inference",title:"추론"}],title:"텍스트 분류"};function cl(v){return Hs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ml extends Ns{constructor(s){super(),Bs(this,s,cl,ol,Es,{})}}export{Ml as component};
