import{S as Wa,i as Ya,s as Ra,e as l,k as c,w,t as f,M as Ja,c as o,d as e,m as h,a as n,x as k,h as m,b as d,G as t,g as i,y as b,q as E,o as j,B as y,v as Xa}from"../chunks/vendor-hf-doc-builder.js";import{T as Oa}from"../chunks/Tip-hf-doc-builder.js";import{Y as La}from"../chunks/Youtube-hf-doc-builder.js";import{I as Yt}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as U}from"../chunks/CodeBlock-hf-doc-builder.js";import{D as Za}from"../chunks/DocNotebookDropdown-hf-doc-builder.js";import{F as Ga,M as Ia}from"../chunks/Markdown-hf-doc-builder.js";function Qa(dt){let $,P;return{c(){$=l("p"),P=f(`\uC0AC\uC804 \uD6C8\uB828\uB41C \uAC00\uC911\uCE58 \uC911 \uC77C\uBD80\uAC00 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uACE0 \uC77C\uBD80 \uAC00\uC911\uCE58\uAC00 \uBB34\uC791\uC704\uB85C \uD45C\uC2DC\uB41C\uB2E4\uB294 \uACBD\uACE0\uAC00 \uD45C\uC2DC\uB429\uB2C8\uB2E4.
\uAC71\uC815\uB9C8\uC138\uC694. \uC774\uAC83\uC740 \uC62C\uBC14\uB978 \uB3D9\uC791\uC785\uB2C8\uB2E4! \uC0AC\uC804 \uD559\uC2B5\uB41C BERT \uBAA8\uB378\uC758 \uD5E4\uB4DC\uB294 \uD3D0\uAE30\uB418\uACE0 \uBB34\uC791\uC704\uB85C \uCD08\uAE30\uD654\uB41C \uBD84\uB958 \uD5E4\uB4DC\uB85C \uB300\uCCB4\uB429\uB2C8\uB2E4. \uC774\uC81C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC758 \uC9C0\uC2DD\uC73C\uB85C \uC2DC\uD000\uC2A4 \uBD84\uB958 \uC791\uC5C5\uC744 \uC704\uD55C \uC0C8\uB85C\uC6B4 \uBAA8\uB378 \uD5E4\uB4DC\uB97C \uBBF8\uC138 \uD29C\uB2DD \uD569\uB2C8\uB2E4.`)},l(u){$=o(u,"P",{});var A=n($);P=m(A,`\uC0AC\uC804 \uD6C8\uB828\uB41C \uAC00\uC911\uCE58 \uC911 \uC77C\uBD80\uAC00 \uC0AC\uC6A9\uB418\uC9C0 \uC54A\uACE0 \uC77C\uBD80 \uAC00\uC911\uCE58\uAC00 \uBB34\uC791\uC704\uB85C \uD45C\uC2DC\uB41C\uB2E4\uB294 \uACBD\uACE0\uAC00 \uD45C\uC2DC\uB429\uB2C8\uB2E4.
\uAC71\uC815\uB9C8\uC138\uC694. \uC774\uAC83\uC740 \uC62C\uBC14\uB978 \uB3D9\uC791\uC785\uB2C8\uB2E4! \uC0AC\uC804 \uD559\uC2B5\uB41C BERT \uBAA8\uB378\uC758 \uD5E4\uB4DC\uB294 \uD3D0\uAE30\uB418\uACE0 \uBB34\uC791\uC704\uB85C \uCD08\uAE30\uD654\uB41C \uBD84\uB958 \uD5E4\uB4DC\uB85C \uB300\uCCB4\uB429\uB2C8\uB2E4. \uC774\uC81C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC758 \uC9C0\uC2DD\uC73C\uB85C \uC2DC\uD000\uC2A4 \uBD84\uB958 \uC791\uC5C5\uC744 \uC704\uD55C \uC0C8\uB85C\uC6B4 \uBAA8\uB378 \uD5E4\uB4DC\uB97C \uBBF8\uC138 \uD29C\uB2DD \uD569\uB2C8\uB2E4.`),A.forEach(e)},m(u,A){i(u,$,A),t($,P)},d(u){u&&e($)}}}function Va(dt){let $,P,u,A,T,q,O,D,ke,be,C,Pt,X,Rt,Tt,z,F,Ye,De,Ce,St,ut,qt,Se,Kt,Z,I,Re,se,Ne,Q,re,le,rt,Le,Nt,Lt,oe,_e,ne,Oe,Je,$t,pe,_t,K,lt,Jt,zt,B,Xe,H,M,Ee,L,ot,nt,V,ie,je,Ie,Ot,x,Me,pt,fe,vt,G,Ze,W,ee,It,me,xt,ye,Qe,it,Ve,ft,ve,Ae,Dt,Fe,ce,Pe,S,Te,gt,Xt,wt,he,et,ge,kt,Ke,te,ae,N,de,mt,ct,Ht,tt,He,ue,Y,R,qe,J,bt,Ut,ze,at,$e,xe,Zt,Et,we,r,a,_,Ue,Be,la,Mt,jt,Bt,ht,yt,ta;return $=new La({props:{id:"nvBXf7s7vTI"}}),q=new Yt({}),Z=new U({props:{code:`from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased", num_labels=5)`,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;bert-base-cased&quot;</span>, num_labels=<span class="hljs-number">5</span>)`}}),Re=new Oa({props:{$$slots:{default:[Qa]},$$scope:{ctx:dt}}}),le=new Yt({}),M=new U({props:{code:`from transformers import TrainingArguments

training_args = TrainingArguments(output_dir="test_trainer")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments

<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(output_dir=<span class="hljs-string">&quot;test_trainer&quot;</span>)`}}),V=new Yt({}),ce=new U({props:{code:`import numpy as np
import evaluate

metric = evaluate.load("accuracy")`,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">import</span> evaluate

<span class="hljs-meta">&gt;&gt;&gt; </span>metric = evaluate.load(<span class="hljs-string">&quot;accuracy&quot;</span>)`}}),ae=new U({props:{code:`def compute_metrics(eval_pred):
    logits, labels = eval_pred
    predictions = np.argmax(logits, axis=-1)
    return metric.compute(predictions=predictions, references=labels)`,highlighted:`<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>    logits, labels = eval_pred
<span class="hljs-meta">... </span>    predictions = np.argmax(logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> metric.compute(predictions=predictions, references=labels)`}}),ue=new U({props:{code:`from transformers import TrainingArguments, Trainer

training_args = TrainingArguments(output_dir="test_trainer", evaluation_strategy="epoch")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(output_dir=<span class="hljs-string">&quot;test_trainer&quot;</span>, evaluation_strategy=<span class="hljs-string">&quot;epoch&quot;</span>)`}}),bt=new Yt({}),_=new U({props:{code:`trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=small_train_dataset,
    eval_dataset=small_eval_dataset,
    compute_metrics=compute_metrics,
)`,highlighted:`<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=small_train_dataset,
<span class="hljs-meta">... </span>    eval_dataset=small_eval_dataset,
<span class="hljs-meta">... </span>    compute_metrics=compute_metrics,
<span class="hljs-meta">... </span>)`}}),yt=new U({props:{code:"trainer.train()",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()'}}),{c(){w($.$$.fragment),P=c(),u=l("h2"),A=l("a"),T=l("span"),w(q.$$.fragment),O=c(),D=l("span"),ke=f("\uD30C\uC774\uD1A0\uCE58 Trainer\uB85C \uD6C8\uB828\uD558\uAE30"),be=c(),C=l("p"),Pt=f("\u{1F917} Transformers\uB294 \u{1F917} Transformers \uBAA8\uB378 \uD6C8\uB828\uC5D0 \uCD5C\uC801\uD654\uB41C "),X=l("code"),Rt=f("Trainer"),Tt=f(" \uD074\uB798\uC2A4\uB97C \uC81C\uACF5\uD558\uC5EC \uD6C8\uB828 \uB8E8\uD504\uB97C \uC9C1\uC811 \uC791\uC131\uD558\uC9C0 \uC54A\uACE0\uB3C4 \uC27D\uAC8C \uD6C8\uB828\uC744 \uC2DC\uC791\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. "),z=l("code"),F=f("Trainer"),Ye=f(" API\uB294 \uB85C\uAE45(logging), \uACBD\uC0AC \uB204\uC801(gradient accumulation), \uD63C\uD569 \uC815\uBC00\uB3C4(mixed precision) \uB4F1 \uB2E4\uC591\uD55C \uD6C8\uB828 \uC635\uC158\uACFC \uAE30\uB2A5\uC744 \uC9C0\uC6D0\uD569\uB2C8\uB2E4."),De=c(),Ce=l("p"),St=f("\uBA3C\uC800 \uBAA8\uB378\uC744 \uAC00\uC838\uC624\uACE0 \uC608\uC0C1\uB418\uB294 \uB808\uC774\uBE14 \uC218\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4. Yelp \uB9AC\uBDF0 "),ut=l("a"),qt=f("\uB370\uC774\uD130\uC14B \uCE74\uB4DC"),Se=f("\uC5D0\uC11C 5\uAC1C\uC758 \uB808\uC774\uBE14\uC774 \uC788\uC74C\uC744 \uC54C \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),Kt=c(),w(Z.$$.fragment),I=c(),w(Re.$$.fragment),se=c(),Ne=l("h3"),Q=l("a"),re=l("span"),w(le.$$.fragment),rt=c(),Le=l("span"),Nt=f("\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130 \uD6C8\uB828"),Lt=c(),oe=l("p"),_e=f("\uB2E4\uC74C\uC73C\uB85C \uC815\uD560 \uC218 \uC788\uB294 \uBAA8\uB4E0 \uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130\uC640 \uB2E4\uC591\uD55C \uD6C8\uB828 \uC635\uC158\uC744 \uD65C\uC131\uD654\uD558\uAE30 \uC704\uD55C \uD50C\uB798\uADF8\uB97C \uD3EC\uD568\uD558\uB294 "),ne=l("code"),Oe=f("TrainingArguments"),Je=f(" \uD074\uB798\uC2A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."),$t=c(),pe=l("p"),_t=f("\uC774 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C\uB294 \uAE30\uBCF8 \uD6C8\uB828 "),K=l("a"),lt=f("\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130"),Jt=f("\uB85C \uC2DC\uC791\uD558\uC9C0\uB9CC, \uC790\uC720\uB86D\uAC8C \uC2E4\uD5D8\uD558\uC5EC \uC5EC\uB7EC\uBD84\uB4E4\uC5D0\uAC8C \uB9DE\uB294 \uCD5C\uC801\uC758 \uC124\uC815\uC744 \uCC3E\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),zt=c(),B=l("p"),Xe=f("\uD6C8\uB828\uC5D0\uC11C \uCCB4\uD06C\uD3EC\uC778\uD2B8(checkpoints)\uB97C \uC800\uC7A5\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4:"),H=c(),w(M.$$.fragment),Ee=c(),L=l("h3"),ot=l("a"),nt=l("span"),w(V.$$.fragment),ie=c(),je=l("span"),Ie=f("\uD3C9\uAC00 \uD558\uAE30"),Ot=c(),x=l("p"),Me=l("code"),pt=f("Trainer"),fe=f("\uB294 \uD6C8\uB828 \uC911\uC5D0 \uBAA8\uB378 \uC131\uB2A5\uC744 \uC790\uB3D9\uC73C\uB85C \uD3C9\uAC00\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD3C9\uAC00 \uC9C0\uD45C\uB97C \uACC4\uC0B0\uD558\uACE0 \uBCF4\uACE0\uD560 \uD568\uC218\uB97C "),vt=l("code"),G=f("Trainer"),Ze=f(`\uC5D0 \uC804\uB2EC\uD574\uC57C \uD569\uB2C8\uB2E4.
`),W=l("a"),ee=f("\u{1F917} Evaluate"),It=f(" \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 "),me=l("a"),xt=l("code"),ye=f("evaluate.load"),Qe=f(" \uD568\uC218\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uB294 \uAC04\uB2E8\uD55C "),it=l("code"),Ve=f("accuracy"),ft=f("\uD568\uC218\uB97C \uC81C\uACF5\uD569\uB2C8\uB2E4 (\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 "),ve=l("a"),Ae=f("\uB458\uB7EC\uBCF4\uAE30"),Dt=f("\uB97C \uCC38\uC870\uD558\uC138\uC694):"),Fe=c(),w(ce.$$.fragment),Pe=c(),S=l("p"),Te=l("code"),gt=f("metric"),Xt=f("\uC5D0\uC11C "),wt=l("code"),he=f("compute"),et=f("\uB97C \uD638\uCD9C\uD558\uC5EC \uC608\uCE21\uC758 \uC815\uD655\uB3C4\uB97C \uACC4\uC0B0\uD569\uB2C8\uB2E4. \uC608\uCE21\uC744 "),ge=l("code"),kt=f("compute"),Ke=f("\uC5D0 \uC804\uB2EC\uD558\uAE30 \uC804\uC5D0 \uC608\uCE21\uC744 \uB85C\uC9D3\uC73C\uB85C \uBCC0\uD658\uD574\uC57C \uD569\uB2C8\uB2E4(\uBAA8\uB4E0 \u{1F917} Transformers \uBAA8\uB378\uC740 \uB85C\uC9D3\uC73C\uB85C \uBC18\uD658\uD55C\uB2E4\uB294 \uC810\uC744 \uAE30\uC5B5\uD558\uC138\uC694):"),te=c(),w(ae.$$.fragment),N=c(),de=l("p"),mt=f("\uBBF8\uC138 \uD29C\uB2DD \uC911\uC5D0 \uD3C9\uAC00 \uC9C0\uD45C\uB97C \uBAA8\uB2C8\uD130\uB9C1\uD558\uB824\uBA74 \uD6C8\uB828 \uC778\uC218\uC5D0 "),ct=l("code"),Ht=f("evaluation_strategy"),tt=f(" \uD30C\uB77C\uBBF8\uD130\uB97C \uC9C0\uC815\uD558\uC5EC \uAC01 \uC5D0\uD3ED\uC774 \uB05D\uB0A0 \uB54C \uD3C9\uAC00 \uC9C0\uD45C\uB97C \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),He=c(),w(ue.$$.fragment),Y=c(),R=l("h3"),qe=l("a"),J=l("span"),w(bt.$$.fragment),Ut=c(),ze=l("span"),at=f("\uD6C8\uB828 \uD558\uAE30"),$e=c(),xe=l("p"),Zt=f("\uBAA8\uB378, \uD6C8\uB828 \uC778\uC218, \uD6C8\uB828 \uBC0F \uD14C\uC2A4\uD2B8 \uB370\uC774\uD130\uC14B, \uD3C9\uAC00 \uD568\uC218\uAC00 \uD3EC\uD568\uB41C "),Et=l("code"),we=f("Trainer"),r=f(" \uAC1D\uCCB4\uB97C \uB9CC\uB4ED\uB2C8\uB2E4:"),a=c(),w(_.$$.fragment),Ue=c(),Be=l("p"),la=f("\uADF8\uB9AC\uACE0 "),Mt=l("code"),jt=f("train()"),Bt=f("\uC744 \uD638\uCD9C\uD558\uC5EC \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD569\uB2C8\uB2E4:"),ht=c(),w(yt.$$.fragment),this.h()},l(p){k($.$$.fragment,p),P=h(p),u=o(p,"H2",{class:!0});var g=n(u);A=o(g,"A",{id:!0,class:!0,href:!0});var Qt=n(A);T=o(Qt,"SPAN",{});var Gt=n(T);k(q.$$.fragment,Gt),Gt.forEach(e),Qt.forEach(e),O=h(g),D=o(g,"SPAN",{});var oa=n(D);ke=m(oa,"\uD30C\uC774\uD1A0\uCE58 Trainer\uB85C \uD6C8\uB828\uD558\uAE30"),oa.forEach(e),g.forEach(e),be=h(p),C=o(p,"P",{});var Ge=n(C);Pt=m(Ge,"\u{1F917} Transformers\uB294 \u{1F917} Transformers \uBAA8\uB378 \uD6C8\uB828\uC5D0 \uCD5C\uC801\uD654\uB41C "),X=o(Ge,"CODE",{});var na=n(X);Rt=m(na,"Trainer"),na.forEach(e),Tt=m(Ge," \uD074\uB798\uC2A4\uB97C \uC81C\uACF5\uD558\uC5EC \uD6C8\uB828 \uB8E8\uD504\uB97C \uC9C1\uC811 \uC791\uC131\uD558\uC9C0 \uC54A\uACE0\uB3C4 \uC27D\uAC8C \uD6C8\uB828\uC744 \uC2DC\uC791\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. "),z=o(Ge,"CODE",{});var s=n(z);F=m(s,"Trainer"),s.forEach(e),Ye=m(Ge," API\uB294 \uB85C\uAE45(logging), \uACBD\uC0AC \uB204\uC801(gradient accumulation), \uD63C\uD569 \uC815\uBC00\uB3C4(mixed precision) \uB4F1 \uB2E4\uC591\uD55C \uD6C8\uB828 \uC635\uC158\uACFC \uAE30\uB2A5\uC744 \uC9C0\uC6D0\uD569\uB2C8\uB2E4."),Ge.forEach(e),De=h(p),Ce=o(p,"P",{});var v=n(Ce);St=m(v,"\uBA3C\uC800 \uBAA8\uB378\uC744 \uAC00\uC838\uC624\uACE0 \uC608\uC0C1\uB418\uB294 \uB808\uC774\uBE14 \uC218\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4. Yelp \uB9AC\uBDF0 "),ut=o(v,"A",{href:!0,rel:!0});var Wt=n(ut);qt=m(Wt,"\uB370\uC774\uD130\uC14B \uCE74\uB4DC"),Wt.forEach(e),Se=m(v,"\uC5D0\uC11C 5\uAC1C\uC758 \uB808\uC774\uBE14\uC774 \uC788\uC74C\uC744 \uC54C \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),v.forEach(e),Kt=h(p),k(Z.$$.fragment,p),I=h(p),k(Re.$$.fragment,p),se=h(p),Ne=o(p,"H3",{class:!0});var pa=n(Ne);Q=o(pa,"A",{id:!0,class:!0,href:!0});var ia=n(Q);re=o(ia,"SPAN",{});var Vt=n(re);k(le.$$.fragment,Vt),Vt.forEach(e),ia.forEach(e),rt=h(pa),Le=o(pa,"SPAN",{});var Ft=n(Le);Nt=m(Ft,"\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130 \uD6C8\uB828"),Ft.forEach(e),pa.forEach(e),Lt=h(p),oe=o(p,"P",{});var ea=n(oe);_e=m(ea,"\uB2E4\uC74C\uC73C\uB85C \uC815\uD560 \uC218 \uC788\uB294 \uBAA8\uB4E0 \uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130\uC640 \uB2E4\uC591\uD55C \uD6C8\uB828 \uC635\uC158\uC744 \uD65C\uC131\uD654\uD558\uAE30 \uC704\uD55C \uD50C\uB798\uADF8\uB97C \uD3EC\uD568\uD558\uB294 "),ne=o(ea,"CODE",{});var ua=n(ne);Oe=m(ua,"TrainingArguments"),ua.forEach(e),Je=m(ea," \uD074\uB798\uC2A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."),ea.forEach(e),$t=h(p),pe=o(p,"P",{});var At=n(pe);_t=m(At,"\uC774 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C\uB294 \uAE30\uBCF8 \uD6C8\uB828 "),K=o(At,"A",{href:!0,rel:!0});var Ct=n(K);lt=m(Ct,"\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130"),Ct.forEach(e),Jt=m(At,"\uB85C \uC2DC\uC791\uD558\uC9C0\uB9CC, \uC790\uC720\uB86D\uAC8C \uC2E4\uD5D8\uD558\uC5EC \uC5EC\uB7EC\uBD84\uB4E4\uC5D0\uAC8C \uB9DE\uB294 \uCD5C\uC801\uC758 \uC124\uC815\uC744 \uCC3E\uC744 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),At.forEach(e),zt=h(p),B=o(p,"P",{});var $a=n(B);Xe=m($a,"\uD6C8\uB828\uC5D0\uC11C \uCCB4\uD06C\uD3EC\uC778\uD2B8(checkpoints)\uB97C \uC800\uC7A5\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4:"),$a.forEach(e),H=h(p),k(M.$$.fragment,p),Ee=h(p),L=o(p,"H3",{class:!0});var aa=n(L);ot=o(aa,"A",{id:!0,class:!0,href:!0});var fa=n(ot);nt=o(fa,"SPAN",{});var sa=n(nt);k(V.$$.fragment,sa),sa.forEach(e),fa.forEach(e),ie=h(aa),je=o(aa,"SPAN",{});var _a=n(je);Ie=m(_a,"\uD3C9\uAC00 \uD558\uAE30"),_a.forEach(e),aa.forEach(e),Ot=h(p),x=o(p,"P",{});var We=n(x);Me=o(We,"CODE",{});var st=n(Me);pt=m(st,"Trainer"),st.forEach(e),fe=m(We,"\uB294 \uD6C8\uB828 \uC911\uC5D0 \uBAA8\uB378 \uC131\uB2A5\uC744 \uC790\uB3D9\uC73C\uB85C \uD3C9\uAC00\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4. \uD3C9\uAC00 \uC9C0\uD45C\uB97C \uACC4\uC0B0\uD558\uACE0 \uBCF4\uACE0\uD560 \uD568\uC218\uB97C "),vt=o(We,"CODE",{});var ma=n(vt);G=m(ma,"Trainer"),ma.forEach(e),Ze=m(We,`\uC5D0 \uC804\uB2EC\uD574\uC57C \uD569\uB2C8\uB2E4.
`),W=o(We,"A",{href:!0,rel:!0});var va=n(W);ee=m(va,"\u{1F917} Evaluate"),va.forEach(e),It=m(We," \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 "),me=o(We,"A",{href:!0,rel:!0});var ha=n(me);xt=o(ha,"CODE",{});var ga=n(xt);ye=m(ga,"evaluate.load"),ga.forEach(e),ha.forEach(e),Qe=m(We," \uD568\uC218\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uB294 \uAC04\uB2E8\uD55C "),it=o(We,"CODE",{});var da=n(it);Ve=m(da,"accuracy"),da.forEach(e),ft=m(We,"\uD568\uC218\uB97C \uC81C\uACF5\uD569\uB2C8\uB2E4 (\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 "),ve=o(We,"A",{href:!0,rel:!0});var ra=n(ve);Ae=m(ra,"\uB458\uB7EC\uBCF4\uAE30"),ra.forEach(e),Dt=m(We,"\uB97C \uCC38\uC870\uD558\uC138\uC694):"),We.forEach(e),Fe=h(p),k(ce.$$.fragment,p),Pe=h(p),S=o(p,"P",{});var ca=n(S);Te=o(ca,"CODE",{});var ya=n(Te);gt=m(ya,"metric"),ya.forEach(e),Xt=m(ca,"\uC5D0\uC11C "),wt=o(ca,"CODE",{});var Aa=n(wt);he=m(Aa,"compute"),Aa.forEach(e),et=m(ca,"\uB97C \uD638\uCD9C\uD558\uC5EC \uC608\uCE21\uC758 \uC815\uD655\uB3C4\uB97C \uACC4\uC0B0\uD569\uB2C8\uB2E4. \uC608\uCE21\uC744 "),ge=o(ca,"CODE",{});var ba=n(ge);kt=m(ba,"compute"),ba.forEach(e),Ke=m(ca,"\uC5D0 \uC804\uB2EC\uD558\uAE30 \uC804\uC5D0 \uC608\uCE21\uC744 \uB85C\uC9D3\uC73C\uB85C \uBCC0\uD658\uD574\uC57C \uD569\uB2C8\uB2E4(\uBAA8\uB4E0 \u{1F917} Transformers \uBAA8\uB378\uC740 \uB85C\uC9D3\uC73C\uB85C \uBC18\uD658\uD55C\uB2E4\uB294 \uC810\uC744 \uAE30\uC5B5\uD558\uC138\uC694):"),ca.forEach(e),te=h(p),k(ae.$$.fragment,p),N=h(p),de=o(p,"P",{});var Ea=n(de);mt=m(Ea,"\uBBF8\uC138 \uD29C\uB2DD \uC911\uC5D0 \uD3C9\uAC00 \uC9C0\uD45C\uB97C \uBAA8\uB2C8\uD130\uB9C1\uD558\uB824\uBA74 \uD6C8\uB828 \uC778\uC218\uC5D0 "),ct=o(Ea,"CODE",{});var Pa=n(ct);Ht=m(Pa,"evaluation_strategy"),Pa.forEach(e),tt=m(Ea," \uD30C\uB77C\uBBF8\uD130\uB97C \uC9C0\uC815\uD558\uC5EC \uAC01 \uC5D0\uD3ED\uC774 \uB05D\uB0A0 \uB54C \uD3C9\uAC00 \uC9C0\uD45C\uB97C \uD655\uC778\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),Ea.forEach(e),He=h(p),k(ue.$$.fragment,p),Y=h(p),R=o(p,"H3",{class:!0});var ka=n(R);qe=o(ka,"A",{id:!0,class:!0,href:!0});var Ta=n(qe);J=o(Ta,"SPAN",{});var qa=n(J);k(bt.$$.fragment,qa),qa.forEach(e),Ta.forEach(e),Ut=h(ka),ze=o(ka,"SPAN",{});var za=n(ze);at=m(za,"\uD6C8\uB828 \uD558\uAE30"),za.forEach(e),ka.forEach(e),$e=h(p),xe=o(p,"P",{});var wa=n(xe);Zt=m(wa,"\uBAA8\uB378, \uD6C8\uB828 \uC778\uC218, \uD6C8\uB828 \uBC0F \uD14C\uC2A4\uD2B8 \uB370\uC774\uD130\uC14B, \uD3C9\uAC00 \uD568\uC218\uAC00 \uD3EC\uD568\uB41C "),Et=o(wa,"CODE",{});var xa=n(Et);we=m(xa,"Trainer"),xa.forEach(e),r=m(wa," \uAC1D\uCCB4\uB97C \uB9CC\uB4ED\uB2C8\uB2E4:"),wa.forEach(e),a=h(p),k(_.$$.fragment,p),Ue=h(p),Be=o(p,"P",{});var ja=n(Be);la=m(ja,"\uADF8\uB9AC\uACE0 "),Mt=o(ja,"CODE",{});var Da=n(Mt);jt=m(Da,"train()"),Da.forEach(e),Bt=m(ja,"\uC744 \uD638\uCD9C\uD558\uC5EC \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD569\uB2C8\uB2E4:"),ja.forEach(e),ht=h(p),k(yt.$$.fragment,p),this.h()},h(){d(A,"id","train-with-pytorch-trainer"),d(A,"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(A,"href","#train-with-pytorch-trainer"),d(u,"class","relative group"),d(ut,"href","https://huggingface.co/datasets/yelp_review_full#data-fields"),d(ut,"rel","nofollow"),d(Q,"id","training-hyperparameters"),d(Q,"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(Q,"href","#training-hyperparameters"),d(Ne,"class","relative group"),d(K,"href","https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments"),d(K,"rel","nofollow"),d(ot,"id","evaluate"),d(ot,"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(ot,"href","#evaluate"),d(L,"class","relative group"),d(W,"href","https://huggingface.co/docs/evaluate/index"),d(W,"rel","nofollow"),d(me,"href","https://huggingface.co/spaces/evaluate-metric/accuracy"),d(me,"rel","nofollow"),d(ve,"href","https://huggingface.co/docs/evaluate/a_quick_tour"),d(ve,"rel","nofollow"),d(qe,"id","trainer"),d(qe,"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(qe,"href","#trainer"),d(R,"class","relative group")},m(p,g){b($,p,g),i(p,P,g),i(p,u,g),t(u,A),t(A,T),b(q,T,null),t(u,O),t(u,D),t(D,ke),i(p,be,g),i(p,C,g),t(C,Pt),t(C,X),t(X,Rt),t(C,Tt),t(C,z),t(z,F),t(C,Ye),i(p,De,g),i(p,Ce,g),t(Ce,St),t(Ce,ut),t(ut,qt),t(Ce,Se),i(p,Kt,g),b(Z,p,g),i(p,I,g),b(Re,p,g),i(p,se,g),i(p,Ne,g),t(Ne,Q),t(Q,re),b(le,re,null),t(Ne,rt),t(Ne,Le),t(Le,Nt),i(p,Lt,g),i(p,oe,g),t(oe,_e),t(oe,ne),t(ne,Oe),t(oe,Je),i(p,$t,g),i(p,pe,g),t(pe,_t),t(pe,K),t(K,lt),t(pe,Jt),i(p,zt,g),i(p,B,g),t(B,Xe),i(p,H,g),b(M,p,g),i(p,Ee,g),i(p,L,g),t(L,ot),t(ot,nt),b(V,nt,null),t(L,ie),t(L,je),t(je,Ie),i(p,Ot,g),i(p,x,g),t(x,Me),t(Me,pt),t(x,fe),t(x,vt),t(vt,G),t(x,Ze),t(x,W),t(W,ee),t(x,It),t(x,me),t(me,xt),t(xt,ye),t(x,Qe),t(x,it),t(it,Ve),t(x,ft),t(x,ve),t(ve,Ae),t(x,Dt),i(p,Fe,g),b(ce,p,g),i(p,Pe,g),i(p,S,g),t(S,Te),t(Te,gt),t(S,Xt),t(S,wt),t(wt,he),t(S,et),t(S,ge),t(ge,kt),t(S,Ke),i(p,te,g),b(ae,p,g),i(p,N,g),i(p,de,g),t(de,mt),t(de,ct),t(ct,Ht),t(de,tt),i(p,He,g),b(ue,p,g),i(p,Y,g),i(p,R,g),t(R,qe),t(qe,J),b(bt,J,null),t(R,Ut),t(R,ze),t(ze,at),i(p,$e,g),i(p,xe,g),t(xe,Zt),t(xe,Et),t(Et,we),t(xe,r),i(p,a,g),b(_,p,g),i(p,Ue,g),i(p,Be,g),t(Be,la),t(Be,Mt),t(Mt,jt),t(Be,Bt),i(p,ht,g),b(yt,p,g),ta=!0},p(p,g){const Qt={};g&2&&(Qt.$$scope={dirty:g,ctx:p}),Re.$set(Qt)},i(p){ta||(E($.$$.fragment,p),E(q.$$.fragment,p),E(Z.$$.fragment,p),E(Re.$$.fragment,p),E(le.$$.fragment,p),E(M.$$.fragment,p),E(V.$$.fragment,p),E(ce.$$.fragment,p),E(ae.$$.fragment,p),E(ue.$$.fragment,p),E(bt.$$.fragment,p),E(_.$$.fragment,p),E(yt.$$.fragment,p),ta=!0)},o(p){j($.$$.fragment,p),j(q.$$.fragment,p),j(Z.$$.fragment,p),j(Re.$$.fragment,p),j(le.$$.fragment,p),j(M.$$.fragment,p),j(V.$$.fragment,p),j(ce.$$.fragment,p),j(ae.$$.fragment,p),j(ue.$$.fragment,p),j(bt.$$.fragment,p),j(_.$$.fragment,p),j(yt.$$.fragment,p),ta=!1},d(p){y($,p),p&&e(P),p&&e(u),y(q),p&&e(be),p&&e(C),p&&e(De),p&&e(Ce),p&&e(Kt),y(Z,p),p&&e(I),y(Re,p),p&&e(se),p&&e(Ne),y(le),p&&e(Lt),p&&e(oe),p&&e($t),p&&e(pe),p&&e(zt),p&&e(B),p&&e(H),y(M,p),p&&e(Ee),p&&e(L),y(V),p&&e(Ot),p&&e(x),p&&e(Fe),y(ce,p),p&&e(Pe),p&&e(S),p&&e(te),y(ae,p),p&&e(N),p&&e(de),p&&e(He),y(ue,p),p&&e(Y),p&&e(R),y(bt),p&&e($e),p&&e(xe),p&&e(a),y(_,p),p&&e(Ue),p&&e(Be),p&&e(ht),y(yt,p)}}}function es(dt){let $,P;return $=new Ia({props:{$$slots:{default:[Va]},$$scope:{ctx:dt}}}),{c(){w($.$$.fragment)},l(u){k($.$$.fragment,u)},m(u,A){b($,u,A),P=!0},p(u,A){const T={};A&2&&(T.$$scope={dirty:A,ctx:u}),$.$set(T)},i(u){P||(E($.$$.fragment,u),P=!0)},o(u){j($.$$.fragment,u),P=!1},d(u){y($,u)}}}function ts(dt){let $,P,u,A,T;return{c(){$=l("p"),P=f("\uBAA8\uB378\uC744 "),u=l("code"),A=f("compile()"),T=f(`\uD560 \uB54C \uC190\uC2E4 \uC778\uC218\uB97C \uBAA8\uB378\uC5D0 \uC804\uB2EC\uD560 \uD544\uC694\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!
\uC774 \uC778\uC218\uB97C \uBE44\uC6CC\uB450\uBA74 \uD5C8\uAE45 \uD398\uC774\uC2A4 \uBAA8\uB378\uC740 \uC791\uC5C5\uACFC \uBAA8\uB378 \uC544\uD0A4\uD14D\uCC98\uC5D0 \uC801\uD569\uD55C \uC190\uC2E4\uC744 \uC790\uB3D9\uC73C\uB85C \uC120\uD0DD\uD569\uB2C8\uB2E4.
\uC6D0\uD55C\uB2E4\uBA74 \uC5B8\uC81C\uB4E0\uC9C0 \uC9C1\uC811 \uC190\uC2E4\uC744 \uC9C0\uC815\uD558\uC5EC \uC774\uB97C \uC7AC\uC815\uC758\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4!`)},l(q){$=o(q,"P",{});var O=n($);P=m(O,"\uBAA8\uB378\uC744 "),u=o(O,"CODE",{});var D=n(u);A=m(D,"compile()"),D.forEach(e),T=m(O,`\uD560 \uB54C \uC190\uC2E4 \uC778\uC218\uB97C \uBAA8\uB378\uC5D0 \uC804\uB2EC\uD560 \uD544\uC694\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4!
\uC774 \uC778\uC218\uB97C \uBE44\uC6CC\uB450\uBA74 \uD5C8\uAE45 \uD398\uC774\uC2A4 \uBAA8\uB378\uC740 \uC791\uC5C5\uACFC \uBAA8\uB378 \uC544\uD0A4\uD14D\uCC98\uC5D0 \uC801\uD569\uD55C \uC190\uC2E4\uC744 \uC790\uB3D9\uC73C\uB85C \uC120\uD0DD\uD569\uB2C8\uB2E4.
\uC6D0\uD55C\uB2E4\uBA74 \uC5B8\uC81C\uB4E0\uC9C0 \uC9C1\uC811 \uC190\uC2E4\uC744 \uC9C0\uC815\uD558\uC5EC \uC774\uB97C \uC7AC\uC815\uC758\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4!`),O.forEach(e)},m(q,O){i(q,$,O),t($,P),t($,u),t(u,A),t($,T)},d(q){q&&e($)}}}function as(dt){let $,P,u,A,T,q,O,D,ke,be,C,Pt,X,Rt,Tt,z,F,Ye,De,Ce,St,ut,qt,Se,Kt,Z,I,Re,se,Ne,Q,re,le,rt,Le,Nt,Lt,oe,_e,ne,Oe,Je,$t,pe,_t,K,lt,Jt,zt,B,Xe,H,M,Ee,L,ot,nt,V,ie,je,Ie,Ot,x,Me,pt,fe,vt,G,Ze,W,ee,It,me,xt,ye,Qe,it,Ve,ft,ve,Ae,Dt,Fe,ce,Pe,S,Te,gt,Xt,wt,he,et,ge,kt,Ke,te,ae,N,de,mt,ct,Ht,tt,He,ue,Y,R,qe,J,bt,Ut,ze,at,$e,xe,Zt,Et,we,r;return u=new La({props:{id:"rnTGBy2ax1c"}}),D=new Yt({}),De=new Yt({}),le=new U({props:{code:`from datasets import load_dataset

dataset = load_dataset("glue", "cola")
dataset = dataset["train"]  # Just take the training split for now`,highlighted:`<span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

dataset = load_dataset(<span class="hljs-string">&quot;glue&quot;</span>, <span class="hljs-string">&quot;cola&quot;</span>)
dataset = dataset[<span class="hljs-string">&quot;train&quot;</span>]  <span class="hljs-comment"># Just take the training split for now</span>`}}),oe=new U({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")
tokenized_data = tokenizer(dataset["sentence"], return_tensors="np", padding=True)
# Tokenizer returns a BatchEncoding, but we convert that to a dict for Keras
tokenized_data = dict(tokenized_data)

labels = np.array(dataset["label"])  # Label is already an array of 0 and 1`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
tokenized_data = tokenizer(dataset[<span class="hljs-string">&quot;sentence&quot;</span>], return_tensors=<span class="hljs-string">&quot;np&quot;</span>, padding=<span class="hljs-literal">True</span>)
<span class="hljs-comment"># Tokenizer returns a BatchEncoding, but we convert that to a dict for Keras</span>
tokenized_data = <span class="hljs-built_in">dict</span>(tokenized_data)

labels = np.array(dataset[<span class="hljs-string">&quot;label&quot;</span>])  <span class="hljs-comment"># Label is already an array of 0 and 1</span>`}}),Xe=new U({props:{code:`from transformers import TFAutoModelForSequenceClassification
from tensorflow.keras.optimizers import Adam

# Load and compile our model
model = TFAutoModelForSequenceClassification.from_pretrained("bert-base-cased")
# Lower learning rates are often better for fine-tuning transformers
model.compile(optimizer=Adam(3e-5))

model.fit(tokenized_data, labels)`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification
<span class="hljs-keyword">from</span> tensorflow.keras.optimizers <span class="hljs-keyword">import</span> Adam

<span class="hljs-comment"># Load and compile our model</span>
model = TFAutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)
<span class="hljs-comment"># Lower learning rates are often better for fine-tuning transformers</span>
model.<span class="hljs-built_in">compile</span>(optimizer=Adam(<span class="hljs-number">3e-5</span>))

model.fit(tokenized_data, labels)`}}),M=new Oa({props:{$$slots:{default:[ts]},$$scope:{ctx:dt}}}),Ie=new Yt({}),he=new U({props:{code:`def tokenize_dataset(data):
    # Keys of the returned dictionary will be added to the dataset as columns
    return tokenizer(data["text"])


dataset = dataset.map(tokenize_dataset)`,highlighted:`<span class="hljs-keyword">def</span> <span class="hljs-title function_">tokenize_dataset</span>(<span class="hljs-params">data</span>):
    <span class="hljs-comment"># Keys of the returned dictionary will be added to the dataset as columns</span>
    <span class="hljs-keyword">return</span> tokenizer(data[<span class="hljs-string">&quot;text&quot;</span>])


dataset = dataset.<span class="hljs-built_in">map</span>(tokenize_dataset)`}}),te=new U({props:{code:"tf_dataset = model.prepare_tf_dataset(dataset, batch_size=16, shuffle=True, tokenizer=tokenizer)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tf_dataset = model.prepare_tf_dataset(dataset, batch_size=<span class="hljs-number">16</span>, shuffle=<span class="hljs-literal">True</span>, tokenizer=tokenizer)'}}),we=new U({props:{code:`model.compile(optimizer=Adam(3e-5))

model.fit(tf_dataset)`,highlighted:`model.<span class="hljs-built_in">compile</span>(optimizer=Adam(<span class="hljs-number">3e-5</span>))

model.fit(tf_dataset)`}}),{c(){$=l("a"),P=c(),w(u.$$.fragment),A=c(),T=l("h2"),q=l("a"),O=l("span"),w(D.$$.fragment),ke=c(),be=l("span"),C=f("Keras\uB85C \uD150\uC11C\uD50C\uB85C\uC6B0 \uBAA8\uB378 \uD6C8\uB828\uD558\uAE30"),Pt=c(),X=l("p"),Rt=f("Keras API\uB97C \uC0AC\uC6A9\uD558\uC5EC \uD150\uC11C\uD50C\uB85C\uC6B0\uC5D0\uC11C \u{1F917} Transformers \uBAA8\uB378\uC744 \uD6C8\uB828\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4!"),Tt=c(),z=l("h3"),F=l("a"),Ye=l("span"),w(De.$$.fragment),Ce=c(),St=l("span"),ut=f("Keras\uC6A9 \uB370\uC774\uD130 \uB85C\uB4DC"),qt=c(),Se=l("p"),Kt=f(`Keras API\uB85C \u{1F917} Transformers \uBAA8\uB378\uC744 \uD559\uC2B5\uC2DC\uD0A4\uB824\uBA74 \uB370\uC774\uD130\uC14B\uC744 Keras\uAC00 \uC774\uD574\uD560 \uC218 \uC788\uB294 \uD615\uC2DD\uC73C\uB85C \uBCC0\uD658\uD574\uC57C \uD569\uB2C8\uB2E4.
\uB370\uC774\uD130 \uC138\uD2B8\uAC00 \uC791\uC740 \uACBD\uC6B0, \uC804\uCCB4\uB97C NumPy \uBC30\uC5F4\uB85C \uBCC0\uD658\uD558\uC5EC Keras\uB85C \uC804\uB2EC\uD558\uBA74 \uB429\uB2C8\uB2E4.
\uB354 \uBCF5\uC7A1\uD55C \uC791\uC5C5\uC744 \uC218\uD589\uD558\uAE30 \uC804\uC5D0 \uBA3C\uC800 \uC774 \uC791\uC5C5\uC744 \uC2DC\uB3C4\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4.`),Z=c(),I=l("p"),Re=f("\uBA3C\uC800 \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. "),se=l("a"),Ne=f("GLUE \uBCA4\uCE58\uB9C8\uD06C"),Q=f(`\uC758 CoLA \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uC0AC\uC6A9\uD558\uACA0\uC2B5\uB2C8\uB2E4.
\uAC04\uB2E8\uD55C \uBC14\uC774\uB108\uB9AC \uD14D\uC2A4\uD2B8 \uBD84\uB958 \uC791\uC5C5\uC774\uBBC0\uB85C \uC9C0\uAE08\uC740 \uD6C8\uB828 \uB370\uC774\uD130 \uBD84\uD560\uB9CC \uC0AC\uC6A9\uD569\uB2C8\uB2E4.`),re=c(),w(le.$$.fragment),rt=c(),Le=l("p"),Nt=f("\uB2E4\uC74C\uC73C\uB85C \uD1A0\uD06C\uB098\uC774\uC800\uB97C \uB85C\uB4DC\uD558\uACE0 \uB370\uC774\uD130\uB97C NumPy \uBC30\uC5F4\uB85C \uD1A0\uD070\uD654\uD569\uB2C8\uB2E4. \uB808\uC774\uBE14\uC740 \uC774\uBBF8 0\uACFC 1\uB85C \uB41C \uB9AC\uC2A4\uD2B8\uC774\uAE30 \uB54C\uBB38\uC5D0 \uD1A0\uD070\uD654\uD558\uC9C0 \uC54A\uACE0 \uBC14\uB85C NumPy \uBC30\uC5F4\uB85C \uBCC0\uD658\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4!"),Lt=c(),w(oe.$$.fragment),_e=c(),ne=l("p"),Oe=f("\uB9C8\uC9C0\uB9C9\uC73C\uB85C \uBAA8\uB378\uC744 \uB85C\uB4DC, "),Je=l("a"),$t=l("code"),pe=f("compile"),_t=f(", "),K=l("a"),lt=l("code"),Jt=f("fit"),zt=f("\uD569\uB2C8\uB2E4:"),B=c(),w(Xe.$$.fragment),H=c(),w(M.$$.fragment),Ee=c(),L=l("p"),ot=f(`\uC774 \uC811\uADFC \uBC29\uC2DD\uC740 \uC18C\uADDC\uBAA8 \uB370\uC774\uD130 \uC9D1\uD569\uC5D0\uC11C\uB294 \uC798 \uC791\uB3D9\uD558\uC9C0\uB9CC, \uB300\uADDC\uBAA8 \uB370\uC774\uD130 \uC9D1\uD569\uC5D0\uC11C\uB294 \uBB38\uC81C\uAC00 \uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC65C \uADF8\uB7F4\uAE4C\uC694?
\uD1A0\uD070\uD654\uB41C \uBC30\uC5F4\uACFC \uB808\uC774\uBE14\uC744 \uBA54\uBAA8\uB9AC\uC5D0 \uC644\uC804\uD788 \uB85C\uB4DC\uD558\uACE0 NumPy\uB294 \u201C\uB4E4\uCB49\uB0A0\uCB49\uD55C\u201D \uBC30\uC5F4\uC744 \uCC98\uB9AC\uD558\uC9C0 \uC54A\uAE30 \uB54C\uBB38\uC5D0,
\uBAA8\uB4E0 \uD1A0\uD070\uD654\uB41C \uC0D8\uD50C\uC744 \uC804\uCCB4 \uB370\uC774\uD130\uC14B\uC5D0\uC11C \uAC00\uC7A5 \uAE34 \uC0D8\uD50C\uC758 \uAE38\uC774\uB9CC\uD07C \uD328\uB529\uD574\uC57C \uD569\uB2C8\uB2E4. \uC774\uB807\uAC8C \uD558\uBA74 \uBC30\uC5F4\uC774 \uD6E8\uC52C \uB354 \uCEE4\uC9C0\uACE0 \uC774 \uD328\uB529 \uD1A0\uD070\uC73C\uB85C \uC778\uD574 \uD559\uC2B5 \uC18D\uB3C4\uB3C4 \uB290\uB824\uC9D1\uB2C8\uB2E4!`),nt=c(),V=l("h3"),ie=l("a"),je=l("span"),w(Ie.$$.fragment),Ot=c(),x=l("span"),Me=f("\uB370\uC774\uD130\uB97C tf.data.Dataset\uC73C\uB85C \uB85C\uB4DC\uD558\uAE30"),pt=c(),fe=l("p"),vt=f("\uD559\uC2B5 \uC18D\uB3C4\uAC00 \uB290\uB824\uC9C0\uB294 \uAC83\uC744 \uD53C\uD558\uB824\uBA74 \uB370\uC774\uD130\uB97C "),G=l("code"),Ze=f("tf.data.Dataset"),W=f(`\uC73C\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC6D0\uD55C\uB2E4\uBA74 \uC9C1\uC811
`),ee=l("code"),It=f("tf.data"),me=f(" \uD30C\uC774\uD504\uB77C\uC778\uC744 \uC9C1\uC811 \uC791\uC131\uD560 \uC218\uB3C4 \uC788\uC9C0\uB9CC, \uC774 \uC791\uC5C5\uC744 \uAC04\uD3B8\uD558\uAC8C \uC218\uD589\uD558\uB294 \uC218 \uC788\uB294 \uB450 \uAC00\uC9C0 \uBC29\uBC95\uC774 \uC788\uC2B5\uB2C8\uB2E4:"),xt=c(),ye=l("ul"),Qe=l("li"),it=l("code"),Ve=f("prepare_tf_dataset()"),ft=f(`: \uB300\uBD80\uBD84\uC758 \uACBD\uC6B0 \uC774 \uBC29\uBC95\uC744 \uAD8C\uC7A5\uD569\uB2C8\uB2E4. \uBAA8\uB378\uC758 \uBA54\uC11C\uB4DC\uC774\uAE30 \uB54C\uBB38\uC5D0 \uBAA8\uB378\uC744 \uAC80\uC0AC\uD558\uC5EC \uBAA8\uB378 \uC785\uB825\uC73C\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC788\uB294 \uC5F4\uC744 \uC790\uB3D9\uC73C\uB85C \uD30C\uC545\uD558\uACE0
\uB098\uBA38\uC9C0\uB294 \uBC84\uB824\uC11C \uB354 \uB2E8\uC21C\uD558\uACE0 \uC131\uB2A5\uC774 \uC88B\uC740 \uB370\uC774\uD130 \uC9D1\uD569\uC744 \uB9CC\uB4E4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),ve=c(),Ae=l("li"),Dt=l("code"),Fe=f("to_tf_dataset"),ce=f(`: \uC774 \uBC29\uBC95\uC740 \uC880 \uB354 \uB0AE\uC740 \uC218\uC900\uC774\uBA70, \uD3EC\uD568\uD560 \u2018\uC5F4\u2019\uACFC \u2018\uB808\uC774\uBE14\u2019\uC744 \uC815\uD655\uD788 \uC9C0\uC815\uD558\uC5EC
\uB370\uC774\uD130\uC14B\uC744 \uC0DD\uC131\uD558\uB294 \uBC29\uBC95\uC744 \uC815\uD655\uD788 \uC81C\uC5B4\uD558\uACE0 \uC2F6\uC744 \uB54C \uC720\uC6A9\uD558\uBA70, \uD3EC\uD568\uD560 \u2018columns\u2019\uACFC \u2018label_cols\u2019\uC744 \uC815\uD655\uD788 \uC9C0\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),Pe=c(),S=l("p"),Te=l("code"),gt=f("prepare_tf_dataset()"),Xt=f("\uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 \uBA3C\uC800 \uB2E4\uC74C \uCF54\uB4DC \uC0D8\uD50C\uACFC \uAC19\uC774 \uD1A0\uD06C\uB098\uC774\uC800 \uCD9C\uB825\uC744 \uB370\uC774\uD130 \uC138\uD2B8\uC5D0 \uC5F4\uB85C \uCD94\uAC00\uD574\uC57C \uD569\uB2C8\uB2E4:"),wt=c(),w(he.$$.fragment),et=c(),ge=l("p"),kt=f(`\uD5C8\uAE45 \uD398\uC774\uC2A4 \uB370\uC774\uD130\uC14B\uC740 \uAE30\uBCF8\uC801\uC73C\uB85C \uB514\uC2A4\uD06C\uC5D0 \uC800\uC7A5\uB418\uBBC0\uB85C \uBA54\uBAA8\uB9AC \uC0AC\uC6A9\uB7C9\uC744 \uB298\uB9AC\uC9C0 \uC54A\uB294\uB2E4\uB294 \uC810\uC744 \uAE30\uC5B5\uD558\uC138\uC694!
\uC5F4\uC774 \uCD94\uAC00\uB418\uBA74 \uB370\uC774\uD130\uC14B\uC5D0\uC11C \uBC30\uCE58\uB97C \uC2A4\uD2B8\uB9AC\uBC0D\uD558\uACE0 \uAC01 \uBC30\uCE58\uC5D0 \uD328\uB529\uC744 \uCD94\uAC00\uD560 \uC218 \uC788\uC73C\uBBC0\uB85C \uC804\uCCB4 \uB370\uC774\uD130\uC14B\uC5D0 \uD328\uB529\uC744 \uCD94\uAC00\uD558\uB294 \uAC83\uBCF4\uB2E4 \uD328\uB529 \uD1A0\uD070\uC758 \uC218\uB97C \uD06C\uAC8C \uC904\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),Ke=c(),w(te.$$.fragment),ae=c(),N=l("p"),de=f("\uC704\uC758 \uCF54\uB4DC \uC0D8\uD50C\uC5D0\uC11C\uB294 \uBC30\uCE58\uAC00 \uB85C\uB4DC\uB420 \uB54C \uC62C\uBC14\uB974\uAC8C \uD328\uB529\uD560 \uC218 \uC788\uB3C4\uB85D "),mt=l("code"),ct=f("prepare_tf_dataset"),Ht=f(`\uC5D0 \uD1A0\uD06C\uB098\uC774\uC800\uB97C \uC804\uB2EC\uD574\uC57C \uD569\uB2C8\uB2E4.
\uB370\uC774\uD130\uC14B\uC758 \uBAA8\uB4E0 \uC0D8\uD50C \uAE38\uC774\uAC00 \uAC19\uACE0 \uD328\uB529\uC774 \uD544\uC694\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0 \uC774 \uC778\uC218\uB97C \uAC74\uB108\uB6F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
\uC0D8\uD50C\uC744 \uCC44\uC6B0\uB294 \uAC83\uBCF4\uB2E4 \uB354 \uBCF5\uC7A1\uD55C \uC791\uC5C5(\uC608: \uB9C8\uC2A4\uD0B9\uB41C \uC5B8\uC5B4\uC758 \uD1A0\uD070 \uC190\uC0C1 \uBAA8\uB378\uB9C1)\uC744 \uC218\uD589\uD558\uAE30 \uC704\uD574 \uD1A0\uD070\uC744 \uC190\uC0C1\uC2DC\uCF1C\uC57C \uD558\uB294 \uACBD\uC6B0,
`),tt=l("code"),He=f("collate_fn"),ue=f(` \uC778\uC218\uB97C \uC0AC\uC6A9\uD558\uC5EC \uC0D8\uD50C \uBAA9\uB85D\uC744 \uBC30\uCE58\uB85C \uBCC0\uD658\uD558\uACE0 \uC6D0\uD558\uB294 \uC804\uCC98\uB9AC\uB97C \uC801\uC6A9\uD560 \uD568\uC218\uB97C \uC804\uB2EC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
`),Y=l("a"),R=f("\uC608\uC2DC"),qe=f(` \uB610\uB294
`),J=l("a"),bt=f("\uB178\uD2B8\uBD81"),Ut=f("\uC744 \uCC38\uC870\uD558\uC5EC \uC774 \uC811\uADFC \uBC29\uC2DD\uC774 \uC2E4\uC81C\uB85C \uC791\uB3D9\uD558\uB294 \uBAA8\uC2B5\uC744 \uD655\uC778\uD558\uC138\uC694."),ze=c(),at=l("p"),$e=l("code"),xe=f("tf.data.Dataset"),Zt=f("\uC744 \uC0DD\uC131\uD55C \uD6C4\uC5D0\uB294 \uC774\uC804\uACFC \uB9C8\uCC2C\uAC00\uC9C0\uB85C \uBAA8\uB378\uC744 \uCEF4\uD30C\uC77C\uD558\uACE0 \uD6C8\uB828(fit)\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),Et=c(),w(we.$$.fragment),this.h()},l(a){$=o(a,"A",{id:!0}),n($).forEach(e),P=h(a),k(u.$$.fragment,a),A=h(a),T=o(a,"H2",{class:!0});var _=n(T);q=o(_,"A",{id:!0,class:!0,href:!0});var Ue=n(q);O=o(Ue,"SPAN",{});var Be=n(O);k(D.$$.fragment,Be),Be.forEach(e),Ue.forEach(e),ke=h(_),be=o(_,"SPAN",{});var la=n(be);C=m(la,"Keras\uB85C \uD150\uC11C\uD50C\uB85C\uC6B0 \uBAA8\uB378 \uD6C8\uB828\uD558\uAE30"),la.forEach(e),_.forEach(e),Pt=h(a),X=o(a,"P",{});var Mt=n(X);Rt=m(Mt,"Keras API\uB97C \uC0AC\uC6A9\uD558\uC5EC \uD150\uC11C\uD50C\uB85C\uC6B0\uC5D0\uC11C \u{1F917} Transformers \uBAA8\uB378\uC744 \uD6C8\uB828\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4!"),Mt.forEach(e),Tt=h(a),z=o(a,"H3",{class:!0});var jt=n(z);F=o(jt,"A",{id:!0,class:!0,href:!0});var Bt=n(F);Ye=o(Bt,"SPAN",{});var ht=n(Ye);k(De.$$.fragment,ht),ht.forEach(e),Bt.forEach(e),Ce=h(jt),St=o(jt,"SPAN",{});var yt=n(St);ut=m(yt,"Keras\uC6A9 \uB370\uC774\uD130 \uB85C\uB4DC"),yt.forEach(e),jt.forEach(e),qt=h(a),Se=o(a,"P",{});var ta=n(Se);Kt=m(ta,`Keras API\uB85C \u{1F917} Transformers \uBAA8\uB378\uC744 \uD559\uC2B5\uC2DC\uD0A4\uB824\uBA74 \uB370\uC774\uD130\uC14B\uC744 Keras\uAC00 \uC774\uD574\uD560 \uC218 \uC788\uB294 \uD615\uC2DD\uC73C\uB85C \uBCC0\uD658\uD574\uC57C \uD569\uB2C8\uB2E4.
\uB370\uC774\uD130 \uC138\uD2B8\uAC00 \uC791\uC740 \uACBD\uC6B0, \uC804\uCCB4\uB97C NumPy \uBC30\uC5F4\uB85C \uBCC0\uD658\uD558\uC5EC Keras\uB85C \uC804\uB2EC\uD558\uBA74 \uB429\uB2C8\uB2E4.
\uB354 \uBCF5\uC7A1\uD55C \uC791\uC5C5\uC744 \uC218\uD589\uD558\uAE30 \uC804\uC5D0 \uBA3C\uC800 \uC774 \uC791\uC5C5\uC744 \uC2DC\uB3C4\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4.`),ta.forEach(e),Z=h(a),I=o(a,"P",{});var p=n(I);Re=m(p,"\uBA3C\uC800 \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. "),se=o(p,"A",{href:!0,rel:!0});var g=n(se);Ne=m(g,"GLUE \uBCA4\uCE58\uB9C8\uD06C"),g.forEach(e),Q=m(p,`\uC758 CoLA \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uC0AC\uC6A9\uD558\uACA0\uC2B5\uB2C8\uB2E4.
\uAC04\uB2E8\uD55C \uBC14\uC774\uB108\uB9AC \uD14D\uC2A4\uD2B8 \uBD84\uB958 \uC791\uC5C5\uC774\uBBC0\uB85C \uC9C0\uAE08\uC740 \uD6C8\uB828 \uB370\uC774\uD130 \uBD84\uD560\uB9CC \uC0AC\uC6A9\uD569\uB2C8\uB2E4.`),p.forEach(e),re=h(a),k(le.$$.fragment,a),rt=h(a),Le=o(a,"P",{});var Qt=n(Le);Nt=m(Qt,"\uB2E4\uC74C\uC73C\uB85C \uD1A0\uD06C\uB098\uC774\uC800\uB97C \uB85C\uB4DC\uD558\uACE0 \uB370\uC774\uD130\uB97C NumPy \uBC30\uC5F4\uB85C \uD1A0\uD070\uD654\uD569\uB2C8\uB2E4. \uB808\uC774\uBE14\uC740 \uC774\uBBF8 0\uACFC 1\uB85C \uB41C \uB9AC\uC2A4\uD2B8\uC774\uAE30 \uB54C\uBB38\uC5D0 \uD1A0\uD070\uD654\uD558\uC9C0 \uC54A\uACE0 \uBC14\uB85C NumPy \uBC30\uC5F4\uB85C \uBCC0\uD658\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4!"),Qt.forEach(e),Lt=h(a),k(oe.$$.fragment,a),_e=h(a),ne=o(a,"P",{});var Gt=n(ne);Oe=m(Gt,"\uB9C8\uC9C0\uB9C9\uC73C\uB85C \uBAA8\uB378\uC744 \uB85C\uB4DC, "),Je=o(Gt,"A",{href:!0,rel:!0});var oa=n(Je);$t=o(oa,"CODE",{});var Ge=n($t);pe=m(Ge,"compile"),Ge.forEach(e),oa.forEach(e),_t=m(Gt,", "),K=o(Gt,"A",{href:!0,rel:!0});var na=n(K);lt=o(na,"CODE",{});var s=n(lt);Jt=m(s,"fit"),s.forEach(e),na.forEach(e),zt=m(Gt,"\uD569\uB2C8\uB2E4:"),Gt.forEach(e),B=h(a),k(Xe.$$.fragment,a),H=h(a),k(M.$$.fragment,a),Ee=h(a),L=o(a,"P",{});var v=n(L);ot=m(v,`\uC774 \uC811\uADFC \uBC29\uC2DD\uC740 \uC18C\uADDC\uBAA8 \uB370\uC774\uD130 \uC9D1\uD569\uC5D0\uC11C\uB294 \uC798 \uC791\uB3D9\uD558\uC9C0\uB9CC, \uB300\uADDC\uBAA8 \uB370\uC774\uD130 \uC9D1\uD569\uC5D0\uC11C\uB294 \uBB38\uC81C\uAC00 \uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC65C \uADF8\uB7F4\uAE4C\uC694?
\uD1A0\uD070\uD654\uB41C \uBC30\uC5F4\uACFC \uB808\uC774\uBE14\uC744 \uBA54\uBAA8\uB9AC\uC5D0 \uC644\uC804\uD788 \uB85C\uB4DC\uD558\uACE0 NumPy\uB294 \u201C\uB4E4\uCB49\uB0A0\uCB49\uD55C\u201D \uBC30\uC5F4\uC744 \uCC98\uB9AC\uD558\uC9C0 \uC54A\uAE30 \uB54C\uBB38\uC5D0,
\uBAA8\uB4E0 \uD1A0\uD070\uD654\uB41C \uC0D8\uD50C\uC744 \uC804\uCCB4 \uB370\uC774\uD130\uC14B\uC5D0\uC11C \uAC00\uC7A5 \uAE34 \uC0D8\uD50C\uC758 \uAE38\uC774\uB9CC\uD07C \uD328\uB529\uD574\uC57C \uD569\uB2C8\uB2E4. \uC774\uB807\uAC8C \uD558\uBA74 \uBC30\uC5F4\uC774 \uD6E8\uC52C \uB354 \uCEE4\uC9C0\uACE0 \uC774 \uD328\uB529 \uD1A0\uD070\uC73C\uB85C \uC778\uD574 \uD559\uC2B5 \uC18D\uB3C4\uB3C4 \uB290\uB824\uC9D1\uB2C8\uB2E4!`),v.forEach(e),nt=h(a),V=o(a,"H3",{class:!0});var Wt=n(V);ie=o(Wt,"A",{id:!0,class:!0,href:!0});var pa=n(ie);je=o(pa,"SPAN",{});var ia=n(je);k(Ie.$$.fragment,ia),ia.forEach(e),pa.forEach(e),Ot=h(Wt),x=o(Wt,"SPAN",{});var Vt=n(x);Me=m(Vt,"\uB370\uC774\uD130\uB97C tf.data.Dataset\uC73C\uB85C \uB85C\uB4DC\uD558\uAE30"),Vt.forEach(e),Wt.forEach(e),pt=h(a),fe=o(a,"P",{});var Ft=n(fe);vt=m(Ft,"\uD559\uC2B5 \uC18D\uB3C4\uAC00 \uB290\uB824\uC9C0\uB294 \uAC83\uC744 \uD53C\uD558\uB824\uBA74 \uB370\uC774\uD130\uB97C "),G=o(Ft,"CODE",{});var ea=n(G);Ze=m(ea,"tf.data.Dataset"),ea.forEach(e),W=m(Ft,`\uC73C\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC6D0\uD55C\uB2E4\uBA74 \uC9C1\uC811
`),ee=o(Ft,"CODE",{});var ua=n(ee);It=m(ua,"tf.data"),ua.forEach(e),me=m(Ft," \uD30C\uC774\uD504\uB77C\uC778\uC744 \uC9C1\uC811 \uC791\uC131\uD560 \uC218\uB3C4 \uC788\uC9C0\uB9CC, \uC774 \uC791\uC5C5\uC744 \uAC04\uD3B8\uD558\uAC8C \uC218\uD589\uD558\uB294 \uC218 \uC788\uB294 \uB450 \uAC00\uC9C0 \uBC29\uBC95\uC774 \uC788\uC2B5\uB2C8\uB2E4:"),Ft.forEach(e),xt=h(a),ye=o(a,"UL",{});var At=n(ye);Qe=o(At,"LI",{});var Ct=n(Qe);it=o(Ct,"CODE",{});var $a=n(it);Ve=m($a,"prepare_tf_dataset()"),$a.forEach(e),ft=m(Ct,`: \uB300\uBD80\uBD84\uC758 \uACBD\uC6B0 \uC774 \uBC29\uBC95\uC744 \uAD8C\uC7A5\uD569\uB2C8\uB2E4. \uBAA8\uB378\uC758 \uBA54\uC11C\uB4DC\uC774\uAE30 \uB54C\uBB38\uC5D0 \uBAA8\uB378\uC744 \uAC80\uC0AC\uD558\uC5EC \uBAA8\uB378 \uC785\uB825\uC73C\uB85C \uC0AC\uC6A9\uD560 \uC218 \uC788\uB294 \uC5F4\uC744 \uC790\uB3D9\uC73C\uB85C \uD30C\uC545\uD558\uACE0
\uB098\uBA38\uC9C0\uB294 \uBC84\uB824\uC11C \uB354 \uB2E8\uC21C\uD558\uACE0 \uC131\uB2A5\uC774 \uC88B\uC740 \uB370\uC774\uD130 \uC9D1\uD569\uC744 \uB9CC\uB4E4 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),Ct.forEach(e),ve=h(At),Ae=o(At,"LI",{});var aa=n(Ae);Dt=o(aa,"CODE",{});var fa=n(Dt);Fe=m(fa,"to_tf_dataset"),fa.forEach(e),ce=m(aa,`: \uC774 \uBC29\uBC95\uC740 \uC880 \uB354 \uB0AE\uC740 \uC218\uC900\uC774\uBA70, \uD3EC\uD568\uD560 \u2018\uC5F4\u2019\uACFC \u2018\uB808\uC774\uBE14\u2019\uC744 \uC815\uD655\uD788 \uC9C0\uC815\uD558\uC5EC
\uB370\uC774\uD130\uC14B\uC744 \uC0DD\uC131\uD558\uB294 \uBC29\uBC95\uC744 \uC815\uD655\uD788 \uC81C\uC5B4\uD558\uACE0 \uC2F6\uC744 \uB54C \uC720\uC6A9\uD558\uBA70, \uD3EC\uD568\uD560 \u2018columns\u2019\uACFC \u2018label_cols\u2019\uC744 \uC815\uD655\uD788 \uC9C0\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),aa.forEach(e),At.forEach(e),Pe=h(a),S=o(a,"P",{});var sa=n(S);Te=o(sa,"CODE",{});var _a=n(Te);gt=m(_a,"prepare_tf_dataset()"),_a.forEach(e),Xt=m(sa,"\uC744 \uC0AC\uC6A9\uD558\uB824\uBA74 \uBA3C\uC800 \uB2E4\uC74C \uCF54\uB4DC \uC0D8\uD50C\uACFC \uAC19\uC774 \uD1A0\uD06C\uB098\uC774\uC800 \uCD9C\uB825\uC744 \uB370\uC774\uD130 \uC138\uD2B8\uC5D0 \uC5F4\uB85C \uCD94\uAC00\uD574\uC57C \uD569\uB2C8\uB2E4:"),sa.forEach(e),wt=h(a),k(he.$$.fragment,a),et=h(a),ge=o(a,"P",{});var We=n(ge);kt=m(We,`\uD5C8\uAE45 \uD398\uC774\uC2A4 \uB370\uC774\uD130\uC14B\uC740 \uAE30\uBCF8\uC801\uC73C\uB85C \uB514\uC2A4\uD06C\uC5D0 \uC800\uC7A5\uB418\uBBC0\uB85C \uBA54\uBAA8\uB9AC \uC0AC\uC6A9\uB7C9\uC744 \uB298\uB9AC\uC9C0 \uC54A\uB294\uB2E4\uB294 \uC810\uC744 \uAE30\uC5B5\uD558\uC138\uC694!
\uC5F4\uC774 \uCD94\uAC00\uB418\uBA74 \uB370\uC774\uD130\uC14B\uC5D0\uC11C \uBC30\uCE58\uB97C \uC2A4\uD2B8\uB9AC\uBC0D\uD558\uACE0 \uAC01 \uBC30\uCE58\uC5D0 \uD328\uB529\uC744 \uCD94\uAC00\uD560 \uC218 \uC788\uC73C\uBBC0\uB85C \uC804\uCCB4 \uB370\uC774\uD130\uC14B\uC5D0 \uD328\uB529\uC744 \uCD94\uAC00\uD558\uB294 \uAC83\uBCF4\uB2E4 \uD328\uB529 \uD1A0\uD070\uC758 \uC218\uB97C \uD06C\uAC8C \uC904\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.`),We.forEach(e),Ke=h(a),k(te.$$.fragment,a),ae=h(a),N=o(a,"P",{});var st=n(N);de=m(st,"\uC704\uC758 \uCF54\uB4DC \uC0D8\uD50C\uC5D0\uC11C\uB294 \uBC30\uCE58\uAC00 \uB85C\uB4DC\uB420 \uB54C \uC62C\uBC14\uB974\uAC8C \uD328\uB529\uD560 \uC218 \uC788\uB3C4\uB85D "),mt=o(st,"CODE",{});var ma=n(mt);ct=m(ma,"prepare_tf_dataset"),ma.forEach(e),Ht=m(st,`\uC5D0 \uD1A0\uD06C\uB098\uC774\uC800\uB97C \uC804\uB2EC\uD574\uC57C \uD569\uB2C8\uB2E4.
\uB370\uC774\uD130\uC14B\uC758 \uBAA8\uB4E0 \uC0D8\uD50C \uAE38\uC774\uAC00 \uAC19\uACE0 \uD328\uB529\uC774 \uD544\uC694\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0 \uC774 \uC778\uC218\uB97C \uAC74\uB108\uB6F8 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
\uC0D8\uD50C\uC744 \uCC44\uC6B0\uB294 \uAC83\uBCF4\uB2E4 \uB354 \uBCF5\uC7A1\uD55C \uC791\uC5C5(\uC608: \uB9C8\uC2A4\uD0B9\uB41C \uC5B8\uC5B4\uC758 \uD1A0\uD070 \uC190\uC0C1 \uBAA8\uB378\uB9C1)\uC744 \uC218\uD589\uD558\uAE30 \uC704\uD574 \uD1A0\uD070\uC744 \uC190\uC0C1\uC2DC\uCF1C\uC57C \uD558\uB294 \uACBD\uC6B0,
`),tt=o(st,"CODE",{});var va=n(tt);He=m(va,"collate_fn"),va.forEach(e),ue=m(st,` \uC778\uC218\uB97C \uC0AC\uC6A9\uD558\uC5EC \uC0D8\uD50C \uBAA9\uB85D\uC744 \uBC30\uCE58\uB85C \uBCC0\uD658\uD558\uACE0 \uC6D0\uD558\uB294 \uC804\uCC98\uB9AC\uB97C \uC801\uC6A9\uD560 \uD568\uC218\uB97C \uC804\uB2EC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.
`),Y=o(st,"A",{href:!0,rel:!0});var ha=n(Y);R=m(ha,"\uC608\uC2DC"),ha.forEach(e),qe=m(st,` \uB610\uB294
`),J=o(st,"A",{href:!0,rel:!0});var ga=n(J);bt=m(ga,"\uB178\uD2B8\uBD81"),ga.forEach(e),Ut=m(st,"\uC744 \uCC38\uC870\uD558\uC5EC \uC774 \uC811\uADFC \uBC29\uC2DD\uC774 \uC2E4\uC81C\uB85C \uC791\uB3D9\uD558\uB294 \uBAA8\uC2B5\uC744 \uD655\uC778\uD558\uC138\uC694."),st.forEach(e),ze=h(a),at=o(a,"P",{});var da=n(at);$e=o(da,"CODE",{});var ra=n($e);xe=m(ra,"tf.data.Dataset"),ra.forEach(e),Zt=m(da,"\uC744 \uC0DD\uC131\uD55C \uD6C4\uC5D0\uB294 \uC774\uC804\uACFC \uB9C8\uCC2C\uAC00\uC9C0\uB85C \uBAA8\uB378\uC744 \uCEF4\uD30C\uC77C\uD558\uACE0 \uD6C8\uB828(fit)\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),da.forEach(e),Et=h(a),k(we.$$.fragment,a),this.h()},h(){d($,"id","keras"),d(q,"id","train-a-tensorflow-model-with-keras"),d(q,"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(q,"href","#train-a-tensorflow-model-with-keras"),d(T,"class","relative group"),d(F,"id","loading-data-for-keras"),d(F,"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(F,"href","#loading-data-for-keras"),d(z,"class","relative group"),d(se,"href","https://huggingface.co/datasets/glue"),d(se,"rel","nofollow"),d(Je,"href","https://keras.io/api/models/model_training_apis/#compile-method"),d(Je,"rel","nofollow"),d(K,"href","https://keras.io/api/models/model_training_apis/#fit-method"),d(K,"rel","nofollow"),d(ie,"id","loading-data-as-a-tfdatadataset"),d(ie,"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(ie,"href","#loading-data-as-a-tfdatadataset"),d(V,"class","relative group"),d(Y,"href","https://github.com/huggingface/transformers/tree/main/examples"),d(Y,"rel","nofollow"),d(J,"href","https://huggingface.co/docs/transformers/notebooks"),d(J,"rel","nofollow")},m(a,_){i(a,$,_),i(a,P,_),b(u,a,_),i(a,A,_),i(a,T,_),t(T,q),t(q,O),b(D,O,null),t(T,ke),t(T,be),t(be,C),i(a,Pt,_),i(a,X,_),t(X,Rt),i(a,Tt,_),i(a,z,_),t(z,F),t(F,Ye),b(De,Ye,null),t(z,Ce),t(z,St),t(St,ut),i(a,qt,_),i(a,Se,_),t(Se,Kt),i(a,Z,_),i(a,I,_),t(I,Re),t(I,se),t(se,Ne),t(I,Q),i(a,re,_),b(le,a,_),i(a,rt,_),i(a,Le,_),t(Le,Nt),i(a,Lt,_),b(oe,a,_),i(a,_e,_),i(a,ne,_),t(ne,Oe),t(ne,Je),t(Je,$t),t($t,pe),t(ne,_t),t(ne,K),t(K,lt),t(lt,Jt),t(ne,zt),i(a,B,_),b(Xe,a,_),i(a,H,_),b(M,a,_),i(a,Ee,_),i(a,L,_),t(L,ot),i(a,nt,_),i(a,V,_),t(V,ie),t(ie,je),b(Ie,je,null),t(V,Ot),t(V,x),t(x,Me),i(a,pt,_),i(a,fe,_),t(fe,vt),t(fe,G),t(G,Ze),t(fe,W),t(fe,ee),t(ee,It),t(fe,me),i(a,xt,_),i(a,ye,_),t(ye,Qe),t(Qe,it),t(it,Ve),t(Qe,ft),t(ye,ve),t(ye,Ae),t(Ae,Dt),t(Dt,Fe),t(Ae,ce),i(a,Pe,_),i(a,S,_),t(S,Te),t(Te,gt),t(S,Xt),i(a,wt,_),b(he,a,_),i(a,et,_),i(a,ge,_),t(ge,kt),i(a,Ke,_),b(te,a,_),i(a,ae,_),i(a,N,_),t(N,de),t(N,mt),t(mt,ct),t(N,Ht),t(N,tt),t(tt,He),t(N,ue),t(N,Y),t(Y,R),t(N,qe),t(N,J),t(J,bt),t(N,Ut),i(a,ze,_),i(a,at,_),t(at,$e),t($e,xe),t(at,Zt),i(a,Et,_),b(we,a,_),r=!0},p(a,_){const Ue={};_&2&&(Ue.$$scope={dirty:_,ctx:a}),M.$set(Ue)},i(a){r||(E(u.$$.fragment,a),E(D.$$.fragment,a),E(De.$$.fragment,a),E(le.$$.fragment,a),E(oe.$$.fragment,a),E(Xe.$$.fragment,a),E(M.$$.fragment,a),E(Ie.$$.fragment,a),E(he.$$.fragment,a),E(te.$$.fragment,a),E(we.$$.fragment,a),r=!0)},o(a){j(u.$$.fragment,a),j(D.$$.fragment,a),j(De.$$.fragment,a),j(le.$$.fragment,a),j(oe.$$.fragment,a),j(Xe.$$.fragment,a),j(M.$$.fragment,a),j(Ie.$$.fragment,a),j(he.$$.fragment,a),j(te.$$.fragment,a),j(we.$$.fragment,a),r=!1},d(a){a&&e($),a&&e(P),y(u,a),a&&e(A),a&&e(T),y(D),a&&e(Pt),a&&e(X),a&&e(Tt),a&&e(z),y(De),a&&e(qt),a&&e(Se),a&&e(Z),a&&e(I),a&&e(re),y(le,a),a&&e(rt),a&&e(Le),a&&e(Lt),y(oe,a),a&&e(_e),a&&e(ne),a&&e(B),y(Xe,a),a&&e(H),y(M,a),a&&e(Ee),a&&e(L),a&&e(nt),a&&e(V),y(Ie),a&&e(pt),a&&e(fe),a&&e(xt),a&&e(ye),a&&e(Pe),a&&e(S),a&&e(wt),y(he,a),a&&e(et),a&&e(ge),a&&e(Ke),y(te,a),a&&e(ae),a&&e(N),a&&e(ze),a&&e(at),a&&e(Et),y(we,a)}}}function ss(dt){let $,P;return $=new Ia({props:{$$slots:{default:[as]},$$scope:{ctx:dt}}}),{c(){w($.$$.fragment)},l(u){k($.$$.fragment,u)},m(u,A){b($,u,A),P=!0},p(u,A){const T={};A&2&&(T.$$scope={dirty:A,ctx:u}),$.$set(T)},i(u){P||(E($.$$.fragment,u),P=!0)},o(u){j($.$$.fragment,u),P=!1},d(u){y($,u)}}}function rs(dt){let $,P,u,A,T,q,O;return{c(){$=l("p"),P=l("a"),u=f("Colaboratory"),A=f(" \uB610\uB294 "),T=l("a"),q=f("SageMaker StudioLab"),O=f("\uACFC \uAC19\uC740 \uD638\uC2A4\uD305 \uB178\uD2B8\uBD81\uC774 \uC5C6\uB294 \uACBD\uC6B0 \uD074\uB77C\uC6B0\uB4DC GPU\uC5D0 \uBB34\uB8CC\uB85C \uC561\uC138\uC2A4\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),this.h()},l(D){$=o(D,"P",{});var ke=n($);P=o(ke,"A",{href:!0,rel:!0});var be=n(P);u=m(be,"Colaboratory"),be.forEach(e),A=m(ke," \uB610\uB294 "),T=o(ke,"A",{href:!0,rel:!0});var C=n(T);q=m(C,"SageMaker StudioLab"),C.forEach(e),O=m(ke,"\uACFC \uAC19\uC740 \uD638\uC2A4\uD305 \uB178\uD2B8\uBD81\uC774 \uC5C6\uB294 \uACBD\uC6B0 \uD074\uB77C\uC6B0\uB4DC GPU\uC5D0 \uBB34\uB8CC\uB85C \uC561\uC138\uC2A4\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),ke.forEach(e),this.h()},h(){d(P,"href","https://colab.research.google.com/"),d(P,"rel","nofollow"),d(T,"href","https://studiolab.sagemaker.aws/"),d(T,"rel","nofollow")},m(D,ke){i(D,$,ke),t($,P),t(P,u),t($,A),t($,T),t(T,q),t($,O)},d(D){D&&e($)}}}function ls(dt){let $,P,u,A,T,q,O,D,ke,be,C,Pt,X,Rt,Tt,z,F,Ye,De,Ce,St,ut,qt,Se,Kt,Z,I,Re,se,Ne,Q,re,le,rt,Le,Nt,Lt,oe,_e,ne,Oe,Je,$t,pe,_t,K,lt,Jt,zt,B,Xe,H,M,Ee,L,ot,nt,V,ie,je,Ie,Ot,x,Me,pt,fe,vt,G,Ze,W,ee,It,me,xt,ye,Qe,it,Ve,ft,ve,Ae,Dt,Fe,ce,Pe,S,Te,gt,Xt,wt,he,et,ge,kt,Ke,te,ae,N,de,mt,ct,Ht,tt,He,ue,Y,R,qe,J,bt,Ut,ze,at,$e,xe,Zt,Et,we,r,a,_,Ue,Be,la,Mt,jt,Bt,ht,yt,ta,p,g,Qt,Gt,oa,Ge,na;return $=new La({props:{id:"Dh9CL8fyG80"}}),C=new U({props:{code:`del model
del trainer
torch.cuda.empty_cache()`,highlighted:`<span class="hljs-keyword">del</span> model
<span class="hljs-keyword">del</span> trainer
torch.cuda.empty_cache()`}}),Se=new U({props:{code:'tokenized_datasets = tokenized_datasets.remove_columns(["text"])',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_datasets = tokenized_datasets.remove_columns([<span class="hljs-string">&quot;text&quot;</span>])'}}),_e=new U({props:{code:'tokenized_datasets = tokenized_datasets.rename_column("label", "labels")',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_datasets = tokenized_datasets.rename_column(<span class="hljs-string">&quot;label&quot;</span>, <span class="hljs-string">&quot;labels&quot;</span>)'}}),_t=new U({props:{code:'tokenized_datasets.set_format("torch")',highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_datasets.set_format(<span class="hljs-string">&quot;torch&quot;</span>)'}}),B=new U({props:{code:`small_train_dataset = tokenized_datasets["train"].shuffle(seed=42).select(range(1000))
small_eval_dataset = tokenized_datasets["test"].shuffle(seed=42).select(range(1000))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>small_train_dataset = tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>].shuffle(seed=<span class="hljs-number">42</span>).select(<span class="hljs-built_in">range</span>(<span class="hljs-number">1000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>small_eval_dataset = tokenized_datasets[<span class="hljs-string">&quot;test&quot;</span>].shuffle(seed=<span class="hljs-number">42</span>).select(<span class="hljs-built_in">range</span>(<span class="hljs-number">1000</span>))`}}),L=new Yt({}),x=new U({props:{code:`from torch.utils.data import DataLoader

train_dataloader = DataLoader(small_train_dataset, shuffle=True, batch_size=8)
eval_dataloader = DataLoader(small_eval_dataset, batch_size=8)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> torch.utils.data <span class="hljs-keyword">import</span> DataLoader

<span class="hljs-meta">&gt;&gt;&gt; </span>train_dataloader = DataLoader(small_train_dataset, shuffle=<span class="hljs-literal">True</span>, batch_size=<span class="hljs-number">8</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>eval_dataloader = DataLoader(small_eval_dataset, batch_size=<span class="hljs-number">8</span>)`}}),G=new U({props:{code:`from transformers import AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained("bert-base-cased", num_labels=5)`,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;bert-base-cased&quot;</span>, num_labels=<span class="hljs-number">5</span>)`}}),me=new Yt({}),Pe=new U({props:{code:`from torch.optim import AdamW

optimizer = AdamW(model.parameters(), lr=5e-5)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> torch.optim <span class="hljs-keyword">import</span> AdamW

<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer = AdamW(model.parameters(), lr=<span class="hljs-number">5e-5</span>)`}}),et=new U({props:{code:`from transformers import get_scheduler

num_epochs = 3
num_training_steps = num_epochs * len(train_dataloader)
lr_scheduler = get_scheduler(
    name="linear", optimizer=optimizer, num_warmup_steps=0, num_training_steps=num_training_steps
)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> get_scheduler

<span class="hljs-meta">&gt;&gt;&gt; </span>num_epochs = <span class="hljs-number">3</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_training_steps = num_epochs * <span class="hljs-built_in">len</span>(train_dataloader)
<span class="hljs-meta">&gt;&gt;&gt; </span>lr_scheduler = get_scheduler(
<span class="hljs-meta">... </span>    name=<span class="hljs-string">&quot;linear&quot;</span>, optimizer=optimizer, num_warmup_steps=<span class="hljs-number">0</span>, num_training_steps=num_training_steps
<span class="hljs-meta">... </span>)`}}),ae=new U({props:{code:`import torch

device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
model.to(device)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch

<span class="hljs-meta">&gt;&gt;&gt; </span>device = torch.device(<span class="hljs-string">&quot;cuda&quot;</span>) <span class="hljs-keyword">if</span> torch.cuda.is_available() <span class="hljs-keyword">else</span> torch.device(<span class="hljs-string">&quot;cpu&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.to(device)`}}),de=new Oa({props:{$$slots:{default:[rs]},$$scope:{ctx:dt}}}),R=new Yt({}),we=new U({props:{code:`from tqdm.auto import tqdm

progress_bar = tqdm(range(num_training_steps))

model.train()
for epoch in range(num_epochs):
    for batch in train_dataloader:
        batch = {k: v.to(device) for k, v in batch.items()}
        outputs = model(**batch)
        loss = outputs.loss
        loss.backward()

        optimizer.step()
        lr_scheduler.step()
        optimizer.zero_grad()
        progress_bar.update(1)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> tqdm.auto <span class="hljs-keyword">import</span> tqdm

<span class="hljs-meta">&gt;&gt;&gt; </span>progress_bar = tqdm(<span class="hljs-built_in">range</span>(num_training_steps))

<span class="hljs-meta">&gt;&gt;&gt; </span>model.train()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> epoch <span class="hljs-keyword">in</span> <span class="hljs-built_in">range</span>(num_epochs):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> train_dataloader:
<span class="hljs-meta">... </span>        batch = {k: v.to(device) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}
<span class="hljs-meta">... </span>        outputs = model(**batch)
<span class="hljs-meta">... </span>        loss = outputs.loss
<span class="hljs-meta">... </span>        loss.backward()

<span class="hljs-meta">... </span>        optimizer.step()
<span class="hljs-meta">... </span>        lr_scheduler.step()
<span class="hljs-meta">... </span>        optimizer.zero_grad()
<span class="hljs-meta">... </span>        progress_bar.update(<span class="hljs-number">1</span>)`}}),Be=new Yt({}),Ge=new U({props:{code:`import evaluate

metric = evaluate.load("accuracy")
model.eval()
for batch in eval_dataloader:
    batch = {k: v.to(device) for k, v in batch.items()}
    with torch.no_grad():
        outputs = model(**batch)

    logits = outputs.logits
    predictions = torch.argmax(logits, dim=-1)
    metric.add_batch(predictions=predictions, references=batch["labels"])

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

<span class="hljs-meta">&gt;&gt;&gt; </span>metric = evaluate.load(<span class="hljs-string">&quot;accuracy&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">eval</span>()
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">for</span> batch <span class="hljs-keyword">in</span> eval_dataloader:
<span class="hljs-meta">... </span>    batch = {k: v.to(device) <span class="hljs-keyword">for</span> k, v <span class="hljs-keyword">in</span> batch.items()}
<span class="hljs-meta">... </span>    <span class="hljs-keyword">with</span> torch.no_grad():
<span class="hljs-meta">... </span>        outputs = model(**batch)

<span class="hljs-meta">... </span>    logits = outputs.logits
<span class="hljs-meta">... </span>    predictions = torch.argmax(logits, dim=-<span class="hljs-number">1</span>)
<span class="hljs-meta">... </span>    metric.add_batch(predictions=predictions, references=batch[<span class="hljs-string">&quot;labels&quot;</span>])

<span class="hljs-meta">&gt;&gt;&gt; </span>metric.compute()`}}),{c(){w($.$$.fragment),P=c(),u=l("p"),A=l("code"),T=f("Trainer"),q=f("\uB294 \uD6C8\uB828 \uB8E8\uD504\uB97C \uCC98\uB9AC\uD558\uBA70 \uD55C \uC904\uC758 \uCF54\uB4DC\uB85C \uBAA8\uB378\uC744 \uBBF8\uC138 \uC870\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC9C1\uC811 \uD6C8\uB828 \uB8E8\uD504\uB97C \uC791\uC131\uD558\uB294 \uAC83\uC744 \uC120\uD638\uD558\uB294 \uC0AC\uC6A9\uC790\uC758 \uACBD\uC6B0, \uAE30\uBCF8 PyTorch\uC5D0\uC11C \u{1F917} Transformers \uBAA8\uB378\uC744 \uBBF8\uC138 \uC870\uC815\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4."),O=c(),D=l("p"),ke=f("\uC774 \uC2DC\uC810\uC5D0\uC11C \uB178\uD2B8\uBD81\uC744 \uB2E4\uC2DC \uC2DC\uC791\uD558\uAC70\uB098 \uB2E4\uC74C \uCF54\uB4DC\uB97C \uC2E4\uD589\uD574 \uBA54\uBAA8\uB9AC\uB97C \uD655\uBCF4\uD574\uC57C \uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),be=c(),w(C.$$.fragment),Pt=c(),X=l("p"),Rt=f("\uB2E4\uC74C\uC73C\uB85C, \u2018\uD1A0\uD070\uD654\uB41C \uB370\uC774\uD130\uC14B\u2019\uC744 \uC218\uB3D9\uC73C\uB85C \uD6C4\uCC98\uB9AC\uD558\uC5EC \uD6C8\uB828\uB828\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC788\uB3C4\uB85D \uC900\uBE44\uD569\uB2C8\uB2E4."),Tt=c(),z=l("ol"),F=l("li"),Ye=l("p"),De=f("\uBAA8\uB378\uC774 \uC6D0\uC2DC \uD14D\uC2A4\uD2B8\uB97C \uC785\uB825\uC73C\uB85C \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uC73C\uBBC0\uB85C "),Ce=l("code"),St=f("text"),ut=f(" \uC5F4\uC744 \uC81C\uAC70\uD569\uB2C8\uB2E4:"),qt=c(),w(Se.$$.fragment),Kt=c(),Z=l("li"),I=l("p"),Re=f("\uBAA8\uB378\uC5D0\uC11C \uC778\uC218\uC758 \uC774\uB984\uC774 "),se=l("code"),Ne=f("labels"),Q=f("\uB85C \uC9C0\uC815\uB420 \uAC83\uC73C\uB85C \uC608\uC0C1\uD558\uBBC0\uB85C "),re=l("code"),le=f("label"),rt=f(" \uC5F4\uC758 \uC774\uB984\uC744 "),Le=l("code"),Nt=f("labels"),Lt=f("\uB85C \uBCC0\uACBD\uD569\uB2C8\uB2E4:"),oe=c(),w(_e.$$.fragment),ne=c(),Oe=l("li"),Je=l("p"),$t=f("\uB370\uC774\uD130\uC14B\uC758 \uD615\uC2DD\uC744 List \uB300\uC2E0 PyTorch \uD150\uC11C\uB97C \uBC18\uD658\uD558\uB3C4\uB85D \uC124\uC815\uD569\uB2C8\uB2E4:"),pe=c(),w(_t.$$.fragment),K=c(),lt=l("p"),Jt=f("\uADF8\uB9AC\uACE0 \uC55E\uC11C \uD45C\uC2DC\uB41C \uB300\uB85C \uB370\uC774\uD130\uC14B\uC758 \uB354 \uC791\uC740 \uD558\uC704 \uC9D1\uD569\uC744 \uC0DD\uC131\uD558\uC5EC \uBBF8\uC138 \uC870\uC815 \uC18D\uB3C4\uB97C \uB192\uC785\uB2C8\uB2E4:"),zt=c(),w(B.$$.fragment),Xe=c(),H=l("h3"),M=l("a"),Ee=l("span"),w(L.$$.fragment),ot=c(),nt=l("span"),V=f("DataLoader"),ie=c(),je=l("p"),Ie=f("\uD6C8\uB828 \uBC0F \uD14C\uC2A4\uD2B8 \uB370\uC774\uD130\uC14B\uC5D0 \uB300\uD55C \u2018DataLoader\u2019\uB97C \uC0DD\uC131\uD558\uC5EC \uB370\uC774\uD130 \uBC30\uCE58\uB97C \uBC18\uBCF5\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),Ot=c(),w(x.$$.fragment),Me=c(),pt=l("p"),fe=f("\uC608\uCE21\uC744 \uC704\uD55C \uB808\uC774\uBE14 \uAC1C\uC218\uB97C \uC0AC\uC6A9\uD558\uC5EC \uBAA8\uB378\uC744 \uB85C\uB4DC\uD569\uB2C8\uB2E4:"),vt=c(),w(G.$$.fragment),Ze=c(),W=l("h3"),ee=l("a"),It=l("span"),w(me.$$.fragment),xt=c(),ye=l("span"),Qe=f("\uC635\uD2F0\uB9C8\uC774\uC800 \uBC0F \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC"),it=c(),Ve=l("p"),ft=f("\uC635\uD2F0\uB9C8\uC774\uC800\uC640 \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC\uB97C \uC0DD\uC131\uD558\uC5EC \uBAA8\uB378\uC744 \uBBF8\uC138 \uC870\uC815\uD569\uB2C8\uB2E4. \uD30C\uC774\uD1A0\uCE58\uC5D0\uC11C \uC81C\uACF5\uD558\uB294 "),ve=l("a"),Ae=l("code"),Dt=f("AdamW"),Fe=f(" \uC635\uD2F0\uB9C8\uC774\uC800\uB97C \uC0AC\uC6A9\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4:"),ce=c(),w(Pe.$$.fragment),S=c(),Te=l("p"),gt=l("code"),Xt=f("Trainer"),wt=f("\uC5D0\uC11C \uAE30\uBCF8 \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4:"),he=c(),w(et.$$.fragment),ge=c(),kt=l("p"),Ke=f("\uB9C8\uC9C0\uB9C9\uC73C\uB85C, GPU\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC788\uB294 \uACBD\uC6B0 \u2018device\u2019\uB97C \uC9C0\uC815\uD558\uC5EC GPU\uB97C \uC0AC\uC6A9\uD558\uB3C4\uB85D \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC73C\uBA74 CPU\uC5D0\uC11C \uD6C8\uB828\uD558\uBA70 \uBA87 \uBD84\uC774 \uC544\uB2CC \uBA87 \uC2DC\uAC04\uC774 \uAC78\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),te=c(),w(ae.$$.fragment),N=c(),w(de.$$.fragment),mt=c(),ct=l("p"),Ht=f("\uC774\uC81C \uD6C8\uB828\uD560 \uC900\uBE44\uAC00 \uB418\uC5C8\uC2B5\uB2C8\uB2E4! \u{1F973}"),tt=c(),He=l("h3"),ue=l("a"),Y=l("span"),w(R.$$.fragment),qe=c(),J=l("span"),bt=f("\uD6C8\uB828 \uB8E8\uD504"),Ut=c(),ze=l("p"),at=f("\uD6C8\uB828 \uC9C4\uD589 \uC0C1\uD669\uC744 \uCD94\uC801\uD558\uB824\uBA74 "),$e=l("a"),xe=f("tqdm"),Zt=f(" \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uC0AC\uC6A9\uD558\uC5EC \uD2B8\uB808\uC774\uB2DD \uB2E8\uACC4 \uC218\uC5D0 \uC9C4\uD589\uB960 \uD45C\uC2DC\uC904\uC744 \uCD94\uAC00\uD558\uC138\uC694:"),Et=c(),w(we.$$.fragment),r=c(),a=l("h3"),_=l("a"),Ue=l("span"),w(Be.$$.fragment),la=c(),Mt=l("span"),jt=f("\uD3C9\uAC00 \uD558\uAE30"),Bt=c(),ht=l("p"),yt=l("code"),ta=f("Trainer"),p=f("\uC5D0 \uD3C9\uAC00 \uD568\uC218\uB97C \uCD94\uAC00\uD55C \uBC29\uBC95\uACFC \uB9C8\uCC2C\uAC00\uC9C0\uB85C, \uD6C8\uB828 \uB8E8\uD504\uB97C \uC9C1\uC811 \uC791\uC131\uD560 \uB54C\uB3C4 \uB3D9\uC77C\uD55C \uC791\uC5C5\uC744 \uC218\uD589\uD574\uC57C \uD569\uB2C8\uB2E4. \uD558\uC9C0\uB9CC \uC774\uBC88\uC5D0\uB294 \uAC01 \uC5D0\uD3EC\uD06C\uAC00 \uB05D\uB0A0 \uB54C\uB9C8\uB2E4 \uD3C9\uAC00\uC9C0\uD45C\uB97C \uACC4\uC0B0\uD558\uC5EC \uBCF4\uACE0\uD558\uB294 \uB300\uC2E0, "),g=l("code"),Qt=f("add_batch"),Gt=f("\uB97C \uC0AC\uC6A9\uD558\uC5EC \uBAA8\uB4E0 \uBC30\uCE58\uB97C \uB204\uC801\uD558\uACE0 \uB9E8 \uB9C8\uC9C0\uB9C9\uC5D0 \uD3C9\uAC00\uC9C0\uD45C\uB97C \uACC4\uC0B0\uD569\uB2C8\uB2E4."),oa=c(),w(Ge.$$.fragment),this.h()},l(s){k($.$$.fragment,s),P=h(s),u=o(s,"P",{});var v=n(u);A=o(v,"CODE",{});var Wt=n(A);T=m(Wt,"Trainer"),Wt.forEach(e),q=m(v,"\uB294 \uD6C8\uB828 \uB8E8\uD504\uB97C \uCC98\uB9AC\uD558\uBA70 \uD55C \uC904\uC758 \uCF54\uB4DC\uB85C \uBAA8\uB378\uC744 \uBBF8\uC138 \uC870\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC9C1\uC811 \uD6C8\uB828 \uB8E8\uD504\uB97C \uC791\uC131\uD558\uB294 \uAC83\uC744 \uC120\uD638\uD558\uB294 \uC0AC\uC6A9\uC790\uC758 \uACBD\uC6B0, \uAE30\uBCF8 PyTorch\uC5D0\uC11C \u{1F917} Transformers \uBAA8\uB378\uC744 \uBBF8\uC138 \uC870\uC815\uD560 \uC218\uB3C4 \uC788\uC2B5\uB2C8\uB2E4."),v.forEach(e),O=h(s),D=o(s,"P",{});var pa=n(D);ke=m(pa,"\uC774 \uC2DC\uC810\uC5D0\uC11C \uB178\uD2B8\uBD81\uC744 \uB2E4\uC2DC \uC2DC\uC791\uD558\uAC70\uB098 \uB2E4\uC74C \uCF54\uB4DC\uB97C \uC2E4\uD589\uD574 \uBA54\uBAA8\uB9AC\uB97C \uD655\uBCF4\uD574\uC57C \uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),pa.forEach(e),be=h(s),k(C.$$.fragment,s),Pt=h(s),X=o(s,"P",{});var ia=n(X);Rt=m(ia,"\uB2E4\uC74C\uC73C\uB85C, \u2018\uD1A0\uD070\uD654\uB41C \uB370\uC774\uD130\uC14B\u2019\uC744 \uC218\uB3D9\uC73C\uB85C \uD6C4\uCC98\uB9AC\uD558\uC5EC \uD6C8\uB828\uB828\uC5D0 \uC0AC\uC6A9\uD560 \uC218 \uC788\uB3C4\uB85D \uC900\uBE44\uD569\uB2C8\uB2E4."),ia.forEach(e),Tt=h(s),z=o(s,"OL",{});var Vt=n(z);F=o(Vt,"LI",{});var Ft=n(F);Ye=o(Ft,"P",{});var ea=n(Ye);De=m(ea,"\uBAA8\uB378\uC774 \uC6D0\uC2DC \uD14D\uC2A4\uD2B8\uB97C \uC785\uB825\uC73C\uB85C \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uC73C\uBBC0\uB85C "),Ce=o(ea,"CODE",{});var ua=n(Ce);St=m(ua,"text"),ua.forEach(e),ut=m(ea," \uC5F4\uC744 \uC81C\uAC70\uD569\uB2C8\uB2E4:"),ea.forEach(e),qt=h(Ft),k(Se.$$.fragment,Ft),Ft.forEach(e),Kt=h(Vt),Z=o(Vt,"LI",{});var At=n(Z);I=o(At,"P",{});var Ct=n(I);Re=m(Ct,"\uBAA8\uB378\uC5D0\uC11C \uC778\uC218\uC758 \uC774\uB984\uC774 "),se=o(Ct,"CODE",{});var $a=n(se);Ne=m($a,"labels"),$a.forEach(e),Q=m(Ct,"\uB85C \uC9C0\uC815\uB420 \uAC83\uC73C\uB85C \uC608\uC0C1\uD558\uBBC0\uB85C "),re=o(Ct,"CODE",{});var aa=n(re);le=m(aa,"label"),aa.forEach(e),rt=m(Ct," \uC5F4\uC758 \uC774\uB984\uC744 "),Le=o(Ct,"CODE",{});var fa=n(Le);Nt=m(fa,"labels"),fa.forEach(e),Lt=m(Ct,"\uB85C \uBCC0\uACBD\uD569\uB2C8\uB2E4:"),Ct.forEach(e),oe=h(At),k(_e.$$.fragment,At),At.forEach(e),ne=h(Vt),Oe=o(Vt,"LI",{});var sa=n(Oe);Je=o(sa,"P",{});var _a=n(Je);$t=m(_a,"\uB370\uC774\uD130\uC14B\uC758 \uD615\uC2DD\uC744 List \uB300\uC2E0 PyTorch \uD150\uC11C\uB97C \uBC18\uD658\uD558\uB3C4\uB85D \uC124\uC815\uD569\uB2C8\uB2E4:"),_a.forEach(e),pe=h(sa),k(_t.$$.fragment,sa),sa.forEach(e),Vt.forEach(e),K=h(s),lt=o(s,"P",{});var We=n(lt);Jt=m(We,"\uADF8\uB9AC\uACE0 \uC55E\uC11C \uD45C\uC2DC\uB41C \uB300\uB85C \uB370\uC774\uD130\uC14B\uC758 \uB354 \uC791\uC740 \uD558\uC704 \uC9D1\uD569\uC744 \uC0DD\uC131\uD558\uC5EC \uBBF8\uC138 \uC870\uC815 \uC18D\uB3C4\uB97C \uB192\uC785\uB2C8\uB2E4:"),We.forEach(e),zt=h(s),k(B.$$.fragment,s),Xe=h(s),H=o(s,"H3",{class:!0});var st=n(H);M=o(st,"A",{id:!0,class:!0,href:!0});var ma=n(M);Ee=o(ma,"SPAN",{});var va=n(Ee);k(L.$$.fragment,va),va.forEach(e),ma.forEach(e),ot=h(st),nt=o(st,"SPAN",{});var ha=n(nt);V=m(ha,"DataLoader"),ha.forEach(e),st.forEach(e),ie=h(s),je=o(s,"P",{});var ga=n(je);Ie=m(ga,"\uD6C8\uB828 \uBC0F \uD14C\uC2A4\uD2B8 \uB370\uC774\uD130\uC14B\uC5D0 \uB300\uD55C \u2018DataLoader\u2019\uB97C \uC0DD\uC131\uD558\uC5EC \uB370\uC774\uD130 \uBC30\uCE58\uB97C \uBC18\uBCF5\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),ga.forEach(e),Ot=h(s),k(x.$$.fragment,s),Me=h(s),pt=o(s,"P",{});var da=n(pt);fe=m(da,"\uC608\uCE21\uC744 \uC704\uD55C \uB808\uC774\uBE14 \uAC1C\uC218\uB97C \uC0AC\uC6A9\uD558\uC5EC \uBAA8\uB378\uC744 \uB85C\uB4DC\uD569\uB2C8\uB2E4:"),da.forEach(e),vt=h(s),k(G.$$.fragment,s),Ze=h(s),W=o(s,"H3",{class:!0});var ra=n(W);ee=o(ra,"A",{id:!0,class:!0,href:!0});var ca=n(ee);It=o(ca,"SPAN",{});var ya=n(It);k(me.$$.fragment,ya),ya.forEach(e),ca.forEach(e),xt=h(ra),ye=o(ra,"SPAN",{});var Aa=n(ye);Qe=m(Aa,"\uC635\uD2F0\uB9C8\uC774\uC800 \uBC0F \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC"),Aa.forEach(e),ra.forEach(e),it=h(s),Ve=o(s,"P",{});var ba=n(Ve);ft=m(ba,"\uC635\uD2F0\uB9C8\uC774\uC800\uC640 \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC\uB97C \uC0DD\uC131\uD558\uC5EC \uBAA8\uB378\uC744 \uBBF8\uC138 \uC870\uC815\uD569\uB2C8\uB2E4. \uD30C\uC774\uD1A0\uCE58\uC5D0\uC11C \uC81C\uACF5\uD558\uB294 "),ve=o(ba,"A",{href:!0,rel:!0});var Ea=n(ve);Ae=o(Ea,"CODE",{});var Pa=n(Ae);Dt=m(Pa,"AdamW"),Pa.forEach(e),Ea.forEach(e),Fe=m(ba," \uC635\uD2F0\uB9C8\uC774\uC800\uB97C \uC0AC\uC6A9\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4:"),ba.forEach(e),ce=h(s),k(Pe.$$.fragment,s),S=h(s),Te=o(s,"P",{});var ka=n(Te);gt=o(ka,"CODE",{});var Ta=n(gt);Xt=m(Ta,"Trainer"),Ta.forEach(e),wt=m(ka,"\uC5D0\uC11C \uAE30\uBCF8 \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4:"),ka.forEach(e),he=h(s),k(et.$$.fragment,s),ge=h(s),kt=o(s,"P",{});var qa=n(kt);Ke=m(qa,"\uB9C8\uC9C0\uB9C9\uC73C\uB85C, GPU\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC788\uB294 \uACBD\uC6B0 \u2018device\u2019\uB97C \uC9C0\uC815\uD558\uC5EC GPU\uB97C \uC0AC\uC6A9\uD558\uB3C4\uB85D \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC73C\uBA74 CPU\uC5D0\uC11C \uD6C8\uB828\uD558\uBA70 \uBA87 \uBD84\uC774 \uC544\uB2CC \uBA87 \uC2DC\uAC04\uC774 \uAC78\uB9B4 \uC218 \uC788\uC2B5\uB2C8\uB2E4."),qa.forEach(e),te=h(s),k(ae.$$.fragment,s),N=h(s),k(de.$$.fragment,s),mt=h(s),ct=o(s,"P",{});var za=n(ct);Ht=m(za,"\uC774\uC81C \uD6C8\uB828\uD560 \uC900\uBE44\uAC00 \uB418\uC5C8\uC2B5\uB2C8\uB2E4! \u{1F973}"),za.forEach(e),tt=h(s),He=o(s,"H3",{class:!0});var wa=n(He);ue=o(wa,"A",{id:!0,class:!0,href:!0});var xa=n(ue);Y=o(xa,"SPAN",{});var ja=n(Y);k(R.$$.fragment,ja),ja.forEach(e),xa.forEach(e),qe=h(wa),J=o(wa,"SPAN",{});var Da=n(J);bt=m(Da,"\uD6C8\uB828 \uB8E8\uD504"),Da.forEach(e),wa.forEach(e),Ut=h(s),ze=o(s,"P",{});var Sa=n(ze);at=m(Sa,"\uD6C8\uB828 \uC9C4\uD589 \uC0C1\uD669\uC744 \uCD94\uC801\uD558\uB824\uBA74 "),$e=o(Sa,"A",{href:!0,rel:!0});var Ma=n($e);xe=m(Ma,"tqdm"),Ma.forEach(e),Zt=m(Sa," \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB97C \uC0AC\uC6A9\uD558\uC5EC \uD2B8\uB808\uC774\uB2DD \uB2E8\uACC4 \uC218\uC5D0 \uC9C4\uD589\uB960 \uD45C\uC2DC\uC904\uC744 \uCD94\uAC00\uD558\uC138\uC694:"),Sa.forEach(e),Et=h(s),k(we.$$.fragment,s),r=h(s),a=o(s,"H3",{class:!0});var Na=n(a);_=o(Na,"A",{id:!0,class:!0,href:!0});var Fa=n(_);Ue=o(Fa,"SPAN",{});var Ka=n(Ue);k(Be.$$.fragment,Ka),Ka.forEach(e),Fa.forEach(e),la=h(Na),Mt=o(Na,"SPAN",{});var Ha=n(Mt);jt=m(Ha,"\uD3C9\uAC00 \uD558\uAE30"),Ha.forEach(e),Na.forEach(e),Bt=h(s),ht=o(s,"P",{});var Ca=n(ht);yt=o(Ca,"CODE",{});var Ua=n(yt);ta=m(Ua,"Trainer"),Ua.forEach(e),p=m(Ca,"\uC5D0 \uD3C9\uAC00 \uD568\uC218\uB97C \uCD94\uAC00\uD55C \uBC29\uBC95\uACFC \uB9C8\uCC2C\uAC00\uC9C0\uB85C, \uD6C8\uB828 \uB8E8\uD504\uB97C \uC9C1\uC811 \uC791\uC131\uD560 \uB54C\uB3C4 \uB3D9\uC77C\uD55C \uC791\uC5C5\uC744 \uC218\uD589\uD574\uC57C \uD569\uB2C8\uB2E4. \uD558\uC9C0\uB9CC \uC774\uBC88\uC5D0\uB294 \uAC01 \uC5D0\uD3EC\uD06C\uAC00 \uB05D\uB0A0 \uB54C\uB9C8\uB2E4 \uD3C9\uAC00\uC9C0\uD45C\uB97C \uACC4\uC0B0\uD558\uC5EC \uBCF4\uACE0\uD558\uB294 \uB300\uC2E0, "),g=o(Ca,"CODE",{});var Ba=n(g);Qt=m(Ba,"add_batch"),Ba.forEach(e),Gt=m(Ca,"\uB97C \uC0AC\uC6A9\uD558\uC5EC \uBAA8\uB4E0 \uBC30\uCE58\uB97C \uB204\uC801\uD558\uACE0 \uB9E8 \uB9C8\uC9C0\uB9C9\uC5D0 \uD3C9\uAC00\uC9C0\uD45C\uB97C \uACC4\uC0B0\uD569\uB2C8\uB2E4."),Ca.forEach(e),oa=h(s),k(Ge.$$.fragment,s),this.h()},h(){d(M,"id","dataloader"),d(M,"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(M,"href","#dataloader"),d(H,"class","relative group"),d(ee,"id","optimizer-and-learning-rate-scheduler"),d(ee,"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(ee,"href","#optimizer-and-learning-rate-scheduler"),d(W,"class","relative group"),d(ve,"href","https://pytorch.org/docs/stable/generated/torch.optim.AdamW.html"),d(ve,"rel","nofollow"),d(ue,"id","training-loop"),d(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"),d(ue,"href","#training-loop"),d(He,"class","relative group"),d($e,"href","https://tqdm.github.io/"),d($e,"rel","nofollow"),d(_,"id","evaluate"),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","#evaluate"),d(a,"class","relative group")},m(s,v){b($,s,v),i(s,P,v),i(s,u,v),t(u,A),t(A,T),t(u,q),i(s,O,v),i(s,D,v),t(D,ke),i(s,be,v),b(C,s,v),i(s,Pt,v),i(s,X,v),t(X,Rt),i(s,Tt,v),i(s,z,v),t(z,F),t(F,Ye),t(Ye,De),t(Ye,Ce),t(Ce,St),t(Ye,ut),t(F,qt),b(Se,F,null),t(z,Kt),t(z,Z),t(Z,I),t(I,Re),t(I,se),t(se,Ne),t(I,Q),t(I,re),t(re,le),t(I,rt),t(I,Le),t(Le,Nt),t(I,Lt),t(Z,oe),b(_e,Z,null),t(z,ne),t(z,Oe),t(Oe,Je),t(Je,$t),t(Oe,pe),b(_t,Oe,null),i(s,K,v),i(s,lt,v),t(lt,Jt),i(s,zt,v),b(B,s,v),i(s,Xe,v),i(s,H,v),t(H,M),t(M,Ee),b(L,Ee,null),t(H,ot),t(H,nt),t(nt,V),i(s,ie,v),i(s,je,v),t(je,Ie),i(s,Ot,v),b(x,s,v),i(s,Me,v),i(s,pt,v),t(pt,fe),i(s,vt,v),b(G,s,v),i(s,Ze,v),i(s,W,v),t(W,ee),t(ee,It),b(me,It,null),t(W,xt),t(W,ye),t(ye,Qe),i(s,it,v),i(s,Ve,v),t(Ve,ft),t(Ve,ve),t(ve,Ae),t(Ae,Dt),t(Ve,Fe),i(s,ce,v),b(Pe,s,v),i(s,S,v),i(s,Te,v),t(Te,gt),t(gt,Xt),t(Te,wt),i(s,he,v),b(et,s,v),i(s,ge,v),i(s,kt,v),t(kt,Ke),i(s,te,v),b(ae,s,v),i(s,N,v),b(de,s,v),i(s,mt,v),i(s,ct,v),t(ct,Ht),i(s,tt,v),i(s,He,v),t(He,ue),t(ue,Y),b(R,Y,null),t(He,qe),t(He,J),t(J,bt),i(s,Ut,v),i(s,ze,v),t(ze,at),t(ze,$e),t($e,xe),t(ze,Zt),i(s,Et,v),b(we,s,v),i(s,r,v),i(s,a,v),t(a,_),t(_,Ue),b(Be,Ue,null),t(a,la),t(a,Mt),t(Mt,jt),i(s,Bt,v),i(s,ht,v),t(ht,yt),t(yt,ta),t(ht,p),t(ht,g),t(g,Qt),t(ht,Gt),i(s,oa,v),b(Ge,s,v),na=!0},p(s,v){const Wt={};v&2&&(Wt.$$scope={dirty:v,ctx:s}),de.$set(Wt)},i(s){na||(E($.$$.fragment,s),E(C.$$.fragment,s),E(Se.$$.fragment,s),E(_e.$$.fragment,s),E(_t.$$.fragment,s),E(B.$$.fragment,s),E(L.$$.fragment,s),E(x.$$.fragment,s),E(G.$$.fragment,s),E(me.$$.fragment,s),E(Pe.$$.fragment,s),E(et.$$.fragment,s),E(ae.$$.fragment,s),E(de.$$.fragment,s),E(R.$$.fragment,s),E(we.$$.fragment,s),E(Be.$$.fragment,s),E(Ge.$$.fragment,s),na=!0)},o(s){j($.$$.fragment,s),j(C.$$.fragment,s),j(Se.$$.fragment,s),j(_e.$$.fragment,s),j(_t.$$.fragment,s),j(B.$$.fragment,s),j(L.$$.fragment,s),j(x.$$.fragment,s),j(G.$$.fragment,s),j(me.$$.fragment,s),j(Pe.$$.fragment,s),j(et.$$.fragment,s),j(ae.$$.fragment,s),j(de.$$.fragment,s),j(R.$$.fragment,s),j(we.$$.fragment,s),j(Be.$$.fragment,s),j(Ge.$$.fragment,s),na=!1},d(s){y($,s),s&&e(P),s&&e(u),s&&e(O),s&&e(D),s&&e(be),y(C,s),s&&e(Pt),s&&e(X),s&&e(Tt),s&&e(z),y(Se),y(_e),y(_t),s&&e(K),s&&e(lt),s&&e(zt),y(B,s),s&&e(Xe),s&&e(H),y(L),s&&e(ie),s&&e(je),s&&e(Ot),y(x,s),s&&e(Me),s&&e(pt),s&&e(vt),y(G,s),s&&e(Ze),s&&e(W),y(me),s&&e(it),s&&e(Ve),s&&e(ce),y(Pe,s),s&&e(S),s&&e(Te),s&&e(he),y(et,s),s&&e(ge),s&&e(kt),s&&e(te),y(ae,s),s&&e(N),y(de,s),s&&e(mt),s&&e(ct),s&&e(tt),s&&e(He),y(R),s&&e(Ut),s&&e(ze),s&&e(Et),y(we,s),s&&e(r),s&&e(a),y(Be),s&&e(Bt),s&&e(ht),s&&e(oa),y(Ge,s)}}}function os(dt){let $,P;return $=new Ia({props:{$$slots:{default:[ls]},$$scope:{ctx:dt}}}),{c(){w($.$$.fragment)},l(u){k($.$$.fragment,u)},m(u,A){b($,u,A),P=!0},p(u,A){const T={};A&2&&(T.$$scope={dirty:A,ctx:u}),$.$set(T)},i(u){P||(E($.$$.fragment,u),P=!0)},o(u){j($.$$.fragment,u),P=!1},d(u){y($,u)}}}function ns(dt){let $,P,u,A,T,q,O,D,ke,be,C,Pt,X,Rt,Tt,z,F,Ye,De,Ce,St,ut,qt,Se,Kt,Z,I,Re,se,Ne,Q,re,le,rt,Le,Nt,Lt,oe,_e,ne,Oe,Je,$t,pe,_t,K,lt,Jt,zt,B,Xe,H,M,Ee,L,ot,nt,V,ie,je,Ie,Ot,x,Me,pt,fe,vt,G,Ze,W,ee,It,me,xt,ye,Qe,it,Ve,ft,ve,Ae,Dt,Fe,ce,Pe,S,Te,gt,Xt,wt,he,et,ge,kt,Ke,te,ae,N,de,mt,ct,Ht,tt,He,ue,Y,R,qe,J,bt,Ut,ze,at,$e,xe,Zt,Et,we;return q=new Yt({}),C=new Za({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/training.ipynb"},{label:"PyTorch",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/training.ipynb"},{label:"TensorFlow",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/training.ipynb"},{label:"Mixed",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/training.ipynb"},{label:"PyTorch",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/pytorch/training.ipynb"},{label:"TensorFlow",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/ko/tensorflow/training.ipynb"}]}}),rt=new Yt({}),_e=new La({props:{id:"_BZearw7f0w"}}),B=new U({props:{code:`from datasets import load_dataset

dataset = load_dataset("yelp_review_full")
dataset["train"][100]`,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>dataset = load_dataset(<span class="hljs-string">&quot;yelp_review_full&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>dataset[<span class="hljs-string">&quot;train&quot;</span>][<span class="hljs-number">100</span>]
{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-number">0</span>,
 <span class="hljs-string">&#x27;text&#x27;</span>: <span class="hljs-string">&#x27;My expectations for McDonalds are t rarely high. But for one to still fail so spectacularly...that takes something special!\\\\nThe cashier took my friends\\&#x27;s order, then promptly ignored me. I had to force myself in front of a cashier who opened his register to wait on the person BEHIND me. I waited over five minutes for a gigantic order that included precisely one kid\\&#x27;s meal. After watching two people who ordered after me be handed their food, I asked where mine was. The manager started yelling at the cashiers for \\\\&quot;serving off their orders\\\\&quot; when they didn\\&#x27;t have their food. But neither cashier was anywhere near those controls, and the manager was the one serving food to customers and clearing the boards.\\\\nThe manager was rude when giving me my order. She didn\\&#x27;t make sure that I had everything ON MY RECEIPT, and never even had the decency to apologize that I felt I was getting poor service.\\\\nI\\&#x27;ve eaten at various McDonalds restaurants for over 30 years. I\\&#x27;ve worked at more than one location. I expect bad days, bad moods, and the occasional mistake. But I have yet to have a decent experience at this store. It will remain a place I avoid unless someone in my party needs to avoid illness from low blood sugar. Perhaps I should go back to the racially biased service of Steak n Shake instead!&#x27;</span>}`}}),ie=new U({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")


def tokenize_function(examples):
    return tokenizer(examples["text"], padding="max_length", truncation=True)


tokenized_datasets = dataset.map(tokenize_function, batched=True)`,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;bert-base-cased&quot;</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">tokenize_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>], padding=<span class="hljs-string">&quot;max_length&quot;</span>, truncation=<span class="hljs-literal">True</span>)


<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_datasets = dataset.<span class="hljs-built_in">map</span>(tokenize_function, batched=<span class="hljs-literal">True</span>)`}}),Me=new U({props:{code:`small_train_dataset = tokenized_datasets["train"].shuffle(seed=42).select(range(1000))
small_eval_dataset = tokenized_datasets["test"].shuffle(seed=42).select(range(1000))`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>small_train_dataset = tokenized_datasets[<span class="hljs-string">&quot;train&quot;</span>].shuffle(seed=<span class="hljs-number">42</span>).select(<span class="hljs-built_in">range</span>(<span class="hljs-number">1000</span>))
<span class="hljs-meta">&gt;&gt;&gt; </span>small_eval_dataset = tokenized_datasets[<span class="hljs-string">&quot;test&quot;</span>].shuffle(seed=<span class="hljs-number">42</span>).select(<span class="hljs-built_in">range</span>(<span class="hljs-number">1000</span>))`}}),ee=new Yt({}),ft=new Ga({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[ss],pytorch:[es]},$$scope:{ctx:dt}}}),S=new Yt({}),he=new Ga({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[os]},$$scope:{ctx:dt}}}),N=new Yt({}),{c(){$=l("meta"),P=c(),u=l("h1"),A=l("a"),T=l("span"),w(q.$$.fragment),O=c(),D=l("span"),ke=f("\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30"),be=c(),w(C.$$.fragment),Pt=c(),X=l("p"),Rt=f("\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD558\uBA74 \uC0C1\uB2F9\uD55C \uC774\uC810\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uACC4\uC0B0 \uBE44\uC6A9\uACFC \uD0C4\uC18C\uBC1C\uC790\uAD6D\uC744 \uC904\uC774\uACE0, \uCC98\uC74C\uBD80\uD130 \uBAA8\uB378\uC744 \uD559\uC2B5\uC2DC\uD0AC \uD544\uC694 \uC5C6\uC774 \uCD5C\uC2E0 \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \u{1F917} Transformers\uB294 \uB2E4\uC591\uD55C \uC791\uC5C5\uC744 \uC704\uD574 \uC0AC\uC804 \uD559\uC2B5\uB41C \uC218\uCC9C \uAC1C\uC758 \uBAA8\uB378\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD558\uB294 \uACBD\uC6B0, \uC790\uC2E0\uC758 \uC791\uC5C5\uACFC \uAD00\uB828\uB41C \uB370\uC774\uD130\uC14B\uC744 \uC0AC\uC6A9\uD574 \uD559\uC2B5\uD569\uB2C8\uB2E4. \uC774\uAC83\uC740 \uBBF8\uC138 \uD29C\uB2DD\uC774\uB77C\uACE0 \uD558\uB294 \uB9E4\uC6B0 \uAC15\uB825\uD55C \uD6C8\uB828 \uAE30\uBC95\uC785\uB2C8\uB2E4. \uC774 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C\uB294 \uB2F9\uC2E0\uC774 \uC120\uD0DD\uD55C \uB525\uB7EC\uB2DD \uD504\uB808\uC784\uC6CC\uD06C\uB85C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD569\uB2C8\uB2E4:"),Tt=c(),z=l("ul"),F=l("li"),Ye=f("\u{1F917} Transformers\uB85C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30 "),De=l("code"),Ce=f("Trainer"),St=f("."),ut=c(),qt=l("li"),Se=f("Keras\uB97C \uC0AC\uC6A9\uD558\uC5EC TensorFlow\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),Kt=c(),Z=l("li"),I=f("\uAE30\uBCF8 PyTorch\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),Re=c(),se=l("a"),Ne=c(),Q=l("h2"),re=l("a"),le=l("span"),w(rt.$$.fragment),Le=c(),Nt=l("span"),Lt=f("\uB370\uC774\uD130\uC14B \uC900\uBE44"),oe=c(),w(_e.$$.fragment),ne=c(),Oe=l("p"),Je=f("\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30 \uC704\uD574\uC11C \uB370\uC774\uD130\uC14B\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uACE0 \uD6C8\uB828\uD560 \uC218 \uC788\uB3C4\uB85D \uC900\uBE44\uD558\uC138\uC694. \uC774\uC804 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C \uD6C8\uB828\uC744 \uC704\uD574 \uB370\uC774\uD130\uB97C \uCC98\uB9AC\uD558\uB294 \uBC29\uBC95\uC744 \uBCF4\uC5EC\uB4DC\uB838\uB294\uB370, \uC9C0\uAE08\uC774 \uBC30\uC6B8 \uAC78 \uB418\uC9DA\uC744 \uAE30\uD68C\uC785\uB2C8\uB2E4!"),$t=c(),pe=l("p"),_t=f("\uBA3C\uC800 "),K=l("a"),lt=f("Yelp \uB9AC\uBDF0"),Jt=f(" \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4:"),zt=c(),w(B.$$.fragment),Xe=c(),H=l("p"),M=f("\uD14D\uC2A4\uD2B8\uB97C \uCC98\uB9AC\uD558\uACE0 \uC11C\uB85C \uB2E4\uB978 \uAE38\uC774\uC758 \uC2DC\uD000\uC2A4 \uD328\uB529 \uBC0F \uC798\uB77C\uB0B4\uAE30 \uC804\uB7B5\uC744 \uD3EC\uD568\uD558\uB824\uBA74 \uD1A0\uD06C\uB098\uC774\uC800\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uB370\uC774\uD130\uC14B\uC744 \uD55C \uBC88\uC5D0 \uCC98\uB9AC\uD558\uB824\uBA74 \u{1F917} Dataset "),Ee=l("a"),L=l("code"),ot=f("map"),nt=f(" \uBA54\uC11C\uB4DC\uB97C \uC0AC\uC6A9\uD558\uC5EC \uC804\uCCB4 \uB370\uC774\uD130\uC14B\uC5D0 \uC804\uCC98\uB9AC \uD568\uC218\uB97C \uC801\uC6A9\uD558\uC138\uC694:"),V=c(),w(ie.$$.fragment),je=c(),Ie=l("p"),Ot=f("\uD544\uC694\uD55C \uACBD\uC6B0 \uBBF8\uC138 \uD29C\uB2DD\uC744 \uC704\uD574 \uB370\uC774\uD130\uC14B\uC758 \uC791\uC740 \uBD80\uBD84 \uC9D1\uD569\uC744 \uB9CC\uB4E4\uC5B4 \uBBF8\uC138 \uD29C\uB2DD \uC791\uC5C5 \uC2DC\uAC04\uC744 \uC904\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),x=c(),w(Me.$$.fragment),pt=c(),fe=l("a"),vt=c(),G=l("h2"),Ze=l("a"),W=l("span"),w(ee.$$.fragment),It=c(),me=l("span"),xt=f("Train"),ye=c(),Qe=l("p"),it=f("\uC5EC\uAE30\uC11C\uBD80\uD130\uB294 \uC0AC\uC6A9\uD558\uB824\uB294 \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uD574\uB2F9\uD558\uB294 \uC139\uC158\uC744 \uB530\uB77C\uC57C \uD569\uB2C8\uB2E4. \uC624\uB978\uCABD \uC0AC\uC774\uB4DC\uBC14\uC758 \uB9C1\uD06C\uB97C \uC0AC\uC6A9\uD558\uC5EC \uC6D0\uD558\uB294 \uD504\uB808\uC784\uC6CC\uD06C\uB85C \uC774\uB3D9\uD560 \uC218 \uC788\uC73C\uBA70, \uD2B9\uC815 \uD504\uB808\uC784\uC6CC\uD06C\uC758 \uBAA8\uB4E0 \uCF58\uD150\uCE20\uB97C \uC228\uAE30\uB824\uBA74 \uD574\uB2F9 \uD504\uB808\uC784\uC6CC\uD06C \uBE14\uB85D\uC758 \uC624\uB978\uCABD \uC0C1\uB2E8\uC5D0 \uC788\uB294 \uBC84\uD2BC\uC744 \uC0AC\uC6A9\uD558\uBA74 \uB429\uB2C8\uB2E4!"),Ve=c(),w(ft.$$.fragment),ve=c(),Ae=l("a"),Dt=c(),Fe=l("h2"),ce=l("a"),Pe=l("span"),w(S.$$.fragment),Te=c(),gt=l("span"),Xt=f("\uAE30\uBCF8 \uD30C\uC774\uD1A0\uCE58\uB85C \uD6C8\uB828\uD558\uAE30"),wt=c(),w(he.$$.fragment),et=c(),ge=l("a"),kt=c(),Ke=l("h2"),te=l("a"),ae=l("span"),w(N.$$.fragment),de=c(),mt=l("span"),ct=f("\uCD94\uAC00 \uC790\uB8CC"),Ht=c(),tt=l("p"),He=f("\uB354 \uB9CE\uC740 \uBBF8\uC138 \uD29C\uB2DD \uC608\uC81C\uB294 \uB2E4\uC74C\uC744 \uCC38\uC870\uD558\uC138\uC694:"),ue=c(),Y=l("ul"),R=l("li"),qe=l("p"),J=l("a"),bt=f("\u{1F917} Trnasformers \uC608\uC81C"),Ut=f("\uC5D0\uB294 PyTorch \uBC0F \uD150\uC11C\uD50C\uB85C\uC6B0\uC5D0\uC11C \uC77C\uBC18\uC801\uC778 NLP \uC791\uC5C5\uC744 \uD6C8\uB828\uD560 \uC218 \uC788\uB294 \uC2A4\uD06C\uB9BD\uD2B8\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),ze=c(),at=l("li"),$e=l("p"),xe=l("a"),Zt=f("\u{1F917} Transformers \uB178\uD2B8\uBD81"),Et=f("\uC5D0\uB294 PyTorch \uBC0F \uD150\uC11C\uD50C\uB85C\uC6B0\uC5D0\uC11C \uD2B9\uC815 \uC791\uC5C5\uC744 \uC704\uD574 \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uB294 \uBC29\uBC95\uC5D0 \uB300\uD55C \uB2E4\uC591\uD55C \uB178\uD2B8\uBD81\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),this.h()},l(r){const a=Ja('[data-svelte="svelte-1phssyn"]',document.head);$=o(a,"META",{name:!0,content:!0}),a.forEach(e),P=h(r),u=o(r,"H1",{class:!0});var _=n(u);A=o(_,"A",{id:!0,class:!0,href:!0});var Ue=n(A);T=o(Ue,"SPAN",{});var Be=n(T);k(q.$$.fragment,Be),Be.forEach(e),Ue.forEach(e),O=h(_),D=o(_,"SPAN",{});var la=n(D);ke=m(la,"\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30"),la.forEach(e),_.forEach(e),be=h(r),k(C.$$.fragment,r),Pt=h(r),X=o(r,"P",{});var Mt=n(X);Rt=m(Mt,"\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD558\uBA74 \uC0C1\uB2F9\uD55C \uC774\uC810\uC774 \uC788\uC2B5\uB2C8\uB2E4. \uACC4\uC0B0 \uBE44\uC6A9\uACFC \uD0C4\uC18C\uBC1C\uC790\uAD6D\uC744 \uC904\uC774\uACE0, \uCC98\uC74C\uBD80\uD130 \uBAA8\uB378\uC744 \uD559\uC2B5\uC2DC\uD0AC \uD544\uC694 \uC5C6\uC774 \uCD5C\uC2E0 \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \u{1F917} Transformers\uB294 \uB2E4\uC591\uD55C \uC791\uC5C5\uC744 \uC704\uD574 \uC0AC\uC804 \uD559\uC2B5\uB41C \uC218\uCC9C \uAC1C\uC758 \uBAA8\uB378\uC5D0 \uC561\uC138\uC2A4\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uC0AC\uC6A9\uD558\uB294 \uACBD\uC6B0, \uC790\uC2E0\uC758 \uC791\uC5C5\uACFC \uAD00\uB828\uB41C \uB370\uC774\uD130\uC14B\uC744 \uC0AC\uC6A9\uD574 \uD559\uC2B5\uD569\uB2C8\uB2E4. \uC774\uAC83\uC740 \uBBF8\uC138 \uD29C\uB2DD\uC774\uB77C\uACE0 \uD558\uB294 \uB9E4\uC6B0 \uAC15\uB825\uD55C \uD6C8\uB828 \uAE30\uBC95\uC785\uB2C8\uB2E4. \uC774 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C\uB294 \uB2F9\uC2E0\uC774 \uC120\uD0DD\uD55C \uB525\uB7EC\uB2DD \uD504\uB808\uC784\uC6CC\uD06C\uB85C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD569\uB2C8\uB2E4:"),Mt.forEach(e),Tt=h(r),z=o(r,"UL",{});var jt=n(z);F=o(jt,"LI",{});var Bt=n(F);Ye=m(Bt,"\u{1F917} Transformers\uB85C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30 "),De=o(Bt,"CODE",{});var ht=n(De);Ce=m(ht,"Trainer"),ht.forEach(e),St=m(Bt,"."),Bt.forEach(e),ut=h(jt),qt=o(jt,"LI",{});var yt=n(qt);Se=m(yt,"Keras\uB97C \uC0AC\uC6A9\uD558\uC5EC TensorFlow\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),yt.forEach(e),Kt=h(jt),Z=o(jt,"LI",{});var ta=n(Z);I=m(ta,"\uAE30\uBCF8 PyTorch\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),ta.forEach(e),jt.forEach(e),Re=h(r),se=o(r,"A",{id:!0}),n(se).forEach(e),Ne=h(r),Q=o(r,"H2",{class:!0});var p=n(Q);re=o(p,"A",{id:!0,class:!0,href:!0});var g=n(re);le=o(g,"SPAN",{});var Qt=n(le);k(rt.$$.fragment,Qt),Qt.forEach(e),g.forEach(e),Le=h(p),Nt=o(p,"SPAN",{});var Gt=n(Nt);Lt=m(Gt,"\uB370\uC774\uD130\uC14B \uC900\uBE44"),Gt.forEach(e),p.forEach(e),oe=h(r),k(_e.$$.fragment,r),ne=h(r),Oe=o(r,"P",{});var oa=n(Oe);Je=m(oa,"\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30 \uC704\uD574\uC11C \uB370\uC774\uD130\uC14B\uC744 \uB2E4\uC6B4\uB85C\uB4DC\uD558\uACE0 \uD6C8\uB828\uD560 \uC218 \uC788\uB3C4\uB85D \uC900\uBE44\uD558\uC138\uC694. \uC774\uC804 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C \uD6C8\uB828\uC744 \uC704\uD574 \uB370\uC774\uD130\uB97C \uCC98\uB9AC\uD558\uB294 \uBC29\uBC95\uC744 \uBCF4\uC5EC\uB4DC\uB838\uB294\uB370, \uC9C0\uAE08\uC774 \uBC30\uC6B8 \uAC78 \uB418\uC9DA\uC744 \uAE30\uD68C\uC785\uB2C8\uB2E4!"),oa.forEach(e),$t=h(r),pe=o(r,"P",{});var Ge=n(pe);_t=m(Ge,"\uBA3C\uC800 "),K=o(Ge,"A",{href:!0,rel:!0});var na=n(K);lt=m(na,"Yelp \uB9AC\uBDF0"),na.forEach(e),Jt=m(Ge," \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4:"),Ge.forEach(e),zt=h(r),k(B.$$.fragment,r),Xe=h(r),H=o(r,"P",{});var s=n(H);M=m(s,"\uD14D\uC2A4\uD2B8\uB97C \uCC98\uB9AC\uD558\uACE0 \uC11C\uB85C \uB2E4\uB978 \uAE38\uC774\uC758 \uC2DC\uD000\uC2A4 \uD328\uB529 \uBC0F \uC798\uB77C\uB0B4\uAE30 \uC804\uB7B5\uC744 \uD3EC\uD568\uD558\uB824\uBA74 \uD1A0\uD06C\uB098\uC774\uC800\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uB370\uC774\uD130\uC14B\uC744 \uD55C \uBC88\uC5D0 \uCC98\uB9AC\uD558\uB824\uBA74 \u{1F917} Dataset "),Ee=o(s,"A",{href:!0,rel:!0});var v=n(Ee);L=o(v,"CODE",{});var Wt=n(L);ot=m(Wt,"map"),Wt.forEach(e),v.forEach(e),nt=m(s," \uBA54\uC11C\uB4DC\uB97C \uC0AC\uC6A9\uD558\uC5EC \uC804\uCCB4 \uB370\uC774\uD130\uC14B\uC5D0 \uC804\uCC98\uB9AC \uD568\uC218\uB97C \uC801\uC6A9\uD558\uC138\uC694:"),s.forEach(e),V=h(r),k(ie.$$.fragment,r),je=h(r),Ie=o(r,"P",{});var pa=n(Ie);Ot=m(pa,"\uD544\uC694\uD55C \uACBD\uC6B0 \uBBF8\uC138 \uD29C\uB2DD\uC744 \uC704\uD574 \uB370\uC774\uD130\uC14B\uC758 \uC791\uC740 \uBD80\uBD84 \uC9D1\uD569\uC744 \uB9CC\uB4E4\uC5B4 \uBBF8\uC138 \uD29C\uB2DD \uC791\uC5C5 \uC2DC\uAC04\uC744 \uC904\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),pa.forEach(e),x=h(r),k(Me.$$.fragment,r),pt=h(r),fe=o(r,"A",{id:!0}),n(fe).forEach(e),vt=h(r),G=o(r,"H2",{class:!0});var ia=n(G);Ze=o(ia,"A",{id:!0,class:!0,href:!0});var Vt=n(Ze);W=o(Vt,"SPAN",{});var Ft=n(W);k(ee.$$.fragment,Ft),Ft.forEach(e),Vt.forEach(e),It=h(ia),me=o(ia,"SPAN",{});var ea=n(me);xt=m(ea,"Train"),ea.forEach(e),ia.forEach(e),ye=h(r),Qe=o(r,"P",{});var ua=n(Qe);it=m(ua,"\uC5EC\uAE30\uC11C\uBD80\uD130\uB294 \uC0AC\uC6A9\uD558\uB824\uB294 \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uD574\uB2F9\uD558\uB294 \uC139\uC158\uC744 \uB530\uB77C\uC57C \uD569\uB2C8\uB2E4. \uC624\uB978\uCABD \uC0AC\uC774\uB4DC\uBC14\uC758 \uB9C1\uD06C\uB97C \uC0AC\uC6A9\uD558\uC5EC \uC6D0\uD558\uB294 \uD504\uB808\uC784\uC6CC\uD06C\uB85C \uC774\uB3D9\uD560 \uC218 \uC788\uC73C\uBA70, \uD2B9\uC815 \uD504\uB808\uC784\uC6CC\uD06C\uC758 \uBAA8\uB4E0 \uCF58\uD150\uCE20\uB97C \uC228\uAE30\uB824\uBA74 \uD574\uB2F9 \uD504\uB808\uC784\uC6CC\uD06C \uBE14\uB85D\uC758 \uC624\uB978\uCABD \uC0C1\uB2E8\uC5D0 \uC788\uB294 \uBC84\uD2BC\uC744 \uC0AC\uC6A9\uD558\uBA74 \uB429\uB2C8\uB2E4!"),ua.forEach(e),Ve=h(r),k(ft.$$.fragment,r),ve=h(r),Ae=o(r,"A",{id:!0}),n(Ae).forEach(e),Dt=h(r),Fe=o(r,"H2",{class:!0});var At=n(Fe);ce=o(At,"A",{id:!0,class:!0,href:!0});var Ct=n(ce);Pe=o(Ct,"SPAN",{});var $a=n(Pe);k(S.$$.fragment,$a),$a.forEach(e),Ct.forEach(e),Te=h(At),gt=o(At,"SPAN",{});var aa=n(gt);Xt=m(aa,"\uAE30\uBCF8 \uD30C\uC774\uD1A0\uCE58\uB85C \uD6C8\uB828\uD558\uAE30"),aa.forEach(e),At.forEach(e),wt=h(r),k(he.$$.fragment,r),et=h(r),ge=o(r,"A",{id:!0}),n(ge).forEach(e),kt=h(r),Ke=o(r,"H2",{class:!0});var fa=n(Ke);te=o(fa,"A",{id:!0,class:!0,href:!0});var sa=n(te);ae=o(sa,"SPAN",{});var _a=n(ae);k(N.$$.fragment,_a),_a.forEach(e),sa.forEach(e),de=h(fa),mt=o(fa,"SPAN",{});var We=n(mt);ct=m(We,"\uCD94\uAC00 \uC790\uB8CC"),We.forEach(e),fa.forEach(e),Ht=h(r),tt=o(r,"P",{});var st=n(tt);He=m(st,"\uB354 \uB9CE\uC740 \uBBF8\uC138 \uD29C\uB2DD \uC608\uC81C\uB294 \uB2E4\uC74C\uC744 \uCC38\uC870\uD558\uC138\uC694:"),st.forEach(e),ue=h(r),Y=o(r,"UL",{});var ma=n(Y);R=o(ma,"LI",{});var va=n(R);qe=o(va,"P",{});var ha=n(qe);J=o(ha,"A",{href:!0,rel:!0});var ga=n(J);bt=m(ga,"\u{1F917} Trnasformers \uC608\uC81C"),ga.forEach(e),Ut=m(ha,"\uC5D0\uB294 PyTorch \uBC0F \uD150\uC11C\uD50C\uB85C\uC6B0\uC5D0\uC11C \uC77C\uBC18\uC801\uC778 NLP \uC791\uC5C5\uC744 \uD6C8\uB828\uD560 \uC218 \uC788\uB294 \uC2A4\uD06C\uB9BD\uD2B8\uAC00 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),ha.forEach(e),va.forEach(e),ze=h(ma),at=o(ma,"LI",{});var da=n(at);$e=o(da,"P",{});var ra=n($e);xe=o(ra,"A",{href:!0});var ca=n(xe);Zt=m(ca,"\u{1F917} Transformers \uB178\uD2B8\uBD81"),ca.forEach(e),Et=m(ra,"\uC5D0\uB294 PyTorch \uBC0F \uD150\uC11C\uD50C\uB85C\uC6B0\uC5D0\uC11C \uD2B9\uC815 \uC791\uC5C5\uC744 \uC704\uD574 \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uB294 \uBC29\uBC95\uC5D0 \uB300\uD55C \uB2E4\uC591\uD55C \uB178\uD2B8\uBD81\uC774 \uD3EC\uD568\uB418\uC5B4 \uC788\uC2B5\uB2C8\uB2E4."),ra.forEach(e),da.forEach(e),ma.forEach(e),this.h()},h(){d($,"name","hf:doc:metadata"),d($,"content",JSON.stringify(ps)),d(A,"id","finetune-a-pretrained-model"),d(A,"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(A,"href","#finetune-a-pretrained-model"),d(u,"class","relative group"),d(se,"id","data-processing"),d(re,"id","prepare-a-dataset"),d(re,"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(re,"href","#prepare-a-dataset"),d(Q,"class","relative group"),d(K,"href","https://huggingface.co/datasets/yelp_review_full"),d(K,"rel","nofollow"),d(Ee,"href","https://huggingface.co/docs/datasets/process.html#map"),d(Ee,"rel","nofollow"),d(fe,"id","trainer"),d(Ze,"id","train"),d(Ze,"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(Ze,"href","#train"),d(G,"class","relative group"),d(Ae,"id","pytorch_native"),d(ce,"id","train-in-native-pytorch"),d(ce,"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(ce,"href","#train-in-native-pytorch"),d(Fe,"class","relative group"),d(ge,"id","additional-resources"),d(te,"id","additional-resources"),d(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"),d(te,"href","#additional-resources"),d(Ke,"class","relative group"),d(J,"href","https://github.com/huggingface/transformers/tree/main/examples"),d(J,"rel","nofollow"),d(xe,"href","notebooks")},m(r,a){t(document.head,$),i(r,P,a),i(r,u,a),t(u,A),t(A,T),b(q,T,null),t(u,O),t(u,D),t(D,ke),i(r,be,a),b(C,r,a),i(r,Pt,a),i(r,X,a),t(X,Rt),i(r,Tt,a),i(r,z,a),t(z,F),t(F,Ye),t(F,De),t(De,Ce),t(F,St),t(z,ut),t(z,qt),t(qt,Se),t(z,Kt),t(z,Z),t(Z,I),i(r,Re,a),i(r,se,a),i(r,Ne,a),i(r,Q,a),t(Q,re),t(re,le),b(rt,le,null),t(Q,Le),t(Q,Nt),t(Nt,Lt),i(r,oe,a),b(_e,r,a),i(r,ne,a),i(r,Oe,a),t(Oe,Je),i(r,$t,a),i(r,pe,a),t(pe,_t),t(pe,K),t(K,lt),t(pe,Jt),i(r,zt,a),b(B,r,a),i(r,Xe,a),i(r,H,a),t(H,M),t(H,Ee),t(Ee,L),t(L,ot),t(H,nt),i(r,V,a),b(ie,r,a),i(r,je,a),i(r,Ie,a),t(Ie,Ot),i(r,x,a),b(Me,r,a),i(r,pt,a),i(r,fe,a),i(r,vt,a),i(r,G,a),t(G,Ze),t(Ze,W),b(ee,W,null),t(G,It),t(G,me),t(me,xt),i(r,ye,a),i(r,Qe,a),t(Qe,it),i(r,Ve,a),b(ft,r,a),i(r,ve,a),i(r,Ae,a),i(r,Dt,a),i(r,Fe,a),t(Fe,ce),t(ce,Pe),b(S,Pe,null),t(Fe,Te),t(Fe,gt),t(gt,Xt),i(r,wt,a),b(he,r,a),i(r,et,a),i(r,ge,a),i(r,kt,a),i(r,Ke,a),t(Ke,te),t(te,ae),b(N,ae,null),t(Ke,de),t(Ke,mt),t(mt,ct),i(r,Ht,a),i(r,tt,a),t(tt,He),i(r,ue,a),i(r,Y,a),t(Y,R),t(R,qe),t(qe,J),t(J,bt),t(qe,Ut),t(Y,ze),t(Y,at),t(at,$e),t($e,xe),t(xe,Zt),t($e,Et),we=!0},p(r,[a]){const _={};a&2&&(_.$$scope={dirty:a,ctx:r}),ft.$set(_);const Ue={};a&2&&(Ue.$$scope={dirty:a,ctx:r}),he.$set(Ue)},i(r){we||(E(q.$$.fragment,r),E(C.$$.fragment,r),E(rt.$$.fragment,r),E(_e.$$.fragment,r),E(B.$$.fragment,r),E(ie.$$.fragment,r),E(Me.$$.fragment,r),E(ee.$$.fragment,r),E(ft.$$.fragment,r),E(S.$$.fragment,r),E(he.$$.fragment,r),E(N.$$.fragment,r),we=!0)},o(r){j(q.$$.fragment,r),j(C.$$.fragment,r),j(rt.$$.fragment,r),j(_e.$$.fragment,r),j(B.$$.fragment,r),j(ie.$$.fragment,r),j(Me.$$.fragment,r),j(ee.$$.fragment,r),j(ft.$$.fragment,r),j(S.$$.fragment,r),j(he.$$.fragment,r),j(N.$$.fragment,r),we=!1},d(r){e($),r&&e(P),r&&e(u),y(q),r&&e(be),y(C,r),r&&e(Pt),r&&e(X),r&&e(Tt),r&&e(z),r&&e(Re),r&&e(se),r&&e(Ne),r&&e(Q),y(rt),r&&e(oe),y(_e,r),r&&e(ne),r&&e(Oe),r&&e($t),r&&e(pe),r&&e(zt),y(B,r),r&&e(Xe),r&&e(H),r&&e(V),y(ie,r),r&&e(je),r&&e(Ie),r&&e(x),y(Me,r),r&&e(pt),r&&e(fe),r&&e(vt),r&&e(G),y(ee),r&&e(ye),r&&e(Qe),r&&e(Ve),y(ft,r),r&&e(ve),r&&e(Ae),r&&e(Dt),r&&e(Fe),y(S),r&&e(wt),y(he,r),r&&e(et),r&&e(ge),r&&e(kt),r&&e(Ke),y(N),r&&e(Ht),r&&e(tt),r&&e(ue),r&&e(Y)}}}const ps={local:"finetune-a-pretrained-model",sections:[{local:"prepare-a-dataset",title:"\uB370\uC774\uD130\uC14B \uC900\uBE44"},{local:"train",title:"Train"},{local:"train-with-pytorch-trainer",sections:[{local:"training-hyperparameters",title:"\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130 \uD6C8\uB828"},{local:"evaluate",title:"\uD3C9\uAC00 \uD558\uAE30"},{local:"trainer",title:"\uD6C8\uB828 \uD558\uAE30"}],title:"\uD30C\uC774\uD1A0\uCE58 Trainer\uB85C \uD6C8\uB828\uD558\uAE30"},{local:"train-a-tensorflow-model-with-keras",sections:[{local:"loading-data-for-keras",title:"Keras\uC6A9 \uB370\uC774\uD130 \uB85C\uB4DC"},{local:"loading-data-as-a-tfdatadataset",title:"\uB370\uC774\uD130\uB97C tf.data.Dataset\uC73C\uB85C \uB85C\uB4DC\uD558\uAE30"}],title:"Keras\uB85C \uD150\uC11C\uD50C\uB85C\uC6B0 \uBAA8\uB378 \uD6C8\uB828\uD558\uAE30"},{local:"train-in-native-pytorch",sections:[{local:"dataloader",title:"DataLoader"},{local:"optimizer-and-learning-rate-scheduler",title:"\uC635\uD2F0\uB9C8\uC774\uC800 \uBC0F \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC"},{local:"training-loop",title:"\uD6C8\uB828 \uB8E8\uD504"},{local:"evaluate",title:"\uD3C9\uAC00 \uD558\uAE30"}],title:"\uAE30\uBCF8 \uD30C\uC774\uD1A0\uCE58\uB85C \uD6C8\uB828\uD558\uAE30"},{local:"additional-resources",title:"\uCD94\uAC00 \uC790\uB8CC"}],title:"\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30"};function is(dt){return Xa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class _s extends Wa{constructor($){super();Ya(this,$,is,ns,Ra,{})}}export{_s as default,ps as metadata};
