import{s as St,o as Wt,n as Bt}from"../chunks/scheduler.37c15a92.js";import{S as Lt,i as Ft,g as f,s as c,r as J,A as Xt,h as T,f as n,c as M,j as Zt,u as U,x as b,k as Jl,y as Yt,a,v as j,t as o,b as L,d as m,w as d,m as Pt,n as qt,p as F}from"../chunks/index.2bf4358c.js";import{T as Ht}from"../chunks/Tip.363c041f.js";import{Y as zt}from"../chunks/Youtube.1e50a667.js";import{C as h}from"../chunks/CodeBlock.4e987730.js";import{C as Rt}from"../chunks/CourseFloatingBanner.9ff4c771.js";import{F as Kt}from"../chunks/FrameworkSwitchCourse.8d4d4ab6.js";import{H as fs,E as Ot}from"../chunks/getInferenceSnippets.80a69898.js";function en(y){let l,r;return l=new Rt({props:{chapter:2,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_tf.ipynb"}]}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function sn(y){let l,r;return l=new Rt({props:{chapter:2,classNames:"absolute z-10 right-0 top-0",notebooks:[{label:"Google Colab",value:"https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_pt.ipynb"}]}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function ln(y){let l;return{c(){l=Pt("PyTorch를 사용하는지, TensorFlow를 사용하는지에 따라 내용이 약간 달라지는 첫 번째 섹션입니다. 제목 상단 스위치를 이용해 선호하는 플랫폼을 선택하세요!")},l(r){l=qt(r,"PyTorch를 사용하는지, TensorFlow를 사용하는지에 따라 내용이 약간 달라지는 첫 번째 섹션입니다. 제목 상단 스위치를 이용해 선호하는 플랫폼을 선택하세요!")},m(r,s){a(r,l,s)},d(r){r&&n(l)}}}function tn(y){let l,r;return l=new zt({props:{id:"wVN12smEvqg"}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function nn(y){let l,r;return l=new zt({props:{id:"1pedAIvTWXk"}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function an(y){let l,r;return l=new h({props:{code:"cmF3X2lucHV0cyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElNUQlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocmF3X2lucHV0cyUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnRmJTIyKSUwQXByaW50KGlucHV0cyk=",highlighted:`raw_inputs = [
    <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
    <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
]
inputs = tokenizer(raw_inputs, padding=<span class="hljs-literal">True</span>, truncation=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)
<span class="hljs-built_in">print</span>(inputs)`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function rn(y){let l,r;return l=new h({props:{code:"cmF3X2lucHV0cyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElNUQlMEFpbnB1dHMlMjAlM0QlMjB0b2tlbml6ZXIocmF3X2lucHV0cyUyQyUyMHBhZGRpbmclM0RUcnVlJTJDJTIwdHJ1bmNhdGlvbiUzRFRydWUlMkMlMjByZXR1cm5fdGVuc29ycyUzRCUyMnB0JTIyKSUwQXByaW50KGlucHV0cyk=",highlighted:`raw_inputs = [
    <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
    <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
]
inputs = tokenizer(raw_inputs, padding=<span class="hljs-literal">True</span>, truncation=<span class="hljs-literal">True</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-built_in">print</span>(inputs)`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function pn(y){let l,r="TensorFlow tensor로 지정했을 때의 결과입니다.",s,i,u;return i=new h({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUyQyUyMCUwQSUyMCUyMCUyMCUyMCdhdHRlbnRpb25fbWFzayclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QjElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUwQSU3RA==",highlighted:`{
    <span class="hljs-string">&#x27;input_ids&#x27;</span>: &lt;tf.Tensor: shape=(<span class="hljs-number">2</span>, <span class="hljs-number">16</span>), dtype=int32, numpy=
        array([
            [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2310</span>,  <span class="hljs-number">2042</span>,  <span class="hljs-number">3403</span>,  <span class="hljs-number">2005</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">17662</span>, <span class="hljs-number">12172</span>,  <span class="hljs-number">2607</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">2878</span>,  <span class="hljs-number">2166</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>],
            [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">5223</span>,  <span class="hljs-number">2023</span>,  <span class="hljs-number">2061</span>,  <span class="hljs-number">2172</span>,   <span class="hljs-number">999</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>]
        ], dtype=int32)&gt;, 
    <span class="hljs-string">&#x27;attention_mask&#x27;</span>: &lt;tf.Tensor: shape=(<span class="hljs-number">2</span>, <span class="hljs-number">16</span>), dtype=int32, numpy=
        array([
            [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>],
            [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>]
        ], dtype=int32)&gt;
}`,wrap:!1}}),{c(){l=f("p"),l.textContent=r,s=c(),J(i.$$.fragment)},l(p){l=T(p,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1bekqba"&&(l.textContent=r),s=M(p),U(i.$$.fragment,p)},m(p,w){a(p,l,w),a(p,s,w),j(i,p,w),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(l),n(s)),d(i,p)}}}function cn(y){let l,r="PyTorch tensor로 지정했을 때의 결과입니다.",s,i,u;return i=new h({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjB0ZW5zb3IoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlNUQpJTJDJTIwJTBBJTIwJTIwJTIwJTIwJ2F0dGVudGlvbl9tYXNrJyUzQSUyMHRlbnNvciglNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCU1RCUwQSUyMCUyMCUyMCUyMCU1RCklMEElN0Q=",highlighted:`{
    <span class="hljs-string">&#x27;input_ids&#x27;</span>: tensor([
        [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">1005</span>,  <span class="hljs-number">2310</span>,  <span class="hljs-number">2042</span>,  <span class="hljs-number">3403</span>,  <span class="hljs-number">2005</span>,  <span class="hljs-number">1037</span>, <span class="hljs-number">17662</span>, <span class="hljs-number">12172</span>, <span class="hljs-number">2607</span>,  <span class="hljs-number">2026</span>,  <span class="hljs-number">2878</span>,  <span class="hljs-number">2166</span>,  <span class="hljs-number">1012</span>,   <span class="hljs-number">102</span>],
        [  <span class="hljs-number">101</span>,  <span class="hljs-number">1045</span>,  <span class="hljs-number">5223</span>,  <span class="hljs-number">2023</span>,  <span class="hljs-number">2061</span>,  <span class="hljs-number">2172</span>,   <span class="hljs-number">999</span>,   <span class="hljs-number">102</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>,     <span class="hljs-number">0</span>]
    ]), 
    <span class="hljs-string">&#x27;attention_mask&#x27;</span>: tensor([
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>],
        [<span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">1</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>, <span class="hljs-number">0</span>]
    ])
}`,wrap:!1}}),{c(){l=f("p"),l.textContent=r,s=c(),J(i.$$.fragment)},l(p){l=T(p,"P",{"data-svelte-h":!0}),b(l)!=="svelte-224u1o"&&(l.textContent=r),s=M(p),U(i.$$.fragment,p)},m(p,w){a(p,l,w),a(p,s,w),j(i,p,w),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(l),n(s)),d(i,p)}}}function Mn(y){let l,r="토크나이저를 다운받은 방식과 동일한 방식으로 사전학습된 모델을 다운받을 수 있습니다. 🤗 Transformers는 <code>from_pretrained</code> 메서드를 가진 <code>TFAutoModel</code> 클래스를 제공합니다.",s,i,u;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsJTBBJTBBY2hlY2twb2ludCUyMCUzRCUyMCUyMmRpc3RpbGJlcnQtYmFzZS11bmNhc2VkLWZpbmV0dW5lZC1zc3QtMi1lbmdsaXNoJTIyJTBBbW9kZWwlMjAlM0QlMjBURkF1dG9Nb2RlbC5mcm9tX3ByZXRyYWluZWQoY2hlY2twb2ludCk=",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModel

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = TFAutoModel.from_pretrained(checkpoint)`,wrap:!1}}),{c(){l=f("p"),l.innerHTML=r,s=c(),J(i.$$.fragment)},l(p){l=T(p,"P",{"data-svelte-h":!0}),b(l)!=="svelte-14kzkj4"&&(l.innerHTML=r),s=M(p),U(i.$$.fragment,p)},m(p,w){a(p,l,w),a(p,s,w),j(i,p,w),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(l),n(s)),d(i,p)}}}function un(y){let l,r="토크나이저를 다운받은 방식과 동일한 방식으로 사전학습된 모델을 다운받을 수 있습니다. 🤗 Transformers는 <code>from_pretrained</code> 메서드를 가진 <code>AutoModel</code> 클래스를 제공합니다.",s,i,u;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbCUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZC1maW5ldHVuZWQtc3N0LTItZW5nbGlzaCUyMiUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = AutoModel.from_pretrained(checkpoint)`,wrap:!1}}),{c(){l=f("p"),l.innerHTML=r,s=c(),J(i.$$.fragment)},l(p){l=T(p,"P",{"data-svelte-h":!0}),b(l)!=="svelte-9oefvu"&&(l.innerHTML=r),s=M(p),U(i.$$.fragment,p)},m(p,w){a(p,l,w),a(p,s,w),j(i,p,w),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(l),n(s)),d(i,p)}}}function on(y){let l,r,s,i;return l=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFwcmludChvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`outputs = model(inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),s=new h({props:{code:"KDIlMkMlMjAxNiUyQyUyMDc2OCk=",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">16</span>, <span class="hljs-number">768</span>)',wrap:!1}}),{c(){J(l.$$.fragment),r=c(),J(s.$$.fragment)},l(u){U(l.$$.fragment,u),r=M(u),U(s.$$.fragment,u)},m(u,p){j(l,u,p),a(u,r,p),j(s,u,p),i=!0},i(u){i||(m(l.$$.fragment,u),m(s.$$.fragment,u),i=!0)},o(u){o(l.$$.fragment,u),o(s.$$.fragment,u),i=!1},d(u){u&&n(r),d(l,u),d(s,u)}}}function mn(y){let l,r,s,i;return l=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQXByaW50KG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUuc2hhcGUp",highlighted:`outputs = model(**inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),s=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMTYlMkMlMjA3NjglNUQp",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">16</span>, <span class="hljs-number">768</span>])',wrap:!1}}),{c(){J(l.$$.fragment),r=c(),J(s.$$.fragment)},l(u){U(l.$$.fragment,u),r=M(u),U(s.$$.fragment,u)},m(u,p){j(l,u,p),a(u,r,p),j(s,u,p),i=!0},i(u){i||(m(l.$$.fragment,u),m(s.$$.fragment,u),i=!0)},o(u){o(l.$$.fragment,u),o(s.$$.fragment,u),i=!1},d(u){u&&n(r),d(l,u),d(s,u)}}}function yn(y){let l,r="이 예제를 위해서는 문장을 긍정 또는 부정으로 분류할 수 있게 하는 시퀀스 분류 헤드를 가진 모델이 필요합니다. 따라서 <code>AutoModel</code> 클래스가 아닌 <code>TFAutoModelForSequenceClassification</code>을 사용할 것입니다.",s,i,u;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMFRGQXV0b01vZGVsRm9yU2VxdWVuY2VDbGFzc2lmaWNhdGlvbiUwQSUwQWNoZWNrcG9pbnQlMjAlM0QlMjAlMjJkaXN0aWxiZXJ0LWJhc2UtdW5jYXNlZC1maW5ldHVuZWQtc3N0LTItZW5nbGlzaCUyMiUwQW1vZGVsJTIwJTNEJTIwVEZBdXRvTW9kZWxGb3JTZXF1ZW5jZUNsYXNzaWZpY2F0aW9uLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KSUwQW91dHB1dHMlMjAlM0QlMjBtb2RlbChpbnB1dHMp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = TFAutoModelForSequenceClassification.from_pretrained(checkpoint)
outputs = model(inputs)`,wrap:!1}}),{c(){l=f("p"),l.innerHTML=r,s=c(),J(i.$$.fragment)},l(p){l=T(p,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1xxwnzw"&&(l.innerHTML=r),s=M(p),U(i.$$.fragment,p)},m(p,w){a(p,l,w),a(p,s,w),j(i,p,w),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(l),n(s)),d(i,p)}}}function fn(y){let l,r="이 예제를 위해서는 문장을 긍정 또는 부정으로 분류할 수 있게 하는 시퀀스 분류 헤드를 가진 모델이 필요합니다. 따라서 <code>AutoModel</code> 클래스가 아닌 <code>AutoModelForSequenceClassification</code>을 사용할 것입니다.",s,i,u;return i=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24lMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQtZmluZXR1bmVkLXNzdC0yLWVuZ2xpc2glMjIlMEFtb2RlbCUyMCUzRCUyMEF1dG9Nb2RlbEZvclNlcXVlbmNlQ2xhc3NpZmljYXRpb24uZnJvbV9wcmV0cmFpbmVkKGNoZWNrcG9pbnQpJTBBb3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
model = AutoModelForSequenceClassification.from_pretrained(checkpoint)
outputs = model(**inputs)`,wrap:!1}}),{c(){l=f("p"),l.innerHTML=r,s=c(),J(i.$$.fragment)},l(p){l=T(p,"P",{"data-svelte-h":!0}),b(l)!=="svelte-vxxqdi"&&(l.innerHTML=r),s=M(p),U(i.$$.fragment,p)},m(p,w){a(p,l,w),a(p,s,w),j(i,p,w),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(l),n(s)),d(i,p)}}}function Tn(y){let l,r;return l=new h({props:{code:"KDIlMkMlMjAyKQ==",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>)',wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function bn(y){let l,r;return l=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMiU1RCk=",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>])',wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function Jn(y){let l,r;return l=new h({props:{code:"JTNDdGYuVGVuc29yJTNBJTIwc2hhcGUlM0QoMiUyQyUyMDIpJTJDJTIwZHR5cGUlM0RmbG9hdDMyJTJDJTIwbnVtcHklM0QlMEElMjAlMjAlMjAlMjBhcnJheSglNUIlNUItMS41NjA2OTkxJTJDJTIwJTIwMS42MTIyODQyJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwNC4xNjkyMzElMjAlMkMlMjAtMy4zNDY0NDcyJTVEJTVEJTJDJTIwZHR5cGUlM0RmbG9hdDMyKSUzRQ==",highlighted:`&lt;tf.Tensor: shape=(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>), dtype=float32, numpy=
    array([[-<span class="hljs-number">1.5606991</span>,  <span class="hljs-number">1.6122842</span>],
           [ <span class="hljs-number">4.169231</span> , -<span class="hljs-number">3.3464472</span>]], dtype=float32)&gt;`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function Un(y){let l,r;return l=new h({props:{code:"dGVuc29yKCU1QiU1Qi0xLjU2MDclMkMlMjAlMjAxLjYxMjMlNUQlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIlMjA0LjE2OTIlMkMlMjAtMy4zNDY0JTVEJTVEJTJDJTIwZ3JhZF9mbiUzRCUzQ0FkZG1tQmFja3dhcmQlM0Up",highlighted:`tensor([[-<span class="hljs-number">1.5607</span>,  <span class="hljs-number">1.6123</span>],
        [ <span class="hljs-number">4.1692</span>, -<span class="hljs-number">3.3464</span>]], grad_fn=&lt;AddmmBackward&gt;)`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function jn(y){let l,r;return l=new h({props:{code:"aW1wb3J0JTIwdGVuc29yZmxvdyUyMGFzJTIwdGYlMEElMEFwcmVkaWN0aW9ucyUyMCUzRCUyMHRmLm1hdGguc29mdG1heChvdXRwdXRzLmxvZ2l0cyUyQyUyMGF4aXMlM0QtMSklMEFwcmludChwcmVkaWN0aW9ucyk=",highlighted:`<span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

predictions = tf.math.softmax(outputs.logits, axis=-<span class="hljs-number">1</span>)
<span class="hljs-built_in">print</span>(predictions)`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function dn(y){let l,r;return l=new h({props:{code:"aW1wb3J0JTIwdG9yY2glMEElMEFwcmVkaWN0aW9ucyUyMCUzRCUyMHRvcmNoLm5uLmZ1bmN0aW9uYWwuc29mdG1heChvdXRwdXRzLmxvZ2l0cyUyQyUyMGRpbSUzRC0xKSUwQXByaW50KHByZWRpY3Rpb25zKQ==",highlighted:`<span class="hljs-keyword">import</span> torch

predictions = torch.nn.functional.softmax(outputs.logits, dim=-<span class="hljs-number">1</span>)
<span class="hljs-built_in">print</span>(predictions)`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function wn(y){let l,r;return l=new h({props:{code:"dGYuVGVuc29yKCUwQSU1QiU1QjQuMDE5NTE2NzFlLTAyJTIwOS41OTgwNDgzM2UtMDElNUQlMEElMjAlNUI5Ljk5NDU1ODdlLTAxJTIwNS40NDE4NDI0ZS0wNCU1RCU1RCUyQyUyMHNoYXBlJTNEKDIlMkMlMjAyKSUyQyUyMGR0eXBlJTNEZmxvYXQzMik=",highlighted:`tf.Tensor(
[[<span class="hljs-number">4.01951671e-02</span> <span class="hljs-number">9.59804833e-01</span>]
 [<span class="hljs-number">9.9945587e-01</span> <span class="hljs-number">5.4418424e-04</span>]], shape=(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>), dtype=float32)`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function hn(y){let l,r;return l=new h({props:{code:"dGVuc29yKCU1QiU1QjQuMDE5NWUtMDIlMkMlMjA5LjU5ODBlLTAxJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCOS45OTQ2ZS0wMSUyQyUyMDUuNDQxOGUtMDQlNUQlNUQlMkMlMjBncmFkX2ZuJTNEJTNDU29mdG1heEJhY2t3YXJkJTNFKQ==",highlighted:`tensor([[<span class="hljs-number">4.0195e-02</span>, <span class="hljs-number">9.5980e-01</span>],
        [<span class="hljs-number">9.9946e-01</span>, <span class="hljs-number">5.4418e-04</span>]], grad_fn=&lt;SoftmaxBackward&gt;)`,wrap:!1}}),{c(){J(l.$$.fragment)},l(s){U(l.$$.fragment,s)},m(s,i){j(l,s,i),r=!0},i(s){r||(m(l.$$.fragment,s),r=!0)},o(s){o(l.$$.fragment,s),r=!1},d(s){d(l,s)}}}function _n(y){let l,r="✏️ <strong>직접 해보세요!</strong> 2개 이상의 문장을 골라 <code>sentiment-analysis</code> 파이프라인을 적용해보세요. 이 챕터에서 본 내용을 그대로 수행해보고 같은 결과가 나오는지 확인해보세요!";return{c(){l=f("p"),l.innerHTML=r},l(s){l=T(s,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1t16ayp"&&(l.innerHTML=r)},m(s,i){a(s,l,i)},p:Bt,d(s){s&&n(l)}}}function $n(y){let l,r,s,i,u,p,w,bs,_,$,ns,X,Js,C,k,as,K,Al='완전한 예제를 이용해, 아래의 <a href="/course/chapter1">제1단원</a> 코드를 수행했을 때 뒤에서 어떤 일이 일어나고 있는지 알아봅시다.',Us,O,js,ee,vl="다음과 같은 출력이 나오게 됩니다.",ds,se,ws,le,xl='<a href="/course/chapter1">제1단원</a>에서 확인했듯이, 이 파이프라인 그룹은 세 단계(전처리, 입력을 모델에 넘겨주는 것, 후처리)를 함께 수행합니다.',hs,Y,Ql='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline.svg" alt="The full NLP pipeline: tokenization of text, conversion to IDs, and inference through the Transformer model and the model head."/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline-dark.svg" alt="The full NLP pipeline: tokenization of text, conversion to IDs, and inference through the Transformer model and the model head."/>',_s,te,Nl="각 단계에 대해 빠르게 살펴보겠습니다.",$s,ne,Cs,ae,Dl="다른 신경망처럼 Transformer 모델도 원시 텍스트를 바로 처리할 수 없기 때문에 파이프라인의 첫 번째 단계는 텍스트 입력을 모델이 이해할 수 있는 숫자로 변환하는 것입니다. 이 과정을 위해 다음 기능들을 수행하는 <em>토크나이저</em>를 사용합니다.",ks,re,El="<li>입력을 <em>토큰</em>이라고 부르는 단어나 하위 단어, 또는 심볼(예-구두점)로 분할</li> <li>각 토큰을 하나의 정수에 매핑</li> <li>모델에 유용할 수 있는 부가적인 입력 추가</li>",Is,pe,Gl='이 모든 전처리 과정은 모델이 사전학습될 때와 완전히 동일한 방식으로 진행되어야 하기 때문에 <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>에서 정보를 다운로드 해야합니다. 전처리를 위해 <code>AutoTokenizer</code> 클래스와 AutoTokenizer의 <code>from_pretrained()</code> 메서드를 사용합니다. 모델의 체크포인트 이름을 사용하여 모델의 토크나이저와 연관된 데이터를 자동으로 가져와 저장합니다. (따라서 아래 코드를 처음 실행할 때만 다운로드됩니다.)',gs,ie,Vl='<code>sentiment-analysis</code> 파이프라인의 기본 체크포인트는 <code>distilbert-base-uncased-finetuned-sst-2-english</code>(모델 카드 확인은 <a href="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english" rel="nofollow">여기</a>서 가능)이므로 아래 코드를 실행합니다.',As,ce,vs,Me,Zl="토크나이저가 있다면 문장을 토크나이저에 입력하여 우리의 모델에 전달할 준비가 된 딕셔너리를 출력으로 얻게 됩니다! 남은 것은 입력 ID 목록을 tensor로 변환하는 것입니다.",xs,ue,Hl="여러분은 어떤 ML 프레임워크-PyTorch나 TensorFlow, 또는 몇몇 모델을 위한 Flax-가 백엔드로 사용되는지 걱정하지 않고 🤗 Transformers를 사용할 수 있습니다. 하지만 Transformer 모델은 <em>tensor</em>만을 입력으로 받습니다. 만약 tensor에 대해 처음 들어봤다면, NumPy 배열을 생각하면 됩니다. NumPy 배열은 스칼라(0D), 벡터(1D), 행렬(2D) 또는 더 많은 차원을 가질 수 있습니다. 이것은 사실상 텐서입니다. 다른 ML 프레임워크의 텐서도 유사하게 동작하며, NumPy 배열처럼 인스턴스화가 쉽습니다.",Qs,oe,zl="얻고자 하는 tensor의 타입(PyTorch, TensorFlow, 일반 NumPy)을 지정하기 위해, <code>return_tensors</code> 전달인자를 사용합니다.",Ns,I,g,rs,me,Rl="padding과 truncation에 대해 벌써 걱정하지 마세요. 나중에 설명하도록 하겠습니다. 여기서 기억해야 할 중요한 점은 하나의 문장 또는 여러 개의 문장 리스트를 토크나이저 함수로 전달할 수 있을 뿐만 아니라 얻고 싶은 텐서 유형까지 지정할 수 있다는 것입니다. (텐서 유형이 지정되지 않으면 이중 리스트를 결과로 얻게 됩니다)",Ds,A,v,ps,ye,Sl="출력은 <code>input_ids</code>와 <code>attention_mask</code> 두 개의 키를 갖는 딕셔너리입니다. <code>input_ids</code>는 각 문장 내 토큰의 고유 식별자인 정수로 이루어진 2개의 행(한 행이 하나의 문장)을 가지고 있습니다. <code>attention_mask</code>는 이 챕터의 뒤쪽에서 설명할 것입니다.",Es,fe,Gs,x,Q,is,Te,Wl="이 코드 스니펫에서 이전 파이프라인에서 사용된 것과 동일한 체크포인트를 다운로드(실제로는 이미 저장되어 있어야 합니다.)하고 그것으로 모델을 인스턴스화했습니다.",Vs,be,Bl="해당 아키텍처는 기본 Transformer 모듈만 포함하고 있습니다. 입력이 주어지면 <em>features</em>라고도 불리는 <em>hidden states</em>를 출력합니다. 각 모델의 입력에 대해 <strong>Transformer 모델에 의해 수행된 입력의 문맥적 이해</strong>로 표현할 수 있는 고차원 벡터를 가져옵니다.",Zs,Je,Ll="이 내용이 이해되지 않더라도 걱정하지 마세요. 뒤에서 설명할 것입니다.",Hs,Ue,Fl='이러한 hidden states는 그 자체로 유용할 수 있지만 일반적으로 <em>head</em>라고 알려진 모델의 다른 부분에 입력으로 들어갑니다. <a href="/course/chapter1">제1단원</a>에서, 동일한 구조로 다른 태스크를 수행할 수 있었는데 이 태스크들은 서로 다른 헤드와 연관되어 있습니다.',zs,je,Rs,de,Xl="Transformer 모듈에 의한 출력 벡터는 일반적으로 크며 보통 3개의 차원을 가집니다.",Ss,we,Yl="<li><strong>Batch size</strong>: 한 번에 처리되는 시퀀스의 수 (예제에서는 2)</li> <li><strong>Sequence length</strong>: 시퀀스의 숫자 표현 길이 (예제에서는 16)</li> <li><strong>Hidden size</strong>: 각 모델 입력 벡터 차원</li>",Ws,he,Pl="위에서 마지막 값으로 인해 “고차원”이라고 불립니다. hidden size는 매우 클 수 있습니다 (작은 모델은 768이 일반적이며 큰 모델은 3072나 그 이상의 값이 될 수 있습니다)",Bs,_e,ql="전처리 과정을 거친 입력을 모델로 넘기면 아래 결과를 확인할 수 있습니다.",Ls,N,D,cs,$e,Kl="🤗 Transformers 모델의 출력은 <code>namedtuple</code> 또는 딕셔너리 형태입니다. 속성이나 키(<code>outputs[&quot;last_hidden_state&quot;]</code>)를 이용해 요소에 접근할 수 있고 찾고자 하는 것의 정확한 위치를 안다면 인덱스(<code>outputs[0]</code>)도 사용할 수 있습니다.",Fs,Ce,Xs,ke,Ol="모델 헤드는 hidden state의 고차원 벡터를 입력으로 받아 다른 차원으로 투영합니다. 모델 헤드는 보통 하나 이상의 선형 레이어로 이루어져 있습니다.",Ys,P,et='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/transformer_and_head.svg" alt="A Transformer network alongside its head."/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/transformer_and_head-dark.svg" alt="A Transformer network alongside its head."/>',Ps,Ie,st="Transformer 모델의 출력은 처리할 모델 헤드로 바로 전달됩니다.",qs,ge,lt="이 다이어그램에서, 모델은 모델의 임베딩 레이어와 후속 레이어로 표현됩니다. 임베딩 레이어는 토큰화된 각각의 입력 ID를 연관된 토큰을 나타내는 벡터로 변환합니다. 후속 레이어는 문장의 최종 표현을 만들기 위해 어텐션 메커니즘을 이용해 이 벡터들을 처리합니다.",Ks,Ae,tt="🤗 Transformer에는 다양한 아키텍처가 있으며, 각각의 아키텍처는 특정 작업을 처리하도록 설계되었습니다. 아래는 일부 아키텍처입니다.",Os,ve,nt="<li><code>*Model</code> (retrieve the hidden states)</li> <li><code>*ForCausalLM</code></li> <li><code>*ForMaskedLM</code></li> <li><code>*ForMultipleChoice</code></li> <li><code>*ForQuestionAnswering</code></li> <li><code>*ForSequenceClassification</code></li> <li><code>*ForTokenClassification</code></li> <li>그 외 🤗</li>",el,E,G,Ms,xe,at="출력 형태를 보면 차원이 훨씬 적은 것을 알 수 있습니다. 모델 헤드는 이전에 봤던 고차원 벡터를 입력으로 받아 2개의 값(레이블 당 하나)으로 이루어진 벡터를 출력합니다.",sl,Qe,ll,V,Z,us,Ne,rt="우리는 2개의 문장과 2개의 레이블만 있기 때문에 모델로부터 얻은 출력 형태는 2 x 2입니다.",tl,De,nl,Ee,pt="모델의 출력 값이 그 자체로 의미있는 것은 아닙니다. 한 번 보도록 합시다.",al,Ge,rl,H,z,os,Ve,it='모델은 첫 번째 문장에 대해 <code>[-1.5607, 1.6123]</code>으로 예측했고 두 번째 문장에 대해 <code>[ 4.1692, -3.3464]</code>으로 예측했습니다. 이 값들은 확률이 아니라 모델의 마지막 층에 의해 출력된 정규화되지 않은 점수인 <em>logits</em>입니다. 확률로 변환되기 위해 logits은 <a href="https://en.wikipedia.org/wiki/Softmax_function" rel="nofollow">SoftMax</a> 층을 거쳐야 합니다. 학습을 위한 손실 함수가 일반적으로 SoftMax와 같은 마지막 활성함수와 교차 엔트로피와 같은 실제 손실 함수를 모두 사용하기 때문에 모든 🤗 Transformers 모델의 출력은 logit입니다.',pl,R,S,ms,W,B,ys,Ze,ct="모델은 첫 번째 문장에 대해 <code>[0.0402, 0.9598]</code>로 예측했고 두 번째 모델에 대해 <code>[0.9995, 0.0005]</code>로 예측했습니다. 이 값들은 확실하게 확률값입니다.",il,He,Mt="각 위치에 해당하는 레이블을 얻기 위해, 모델 config의 <code>id2label</code> 속성을 살펴봅시다. Config에 대한 더 많은 내용은 다음 섹션에서 진행됩니다.",cl,ze,Ml,Re,ul,Se,ut="모델의 예측 결과를 아래처럼 결론 지을 수 있습니다.",ol,We,ot="<li>첫 번째 문장: NEGATIVE: 0.0402, POSITIVE: 0.9598</li> <li>두 번째 문장: NEGATIVE: 0.9995, POSITIVE: 0.0005</li>",ml,Be,mt="파이프라인 세 단계-토크나이저를 이용한 전처리, 모델에 입력 넣어주기, 후처리-를 성공적으로 재현했습니다! 이제 각 단계별로 좀 더 깊게 알아보는 시간을 가져봅시다.",yl,q,fl,Le,Tl,Ts,bl;u=new Kt({props:{fw:y[0]}}),w=new fs({props:{title:"파이프라인 내부 동작 과정",local:"behind-the-pipeline",headingTag:"h1"}});const yt=[sn,en],Fe=[];function ft(e,t){return e[0]==="pt"?0:1}_=ft(y),$=Fe[_]=yt[_](y),X=new Ht({props:{$$slots:{default:[ln]},$$scope:{ctx:y}}});const Tt=[nn,tn],Xe=[];function bt(e,t){return e[0]==="pt"?0:1}C=bt(y),k=Xe[C]=Tt[C](y),O=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKCUyMnNlbnRpbWVudC1hbmFseXNpcyUyMiklMEFjbGFzc2lmaWVyKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

classifier = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>)
classifier(
    [
        <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
        <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
    ]
)`,wrap:!1}}),se=new h({props:{code:"JTVCJTdCJ2xhYmVsJyUzQSUyMCdQT1NJVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45NTk4MDQ3MTM3MjYwNDM3JTdEJTJDJTBBJTIwJTdCJ2xhYmVsJyUzQSUyMCdORUdBVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45OTk0NTU4MDk1OTMyMDA3JTdEJTVE",highlighted:`[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9598047137260437</span>},
 {<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9994558095932007</span>}]`,wrap:!1}}),ne=new fs({props:{title:"토크나이저를 이용한 전처리",local:"preprocessing-with-a-tokenizer",headingTag:"h2"}}),ce=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEF1dG9Ub2tlbml6ZXIlMEElMEFjaGVja3BvaW50JTIwJTNEJTIwJTIyZGlzdGlsYmVydC1iYXNlLXVuY2FzZWQtZmluZXR1bmVkLXNzdC0yLWVuZ2xpc2glMjIlMEF0b2tlbml6ZXIlMjAlM0QlMjBBdXRvVG9rZW5pemVyLmZyb21fcHJldHJhaW5lZChjaGVja3BvaW50KQ==",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

checkpoint = <span class="hljs-string">&quot;distilbert-base-uncased-finetuned-sst-2-english&quot;</span>
tokenizer = AutoTokenizer.from_pretrained(checkpoint)`,wrap:!1}});const Jt=[rn,an],Ye=[];function Ut(e,t){return e[0]==="pt"?0:1}I=Ut(y),g=Ye[I]=Jt[I](y);const jt=[cn,pn],Pe=[];function dt(e,t){return e[0]==="pt"?0:1}A=dt(y),v=Pe[A]=jt[A](y),fe=new fs({props:{title:"모델 살펴보기",local:"going-through-the-model",headingTag:"h2"}});const wt=[un,Mn],qe=[];function ht(e,t){return e[0]==="pt"?0:1}x=ht(y),Q=qe[x]=wt[x](y),je=new fs({props:{title:"고차원 벡터란?",local:"a-high-dimensional-vector",headingTag:"h3"}});const _t=[mn,on],Ke=[];function $t(e,t){return e[0]==="pt"?0:1}N=$t(y),D=Ke[N]=_t[N](y),Ce=new fs({props:{title:"모델 헤드: 숫자로 이해하기",local:"model-heads-making-sense-out-of-numbers",headingTag:"h3"}});const Ct=[fn,yn],Oe=[];function kt(e,t){return e[0]==="pt"?0:1}E=kt(y),G=Oe[E]=Ct[E](y),Qe=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const It=[bn,Tn],es=[];function gt(e,t){return e[0]==="pt"?0:1}V=gt(y),Z=es[V]=It[V](y),De=new fs({props:{title:"출력 후처리",local:"postprocessing-the-output",headingTag:"h2"}}),Ge=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const At=[Un,Jn],ss=[];function vt(e,t){return e[0]==="pt"?0:1}H=vt(y),z=ss[H]=At[H](y);const xt=[dn,jn],ls=[];function Qt(e,t){return e[0]==="pt"?0:1}R=Qt(y),S=ls[R]=xt[R](y);const Nt=[hn,wn],ts=[];function Dt(e,t){return e[0]==="pt"?0:1}return W=Dt(y),B=ts[W]=Nt[W](y),ze=new h({props:{code:"bW9kZWwuY29uZmlnLmlkMmxhYmVs",highlighted:"model.config.id2label",wrap:!1}}),Re=new h({props:{code:"JTdCMCUzQSUyMCdORUdBVElWRSclMkMlMjAxJTNBJTIwJ1BPU0lUSVZFJyU3RA==",highlighted:'{<span class="hljs-number">0</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>}',wrap:!1}}),q=new Ht({props:{$$slots:{default:[_n]},$$scope:{ctx:y}}}),Le=new Ot({props:{source:"https://github.com/huggingface/course/blob/main/chapters/ko/chapter2/2.mdx"}}),{c(){l=f("meta"),r=c(),s=f("p"),i=c(),J(u.$$.fragment),p=c(),J(w.$$.fragment),bs=c(),$.c(),ns=c(),J(X.$$.fragment),Js=c(),k.c(),as=c(),K=f("p"),K.innerHTML=Al,Us=c(),J(O.$$.fragment),js=c(),ee=f("p"),ee.textContent=vl,ds=c(),J(se.$$.fragment),ws=c(),le=f("p"),le.innerHTML=xl,hs=c(),Y=f("div"),Y.innerHTML=Ql,_s=c(),te=f("p"),te.textContent=Nl,$s=c(),J(ne.$$.fragment),Cs=c(),ae=f("p"),ae.innerHTML=Dl,ks=c(),re=f("ul"),re.innerHTML=El,Is=c(),pe=f("p"),pe.innerHTML=Gl,gs=c(),ie=f("p"),ie.innerHTML=Vl,As=c(),J(ce.$$.fragment),vs=c(),Me=f("p"),Me.textContent=Zl,xs=c(),ue=f("p"),ue.innerHTML=Hl,Qs=c(),oe=f("p"),oe.innerHTML=zl,Ns=c(),g.c(),rs=c(),me=f("p"),me.textContent=Rl,Ds=c(),v.c(),ps=c(),ye=f("p"),ye.innerHTML=Sl,Es=c(),J(fe.$$.fragment),Gs=c(),Q.c(),is=c(),Te=f("p"),Te.textContent=Wl,Vs=c(),be=f("p"),be.innerHTML=Bl,Zs=c(),Je=f("p"),Je.textContent=Ll,Hs=c(),Ue=f("p"),Ue.innerHTML=Fl,zs=c(),J(je.$$.fragment),Rs=c(),de=f("p"),de.textContent=Xl,Ss=c(),we=f("ul"),we.innerHTML=Yl,Ws=c(),he=f("p"),he.textContent=Pl,Bs=c(),_e=f("p"),_e.textContent=ql,Ls=c(),D.c(),cs=c(),$e=f("p"),$e.innerHTML=Kl,Fs=c(),J(Ce.$$.fragment),Xs=c(),ke=f("p"),ke.textContent=Ol,Ys=c(),P=f("div"),P.innerHTML=et,Ps=c(),Ie=f("p"),Ie.textContent=st,qs=c(),ge=f("p"),ge.textContent=lt,Ks=c(),Ae=f("p"),Ae.textContent=tt,Os=c(),ve=f("ul"),ve.innerHTML=nt,el=c(),G.c(),Ms=c(),xe=f("p"),xe.textContent=at,sl=c(),J(Qe.$$.fragment),ll=c(),Z.c(),us=c(),Ne=f("p"),Ne.textContent=rt,tl=c(),J(De.$$.fragment),nl=c(),Ee=f("p"),Ee.textContent=pt,al=c(),J(Ge.$$.fragment),rl=c(),z.c(),os=c(),Ve=f("p"),Ve.innerHTML=it,pl=c(),S.c(),ms=c(),B.c(),ys=c(),Ze=f("p"),Ze.innerHTML=ct,il=c(),He=f("p"),He.innerHTML=Mt,cl=c(),J(ze.$$.fragment),Ml=c(),J(Re.$$.fragment),ul=c(),Se=f("p"),Se.textContent=ut,ol=c(),We=f("ul"),We.innerHTML=ot,ml=c(),Be=f("p"),Be.textContent=mt,yl=c(),J(q.$$.fragment),fl=c(),J(Le.$$.fragment),Tl=c(),Ts=f("p"),this.h()},l(e){const t=Xt("svelte-u9bgzb",document.head);l=T(t,"META",{name:!0,content:!0}),t.forEach(n),r=M(e),s=T(e,"P",{}),Zt(s).forEach(n),i=M(e),U(u.$$.fragment,e),p=M(e),U(w.$$.fragment,e),bs=M(e),$.l(e),ns=M(e),U(X.$$.fragment,e),Js=M(e),k.l(e),as=M(e),K=T(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-g9xmns"&&(K.innerHTML=Al),Us=M(e),U(O.$$.fragment,e),js=M(e),ee=T(e,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-wl1uu7"&&(ee.textContent=vl),ds=M(e),U(se.$$.fragment,e),ws=M(e),le=T(e,"P",{"data-svelte-h":!0}),b(le)!=="svelte-1iq5920"&&(le.innerHTML=xl),hs=M(e),Y=T(e,"DIV",{class:!0,"data-svelte-h":!0}),b(Y)!=="svelte-fbe70j"&&(Y.innerHTML=Ql),_s=M(e),te=T(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-vi0ems"&&(te.textContent=Nl),$s=M(e),U(ne.$$.fragment,e),Cs=M(e),ae=T(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-e4ngzp"&&(ae.innerHTML=Dl),ks=M(e),re=T(e,"UL",{"data-svelte-h":!0}),b(re)!=="svelte-cxgkxr"&&(re.innerHTML=El),Is=M(e),pe=T(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-w17t67"&&(pe.innerHTML=Gl),gs=M(e),ie=T(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-79gaho"&&(ie.innerHTML=Vl),As=M(e),U(ce.$$.fragment,e),vs=M(e),Me=T(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-1rskcen"&&(Me.textContent=Zl),xs=M(e),ue=T(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-1yfq89p"&&(ue.innerHTML=Hl),Qs=M(e),oe=T(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-yp4x9m"&&(oe.innerHTML=zl),Ns=M(e),g.l(e),rs=M(e),me=T(e,"P",{"data-svelte-h":!0}),b(me)!=="svelte-12luxqf"&&(me.textContent=Rl),Ds=M(e),v.l(e),ps=M(e),ye=T(e,"P",{"data-svelte-h":!0}),b(ye)!=="svelte-4zxdhb"&&(ye.innerHTML=Sl),Es=M(e),U(fe.$$.fragment,e),Gs=M(e),Q.l(e),is=M(e),Te=T(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-1kq8h6f"&&(Te.textContent=Wl),Vs=M(e),be=T(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-1m8n2tn"&&(be.innerHTML=Bl),Zs=M(e),Je=T(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-xwzhyw"&&(Je.textContent=Ll),Hs=M(e),Ue=T(e,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-1j1df6u"&&(Ue.innerHTML=Fl),zs=M(e),U(je.$$.fragment,e),Rs=M(e),de=T(e,"P",{"data-svelte-h":!0}),b(de)!=="svelte-118vqvh"&&(de.textContent=Xl),Ss=M(e),we=T(e,"UL",{"data-svelte-h":!0}),b(we)!=="svelte-1yer64p"&&(we.innerHTML=Yl),Ws=M(e),he=T(e,"P",{"data-svelte-h":!0}),b(he)!=="svelte-1ldcz1p"&&(he.textContent=Pl),Bs=M(e),_e=T(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-foiu8f"&&(_e.textContent=ql),Ls=M(e),D.l(e),cs=M(e),$e=T(e,"P",{"data-svelte-h":!0}),b($e)!=="svelte-it37lc"&&($e.innerHTML=Kl),Fs=M(e),U(Ce.$$.fragment,e),Xs=M(e),ke=T(e,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-13d2s5r"&&(ke.textContent=Ol),Ys=M(e),P=T(e,"DIV",{class:!0,"data-svelte-h":!0}),b(P)!=="svelte-8mo6lt"&&(P.innerHTML=et),Ps=M(e),Ie=T(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-k1g54v"&&(Ie.textContent=st),qs=M(e),ge=T(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-did2wt"&&(ge.textContent=lt),Ks=M(e),Ae=T(e,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-1bvhwer"&&(Ae.textContent=tt),Os=M(e),ve=T(e,"UL",{"data-svelte-h":!0}),b(ve)!=="svelte-nf90ig"&&(ve.innerHTML=nt),el=M(e),G.l(e),Ms=M(e),xe=T(e,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-19v4iwk"&&(xe.textContent=at),sl=M(e),U(Qe.$$.fragment,e),ll=M(e),Z.l(e),us=M(e),Ne=T(e,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-vcufcz"&&(Ne.textContent=rt),tl=M(e),U(De.$$.fragment,e),nl=M(e),Ee=T(e,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-1fm5gwp"&&(Ee.textContent=pt),al=M(e),U(Ge.$$.fragment,e),rl=M(e),z.l(e),os=M(e),Ve=T(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-a9kzjr"&&(Ve.innerHTML=it),pl=M(e),S.l(e),ms=M(e),B.l(e),ys=M(e),Ze=T(e,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-11qcsxk"&&(Ze.innerHTML=ct),il=M(e),He=T(e,"P",{"data-svelte-h":!0}),b(He)!=="svelte-16uv0pg"&&(He.innerHTML=Mt),cl=M(e),U(ze.$$.fragment,e),Ml=M(e),U(Re.$$.fragment,e),ul=M(e),Se=T(e,"P",{"data-svelte-h":!0}),b(Se)!=="svelte-1qu5r5q"&&(Se.textContent=ut),ol=M(e),We=T(e,"UL",{"data-svelte-h":!0}),b(We)!=="svelte-a79kkl"&&(We.innerHTML=ot),ml=M(e),Be=T(e,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-ptsq7t"&&(Be.textContent=mt),yl=M(e),U(q.$$.fragment,e),fl=M(e),U(Le.$$.fragment,e),Tl=M(e),Ts=T(e,"P",{}),Zt(Ts).forEach(n),this.h()},h(){Jl(l,"name","hf:doc:metadata"),Jl(l,"content",Cn),Jl(Y,"class","flex justify-center"),Jl(P,"class","flex justify-center")},m(e,t){Yt(document.head,l),a(e,r,t),a(e,s,t),a(e,i,t),j(u,e,t),a(e,p,t),j(w,e,t),a(e,bs,t),Fe[_].m(e,t),a(e,ns,t),j(X,e,t),a(e,Js,t),Xe[C].m(e,t),a(e,as,t),a(e,K,t),a(e,Us,t),j(O,e,t),a(e,js,t),a(e,ee,t),a(e,ds,t),j(se,e,t),a(e,ws,t),a(e,le,t),a(e,hs,t),a(e,Y,t),a(e,_s,t),a(e,te,t),a(e,$s,t),j(ne,e,t),a(e,Cs,t),a(e,ae,t),a(e,ks,t),a(e,re,t),a(e,Is,t),a(e,pe,t),a(e,gs,t),a(e,ie,t),a(e,As,t),j(ce,e,t),a(e,vs,t),a(e,Me,t),a(e,xs,t),a(e,ue,t),a(e,Qs,t),a(e,oe,t),a(e,Ns,t),Ye[I].m(e,t),a(e,rs,t),a(e,me,t),a(e,Ds,t),Pe[A].m(e,t),a(e,ps,t),a(e,ye,t),a(e,Es,t),j(fe,e,t),a(e,Gs,t),qe[x].m(e,t),a(e,is,t),a(e,Te,t),a(e,Vs,t),a(e,be,t),a(e,Zs,t),a(e,Je,t),a(e,Hs,t),a(e,Ue,t),a(e,zs,t),j(je,e,t),a(e,Rs,t),a(e,de,t),a(e,Ss,t),a(e,we,t),a(e,Ws,t),a(e,he,t),a(e,Bs,t),a(e,_e,t),a(e,Ls,t),Ke[N].m(e,t),a(e,cs,t),a(e,$e,t),a(e,Fs,t),j(Ce,e,t),a(e,Xs,t),a(e,ke,t),a(e,Ys,t),a(e,P,t),a(e,Ps,t),a(e,Ie,t),a(e,qs,t),a(e,ge,t),a(e,Ks,t),a(e,Ae,t),a(e,Os,t),a(e,ve,t),a(e,el,t),Oe[E].m(e,t),a(e,Ms,t),a(e,xe,t),a(e,sl,t),j(Qe,e,t),a(e,ll,t),es[V].m(e,t),a(e,us,t),a(e,Ne,t),a(e,tl,t),j(De,e,t),a(e,nl,t),a(e,Ee,t),a(e,al,t),j(Ge,e,t),a(e,rl,t),ss[H].m(e,t),a(e,os,t),a(e,Ve,t),a(e,pl,t),ls[R].m(e,t),a(e,ms,t),ts[W].m(e,t),a(e,ys,t),a(e,Ze,t),a(e,il,t),a(e,He,t),a(e,cl,t),j(ze,e,t),a(e,Ml,t),j(Re,e,t),a(e,ul,t),a(e,Se,t),a(e,ol,t),a(e,We,t),a(e,ml,t),a(e,Be,t),a(e,yl,t),j(q,e,t),a(e,fl,t),j(Le,e,t),a(e,Tl,t),a(e,Ts,t),bl=!0},p(e,[t]){const Et={};t&1&&(Et.fw=e[0]),u.$set(Et);let Ul=_;_=ft(e),_!==Ul&&(F(),o(Fe[Ul],1,1,()=>{Fe[Ul]=null}),L(),$=Fe[_],$||($=Fe[_]=yt[_](e),$.c()),m($,1),$.m(ns.parentNode,ns));const Gt={};t&2&&(Gt.$$scope={dirty:t,ctx:e}),X.$set(Gt);let jl=C;C=bt(e),C!==jl&&(F(),o(Xe[jl],1,1,()=>{Xe[jl]=null}),L(),k=Xe[C],k||(k=Xe[C]=Tt[C](e),k.c()),m(k,1),k.m(as.parentNode,as));let dl=I;I=Ut(e),I!==dl&&(F(),o(Ye[dl],1,1,()=>{Ye[dl]=null}),L(),g=Ye[I],g||(g=Ye[I]=Jt[I](e),g.c()),m(g,1),g.m(rs.parentNode,rs));let wl=A;A=dt(e),A!==wl&&(F(),o(Pe[wl],1,1,()=>{Pe[wl]=null}),L(),v=Pe[A],v||(v=Pe[A]=jt[A](e),v.c()),m(v,1),v.m(ps.parentNode,ps));let hl=x;x=ht(e),x!==hl&&(F(),o(qe[hl],1,1,()=>{qe[hl]=null}),L(),Q=qe[x],Q||(Q=qe[x]=wt[x](e),Q.c()),m(Q,1),Q.m(is.parentNode,is));let _l=N;N=$t(e),N!==_l&&(F(),o(Ke[_l],1,1,()=>{Ke[_l]=null}),L(),D=Ke[N],D||(D=Ke[N]=_t[N](e),D.c()),m(D,1),D.m(cs.parentNode,cs));let $l=E;E=kt(e),E!==$l&&(F(),o(Oe[$l],1,1,()=>{Oe[$l]=null}),L(),G=Oe[E],G||(G=Oe[E]=Ct[E](e),G.c()),m(G,1),G.m(Ms.parentNode,Ms));let Cl=V;V=gt(e),V!==Cl&&(F(),o(es[Cl],1,1,()=>{es[Cl]=null}),L(),Z=es[V],Z||(Z=es[V]=It[V](e),Z.c()),m(Z,1),Z.m(us.parentNode,us));let kl=H;H=vt(e),H!==kl&&(F(),o(ss[kl],1,1,()=>{ss[kl]=null}),L(),z=ss[H],z||(z=ss[H]=At[H](e),z.c()),m(z,1),z.m(os.parentNode,os));let Il=R;R=Qt(e),R!==Il&&(F(),o(ls[Il],1,1,()=>{ls[Il]=null}),L(),S=ls[R],S||(S=ls[R]=xt[R](e),S.c()),m(S,1),S.m(ms.parentNode,ms));let gl=W;W=Dt(e),W!==gl&&(F(),o(ts[gl],1,1,()=>{ts[gl]=null}),L(),B=ts[W],B||(B=ts[W]=Nt[W](e),B.c()),m(B,1),B.m(ys.parentNode,ys));const Vt={};t&2&&(Vt.$$scope={dirty:t,ctx:e}),q.$set(Vt)},i(e){bl||(m(u.$$.fragment,e),m(w.$$.fragment,e),m($),m(X.$$.fragment,e),m(k),m(O.$$.fragment,e),m(se.$$.fragment,e),m(ne.$$.fragment,e),m(ce.$$.fragment,e),m(g),m(v),m(fe.$$.fragment,e),m(Q),m(je.$$.fragment,e),m(D),m(Ce.$$.fragment,e),m(G),m(Qe.$$.fragment,e),m(Z),m(De.$$.fragment,e),m(Ge.$$.fragment,e),m(z),m(S),m(B),m(ze.$$.fragment,e),m(Re.$$.fragment,e),m(q.$$.fragment,e),m(Le.$$.fragment,e),bl=!0)},o(e){o(u.$$.fragment,e),o(w.$$.fragment,e),o($),o(X.$$.fragment,e),o(k),o(O.$$.fragment,e),o(se.$$.fragment,e),o(ne.$$.fragment,e),o(ce.$$.fragment,e),o(g),o(v),o(fe.$$.fragment,e),o(Q),o(je.$$.fragment,e),o(D),o(Ce.$$.fragment,e),o(G),o(Qe.$$.fragment,e),o(Z),o(De.$$.fragment,e),o(Ge.$$.fragment,e),o(z),o(S),o(B),o(ze.$$.fragment,e),o(Re.$$.fragment,e),o(q.$$.fragment,e),o(Le.$$.fragment,e),bl=!1},d(e){e&&(n(r),n(s),n(i),n(p),n(bs),n(ns),n(Js),n(as),n(K),n(Us),n(js),n(ee),n(ds),n(ws),n(le),n(hs),n(Y),n(_s),n(te),n($s),n(Cs),n(ae),n(ks),n(re),n(Is),n(pe),n(gs),n(ie),n(As),n(vs),n(Me),n(xs),n(ue),n(Qs),n(oe),n(Ns),n(rs),n(me),n(Ds),n(ps),n(ye),n(Es),n(Gs),n(is),n(Te),n(Vs),n(be),n(Zs),n(Je),n(Hs),n(Ue),n(zs),n(Rs),n(de),n(Ss),n(we),n(Ws),n(he),n(Bs),n(_e),n(Ls),n(cs),n($e),n(Fs),n(Xs),n(ke),n(Ys),n(P),n(Ps),n(Ie),n(qs),n(ge),n(Ks),n(Ae),n(Os),n(ve),n(el),n(Ms),n(xe),n(sl),n(ll),n(us),n(Ne),n(tl),n(nl),n(Ee),n(al),n(rl),n(os),n(Ve),n(pl),n(ms),n(ys),n(Ze),n(il),n(He),n(cl),n(Ml),n(ul),n(Se),n(ol),n(We),n(ml),n(Be),n(yl),n(fl),n(Tl),n(Ts)),n(l),d(u,e),d(w,e),Fe[_].d(e),d(X,e),Xe[C].d(e),d(O,e),d(se,e),d(ne,e),d(ce,e),Ye[I].d(e),Pe[A].d(e),d(fe,e),qe[x].d(e),d(je,e),Ke[N].d(e),d(Ce,e),Oe[E].d(e),d(Qe,e),es[V].d(e),d(De,e),d(Ge,e),ss[H].d(e),ls[R].d(e),ts[W].d(e),d(ze,e),d(Re,e),d(q,e),d(Le,e)}}}const Cn='{"title":"파이프라인 내부 동작 과정","local":"behind-the-pipeline","sections":[{"title":"토크나이저를 이용한 전처리","local":"preprocessing-with-a-tokenizer","sections":[],"depth":2},{"title":"모델 살펴보기","local":"going-through-the-model","sections":[{"title":"고차원 벡터란?","local":"a-high-dimensional-vector","sections":[],"depth":3},{"title":"모델 헤드: 숫자로 이해하기","local":"model-heads-making-sense-out-of-numbers","sections":[],"depth":3}],"depth":2},{"title":"출력 후처리","local":"postprocessing-the-output","sections":[],"depth":2}],"depth":1}';function kn(y,l,r){let s="pt";return Wt(()=>{const i=new URLSearchParams(window.location.search);r(0,s=i.get("fw")||"pt")}),[s]}class En extends Lt{constructor(l){super(),Ft(this,l,kn,$n,St,{})}}export{En as component};
