import{S as Hs,i as Qs,s as xs,e as r,k as h,w as b,t as f,M as qs,c as n,d as e,m as c,a as o,x as v,h as m,b as d,G as t,g as i,y as j,q as _,o as g,B as J,v as Ds}from"../chunks/vendor-hf-doc-builder.js";import{T as As}from"../chunks/Tip-hf-doc-builder.js";import{Y as Cs}from"../chunks/Youtube-hf-doc-builder.js";import{I as Qt}from"../chunks/IconCopyLink-hf-doc-builder.js";import{C as N}from"../chunks/CodeBlock-hf-doc-builder.js";import{D as Ks}from"../chunks/DocNotebookDropdown-hf-doc-builder.js";import{F as Ss,M as Bs}from"../chunks/Markdown-hf-doc-builder.js";function Ls(dt){let y,T;return{c(){y=r("p"),T=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){y=n(u,"P",{});var E=o(y);T=m(E,`\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.`),E.forEach(e)},m(u,E){i(u,y,E),t(y,T)},d(u){u&&e(y)}}}function Os(dt){let y,T,u,E,k,Z,A,I,ve,je,W,Tt,D,xt,kt,U,Y,Qe,Ie,We,Rt,ut,Zt,Re,zt,K,B,xe,ae,Xe,L,le,re,lt,Ce,Xt,Ct,ne,$e,oe,Ae,qe,yt,pe,$t,z,rt,qt,Ut,P,De,F,V,_e,C,nt,ot,O,ie,ge,Be,At,G,Ve,pt,fe,wt,S,Ke,H,ee,Bt,me,Gt,Je,Le,it,Oe,ft,we,Ee,It,Ye,he,Te,R,ke,Mt,Dt,bt,ce,et,Me,vt,ze,te,se,X,de,mt,ht,Ft,tt,Fe,ue,Q,x,Ze,q,jt,Nt,Ue,st,ye,Ge,Kt,_t,be,l,s,$,Ne,Pe,rs,Vt,gt,Pt,ct,Jt,ts;return y=new Cs({props:{id:"nvBXf7s7vTI"}}),Z=new Qt({}),K=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiUyQyUyMG51bV9sYWJlbHMlM0Q1KQ==",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>)`}}),xe=new As({props:{$$slots:{default:[Ls]},$$scope:{ctx:dt}}}),re=new Qt({}),V=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTBBJTBBdHJhaW5pbmdfYXJncyUyMCUzRCUyMFRyYWluaW5nQXJndW1lbnRzKG91dHB1dF9kaXIlM0QlMjJ0ZXN0X3RyYWluZXIlMjIp",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>)`}}),O=new Qt({}),he=new N({props:{code:"aW1wb3J0JTIwbnVtcHklMjBhcyUyMG5wJTBBaW1wb3J0JTIwZXZhbHVhdGUlMEElMEFtZXRyaWMlMjAlM0QlMjBldmFsdWF0ZS5sb2FkKCUyMmFjY3VyYWN5JTIyKQ==",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>)`}}),se=new N({props:{code:"ZGVmJTIwY29tcHV0ZV9tZXRyaWNzKGV2YWxfcHJlZCklM0ElMEElMjAlMjAlMjAlMjBsb2dpdHMlMkMlMjBsYWJlbHMlMjAlM0QlMjBldmFsX3ByZWQlMEElMjAlMjAlMjAlMjBwcmVkaWN0aW9ucyUyMCUzRCUyMG5wLmFyZ21heChsb2dpdHMlMkMlMjBheGlzJTNELTEpJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwbWV0cmljLmNvbXB1dGUocHJlZGljdGlvbnMlM0RwcmVkaWN0aW9ucyUyQyUyMHJlZmVyZW5jZXMlM0RsYWJlbHMp",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 N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRyYWluaW5nQXJndW1lbnRzJTJDJTIwVHJhaW5lciUwQSUwQXRyYWluaW5nX2FyZ3MlMjAlM0QlMjBUcmFpbmluZ0FyZ3VtZW50cyhvdXRwdXRfZGlyJTNEJTIydGVzdF90cmFpbmVyJTIyJTJDJTIwZXZhbHVhdGlvbl9zdHJhdGVneSUzRCUyMmVwb2NoJTIyKQ==",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>)`}}),jt=new Qt({}),$=new N({props:{code:"dHJhaW5lciUyMCUzRCUyMFRyYWluZXIoJTBBJTIwJTIwJTIwJTIwbW9kZWwlM0Rtb2RlbCUyQyUwQSUyMCUyMCUyMCUyMGFyZ3MlM0R0cmFpbmluZ19hcmdzJTJDJTBBJTIwJTIwJTIwJTIwdHJhaW5fZGF0YXNldCUzRHNtYWxsX3RyYWluX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBldmFsX2RhdGFzZXQlM0RzbWFsbF9ldmFsX2RhdGFzZXQlMkMlMEElMjAlMjAlMjAlMjBjb21wdXRlX21ldHJpY3MlM0Rjb21wdXRlX21ldHJpY3MlMkMlMEEp",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>)`}}),Jt=new N({props:{code:"dHJhaW5lci50cmFpbigp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()'}}),{c(){b(y.$$.fragment),T=h(),u=r("h2"),E=r("a"),k=r("span"),b(Z.$$.fragment),A=h(),I=r("span"),ve=f("\uD30C\uC774\uD1A0\uCE58 Trainer\uB85C \uD6C8\uB828\uD558\uAE30"),je=h(),W=r("p"),Tt=f("\u{1F917} Transformers\uB294 \u{1F917} Transformers \uBAA8\uB378 \uD6C8\uB828\uC5D0 \uCD5C\uC801\uD654\uB41C "),D=r("code"),xt=f("Trainer"),kt=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. "),U=r("code"),Y=f("Trainer"),Qe=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."),Ie=h(),We=r("p"),Rt=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=r("a"),Zt=f("\uB370\uC774\uD130\uC14B \uCE74\uB4DC"),Re=f("\uC5D0\uC11C 5\uAC1C\uC758 \uB808\uC774\uBE14\uC774 \uC788\uC74C\uC744 \uC54C \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),zt=h(),b(K.$$.fragment),B=h(),b(xe.$$.fragment),ae=h(),Xe=r("h3"),L=r("a"),le=r("span"),b(re.$$.fragment),lt=h(),Ce=r("span"),Xt=f("\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130 \uD6C8\uB828"),Ct=h(),ne=r("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 "),oe=r("code"),Ae=f("TrainingArguments"),qe=f(" \uD074\uB798\uC2A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."),yt=h(),pe=r("p"),$t=f("\uC774 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C\uB294 \uAE30\uBCF8 \uD6C8\uB828 "),z=r("a"),rt=f("\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130"),qt=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."),Ut=h(),P=r("p"),De=f("\uD6C8\uB828\uC5D0\uC11C \uCCB4\uD06C\uD3EC\uC778\uD2B8(checkpoints)\uB97C \uC800\uC7A5\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4:"),F=h(),b(V.$$.fragment),_e=h(),C=r("h3"),nt=r("a"),ot=r("span"),b(O.$$.fragment),ie=h(),ge=r("span"),Be=f("\uD3C9\uAC00 \uD558\uAE30"),At=h(),G=r("p"),Ve=r("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 "),wt=r("code"),S=f("Trainer"),Ke=f(`\uC5D0 \uC804\uB2EC\uD574\uC57C \uD569\uB2C8\uB2E4.
`),H=r("a"),ee=f("\u{1F917} Evaluate"),Bt=f(" \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 "),me=r("a"),Gt=r("code"),Je=f("evaluate.load"),Le=f(" \uD568\uC218\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uB294 \uAC04\uB2E8\uD55C "),it=r("code"),Oe=f("accuracy"),ft=f("\uD568\uC218\uB97C \uC81C\uACF5\uD569\uB2C8\uB2E4 (\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 "),we=r("a"),Ee=f("\uB458\uB7EC\uBCF4\uAE30"),It=f("\uB97C \uCC38\uC870\uD558\uC138\uC694):"),Ye=h(),b(he.$$.fragment),Te=h(),R=r("p"),ke=r("code"),Mt=f("metric"),Dt=f("\uC5D0\uC11C "),bt=r("code"),ce=f("compute"),et=f("\uB97C \uD638\uCD9C\uD558\uC5EC \uC608\uCE21\uC758 \uC815\uD655\uB3C4\uB97C \uACC4\uC0B0\uD569\uB2C8\uB2E4. \uC608\uCE21\uC744 "),Me=r("code"),vt=f("compute"),ze=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=h(),b(se.$$.fragment),X=h(),de=r("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 "),ht=r("code"),Ft=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:"),Fe=h(),b(ue.$$.fragment),Q=h(),x=r("h3"),Ze=r("a"),q=r("span"),b(jt.$$.fragment),Nt=h(),Ue=r("span"),st=f("\uD6C8\uB828 \uD558\uAE30"),ye=h(),Ge=r("p"),Kt=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 "),_t=r("code"),be=f("Trainer"),l=f(" \uAC1D\uCCB4\uB97C \uB9CC\uB4ED\uB2C8\uB2E4:"),s=h(),b($.$$.fragment),Ne=h(),Pe=r("p"),rs=f("\uADF8\uB9AC\uACE0 "),Vt=r("code"),gt=f("train()"),Pt=f("\uC744 \uD638\uCD9C\uD558\uC5EC \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD569\uB2C8\uB2E4:"),ct=h(),b(Jt.$$.fragment),this.h()},l(p){v(y.$$.fragment,p),T=c(p),u=n(p,"H2",{class:!0});var M=o(u);E=n(M,"A",{id:!0,class:!0,href:!0});var Lt=o(E);k=n(Lt,"SPAN",{});var St=o(k);v(Z.$$.fragment,St),St.forEach(e),Lt.forEach(e),A=c(M),I=n(M,"SPAN",{});var ns=o(I);ve=m(ns,"\uD30C\uC774\uD1A0\uCE58 Trainer\uB85C \uD6C8\uB828\uD558\uAE30"),ns.forEach(e),M.forEach(e),je=c(p),W=n(p,"P",{});var Se=o(W);Tt=m(Se,"\u{1F917} Transformers\uB294 \u{1F917} Transformers \uBAA8\uB378 \uD6C8\uB828\uC5D0 \uCD5C\uC801\uD654\uB41C "),D=n(Se,"CODE",{});var os=o(D);xt=m(os,"Trainer"),os.forEach(e),kt=m(Se," \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. "),U=n(Se,"CODE",{});var a=o(U);Y=m(a,"Trainer"),a.forEach(e),Qe=m(Se," 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."),Se.forEach(e),Ie=c(p),We=n(p,"P",{});var w=o(We);Rt=m(w,"\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=n(w,"A",{href:!0,rel:!0});var Ht=o(ut);Zt=m(Ht,"\uB370\uC774\uD130\uC14B \uCE74\uB4DC"),Ht.forEach(e),Re=m(w,"\uC5D0\uC11C 5\uAC1C\uC758 \uB808\uC774\uBE14\uC774 \uC788\uC74C\uC744 \uC54C \uC218 \uC788\uC2B5\uB2C8\uB2E4:"),w.forEach(e),zt=c(p),v(K.$$.fragment,p),B=c(p),v(xe.$$.fragment,p),ae=c(p),Xe=n(p,"H3",{class:!0});var ps=o(Xe);L=n(ps,"A",{id:!0,class:!0,href:!0});var is=o(L);le=n(is,"SPAN",{});var Ot=o(le);v(re.$$.fragment,Ot),Ot.forEach(e),is.forEach(e),lt=c(ps),Ce=n(ps,"SPAN",{});var Yt=o(Ce);Xt=m(Yt,"\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130 \uD6C8\uB828"),Yt.forEach(e),ps.forEach(e),Ct=c(p),ne=n(p,"P",{});var es=o(ne);$e=m(es,"\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 "),oe=n(es,"CODE",{});var us=o(oe);Ae=m(us,"TrainingArguments"),us.forEach(e),qe=m(es," \uD074\uB798\uC2A4\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4."),es.forEach(e),yt=c(p),pe=n(p,"P",{});var Et=o(pe);$t=m(Et,"\uC774 \uD29C\uD1A0\uB9AC\uC5BC\uC5D0\uC11C\uB294 \uAE30\uBCF8 \uD6C8\uB828 "),z=n(Et,"A",{href:!0,rel:!0});var Wt=o(z);rt=m(Wt,"\uD558\uC774\uD37C\uD30C\uB77C\uBBF8\uD130"),Wt.forEach(e),qt=m(Et,"\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."),Et.forEach(e),Ut=c(p),P=n(p,"P",{});var ys=o(P);De=m(ys,"\uD6C8\uB828\uC5D0\uC11C \uCCB4\uD06C\uD3EC\uC778\uD2B8(checkpoints)\uB97C \uC800\uC7A5\uD560 \uC704\uCE58\uB97C \uC9C0\uC815\uD569\uB2C8\uB2E4:"),ys.forEach(e),F=c(p),v(V.$$.fragment,p),_e=c(p),C=n(p,"H3",{class:!0});var ss=o(C);nt=n(ss,"A",{id:!0,class:!0,href:!0});var fs=o(nt);ot=n(fs,"SPAN",{});var as=o(ot);v(O.$$.fragment,as),as.forEach(e),fs.forEach(e),ie=c(ss),ge=n(ss,"SPAN",{});var $s=o(ge);Be=m($s,"\uD3C9\uAC00 \uD558\uAE30"),$s.forEach(e),ss.forEach(e),At=c(p),G=n(p,"P",{});var He=o(G);Ve=n(He,"CODE",{});var at=o(Ve);pt=m(at,"Trainer"),at.forEach(e),fe=m(He,"\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 "),wt=n(He,"CODE",{});var ms=o(wt);S=m(ms,"Trainer"),ms.forEach(e),Ke=m(He,`\uC5D0 \uC804\uB2EC\uD574\uC57C \uD569\uB2C8\uB2E4.
`),H=n(He,"A",{href:!0,rel:!0});var ws=o(H);ee=m(ws,"\u{1F917} Evaluate"),ws.forEach(e),Bt=m(He," \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 "),me=n(He,"A",{href:!0,rel:!0});var cs=o(me);Gt=n(cs,"CODE",{});var Ms=o(Gt);Je=m(Ms,"evaluate.load"),Ms.forEach(e),cs.forEach(e),Le=m(He," \uD568\uC218\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uB294 \uAC04\uB2E8\uD55C "),it=n(He,"CODE",{});var ds=o(it);Oe=m(ds,"accuracy"),ds.forEach(e),ft=m(He,"\uD568\uC218\uB97C \uC81C\uACF5\uD569\uB2C8\uB2E4 (\uC790\uC138\uD55C \uB0B4\uC6A9\uC740 "),we=n(He,"A",{href:!0,rel:!0});var ls=o(we);Ee=m(ls,"\uB458\uB7EC\uBCF4\uAE30"),ls.forEach(e),It=m(He,"\uB97C \uCC38\uC870\uD558\uC138\uC694):"),He.forEach(e),Ye=c(p),v(he.$$.fragment,p),Te=c(p),R=n(p,"P",{});var hs=o(R);ke=n(hs,"CODE",{});var Js=o(ke);Mt=m(Js,"metric"),Js.forEach(e),Dt=m(hs,"\uC5D0\uC11C "),bt=n(hs,"CODE",{});var Es=o(bt);ce=m(Es,"compute"),Es.forEach(e),et=m(hs,"\uB97C \uD638\uCD9C\uD558\uC5EC \uC608\uCE21\uC758 \uC815\uD655\uB3C4\uB97C \uACC4\uC0B0\uD569\uB2C8\uB2E4. \uC608\uCE21\uC744 "),Me=n(hs,"CODE",{});var js=o(Me);vt=m(js,"compute"),js.forEach(e),ze=m(hs,"\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):"),hs.forEach(e),te=c(p),v(se.$$.fragment,p),X=c(p),de=n(p,"P",{});var _s=o(de);mt=m(_s,"\uBBF8\uC138 \uD29C\uB2DD \uC911\uC5D0 \uD3C9\uAC00 \uC9C0\uD45C\uB97C \uBAA8\uB2C8\uD130\uB9C1\uD558\uB824\uBA74 \uD6C8\uB828 \uC778\uC218\uC5D0 "),ht=n(_s,"CODE",{});var Ts=o(ht);Ft=m(Ts,"evaluation_strategy"),Ts.forEach(e),tt=m(_s," \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:"),_s.forEach(e),Fe=c(p),v(ue.$$.fragment,p),Q=c(p),x=n(p,"H3",{class:!0});var vs=o(x);Ze=n(vs,"A",{id:!0,class:!0,href:!0});var ks=o(Ze);q=n(ks,"SPAN",{});var Zs=o(q);v(jt.$$.fragment,Zs),Zs.forEach(e),ks.forEach(e),Nt=c(vs),Ue=n(vs,"SPAN",{});var Us=o(Ue);st=m(Us,"\uD6C8\uB828 \uD558\uAE30"),Us.forEach(e),vs.forEach(e),ye=c(p),Ge=n(p,"P",{});var bs=o(Ge);Kt=m(bs,"\uBAA8\uB378, \uD6C8\uB828 \uC778\uC218, \uD6C8\uB828 \uBC0F \uD14C\uC2A4\uD2B8 \uB370\uC774\uD130\uC14B, \uD3C9\uAC00 \uD568\uC218\uAC00 \uD3EC\uD568\uB41C "),_t=n(bs,"CODE",{});var Gs=o(_t);be=m(Gs,"Trainer"),Gs.forEach(e),l=m(bs," \uAC1D\uCCB4\uB97C \uB9CC\uB4ED\uB2C8\uB2E4:"),bs.forEach(e),s=c(p),v($.$$.fragment,p),Ne=c(p),Pe=n(p,"P",{});var gs=o(Pe);rs=m(gs,"\uADF8\uB9AC\uACE0 "),Vt=n(gs,"CODE",{});var Is=o(Vt);gt=m(Is,"train()"),Is.forEach(e),Pt=m(gs,"\uC744 \uD638\uCD9C\uD558\uC5EC \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD569\uB2C8\uB2E4:"),gs.forEach(e),ct=c(p),v(Jt.$$.fragment,p),this.h()},h(){d(E,"id","train-with-pytorch-trainer"),d(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(E,"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(L,"id","training-hyperparameters"),d(L,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(L,"href","#training-hyperparameters"),d(Xe,"class","relative group"),d(z,"href","https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments"),d(z,"rel","nofollow"),d(nt,"id","evaluate"),d(nt,"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(nt,"href","#evaluate"),d(C,"class","relative group"),d(H,"href","https://huggingface.co/docs/evaluate/index"),d(H,"rel","nofollow"),d(me,"href","https://huggingface.co/spaces/evaluate-metric/accuracy"),d(me,"rel","nofollow"),d(we,"href","https://huggingface.co/docs/evaluate/a_quick_tour"),d(we,"rel","nofollow"),d(Ze,"id","trainer"),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","#trainer"),d(x,"class","relative group")},m(p,M){j(y,p,M),i(p,T,M),i(p,u,M),t(u,E),t(E,k),j(Z,k,null),t(u,A),t(u,I),t(I,ve),i(p,je,M),i(p,W,M),t(W,Tt),t(W,D),t(D,xt),t(W,kt),t(W,U),t(U,Y),t(W,Qe),i(p,Ie,M),i(p,We,M),t(We,Rt),t(We,ut),t(ut,Zt),t(We,Re),i(p,zt,M),j(K,p,M),i(p,B,M),j(xe,p,M),i(p,ae,M),i(p,Xe,M),t(Xe,L),t(L,le),j(re,le,null),t(Xe,lt),t(Xe,Ce),t(Ce,Xt),i(p,Ct,M),i(p,ne,M),t(ne,$e),t(ne,oe),t(oe,Ae),t(ne,qe),i(p,yt,M),i(p,pe,M),t(pe,$t),t(pe,z),t(z,rt),t(pe,qt),i(p,Ut,M),i(p,P,M),t(P,De),i(p,F,M),j(V,p,M),i(p,_e,M),i(p,C,M),t(C,nt),t(nt,ot),j(O,ot,null),t(C,ie),t(C,ge),t(ge,Be),i(p,At,M),i(p,G,M),t(G,Ve),t(Ve,pt),t(G,fe),t(G,wt),t(wt,S),t(G,Ke),t(G,H),t(H,ee),t(G,Bt),t(G,me),t(me,Gt),t(Gt,Je),t(G,Le),t(G,it),t(it,Oe),t(G,ft),t(G,we),t(we,Ee),t(G,It),i(p,Ye,M),j(he,p,M),i(p,Te,M),i(p,R,M),t(R,ke),t(ke,Mt),t(R,Dt),t(R,bt),t(bt,ce),t(R,et),t(R,Me),t(Me,vt),t(R,ze),i(p,te,M),j(se,p,M),i(p,X,M),i(p,de,M),t(de,mt),t(de,ht),t(ht,Ft),t(de,tt),i(p,Fe,M),j(ue,p,M),i(p,Q,M),i(p,x,M),t(x,Ze),t(Ze,q),j(jt,q,null),t(x,Nt),t(x,Ue),t(Ue,st),i(p,ye,M),i(p,Ge,M),t(Ge,Kt),t(Ge,_t),t(_t,be),t(Ge,l),i(p,s,M),j($,p,M),i(p,Ne,M),i(p,Pe,M),t(Pe,rs),t(Pe,Vt),t(Vt,gt),t(Pe,Pt),i(p,ct,M),j(Jt,p,M),ts=!0},p(p,M){const Lt={};M&2&&(Lt.$$scope={dirty:M,ctx:p}),xe.$set(Lt)},i(p){ts||(_(y.$$.fragment,p),_(Z.$$.fragment,p),_(K.$$.fragment,p),_(xe.$$.fragment,p),_(re.$$.fragment,p),_(V.$$.fragment,p),_(O.$$.fragment,p),_(he.$$.fragment,p),_(se.$$.fragment,p),_(ue.$$.fragment,p),_(jt.$$.fragment,p),_($.$$.fragment,p),_(Jt.$$.fragment,p),ts=!0)},o(p){g(y.$$.fragment,p),g(Z.$$.fragment,p),g(K.$$.fragment,p),g(xe.$$.fragment,p),g(re.$$.fragment,p),g(V.$$.fragment,p),g(O.$$.fragment,p),g(he.$$.fragment,p),g(se.$$.fragment,p),g(ue.$$.fragment,p),g(jt.$$.fragment,p),g($.$$.fragment,p),g(Jt.$$.fragment,p),ts=!1},d(p){J(y,p),p&&e(T),p&&e(u),J(Z),p&&e(je),p&&e(W),p&&e(Ie),p&&e(We),p&&e(zt),J(K,p),p&&e(B),J(xe,p),p&&e(ae),p&&e(Xe),J(re),p&&e(Ct),p&&e(ne),p&&e(yt),p&&e(pe),p&&e(Ut),p&&e(P),p&&e(F),J(V,p),p&&e(_e),p&&e(C),J(O),p&&e(At),p&&e(G),p&&e(Ye),J(he,p),p&&e(Te),p&&e(R),p&&e(te),J(se,p),p&&e(X),p&&e(de),p&&e(Fe),J(ue,p),p&&e(Q),p&&e(x),J(jt),p&&e(ye),p&&e(Ge),p&&e(s),J($,p),p&&e(Ne),p&&e(Pe),p&&e(ct),J(Jt,p)}}}function ea(dt){let y,T;return y=new Bs({props:{$$slots:{default:[Os]},$$scope:{ctx:dt}}}),{c(){b(y.$$.fragment)},l(u){v(y.$$.fragment,u)},m(u,E){j(y,u,E),T=!0},p(u,E){const k={};E&2&&(k.$$scope={dirty:E,ctx:u}),y.$set(k)},i(u){T||(_(y.$$.fragment,u),T=!0)},o(u){g(y.$$.fragment,u),T=!1},d(u){J(y,u)}}}function ta(dt){let y,T,u,E,k;return{c(){y=r("p"),T=f("\uBAA8\uB378\uC744 "),u=r("code"),E=f("compile()"),k=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(Z){y=n(Z,"P",{});var A=o(y);T=m(A,"\uBAA8\uB378\uC744 "),u=n(A,"CODE",{});var I=o(u);E=m(I,"compile()"),I.forEach(e),k=m(A,`\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!`),A.forEach(e)},m(Z,A){i(Z,y,A),t(y,T),t(y,u),t(u,E),t(y,k)},d(Z){Z&&e(y)}}}function sa(dt){let y,T,u,E,k,Z,A,I,ve,je,W,Tt,D,xt,kt,U,Y,Qe,Ie,We,Rt,ut,Zt,Re,zt,K,B,xe,ae,Xe,L,le,re,lt,Ce,Xt,Ct,ne,$e,oe,Ae,qe,yt,pe,$t,z,rt,qt,Ut,P,De,F,V,_e,C,nt,ot,O,ie,ge,Be,At,G,Ve,pt,fe,wt,S,Ke,H,ee,Bt,me,Gt,Je,Le,it,Oe,ft,we,Ee,It,Ye,he,Te,R,ke,Mt,Dt,bt,ce,et,Me,vt,ze,te,se,X,de,mt,ht,Ft,tt,Fe,ue,Q,x,Ze,q,jt,Nt,Ue,st,ye,Ge,Kt,_t,be,l;return u=new Cs({props:{id:"rnTGBy2ax1c"}}),I=new Qt({}),Ie=new Qt({}),re=new N({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJnbHVlJTIyJTJDJTIwJTIyY29sYSUyMiklMEFkYXRhc2V0JTIwJTNEJTIwZGF0YXNldCU1QiUyMnRyYWluJTIyJTVEJTIwJTIwJTIzJTIwSnVzdCUyMHRha2UlMjB0aGUlMjB0cmFpbmluZyUyMHNwbGl0JTIwZm9yJTIwbm93",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>`}}),ne=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBdG9rZW5pemVkX2RhdGElMjAlM0QlMjB0b2tlbml6ZXIoZGF0YXNldCU1QiUyMnNlbnRlbmNlJTIyJTVEJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJucCUyMiUyQyUyMHBhZGRpbmclM0RUcnVlKSUwQSUyMyUyMFRva2VuaXplciUyMHJldHVybnMlMjBhJTIwQmF0Y2hFbmNvZGluZyUyQyUyMGJ1dCUyMHdlJTIwY29udmVydCUyMHRoYXQlMjB0byUyMGElMjBkaWN0JTIwZm9yJTIwS2VyYXMlMEF0b2tlbml6ZWRfZGF0YSUyMCUzRCUyMGRpY3QodG9rZW5pemVkX2RhdGEpJTBBJTBBbGFiZWxzJTIwJTNEJTIwbnAuYXJyYXkoZGF0YXNldCU1QiUyMmxhYmVsJTIyJTVEKSUyMCUyMCUyMyUyMExhYmVsJTIwaXMlMjBhbHJlYWR5JTIwYW4lMjBhcnJheSUyMG9mJTIwMCUyMGFuZCUyMDE=",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>`}}),De=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQWZyb20lMjB0ZW5zb3JmbG93LmtlcmFzLm9wdGltaXplcnMlMjBpbXBvcnQlMjBBZGFtJTBBJTBBJTIzJTIwTG9hZCUyMGFuZCUyMGNvbXBpbGUlMjBvdXIlMjBtb2RlbCUwQW1vZGVsJTIwJTNEJTIwVEZBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTIzJTIwTG93ZXIlMjBsZWFybmluZyUyMHJhdGVzJTIwYXJlJTIwb2Z0ZW4lMjBiZXR0ZXIlMjBmb3IlMjBmaW5lLXR1bmluZyUyMHRyYW5zZm9ybWVycyUwQW1vZGVsLmNvbXBpbGUob3B0aW1pemVyJTNEQWRhbSgzZS01KSklMEElMEFtb2RlbC5maXQodG9rZW5pemVkX2RhdGElMkMlMjBsYWJlbHMp",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)`}}),V=new As({props:{$$slots:{default:[ta]},$$scope:{ctx:dt}}}),Be=new Qt({}),ce=new N({props:{code:"ZGVmJTIwdG9rZW5pemVfZGF0YXNldChkYXRhKSUzQSUwQSUyMCUyMCUyMCUyMCUyMyUyMEtleXMlMjBvZiUyMHRoZSUyMHJldHVybmVkJTIwZGljdGlvbmFyeSUyMHdpbGwlMjBiZSUyMGFkZGVkJTIwdG8lMjB0aGUlMjBkYXRhc2V0JTIwYXMlMjBjb2x1bW5zJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwdG9rZW5pemVyKGRhdGElNUIlMjJ0ZXh0JTIyJTVEKSUwQSUwQSUwQWRhdGFzZXQlMjAlM0QlMjBkYXRhc2V0Lm1hcCh0b2tlbml6ZV9kYXRhc2V0KQ==",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 N({props:{code:"dGZfZGF0YXNldCUyMCUzRCUyMG1vZGVsLnByZXBhcmVfdGZfZGF0YXNldChkYXRhc2V0JTJDJTIwYmF0Y2hfc2l6ZSUzRDE2JTJDJTIwc2h1ZmZsZSUzRFRydWUlMkMlMjB0b2tlbml6ZXIlM0R0b2tlbml6ZXIp",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)'}}),be=new N({props:{code:"bW9kZWwuY29tcGlsZShvcHRpbWl6ZXIlM0RBZGFtKDNlLTUpKSUwQSUwQW1vZGVsLmZpdCh0Zl9kYXRhc2V0KQ==",highlighted:`model.<span class="hljs-built_in">compile</span>(optimizer=Adam(<span class="hljs-number">3e-5</span>))

model.fit(tf_dataset)`}}),{c(){y=r("a"),T=h(),b(u.$$.fragment),E=h(),k=r("h2"),Z=r("a"),A=r("span"),b(I.$$.fragment),ve=h(),je=r("span"),W=f("Keras\uB85C \uD150\uC11C\uD50C\uB85C\uC6B0 \uBAA8\uB378 \uD6C8\uB828\uD558\uAE30"),Tt=h(),D=r("p"),xt=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!"),kt=h(),U=r("h3"),Y=r("a"),Qe=r("span"),b(Ie.$$.fragment),We=h(),Rt=r("span"),ut=f("Keras\uC6A9 \uB370\uC774\uD130 \uB85C\uB4DC"),Zt=h(),Re=r("p"),zt=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.`),K=h(),B=r("p"),xe=f("\uBA3C\uC800 \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. "),ae=r("a"),Xe=f("GLUE \uBCA4\uCE58\uB9C8\uD06C"),L=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.`),le=h(),b(re.$$.fragment),lt=h(),Ce=r("p"),Xt=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!"),Ct=h(),b(ne.$$.fragment),$e=h(),oe=r("p"),Ae=f("\uB9C8\uC9C0\uB9C9\uC73C\uB85C \uBAA8\uB378\uC744 \uB85C\uB4DC, "),qe=r("a"),yt=r("code"),pe=f("compile"),$t=f(", "),z=r("a"),rt=r("code"),qt=f("fit"),Ut=f("\uD569\uB2C8\uB2E4:"),P=h(),b(De.$$.fragment),F=h(),b(V.$$.fragment),_e=h(),C=r("p"),nt=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!`),ot=h(),O=r("h3"),ie=r("a"),ge=r("span"),b(Be.$$.fragment),At=h(),G=r("span"),Ve=f("\uB370\uC774\uD130\uB97C tf.data.Dataset\uC73C\uB85C \uB85C\uB4DC\uD558\uAE30"),pt=h(),fe=r("p"),wt=f("\uD559\uC2B5 \uC18D\uB3C4\uAC00 \uB290\uB824\uC9C0\uB294 \uAC83\uC744 \uD53C\uD558\uB824\uBA74 \uB370\uC774\uD130\uB97C "),S=r("code"),Ke=f("tf.data.Dataset"),H=f(`\uC73C\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC6D0\uD55C\uB2E4\uBA74 \uC9C1\uC811
`),ee=r("code"),Bt=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:"),Gt=h(),Je=r("ul"),Le=r("li"),it=r("code"),Oe=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.`),we=h(),Ee=r("li"),It=r("code"),Ye=f("to_tf_dataset"),he=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.`),Te=h(),R=r("p"),ke=r("code"),Mt=f("prepare_tf_dataset()"),Dt=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:"),bt=h(),b(ce.$$.fragment),et=h(),Me=r("p"),vt=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.`),ze=h(),b(te.$$.fragment),se=h(),X=r("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=r("code"),ht=f("prepare_tf_dataset"),Ft=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=r("code"),Fe=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.
`),Q=r("a"),x=f("\uC608\uC2DC"),Ze=f(` \uB610\uB294
`),q=r("a"),jt=f("\uB178\uD2B8\uBD81"),Nt=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."),Ue=h(),st=r("p"),ye=r("code"),Ge=f("tf.data.Dataset"),Kt=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:"),_t=h(),b(be.$$.fragment),this.h()},l(s){y=n(s,"A",{id:!0}),o(y).forEach(e),T=c(s),v(u.$$.fragment,s),E=c(s),k=n(s,"H2",{class:!0});var $=o(k);Z=n($,"A",{id:!0,class:!0,href:!0});var Ne=o(Z);A=n(Ne,"SPAN",{});var Pe=o(A);v(I.$$.fragment,Pe),Pe.forEach(e),Ne.forEach(e),ve=c($),je=n($,"SPAN",{});var rs=o(je);W=m(rs,"Keras\uB85C \uD150\uC11C\uD50C\uB85C\uC6B0 \uBAA8\uB378 \uD6C8\uB828\uD558\uAE30"),rs.forEach(e),$.forEach(e),Tt=c(s),D=n(s,"P",{});var Vt=o(D);xt=m(Vt,"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!"),Vt.forEach(e),kt=c(s),U=n(s,"H3",{class:!0});var gt=o(U);Y=n(gt,"A",{id:!0,class:!0,href:!0});var Pt=o(Y);Qe=n(Pt,"SPAN",{});var ct=o(Qe);v(Ie.$$.fragment,ct),ct.forEach(e),Pt.forEach(e),We=c(gt),Rt=n(gt,"SPAN",{});var Jt=o(Rt);ut=m(Jt,"Keras\uC6A9 \uB370\uC774\uD130 \uB85C\uB4DC"),Jt.forEach(e),gt.forEach(e),Zt=c(s),Re=n(s,"P",{});var ts=o(Re);zt=m(ts,`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.`),ts.forEach(e),K=c(s),B=n(s,"P",{});var p=o(B);xe=m(p,"\uBA3C\uC800 \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4. "),ae=n(p,"A",{href:!0,rel:!0});var M=o(ae);Xe=m(M,"GLUE \uBCA4\uCE58\uB9C8\uD06C"),M.forEach(e),L=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),le=c(s),v(re.$$.fragment,s),lt=c(s),Ce=n(s,"P",{});var Lt=o(Ce);Xt=m(Lt,"\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.forEach(e),Ct=c(s),v(ne.$$.fragment,s),$e=c(s),oe=n(s,"P",{});var St=o(oe);Ae=m(St,"\uB9C8\uC9C0\uB9C9\uC73C\uB85C \uBAA8\uB378\uC744 \uB85C\uB4DC, "),qe=n(St,"A",{href:!0,rel:!0});var ns=o(qe);yt=n(ns,"CODE",{});var Se=o(yt);pe=m(Se,"compile"),Se.forEach(e),ns.forEach(e),$t=m(St,", "),z=n(St,"A",{href:!0,rel:!0});var os=o(z);rt=n(os,"CODE",{});var a=o(rt);qt=m(a,"fit"),a.forEach(e),os.forEach(e),Ut=m(St,"\uD569\uB2C8\uB2E4:"),St.forEach(e),P=c(s),v(De.$$.fragment,s),F=c(s),v(V.$$.fragment,s),_e=c(s),C=n(s,"P",{});var w=o(C);nt=m(w,`\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!`),w.forEach(e),ot=c(s),O=n(s,"H3",{class:!0});var Ht=o(O);ie=n(Ht,"A",{id:!0,class:!0,href:!0});var ps=o(ie);ge=n(ps,"SPAN",{});var is=o(ge);v(Be.$$.fragment,is),is.forEach(e),ps.forEach(e),At=c(Ht),G=n(Ht,"SPAN",{});var Ot=o(G);Ve=m(Ot,"\uB370\uC774\uD130\uB97C tf.data.Dataset\uC73C\uB85C \uB85C\uB4DC\uD558\uAE30"),Ot.forEach(e),Ht.forEach(e),pt=c(s),fe=n(s,"P",{});var Yt=o(fe);wt=m(Yt,"\uD559\uC2B5 \uC18D\uB3C4\uAC00 \uB290\uB824\uC9C0\uB294 \uAC83\uC744 \uD53C\uD558\uB824\uBA74 \uB370\uC774\uD130\uB97C "),S=n(Yt,"CODE",{});var es=o(S);Ke=m(es,"tf.data.Dataset"),es.forEach(e),H=m(Yt,`\uC73C\uB85C \uB85C\uB4DC\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uC6D0\uD55C\uB2E4\uBA74 \uC9C1\uC811
`),ee=n(Yt,"CODE",{});var us=o(ee);Bt=m(us,"tf.data"),us.forEach(e),me=m(Yt," \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:"),Yt.forEach(e),Gt=c(s),Je=n(s,"UL",{});var Et=o(Je);Le=n(Et,"LI",{});var Wt=o(Le);it=n(Wt,"CODE",{});var ys=o(it);Oe=m(ys,"prepare_tf_dataset()"),ys.forEach(e),ft=m(Wt,`: \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.`),Wt.forEach(e),we=c(Et),Ee=n(Et,"LI",{});var ss=o(Ee);It=n(ss,"CODE",{});var fs=o(It);Ye=m(fs,"to_tf_dataset"),fs.forEach(e),he=m(ss,`: \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.`),ss.forEach(e),Et.forEach(e),Te=c(s),R=n(s,"P",{});var as=o(R);ke=n(as,"CODE",{});var $s=o(ke);Mt=m($s,"prepare_tf_dataset()"),$s.forEach(e),Dt=m(as,"\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:"),as.forEach(e),bt=c(s),v(ce.$$.fragment,s),et=c(s),Me=n(s,"P",{});var He=o(Me);vt=m(He,`\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.`),He.forEach(e),ze=c(s),v(te.$$.fragment,s),se=c(s),X=n(s,"P",{});var at=o(X);de=m(at,"\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=n(at,"CODE",{});var ms=o(mt);ht=m(ms,"prepare_tf_dataset"),ms.forEach(e),Ft=m(at,`\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=n(at,"CODE",{});var ws=o(tt);Fe=m(ws,"collate_fn"),ws.forEach(e),ue=m(at,` \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.
`),Q=n(at,"A",{href:!0,rel:!0});var cs=o(Q);x=m(cs,"\uC608\uC2DC"),cs.forEach(e),Ze=m(at,` \uB610\uB294
`),q=n(at,"A",{href:!0,rel:!0});var Ms=o(q);jt=m(Ms,"\uB178\uD2B8\uBD81"),Ms.forEach(e),Nt=m(at,"\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."),at.forEach(e),Ue=c(s),st=n(s,"P",{});var ds=o(st);ye=n(ds,"CODE",{});var ls=o(ye);Ge=m(ls,"tf.data.Dataset"),ls.forEach(e),Kt=m(ds,"\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:"),ds.forEach(e),_t=c(s),v(be.$$.fragment,s),this.h()},h(){d(y,"id","keras"),d(Z,"id","train-a-tensorflow-model-with-keras"),d(Z,"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(Z,"href","#train-a-tensorflow-model-with-keras"),d(k,"class","relative group"),d(Y,"id","loading-data-for-keras"),d(Y,"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(Y,"href","#loading-data-for-keras"),d(U,"class","relative group"),d(ae,"href","https://huggingface.co/datasets/glue"),d(ae,"rel","nofollow"),d(qe,"href","https://keras.io/api/models/model_training_apis/#compile-method"),d(qe,"rel","nofollow"),d(z,"href","https://keras.io/api/models/model_training_apis/#fit-method"),d(z,"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(O,"class","relative group"),d(Q,"href","https://github.com/huggingface/transformers/tree/main/examples"),d(Q,"rel","nofollow"),d(q,"href","https://huggingface.co/docs/transformers/notebooks"),d(q,"rel","nofollow")},m(s,$){i(s,y,$),i(s,T,$),j(u,s,$),i(s,E,$),i(s,k,$),t(k,Z),t(Z,A),j(I,A,null),t(k,ve),t(k,je),t(je,W),i(s,Tt,$),i(s,D,$),t(D,xt),i(s,kt,$),i(s,U,$),t(U,Y),t(Y,Qe),j(Ie,Qe,null),t(U,We),t(U,Rt),t(Rt,ut),i(s,Zt,$),i(s,Re,$),t(Re,zt),i(s,K,$),i(s,B,$),t(B,xe),t(B,ae),t(ae,Xe),t(B,L),i(s,le,$),j(re,s,$),i(s,lt,$),i(s,Ce,$),t(Ce,Xt),i(s,Ct,$),j(ne,s,$),i(s,$e,$),i(s,oe,$),t(oe,Ae),t(oe,qe),t(qe,yt),t(yt,pe),t(oe,$t),t(oe,z),t(z,rt),t(rt,qt),t(oe,Ut),i(s,P,$),j(De,s,$),i(s,F,$),j(V,s,$),i(s,_e,$),i(s,C,$),t(C,nt),i(s,ot,$),i(s,O,$),t(O,ie),t(ie,ge),j(Be,ge,null),t(O,At),t(O,G),t(G,Ve),i(s,pt,$),i(s,fe,$),t(fe,wt),t(fe,S),t(S,Ke),t(fe,H),t(fe,ee),t(ee,Bt),t(fe,me),i(s,Gt,$),i(s,Je,$),t(Je,Le),t(Le,it),t(it,Oe),t(Le,ft),t(Je,we),t(Je,Ee),t(Ee,It),t(It,Ye),t(Ee,he),i(s,Te,$),i(s,R,$),t(R,ke),t(ke,Mt),t(R,Dt),i(s,bt,$),j(ce,s,$),i(s,et,$),i(s,Me,$),t(Me,vt),i(s,ze,$),j(te,s,$),i(s,se,$),i(s,X,$),t(X,de),t(X,mt),t(mt,ht),t(X,Ft),t(X,tt),t(tt,Fe),t(X,ue),t(X,Q),t(Q,x),t(X,Ze),t(X,q),t(q,jt),t(X,Nt),i(s,Ue,$),i(s,st,$),t(st,ye),t(ye,Ge),t(st,Kt),i(s,_t,$),j(be,s,$),l=!0},p(s,$){const Ne={};$&2&&(Ne.$$scope={dirty:$,ctx:s}),V.$set(Ne)},i(s){l||(_(u.$$.fragment,s),_(I.$$.fragment,s),_(Ie.$$.fragment,s),_(re.$$.fragment,s),_(ne.$$.fragment,s),_(De.$$.fragment,s),_(V.$$.fragment,s),_(Be.$$.fragment,s),_(ce.$$.fragment,s),_(te.$$.fragment,s),_(be.$$.fragment,s),l=!0)},o(s){g(u.$$.fragment,s),g(I.$$.fragment,s),g(Ie.$$.fragment,s),g(re.$$.fragment,s),g(ne.$$.fragment,s),g(De.$$.fragment,s),g(V.$$.fragment,s),g(Be.$$.fragment,s),g(ce.$$.fragment,s),g(te.$$.fragment,s),g(be.$$.fragment,s),l=!1},d(s){s&&e(y),s&&e(T),J(u,s),s&&e(E),s&&e(k),J(I),s&&e(Tt),s&&e(D),s&&e(kt),s&&e(U),J(Ie),s&&e(Zt),s&&e(Re),s&&e(K),s&&e(B),s&&e(le),J(re,s),s&&e(lt),s&&e(Ce),s&&e(Ct),J(ne,s),s&&e($e),s&&e(oe),s&&e(P),J(De,s),s&&e(F),J(V,s),s&&e(_e),s&&e(C),s&&e(ot),s&&e(O),J(Be),s&&e(pt),s&&e(fe),s&&e(Gt),s&&e(Je),s&&e(Te),s&&e(R),s&&e(bt),J(ce,s),s&&e(et),s&&e(Me),s&&e(ze),J(te,s),s&&e(se),s&&e(X),s&&e(Ue),s&&e(st),s&&e(_t),J(be,s)}}}function aa(dt){let y,T;return y=new Bs({props:{$$slots:{default:[sa]},$$scope:{ctx:dt}}}),{c(){b(y.$$.fragment)},l(u){v(y.$$.fragment,u)},m(u,E){j(y,u,E),T=!0},p(u,E){const k={};E&2&&(k.$$scope={dirty:E,ctx:u}),y.$set(k)},i(u){T||(_(y.$$.fragment,u),T=!0)},o(u){g(y.$$.fragment,u),T=!1},d(u){J(y,u)}}}function la(dt){let y,T,u,E,k,Z,A;return{c(){y=r("p"),T=r("a"),u=f("Colaboratory"),E=f(" \uB610\uB294 "),k=r("a"),Z=f("SageMaker StudioLab"),A=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(I){y=n(I,"P",{});var ve=o(y);T=n(ve,"A",{href:!0,rel:!0});var je=o(T);u=m(je,"Colaboratory"),je.forEach(e),E=m(ve," \uB610\uB294 "),k=n(ve,"A",{href:!0,rel:!0});var W=o(k);Z=m(W,"SageMaker StudioLab"),W.forEach(e),A=m(ve,"\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."),ve.forEach(e),this.h()},h(){d(T,"href","https://colab.research.google.com/"),d(T,"rel","nofollow"),d(k,"href","https://studiolab.sagemaker.aws/"),d(k,"rel","nofollow")},m(I,ve){i(I,y,ve),t(y,T),t(T,u),t(y,E),t(y,k),t(k,Z),t(y,A)},d(I){I&&e(y)}}}function ra(dt){let y,T,u,E,k,Z,A,I,ve,je,W,Tt,D,xt,kt,U,Y,Qe,Ie,We,Rt,ut,Zt,Re,zt,K,B,xe,ae,Xe,L,le,re,lt,Ce,Xt,Ct,ne,$e,oe,Ae,qe,yt,pe,$t,z,rt,qt,Ut,P,De,F,V,_e,C,nt,ot,O,ie,ge,Be,At,G,Ve,pt,fe,wt,S,Ke,H,ee,Bt,me,Gt,Je,Le,it,Oe,ft,we,Ee,It,Ye,he,Te,R,ke,Mt,Dt,bt,ce,et,Me,vt,ze,te,se,X,de,mt,ht,Ft,tt,Fe,ue,Q,x,Ze,q,jt,Nt,Ue,st,ye,Ge,Kt,_t,be,l,s,$,Ne,Pe,rs,Vt,gt,Pt,ct,Jt,ts,p,M,Lt,St,ns,Se,os;return y=new Cs({props:{id:"Dh9CL8fyG80"}}),W=new N({props:{code:"ZGVsJTIwbW9kZWwlMEFkZWwlMjB0cmFpbmVyJTBBdG9yY2guY3VkYS5lbXB0eV9jYWNoZSgp",highlighted:`<span class="hljs-keyword">del</span> model
<span class="hljs-keyword">del</span> trainer
torch.cuda.empty_cache()`}}),Re=new N({props:{code:"dG9rZW5pemVkX2RhdGFzZXRzJTIwJTNEJTIwdG9rZW5pemVkX2RhdGFzZXRzLnJlbW92ZV9jb2x1bW5zKCU1QiUyMnRleHQlMjIlNUQp",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 N({props:{code:"dG9rZW5pemVkX2RhdGFzZXRzJTIwJTNEJTIwdG9rZW5pemVkX2RhdGFzZXRzLnJlbmFtZV9jb2x1bW4oJTIybGFiZWwlMjIlMkMlMjAlMjJsYWJlbHMlMjIp",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 N({props:{code:"dG9rZW5pemVkX2RhdGFzZXRzLnNldF9mb3JtYXQoJTIydG9yY2glMjIp",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>tokenized_datasets.set_format(<span class="hljs-string">&quot;torch&quot;</span>)'}}),P=new N({props:{code:"c21hbGxfdHJhaW5fZGF0YXNldCUyMCUzRCUyMHRva2VuaXplZF9kYXRhc2V0cyU1QiUyMnRyYWluJTIyJTVELnNodWZmbGUoc2VlZCUzRDQyKS5zZWxlY3QocmFuZ2UoMTAwMCkpJTBBc21hbGxfZXZhbF9kYXRhc2V0JTIwJTNEJTIwdG9rZW5pemVkX2RhdGFzZXRzJTVCJTIydGVzdCUyMiU1RC5zaHVmZmxlKHNlZWQlM0Q0Mikuc2VsZWN0KHJhbmdlKDEwMDApKQ==",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>))`}}),C=new Qt({}),G=new N({props:{code:"ZnJvbSUyMHRvcmNoLnV0aWxzLmRhdGElMjBpbXBvcnQlMjBEYXRhTG9hZGVyJTBBJTBBdHJhaW5fZGF0YWxvYWRlciUyMCUzRCUyMERhdGFMb2FkZXIoc21hbGxfdHJhaW5fZGF0YXNldCUyQyUyMHNodWZmbGUlM0RUcnVlJTJDJTIwYmF0Y2hfc2l6ZSUzRDgpJTBBZXZhbF9kYXRhbG9hZGVyJTIwJTNEJTIwRGF0YUxvYWRlcihzbWFsbF9ldmFsX2RhdGFzZXQlMkMlMjBiYXRjaF9zaXplJTNEOCk=",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>)`}}),S=new N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKCUyMmJlcnQtYmFzZS1jYXNlZCUyMiUyQyUyMG51bV9sYWJlbHMlM0Q1KQ==",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 Qt({}),Te=new N({props:{code:"ZnJvbSUyMHRvcmNoLm9wdGltJTIwaW1wb3J0JTIwQWRhbVclMEElMEFvcHRpbWl6ZXIlMjAlM0QlMjBBZGFtVyhtb2RlbC5wYXJhbWV0ZXJzKCklMkMlMjBsciUzRDVlLTUp",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 N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMGdldF9zY2hlZHVsZXIlMEElMEFudW1fZXBvY2hzJTIwJTNEJTIwMyUwQW51bV90cmFpbmluZ19zdGVwcyUyMCUzRCUyMG51bV9lcG9jaHMlMjAqJTIwbGVuKHRyYWluX2RhdGFsb2FkZXIpJTBBbHJfc2NoZWR1bGVyJTIwJTNEJTIwZ2V0X3NjaGVkdWxlciglMEElMjAlMjAlMjAlMjBuYW1lJTNEJTIybGluZWFyJTIyJTJDJTIwb3B0aW1pemVyJTNEb3B0aW1pemVyJTJDJTIwbnVtX3dhcm11cF9zdGVwcyUzRDAlMkMlMjBudW1fdHJhaW5pbmdfc3RlcHMlM0RudW1fdHJhaW5pbmdfc3RlcHMlMEEp",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>)`}}),se=new N({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFkZXZpY2UlMjAlM0QlMjB0b3JjaC5kZXZpY2UoJTIyY3VkYSUyMiklMjBpZiUyMHRvcmNoLmN1ZGEuaXNfYXZhaWxhYmxlKCklMjBlbHNlJTIwdG9yY2guZGV2aWNlKCUyMmNwdSUyMiklMEFtb2RlbC50byhkZXZpY2Up",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 As({props:{$$slots:{default:[la]},$$scope:{ctx:dt}}}),x=new Qt({}),be=new N({props:{code:"ZnJvbSUyMHRxZG0uYXV0byUyMGltcG9ydCUyMHRxZG0lMEElMEFwcm9ncmVzc19iYXIlMjAlM0QlMjB0cWRtKHJhbmdlKG51bV90cmFpbmluZ19zdGVwcykpJTBBJTBBbW9kZWwudHJhaW4oKSUwQWZvciUyMGVwb2NoJTIwaW4lMjByYW5nZShudW1fZXBvY2hzKSUzQSUwQSUyMCUyMCUyMCUyMGZvciUyMGJhdGNoJTIwaW4lMjB0cmFpbl9kYXRhbG9hZGVyJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYmF0Y2glMjAlM0QlMjAlN0JrJTNBJTIwdi50byhkZXZpY2UpJTIwZm9yJTIwayUyQyUyMHYlMjBpbiUyMGJhdGNoLml0ZW1zKCklN0QlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKipiYXRjaCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBsb3NzJTIwJTNEJTIwb3V0cHV0cy5sb3NzJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwbG9zcy5iYWNrd2FyZCgpJTBBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwb3B0aW1pemVyLnN0ZXAoKSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGxyX3NjaGVkdWxlci5zdGVwKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvcHRpbWl6ZXIuemVyb19ncmFkKCklMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwcm9ncmVzc19iYXIudXBkYXRlKDEp",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>)`}}),Pe=new Qt({}),Se=new N({props:{code:"aW1wb3J0JTIwZXZhbHVhdGUlMEElMEFtZXRyaWMlMjAlM0QlMjBldmFsdWF0ZS5sb2FkKCUyMmFjY3VyYWN5JTIyKSUwQW1vZGVsLmV2YWwoKSUwQWZvciUyMGJhdGNoJTIwaW4lMjBldmFsX2RhdGFsb2FkZXIlM0ElMEElMjAlMjAlMjAlMjBiYXRjaCUyMCUzRCUyMCU3QmslM0ElMjB2LnRvKGRldmljZSklMjBmb3IlMjBrJTJDJTIwdiUyMGluJTIwYmF0Y2guaXRlbXMoKSU3RCUwQSUyMCUyMCUyMCUyMHdpdGglMjB0b3JjaC5ub19ncmFkKCklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBvdXRwdXRzJTIwJTNEJTIwbW9kZWwoKipiYXRjaCklMEElMEElMjAlMjAlMjAlMjBsb2dpdHMlMjAlM0QlMjBvdXRwdXRzLmxvZ2l0cyUwQSUyMCUyMCUyMCUyMHByZWRpY3Rpb25zJTIwJTNEJTIwdG9yY2guYXJnbWF4KGxvZ2l0cyUyQyUyMGRpbSUzRC0xKSUwQSUyMCUyMCUyMCUyMG1ldHJpYy5hZGRfYmF0Y2gocHJlZGljdGlvbnMlM0RwcmVkaWN0aW9ucyUyQyUyMHJlZmVyZW5jZXMlM0RiYXRjaCU1QiUyMmxhYmVscyUyMiU1RCklMEElMEFtZXRyaWMuY29tcHV0ZSgp",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(){b(y.$$.fragment),T=h(),u=r("p"),E=r("code"),k=f("Trainer"),Z=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."),A=h(),I=r("p"),ve=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:"),je=h(),b(W.$$.fragment),Tt=h(),D=r("p"),xt=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."),kt=h(),U=r("ol"),Y=r("li"),Qe=r("p"),Ie=f("\uBAA8\uB378\uC774 \uC6D0\uC2DC \uD14D\uC2A4\uD2B8\uB97C \uC785\uB825\uC73C\uB85C \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uC73C\uBBC0\uB85C "),We=r("code"),Rt=f("text"),ut=f(" \uC5F4\uC744 \uC81C\uAC70\uD569\uB2C8\uB2E4:"),Zt=h(),b(Re.$$.fragment),zt=h(),K=r("li"),B=r("p"),xe=f("\uBAA8\uB378\uC5D0\uC11C \uC778\uC218\uC758 \uC774\uB984\uC774 "),ae=r("code"),Xe=f("labels"),L=f("\uB85C \uC9C0\uC815\uB420 \uAC83\uC73C\uB85C \uC608\uC0C1\uD558\uBBC0\uB85C "),le=r("code"),re=f("label"),lt=f(" \uC5F4\uC758 \uC774\uB984\uC744 "),Ce=r("code"),Xt=f("labels"),Ct=f("\uB85C \uBCC0\uACBD\uD569\uB2C8\uB2E4:"),ne=h(),b($e.$$.fragment),oe=h(),Ae=r("li"),qe=r("p"),yt=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=h(),b($t.$$.fragment),z=h(),rt=r("p"),qt=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:"),Ut=h(),b(P.$$.fragment),De=h(),F=r("h3"),V=r("a"),_e=r("span"),b(C.$$.fragment),nt=h(),ot=r("span"),O=f("DataLoader"),ie=h(),ge=r("p"),Be=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:"),At=h(),b(G.$$.fragment),Ve=h(),pt=r("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:"),wt=h(),b(S.$$.fragment),Ke=h(),H=r("h3"),ee=r("a"),Bt=r("span"),b(me.$$.fragment),Gt=h(),Je=r("span"),Le=f("\uC635\uD2F0\uB9C8\uC774\uC800 \uBC0F \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC"),it=h(),Oe=r("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 "),we=r("a"),Ee=r("code"),It=f("AdamW"),Ye=f(" \uC635\uD2F0\uB9C8\uC774\uC800\uB97C \uC0AC\uC6A9\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4:"),he=h(),b(Te.$$.fragment),R=h(),ke=r("p"),Mt=r("code"),Dt=f("Trainer"),bt=f("\uC5D0\uC11C \uAE30\uBCF8 \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4:"),ce=h(),b(et.$$.fragment),Me=h(),vt=r("p"),ze=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=h(),b(se.$$.fragment),X=h(),b(de.$$.fragment),mt=h(),ht=r("p"),Ft=f("\uC774\uC81C \uD6C8\uB828\uD560 \uC900\uBE44\uAC00 \uB418\uC5C8\uC2B5\uB2C8\uB2E4! \u{1F973}"),tt=h(),Fe=r("h3"),ue=r("a"),Q=r("span"),b(x.$$.fragment),Ze=h(),q=r("span"),jt=f("\uD6C8\uB828 \uB8E8\uD504"),Nt=h(),Ue=r("p"),st=f("\uD6C8\uB828 \uC9C4\uD589 \uC0C1\uD669\uC744 \uCD94\uC801\uD558\uB824\uBA74 "),ye=r("a"),Ge=f("tqdm"),Kt=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:"),_t=h(),b(be.$$.fragment),l=h(),s=r("h3"),$=r("a"),Ne=r("span"),b(Pe.$$.fragment),rs=h(),Vt=r("span"),gt=f("\uD3C9\uAC00 \uD558\uAE30"),Pt=h(),ct=r("p"),Jt=r("code"),ts=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, "),M=r("code"),Lt=f("add_batch"),St=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."),ns=h(),b(Se.$$.fragment),this.h()},l(a){v(y.$$.fragment,a),T=c(a),u=n(a,"P",{});var w=o(u);E=n(w,"CODE",{});var Ht=o(E);k=m(Ht,"Trainer"),Ht.forEach(e),Z=m(w,"\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."),w.forEach(e),A=c(a),I=n(a,"P",{});var ps=o(I);ve=m(ps,"\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:"),ps.forEach(e),je=c(a),v(W.$$.fragment,a),Tt=c(a),D=n(a,"P",{});var is=o(D);xt=m(is,"\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."),is.forEach(e),kt=c(a),U=n(a,"OL",{});var Ot=o(U);Y=n(Ot,"LI",{});var Yt=o(Y);Qe=n(Yt,"P",{});var es=o(Qe);Ie=m(es,"\uBAA8\uB378\uC774 \uC6D0\uC2DC \uD14D\uC2A4\uD2B8\uB97C \uC785\uB825\uC73C\uB85C \uD5C8\uC6A9\uD558\uC9C0 \uC54A\uC73C\uBBC0\uB85C "),We=n(es,"CODE",{});var us=o(We);Rt=m(us,"text"),us.forEach(e),ut=m(es," \uC5F4\uC744 \uC81C\uAC70\uD569\uB2C8\uB2E4:"),es.forEach(e),Zt=c(Yt),v(Re.$$.fragment,Yt),Yt.forEach(e),zt=c(Ot),K=n(Ot,"LI",{});var Et=o(K);B=n(Et,"P",{});var Wt=o(B);xe=m(Wt,"\uBAA8\uB378\uC5D0\uC11C \uC778\uC218\uC758 \uC774\uB984\uC774 "),ae=n(Wt,"CODE",{});var ys=o(ae);Xe=m(ys,"labels"),ys.forEach(e),L=m(Wt,"\uB85C \uC9C0\uC815\uB420 \uAC83\uC73C\uB85C \uC608\uC0C1\uD558\uBBC0\uB85C "),le=n(Wt,"CODE",{});var ss=o(le);re=m(ss,"label"),ss.forEach(e),lt=m(Wt," \uC5F4\uC758 \uC774\uB984\uC744 "),Ce=n(Wt,"CODE",{});var fs=o(Ce);Xt=m(fs,"labels"),fs.forEach(e),Ct=m(Wt,"\uB85C \uBCC0\uACBD\uD569\uB2C8\uB2E4:"),Wt.forEach(e),ne=c(Et),v($e.$$.fragment,Et),Et.forEach(e),oe=c(Ot),Ae=n(Ot,"LI",{});var as=o(Ae);qe=n(as,"P",{});var $s=o(qe);yt=m($s,"\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:"),$s.forEach(e),pe=c(as),v($t.$$.fragment,as),as.forEach(e),Ot.forEach(e),z=c(a),rt=n(a,"P",{});var He=o(rt);qt=m(He,"\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:"),He.forEach(e),Ut=c(a),v(P.$$.fragment,a),De=c(a),F=n(a,"H3",{class:!0});var at=o(F);V=n(at,"A",{id:!0,class:!0,href:!0});var ms=o(V);_e=n(ms,"SPAN",{});var ws=o(_e);v(C.$$.fragment,ws),ws.forEach(e),ms.forEach(e),nt=c(at),ot=n(at,"SPAN",{});var cs=o(ot);O=m(cs,"DataLoader"),cs.forEach(e),at.forEach(e),ie=c(a),ge=n(a,"P",{});var Ms=o(ge);Be=m(Ms,"\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:"),Ms.forEach(e),At=c(a),v(G.$$.fragment,a),Ve=c(a),pt=n(a,"P",{});var ds=o(pt);fe=m(ds,"\uC608\uCE21\uC744 \uC704\uD55C \uB808\uC774\uBE14 \uAC1C\uC218\uB97C \uC0AC\uC6A9\uD558\uC5EC \uBAA8\uB378\uC744 \uB85C\uB4DC\uD569\uB2C8\uB2E4:"),ds.forEach(e),wt=c(a),v(S.$$.fragment,a),Ke=c(a),H=n(a,"H3",{class:!0});var ls=o(H);ee=n(ls,"A",{id:!0,class:!0,href:!0});var hs=o(ee);Bt=n(hs,"SPAN",{});var Js=o(Bt);v(me.$$.fragment,Js),Js.forEach(e),hs.forEach(e),Gt=c(ls),Je=n(ls,"SPAN",{});var Es=o(Je);Le=m(Es,"\uC635\uD2F0\uB9C8\uC774\uC800 \uBC0F \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC"),Es.forEach(e),ls.forEach(e),it=c(a),Oe=n(a,"P",{});var js=o(Oe);ft=m(js,"\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 "),we=n(js,"A",{href:!0,rel:!0});var _s=o(we);Ee=n(_s,"CODE",{});var Ts=o(Ee);It=m(Ts,"AdamW"),Ts.forEach(e),_s.forEach(e),Ye=m(js," \uC635\uD2F0\uB9C8\uC774\uC800\uB97C \uC0AC\uC6A9\uD574 \uBCF4\uACA0\uC2B5\uB2C8\uB2E4:"),js.forEach(e),he=c(a),v(Te.$$.fragment,a),R=c(a),ke=n(a,"P",{});var vs=o(ke);Mt=n(vs,"CODE",{});var ks=o(Mt);Dt=m(ks,"Trainer"),ks.forEach(e),bt=m(vs,"\uC5D0\uC11C \uAE30\uBCF8 \uD559\uC2B5 \uC18D\uB3C4 \uC2A4\uCF00\uC904\uB7EC\uB97C \uC0DD\uC131\uD569\uB2C8\uB2E4:"),vs.forEach(e),ce=c(a),v(et.$$.fragment,a),Me=c(a),vt=n(a,"P",{});var Zs=o(vt);ze=m(Zs,"\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."),Zs.forEach(e),te=c(a),v(se.$$.fragment,a),X=c(a),v(de.$$.fragment,a),mt=c(a),ht=n(a,"P",{});var Us=o(ht);Ft=m(Us,"\uC774\uC81C \uD6C8\uB828\uD560 \uC900\uBE44\uAC00 \uB418\uC5C8\uC2B5\uB2C8\uB2E4! \u{1F973}"),Us.forEach(e),tt=c(a),Fe=n(a,"H3",{class:!0});var bs=o(Fe);ue=n(bs,"A",{id:!0,class:!0,href:!0});var Gs=o(ue);Q=n(Gs,"SPAN",{});var gs=o(Q);v(x.$$.fragment,gs),gs.forEach(e),Gs.forEach(e),Ze=c(bs),q=n(bs,"SPAN",{});var Is=o(q);jt=m(Is,"\uD6C8\uB828 \uB8E8\uD504"),Is.forEach(e),bs.forEach(e),Nt=c(a),Ue=n(a,"P",{});var Rs=o(Ue);st=m(Rs,"\uD6C8\uB828 \uC9C4\uD589 \uC0C1\uD669\uC744 \uCD94\uC801\uD558\uB824\uBA74 "),ye=n(Rs,"A",{href:!0,rel:!0});var Vs=o(ye);Ge=m(Vs,"tqdm"),Vs.forEach(e),Kt=m(Rs," \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:"),Rs.forEach(e),_t=c(a),v(be.$$.fragment,a),l=c(a),s=n(a,"H3",{class:!0});var Xs=o(s);$=n(Xs,"A",{id:!0,class:!0,href:!0});var Ys=o($);Ne=n(Ys,"SPAN",{});var zs=o(Ne);v(Pe.$$.fragment,zs),zs.forEach(e),Ys.forEach(e),rs=c(Xs),Vt=n(Xs,"SPAN",{});var Fs=o(Vt);gt=m(Fs,"\uD3C9\uAC00 \uD558\uAE30"),Fs.forEach(e),Xs.forEach(e),Pt=c(a),ct=n(a,"P",{});var Ws=o(ct);Jt=n(Ws,"CODE",{});var Ns=o(Jt);ts=m(Ns,"Trainer"),Ns.forEach(e),p=m(Ws,"\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, "),M=n(Ws,"CODE",{});var Ps=o(M);Lt=m(Ps,"add_batch"),Ps.forEach(e),St=m(Ws,"\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."),Ws.forEach(e),ns=c(a),v(Se.$$.fragment,a),this.h()},h(){d(V,"id","dataloader"),d(V,"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(V,"href","#dataloader"),d(F,"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(H,"class","relative group"),d(we,"href","https://pytorch.org/docs/stable/generated/torch.optim.AdamW.html"),d(we,"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(Fe,"class","relative group"),d(ye,"href","https://tqdm.github.io/"),d(ye,"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(s,"class","relative group")},m(a,w){j(y,a,w),i(a,T,w),i(a,u,w),t(u,E),t(E,k),t(u,Z),i(a,A,w),i(a,I,w),t(I,ve),i(a,je,w),j(W,a,w),i(a,Tt,w),i(a,D,w),t(D,xt),i(a,kt,w),i(a,U,w),t(U,Y),t(Y,Qe),t(Qe,Ie),t(Qe,We),t(We,Rt),t(Qe,ut),t(Y,Zt),j(Re,Y,null),t(U,zt),t(U,K),t(K,B),t(B,xe),t(B,ae),t(ae,Xe),t(B,L),t(B,le),t(le,re),t(B,lt),t(B,Ce),t(Ce,Xt),t(B,Ct),t(K,ne),j($e,K,null),t(U,oe),t(U,Ae),t(Ae,qe),t(qe,yt),t(Ae,pe),j($t,Ae,null),i(a,z,w),i(a,rt,w),t(rt,qt),i(a,Ut,w),j(P,a,w),i(a,De,w),i(a,F,w),t(F,V),t(V,_e),j(C,_e,null),t(F,nt),t(F,ot),t(ot,O),i(a,ie,w),i(a,ge,w),t(ge,Be),i(a,At,w),j(G,a,w),i(a,Ve,w),i(a,pt,w),t(pt,fe),i(a,wt,w),j(S,a,w),i(a,Ke,w),i(a,H,w),t(H,ee),t(ee,Bt),j(me,Bt,null),t(H,Gt),t(H,Je),t(Je,Le),i(a,it,w),i(a,Oe,w),t(Oe,ft),t(Oe,we),t(we,Ee),t(Ee,It),t(Oe,Ye),i(a,he,w),j(Te,a,w),i(a,R,w),i(a,ke,w),t(ke,Mt),t(Mt,Dt),t(ke,bt),i(a,ce,w),j(et,a,w),i(a,Me,w),i(a,vt,w),t(vt,ze),i(a,te,w),j(se,a,w),i(a,X,w),j(de,a,w),i(a,mt,w),i(a,ht,w),t(ht,Ft),i(a,tt,w),i(a,Fe,w),t(Fe,ue),t(ue,Q),j(x,Q,null),t(Fe,Ze),t(Fe,q),t(q,jt),i(a,Nt,w),i(a,Ue,w),t(Ue,st),t(Ue,ye),t(ye,Ge),t(Ue,Kt),i(a,_t,w),j(be,a,w),i(a,l,w),i(a,s,w),t(s,$),t($,Ne),j(Pe,Ne,null),t(s,rs),t(s,Vt),t(Vt,gt),i(a,Pt,w),i(a,ct,w),t(ct,Jt),t(Jt,ts),t(ct,p),t(ct,M),t(M,Lt),t(ct,St),i(a,ns,w),j(Se,a,w),os=!0},p(a,w){const Ht={};w&2&&(Ht.$$scope={dirty:w,ctx:a}),de.$set(Ht)},i(a){os||(_(y.$$.fragment,a),_(W.$$.fragment,a),_(Re.$$.fragment,a),_($e.$$.fragment,a),_($t.$$.fragment,a),_(P.$$.fragment,a),_(C.$$.fragment,a),_(G.$$.fragment,a),_(S.$$.fragment,a),_(me.$$.fragment,a),_(Te.$$.fragment,a),_(et.$$.fragment,a),_(se.$$.fragment,a),_(de.$$.fragment,a),_(x.$$.fragment,a),_(be.$$.fragment,a),_(Pe.$$.fragment,a),_(Se.$$.fragment,a),os=!0)},o(a){g(y.$$.fragment,a),g(W.$$.fragment,a),g(Re.$$.fragment,a),g($e.$$.fragment,a),g($t.$$.fragment,a),g(P.$$.fragment,a),g(C.$$.fragment,a),g(G.$$.fragment,a),g(S.$$.fragment,a),g(me.$$.fragment,a),g(Te.$$.fragment,a),g(et.$$.fragment,a),g(se.$$.fragment,a),g(de.$$.fragment,a),g(x.$$.fragment,a),g(be.$$.fragment,a),g(Pe.$$.fragment,a),g(Se.$$.fragment,a),os=!1},d(a){J(y,a),a&&e(T),a&&e(u),a&&e(A),a&&e(I),a&&e(je),J(W,a),a&&e(Tt),a&&e(D),a&&e(kt),a&&e(U),J(Re),J($e),J($t),a&&e(z),a&&e(rt),a&&e(Ut),J(P,a),a&&e(De),a&&e(F),J(C),a&&e(ie),a&&e(ge),a&&e(At),J(G,a),a&&e(Ve),a&&e(pt),a&&e(wt),J(S,a),a&&e(Ke),a&&e(H),J(me),a&&e(it),a&&e(Oe),a&&e(he),J(Te,a),a&&e(R),a&&e(ke),a&&e(ce),J(et,a),a&&e(Me),a&&e(vt),a&&e(te),J(se,a),a&&e(X),J(de,a),a&&e(mt),a&&e(ht),a&&e(tt),a&&e(Fe),J(x),a&&e(Nt),a&&e(Ue),a&&e(_t),J(be,a),a&&e(l),a&&e(s),J(Pe),a&&e(Pt),a&&e(ct),a&&e(ns),J(Se,a)}}}function na(dt){let y,T;return y=new Bs({props:{$$slots:{default:[ra]},$$scope:{ctx:dt}}}),{c(){b(y.$$.fragment)},l(u){v(y.$$.fragment,u)},m(u,E){j(y,u,E),T=!0},p(u,E){const k={};E&2&&(k.$$scope={dirty:E,ctx:u}),y.$set(k)},i(u){T||(_(y.$$.fragment,u),T=!0)},o(u){g(y.$$.fragment,u),T=!1},d(u){J(y,u)}}}function oa(dt){let y,T,u,E,k,Z,A,I,ve,je,W,Tt,D,xt,kt,U,Y,Qe,Ie,We,Rt,ut,Zt,Re,zt,K,B,xe,ae,Xe,L,le,re,lt,Ce,Xt,Ct,ne,$e,oe,Ae,qe,yt,pe,$t,z,rt,qt,Ut,P,De,F,V,_e,C,nt,ot,O,ie,ge,Be,At,G,Ve,pt,fe,wt,S,Ke,H,ee,Bt,me,Gt,Je,Le,it,Oe,ft,we,Ee,It,Ye,he,Te,R,ke,Mt,Dt,bt,ce,et,Me,vt,ze,te,se,X,de,mt,ht,Ft,tt,Fe,ue,Q,x,Ze,q,jt,Nt,Ue,st,ye,Ge,Kt,_t,be;return Z=new Qt({}),W=new Ks({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"}]}}),lt=new Qt({}),$e=new Cs({props:{id:"_BZearw7f0w"}}),P=new N({props:{code:"ZnJvbSUyMGRhdGFzZXRzJTIwaW1wb3J0JTIwbG9hZF9kYXRhc2V0JTBBJTBBZGF0YXNldCUyMCUzRCUyMGxvYWRfZGF0YXNldCglMjJ5ZWxwX3Jldmlld19mdWxsJTIyKSUwQWRhdGFzZXQlNUIlMjJ0cmFpbiUyMiU1RCU1QjEwMCU1RA==",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 N({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJiZXJ0LWJhc2UtY2FzZWQlMjIpJTBBJTBBJTBBZGVmJTIwdG9rZW5pemVfZnVuY3Rpb24oZXhhbXBsZXMpJTNBJTBBJTIwJTIwJTIwJTIwcmV0dXJuJTIwdG9rZW5pemVyKGV4YW1wbGVzJTVCJTIydGV4dCUyMiU1RCUyQyUyMHBhZGRpbmclM0QlMjJtYXhfbGVuZ3RoJTIyJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUpJTBBJTBBJTBBdG9rZW5pemVkX2RhdGFzZXRzJTIwJTNEJTIwZGF0YXNldC5tYXAodG9rZW5pemVfZnVuY3Rpb24lMkMlMjBiYXRjaGVkJTNEVHJ1ZSk=",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>)`}}),Ve=new N({props:{code:"c21hbGxfdHJhaW5fZGF0YXNldCUyMCUzRCUyMHRva2VuaXplZF9kYXRhc2V0cyU1QiUyMnRyYWluJTIyJTVELnNodWZmbGUoc2VlZCUzRDQyKS5zZWxlY3QocmFuZ2UoMTAwMCkpJTBBc21hbGxfZXZhbF9kYXRhc2V0JTIwJTNEJTIwdG9rZW5pemVkX2RhdGFzZXRzJTVCJTIydGVzdCUyMiU1RC5zaHVmZmxlKHNlZWQlM0Q0Mikuc2VsZWN0KHJhbmdlKDEwMDApKQ==",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 Qt({}),ft=new Ss({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[aa],pytorch:[ea]},$$scope:{ctx:dt}}}),R=new Qt({}),ce=new Ss({props:{pytorch:!0,tensorflow:!1,jax:!1,$$slots:{pytorch:[na]},$$scope:{ctx:dt}}}),X=new Qt({}),{c(){y=r("meta"),T=h(),u=r("h1"),E=r("a"),k=r("span"),b(Z.$$.fragment),A=h(),I=r("span"),ve=f("\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30"),je=h(),b(W.$$.fragment),Tt=h(),D=r("p"),xt=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:"),kt=h(),U=r("ul"),Y=r("li"),Qe=f("\u{1F917} Transformers\uB85C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30 "),Ie=r("code"),We=f("Trainer"),Rt=f("."),ut=h(),Zt=r("li"),Re=f("Keras\uB97C \uC0AC\uC6A9\uD558\uC5EC TensorFlow\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),zt=h(),K=r("li"),B=f("\uAE30\uBCF8 PyTorch\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),xe=h(),ae=r("a"),Xe=h(),L=r("h2"),le=r("a"),re=r("span"),b(lt.$$.fragment),Ce=h(),Xt=r("span"),Ct=f("\uB370\uC774\uD130\uC14B \uC900\uBE44"),ne=h(),b($e.$$.fragment),oe=h(),Ae=r("p"),qe=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!"),yt=h(),pe=r("p"),$t=f("\uBA3C\uC800 "),z=r("a"),rt=f("Yelp \uB9AC\uBDF0"),qt=f(" \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4:"),Ut=h(),b(P.$$.fragment),De=h(),F=r("p"),V=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 "),_e=r("a"),C=r("code"),nt=f("map"),ot=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:"),O=h(),b(ie.$$.fragment),ge=h(),Be=r("p"),At=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:"),G=h(),b(Ve.$$.fragment),pt=h(),fe=r("a"),wt=h(),S=r("h2"),Ke=r("a"),H=r("span"),b(ee.$$.fragment),Bt=h(),me=r("span"),Gt=f("Train"),Je=h(),Le=r("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!"),Oe=h(),b(ft.$$.fragment),we=h(),Ee=r("a"),It=h(),Ye=r("h2"),he=r("a"),Te=r("span"),b(R.$$.fragment),ke=h(),Mt=r("span"),Dt=f("\uAE30\uBCF8 \uD30C\uC774\uD1A0\uCE58\uB85C \uD6C8\uB828\uD558\uAE30"),bt=h(),b(ce.$$.fragment),et=h(),Me=r("a"),vt=h(),ze=r("h2"),te=r("a"),se=r("span"),b(X.$$.fragment),de=h(),mt=r("span"),ht=f("\uCD94\uAC00 \uC790\uB8CC"),Ft=h(),tt=r("p"),Fe=f("\uB354 \uB9CE\uC740 \uBBF8\uC138 \uD29C\uB2DD \uC608\uC81C\uB294 \uB2E4\uC74C\uC744 \uCC38\uC870\uD558\uC138\uC694:"),ue=h(),Q=r("ul"),x=r("li"),Ze=r("p"),q=r("a"),jt=f("\u{1F917} Trnasformers \uC608\uC81C"),Nt=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."),Ue=h(),st=r("li"),ye=r("p"),Ge=r("a"),Kt=f("\u{1F917} Transformers \uB178\uD2B8\uBD81"),_t=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(l){const s=qs('[data-svelte="svelte-1phssyn"]',document.head);y=n(s,"META",{name:!0,content:!0}),s.forEach(e),T=c(l),u=n(l,"H1",{class:!0});var $=o(u);E=n($,"A",{id:!0,class:!0,href:!0});var Ne=o(E);k=n(Ne,"SPAN",{});var Pe=o(k);v(Z.$$.fragment,Pe),Pe.forEach(e),Ne.forEach(e),A=c($),I=n($,"SPAN",{});var rs=o(I);ve=m(rs,"\uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30"),rs.forEach(e),$.forEach(e),je=c(l),v(W.$$.fragment,l),Tt=c(l),D=n(l,"P",{});var Vt=o(D);xt=m(Vt,"\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:"),Vt.forEach(e),kt=c(l),U=n(l,"UL",{});var gt=o(U);Y=n(gt,"LI",{});var Pt=o(Y);Qe=m(Pt,"\u{1F917} Transformers\uB85C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30 "),Ie=n(Pt,"CODE",{});var ct=o(Ie);We=m(ct,"Trainer"),ct.forEach(e),Rt=m(Pt,"."),Pt.forEach(e),ut=c(gt),Zt=n(gt,"LI",{});var Jt=o(Zt);Re=m(Jt,"Keras\uB97C \uC0AC\uC6A9\uD558\uC5EC TensorFlow\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),Jt.forEach(e),zt=c(gt),K=n(gt,"LI",{});var ts=o(K);B=m(ts,"\uAE30\uBCF8 PyTorch\uC5D0\uC11C \uC0AC\uC804 \uD559\uC2B5\uB41C \uBAA8\uB378\uC744 \uBBF8\uC138 \uD29C\uB2DD\uD558\uAE30."),ts.forEach(e),gt.forEach(e),xe=c(l),ae=n(l,"A",{id:!0}),o(ae).forEach(e),Xe=c(l),L=n(l,"H2",{class:!0});var p=o(L);le=n(p,"A",{id:!0,class:!0,href:!0});var M=o(le);re=n(M,"SPAN",{});var Lt=o(re);v(lt.$$.fragment,Lt),Lt.forEach(e),M.forEach(e),Ce=c(p),Xt=n(p,"SPAN",{});var St=o(Xt);Ct=m(St,"\uB370\uC774\uD130\uC14B \uC900\uBE44"),St.forEach(e),p.forEach(e),ne=c(l),v($e.$$.fragment,l),oe=c(l),Ae=n(l,"P",{});var ns=o(Ae);qe=m(ns,"\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!"),ns.forEach(e),yt=c(l),pe=n(l,"P",{});var Se=o(pe);$t=m(Se,"\uBA3C\uC800 "),z=n(Se,"A",{href:!0,rel:!0});var os=o(z);rt=m(os,"Yelp \uB9AC\uBDF0"),os.forEach(e),qt=m(Se," \uB370\uC774\uD130 \uC138\uD2B8\uB97C \uB85C\uB4DC\uD569\uB2C8\uB2E4:"),Se.forEach(e),Ut=c(l),v(P.$$.fragment,l),De=c(l),F=n(l,"P",{});var a=o(F);V=m(a,"\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 "),_e=n(a,"A",{href:!0,rel:!0});var w=o(_e);C=n(w,"CODE",{});var Ht=o(C);nt=m(Ht,"map"),Ht.forEach(e),w.forEach(e),ot=m(a," \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:"),a.forEach(e),O=c(l),v(ie.$$.fragment,l),ge=c(l),Be=n(l,"P",{});var ps=o(Be);At=m(ps,"\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:"),ps.forEach(e),G=c(l),v(Ve.$$.fragment,l),pt=c(l),fe=n(l,"A",{id:!0}),o(fe).forEach(e),wt=c(l),S=n(l,"H2",{class:!0});var is=o(S);Ke=n(is,"A",{id:!0,class:!0,href:!0});var Ot=o(Ke);H=n(Ot,"SPAN",{});var Yt=o(H);v(ee.$$.fragment,Yt),Yt.forEach(e),Ot.forEach(e),Bt=c(is),me=n(is,"SPAN",{});var es=o(me);Gt=m(es,"Train"),es.forEach(e),is.forEach(e),Je=c(l),Le=n(l,"P",{});var us=o(Le);it=m(us,"\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!"),us.forEach(e),Oe=c(l),v(ft.$$.fragment,l),we=c(l),Ee=n(l,"A",{id:!0}),o(Ee).forEach(e),It=c(l),Ye=n(l,"H2",{class:!0});var Et=o(Ye);he=n(Et,"A",{id:!0,class:!0,href:!0});var Wt=o(he);Te=n(Wt,"SPAN",{});var ys=o(Te);v(R.$$.fragment,ys),ys.forEach(e),Wt.forEach(e),ke=c(Et),Mt=n(Et,"SPAN",{});var ss=o(Mt);Dt=m(ss,"\uAE30\uBCF8 \uD30C\uC774\uD1A0\uCE58\uB85C \uD6C8\uB828\uD558\uAE30"),ss.forEach(e),Et.forEach(e),bt=c(l),v(ce.$$.fragment,l),et=c(l),Me=n(l,"A",{id:!0}),o(Me).forEach(e),vt=c(l),ze=n(l,"H2",{class:!0});var fs=o(ze);te=n(fs,"A",{id:!0,class:!0,href:!0});var as=o(te);se=n(as,"SPAN",{});var $s=o(se);v(X.$$.fragment,$s),$s.forEach(e),as.forEach(e),de=c(fs),mt=n(fs,"SPAN",{});var He=o(mt);ht=m(He,"\uCD94\uAC00 \uC790\uB8CC"),He.forEach(e),fs.forEach(e),Ft=c(l),tt=n(l,"P",{});var at=o(tt);Fe=m(at,"\uB354 \uB9CE\uC740 \uBBF8\uC138 \uD29C\uB2DD \uC608\uC81C\uB294 \uB2E4\uC74C\uC744 \uCC38\uC870\uD558\uC138\uC694:"),at.forEach(e),ue=c(l),Q=n(l,"UL",{});var ms=o(Q);x=n(ms,"LI",{});var ws=o(x);Ze=n(ws,"P",{});var cs=o(Ze);q=n(cs,"A",{href:!0,rel:!0});var Ms=o(q);jt=m(Ms,"\u{1F917} Trnasformers \uC608\uC81C"),Ms.forEach(e),Nt=m(cs,"\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."),cs.forEach(e),ws.forEach(e),Ue=c(ms),st=n(ms,"LI",{});var ds=o(st);ye=n(ds,"P",{});var ls=o(ye);Ge=n(ls,"A",{href:!0});var hs=o(Ge);Kt=m(hs,"\u{1F917} Transformers \uB178\uD2B8\uBD81"),hs.forEach(e),_t=m(ls,"\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."),ls.forEach(e),ds.forEach(e),ms.forEach(e),this.h()},h(){d(y,"name","hf:doc:metadata"),d(y,"content",JSON.stringify(pa)),d(E,"id","finetune-a-pretrained-model"),d(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),d(E,"href","#finetune-a-pretrained-model"),d(u,"class","relative group"),d(ae,"id","data-processing"),d(le,"id","prepare-a-dataset"),d(le,"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(le,"href","#prepare-a-dataset"),d(L,"class","relative group"),d(z,"href","https://huggingface.co/datasets/yelp_review_full"),d(z,"rel","nofollow"),d(_e,"href","https://huggingface.co/docs/datasets/process.html#map"),d(_e,"rel","nofollow"),d(fe,"id","trainer"),d(Ke,"id","train"),d(Ke,"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(Ke,"href","#train"),d(S,"class","relative group"),d(Ee,"id","pytorch_native"),d(he,"id","train-in-native-pytorch"),d(he,"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(he,"href","#train-in-native-pytorch"),d(Ye,"class","relative group"),d(Me,"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(ze,"class","relative group"),d(q,"href","https://github.com/huggingface/transformers/tree/main/examples"),d(q,"rel","nofollow"),d(Ge,"href","notebooks")},m(l,s){t(document.head,y),i(l,T,s),i(l,u,s),t(u,E),t(E,k),j(Z,k,null),t(u,A),t(u,I),t(I,ve),i(l,je,s),j(W,l,s),i(l,Tt,s),i(l,D,s),t(D,xt),i(l,kt,s),i(l,U,s),t(U,Y),t(Y,Qe),t(Y,Ie),t(Ie,We),t(Y,Rt),t(U,ut),t(U,Zt),t(Zt,Re),t(U,zt),t(U,K),t(K,B),i(l,xe,s),i(l,ae,s),i(l,Xe,s),i(l,L,s),t(L,le),t(le,re),j(lt,re,null),t(L,Ce),t(L,Xt),t(Xt,Ct),i(l,ne,s),j($e,l,s),i(l,oe,s),i(l,Ae,s),t(Ae,qe),i(l,yt,s),i(l,pe,s),t(pe,$t),t(pe,z),t(z,rt),t(pe,qt),i(l,Ut,s),j(P,l,s),i(l,De,s),i(l,F,s),t(F,V),t(F,_e),t(_e,C),t(C,nt),t(F,ot),i(l,O,s),j(ie,l,s),i(l,ge,s),i(l,Be,s),t(Be,At),i(l,G,s),j(Ve,l,s),i(l,pt,s),i(l,fe,s),i(l,wt,s),i(l,S,s),t(S,Ke),t(Ke,H),j(ee,H,null),t(S,Bt),t(S,me),t(me,Gt),i(l,Je,s),i(l,Le,s),t(Le,it),i(l,Oe,s),j(ft,l,s),i(l,we,s),i(l,Ee,s),i(l,It,s),i(l,Ye,s),t(Ye,he),t(he,Te),j(R,Te,null),t(Ye,ke),t(Ye,Mt),t(Mt,Dt),i(l,bt,s),j(ce,l,s),i(l,et,s),i(l,Me,s),i(l,vt,s),i(l,ze,s),t(ze,te),t(te,se),j(X,se,null),t(ze,de),t(ze,mt),t(mt,ht),i(l,Ft,s),i(l,tt,s),t(tt,Fe),i(l,ue,s),i(l,Q,s),t(Q,x),t(x,Ze),t(Ze,q),t(q,jt),t(Ze,Nt),t(Q,Ue),t(Q,st),t(st,ye),t(ye,Ge),t(Ge,Kt),t(ye,_t),be=!0},p(l,[s]){const $={};s&2&&($.$$scope={dirty:s,ctx:l}),ft.$set($);const Ne={};s&2&&(Ne.$$scope={dirty:s,ctx:l}),ce.$set(Ne)},i(l){be||(_(Z.$$.fragment,l),_(W.$$.fragment,l),_(lt.$$.fragment,l),_($e.$$.fragment,l),_(P.$$.fragment,l),_(ie.$$.fragment,l),_(Ve.$$.fragment,l),_(ee.$$.fragment,l),_(ft.$$.fragment,l),_(R.$$.fragment,l),_(ce.$$.fragment,l),_(X.$$.fragment,l),be=!0)},o(l){g(Z.$$.fragment,l),g(W.$$.fragment,l),g(lt.$$.fragment,l),g($e.$$.fragment,l),g(P.$$.fragment,l),g(ie.$$.fragment,l),g(Ve.$$.fragment,l),g(ee.$$.fragment,l),g(ft.$$.fragment,l),g(R.$$.fragment,l),g(ce.$$.fragment,l),g(X.$$.fragment,l),be=!1},d(l){e(y),l&&e(T),l&&e(u),J(Z),l&&e(je),J(W,l),l&&e(Tt),l&&e(D),l&&e(kt),l&&e(U),l&&e(xe),l&&e(ae),l&&e(Xe),l&&e(L),J(lt),l&&e(ne),J($e,l),l&&e(oe),l&&e(Ae),l&&e(yt),l&&e(pe),l&&e(Ut),J(P,l),l&&e(De),l&&e(F),l&&e(O),J(ie,l),l&&e(ge),l&&e(Be),l&&e(G),J(Ve,l),l&&e(pt),l&&e(fe),l&&e(wt),l&&e(S),J(ee),l&&e(Je),l&&e(Le),l&&e(Oe),J(ft,l),l&&e(we),l&&e(Ee),l&&e(It),l&&e(Ye),J(R),l&&e(bt),J(ce,l),l&&e(et),l&&e(Me),l&&e(vt),l&&e(ze),J(X),l&&e(Ft),l&&e(tt),l&&e(ue),l&&e(Q)}}}const pa={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 ia(dt){return Ds(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $a extends Hs{constructor(y){super();Qs(this,y,ia,oa,xs,{})}}export{$a as default,pa as metadata};
