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 Vt,u as U,x as b,k as Js,y as Yt,a,v as j,t as o,b as L,d as m,w,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 fl,E as Ot}from"../chunks/getInferenceSnippets.24b50994.js";function en(y){let s,r;return s=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/zh-CN/chapter2/section2_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter2/section2_tf.ipynb"}]}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function ln(y){let s,r;return s=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/zh-CN/chapter2/section2_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/zh-CN/chapter2/section2_pt.ipynb"}]}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function sn(y){let s;return{c(){s=Pt("這是第一部分，根據您使用 PyTorch 或者 TensorFlow，內容略有不同。點擊標題上方的平臺，選一個您喜歡的吧！")},l(r){s=qt(r,"這是第一部分，根據您使用 PyTorch 或者 TensorFlow，內容略有不同。點擊標題上方的平臺，選一個您喜歡的吧！")},m(r,l){a(r,s,l)},d(r){r&&n(s)}}}function tn(y){let s,r;return s=new zt({props:{id:"wVN12smEvqg"}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function nn(y){let s,r;return s=new zt({props:{id:"1pedAIvTWXk"}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function an(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function rn(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function pn(y){let s,r="以下是 TensorFlow 張量的結果：",l,i,u;return i=new h({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUyQyUyMCUwQSUyMCUyMCUyMCUyMCdhdHRlbnRpb25fbWFzayclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QjElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUwQSU3RA==",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">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-number">0</span>]
        ], dtype=int32)&gt;
}`,wrap:!1}}),{c(){s=f("p"),s.textContent=r,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-1f9p4nc"&&(s.textContent=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function cn(y){let s,r="以下是PyTorch張量的結果：",l,i,u;return i=new h({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjB0ZW5zb3IoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlNUQpJTJDJTIwJTBBJTIwJTIwJTIwJTIwJ2F0dGVudGlvbl9tYXNrJyUzQSUyMHRlbnNvciglNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCU1RCUwQSUyMCUyMCUyMCUyMCU1RCklMEElN0Q=",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">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-number">0</span>]
    ])
}`,wrap:!1}}),{c(){s=f("p"),s.textContent=r,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-1at5vza"&&(s.textContent=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function Mn(y){let s,r="我們可以像使用標記器一樣下載預訓練模型。🤗 Transformers提供了一個<code>TFAutoModel</code>類，該類還具有<code>from_pretrained()</code>方法：",l,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(){s=f("p"),s.innerHTML=r,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-1l9rz52"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function un(y){let s,r="我們可以像使用標記器一樣下載預訓練模型。🤗 Transformers提供了一個<code>AutoModel</code>類，該類還具有<code>from_pretrained()</code>方法：",l,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(){s=f("p"),s.innerHTML=r,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-1rb1u70"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function on(y){let s,r,l,i;return s=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFwcmludChvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`outputs = model(inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),l=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(s.$$.fragment),r=c(),J(l.$$.fragment)},l(u){U(s.$$.fragment,u),r=M(u),U(l.$$.fragment,u)},m(u,p){j(s,u,p),a(u,r,p),j(l,u,p),i=!0},i(u){i||(m(s.$$.fragment,u),m(l.$$.fragment,u),i=!0)},o(u){o(s.$$.fragment,u),o(l.$$.fragment,u),i=!1},d(u){u&&n(r),w(s,u),w(l,u)}}}function mn(y){let s,r,l,i;return s=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQXByaW50KG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUuc2hhcGUp",highlighted:`outputs = model(**inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),l=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(s.$$.fragment),r=c(),J(l.$$.fragment)},l(u){U(s.$$.fragment,u),r=M(u),U(l.$$.fragment,u)},m(u,p){j(s,u,p),a(u,r,p),j(l,u,p),i=!0},i(u){i||(m(s.$$.fragment,u),m(l.$$.fragment,u),i=!0)},o(u){o(s.$$.fragment,u),o(l.$$.fragment,u),i=!1},d(u){u&&n(r),w(s,u),w(l,u)}}}function yn(y){let s,r="For our example, we will need a model with a sequence classification head (to be able to classify the sentences as positive or negative). So, we won’t actually use the <code>TFAutoModel</code> class, but <code>TFAutoModelForSequenceClassification</code>:",l,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(){s=f("p"),s.innerHTML=r,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-6up9xi"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function fn(y){let s,r="對於我們的示例，我們需要一個帶有序列分類頭的模型（能夠將句子分類為肯定或否定）。因此，我們實際上不會使用<code>AutoModel</code>類，而是使用<code>AutoModelForSequenceClassification</code>：",l,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(){s=f("p"),s.innerHTML=r,l=c(),J(i.$$.fragment)},l(p){s=T(p,"P",{"data-svelte-h":!0}),b(s)!=="svelte-vhai1b"&&(s.innerHTML=r),l=M(p),U(i.$$.fragment,p)},m(p,d){a(p,s,d),a(p,l,d),j(i,p,d),u=!0},i(p){u||(m(i.$$.fragment,p),u=!0)},o(p){o(i.$$.fragment,p),u=!1},d(p){p&&(n(s),n(l)),w(i,p)}}}function Tn(y){let s,r;return s=new h({props:{code:"KDIlMkMlMjAyKQ==",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>)',wrap:!1}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function bn(y){let s,r;return s=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMiU1RCk=",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>])',wrap:!1}}),{c(){J(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function Jn(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function Un(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function jn(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function wn(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function dn(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function hn(y){let s,r;return s=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(s.$$.fragment)},l(l){U(s.$$.fragment,l)},m(l,i){j(s,l,i),r=!0},i(l){r||(m(s.$$.fragment,l),r=!0)},o(l){o(s.$$.fragment,l),r=!1},d(l){w(s,l)}}}function _n(y){let s,r="✏️ <strong>試試看！</strong> 選擇兩個（或更多）你自己的文本並在管道中運行它們。然後自己複製在這裡看到的步驟，並檢查是否獲得相同的結果！";return{c(){s=f("p"),s.innerHTML=r},l(l){s=T(l,"P",{"data-svelte-h":!0}),b(s)!=="svelte-9lmtrv"&&(s.innerHTML=r)},m(l,i){a(l,s,i)},p:Bt,d(l){l&&n(s)}}}function $n(y){let s,r,l,i,u,p,d,bl,_,$,nl,X,Jl,C,k,al,K,As='讓我們從一個完整的示例開始，看看在<a href="/course/chapter1">Chapter 1</a>中執行以下代碼時在幕後發生了什麼',Ul,O,jl,ee,vs="獲得:",wl,le,dl,se,xs='正如我們在<a href="/course/chapter1">Chapter 1</a>中看到的，此管道將三個步驟組合在一起：預處理、通過模型傳遞輸入和後處理：',hl,Y,Qs='<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."/>',_l,te,Ns="讓我們快速瀏覽一下這些內容。",$l,ne,Cl,ae,Ds="與其他神經網絡一樣，Transformer 模型無法直接處理原始文本， 因此我們管道的第一步是將文本輸入轉換為模型能夠理解的數字。 為此，我們使用<em>tokenizer</em>(標記器)，負責：",kl,re,Es="<li>將輸入拆分為單詞、子單詞或符號（如標點符號），稱為標記(<em>token</em>)</li> <li>將每個標記(token)映射到一個整數</li> <li>添加可能對模型有用的其他輸入</li>",Il,pe,Gs='所有這些預處理都需要以與模型預訓練時完全相同的方式完成，因此我們首先需要從<a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>中下載這些信息。為此，我們使用<code>AutoTokenizer</code>類及其<code>from_pretrained()</code>方法。使用我們模型的檢查點名稱，它將自動獲取與模型的標記器相關聯的數據，並對其進行緩存（因此只有在您第一次運行下面的代碼時才會下載）。',gl,ie,Zs='因為<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">here</a>)，我們運行以下程序：',Al,ce,vl,Me,Vs="一旦我們有了標記器，我們就可以直接將我們的句子傳遞給它，然後我們就會得到一本字典，它可以提供給我們的模型！剩下要做的唯一一件事就是將輸入ID列表轉換為張量。",xl,ue,Hs="您可以使用🤗 Transformers，而不必擔心哪個 ML 框架被用作後端；它可能是 PyTorch 或 TensorFlow，或 Flax。但是，Transformers型號只接受<em>張量</em>作為輸入。如果這是你第一次聽說張量，你可以把它們想象成NumPy數組。NumPy數組可以是標量（0D）、向量（1D）、矩陣（2D）或具有更多維度。它實際上是張量；其他 ML 框架的張量行為類似，通常與 NumPy 數組一樣易於實例化。",Ql,oe,zs="要指定要返回的張量類型（PyTorch、TensorFlow 或 plain NumPy），我們使用<code>return_tensors</code>參數：",Nl,I,g,rl,me,Rs="現在不要擔心填充和截斷；我們稍後會解釋這些。這裡要記住的主要事情是，您可以傳遞一個句子或一組句子，還可以指定要返回的張量類型（如果沒有傳遞類型，您將得到一組列表）。",Dl,A,v,pl,ye,Ss="輸出本身是一個包含兩個鍵的字典，<code>input_ids</code>和<code>attention_mask</code>。<code>input_ids</code>包含兩行整數（每個句子一行），它們是每個句子中標記的唯一標記（token）。我們將在本章後面解釋什麼是<code>attention_mask</code>。",El,fe,Gl,x,Q,il,Te,Ws="在這個代碼片段中，我們下載了之前在管道中使用的相同檢查點（它實際上應該已經被緩存），並用它實例化了一個模型。",Zl,be,Bs="這個架構只包含基本轉換器模塊：給定一些輸入，它輸出我們將調用的內容<em>隱藏狀態（hidden states）</em>，亦稱<em>特徵（features）</em>。對於每個模型輸入，我們將檢索一個高維向量，表示<strong>Transformer模型對該輸入的上下文理解</strong>。",Vl,Je,Ls="如果這不合理，不要擔心。我們以後再解釋。",Hl,Ue,Fs='雖然這些隱藏狀態本身可能很有用，但它們通常是模型另一部分（稱為<em>頭部(head)</em>）的輸入。 在<a href="/course/chapter1">Chapter 1</a>中，可以使用相同的體系結構執行不同的任務，但這些任務中的每個任務都有一個與之關聯的不同頭。',zl,je,Rl,we,Xs="Transformers 模塊的向量輸出通常較大。它通常有三個維度：",Sl,de,Ys="<li><strong>Batch size</strong>: 一次處理的序列數（在我們的示例中為2）。</li> <li><strong>Sequence length</strong>: 序列的數值表示的長度（在我們的示例中為16）。</li> <li><strong>Hidden size</strong>: 每個模型輸入的向量維度。</li>",Wl,he,Ps="由於最後一個值，它被稱為「高維」。隱藏的大小可能非常大（768通常用於較小的型號，而在較大的型號中，這可能達到3072或更大）。",Bl,_e,qs="如果我們將預處理的輸入輸入到模型中，我們可以看到這一點：",Ll,N,D,cl,$e,Ks="注意🤗 Transformers 模型的輸出與<code>namedtuple</code>或詞典相似。您可以通過屬性（就像我們所做的那樣）或鍵（<code>輸出[&quot;last_hidden_state&quot;]</code>）訪問元素，甚至可以通過索引訪問元素，前提是您確切知道要查找的內容在哪裡（<code>outputs[0]</code>）。",Fl,Ce,Xl,ke,Os="模型頭將隱藏狀態的高維向量作為輸入，並將其投影到不同的維度。它們通常由一個或幾個線性層組成：",Yl,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."/>',Pl,Ie,lt="Transformers 模型的輸出直接發送到模型頭進行處理。",ql,ge,st="在此圖中，模型由其嵌入層和後續層表示。嵌入層將標記化輸入中的每個輸入ID轉換為表示關聯標記(token)的向量。後續層使用注意機制操縱這些向量，以生成句子的最終表示。",Kl,Ae,tt="🤗 Transformers中有許多不同的體系結構，每種體系結構都是圍繞處理特定任務而設計的。以下是一個非詳盡的列表：",Ol,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>",es,E,G,Ml,xe,at="現在，如果我們觀察輸入的形狀，維度將低得多：模型頭將我們之前看到的高維向量作為輸入，並輸出包含兩個值的向量（每個標籤一個）：",ls,Qe,ss,Z,V,ul,Ne,rt="因為我們只有兩個句子和兩個標籤，所以我們從模型中得到的結果是2 x 2的形狀。",ts,De,ns,Ee,pt="我們從模型中得到的輸出值本身並不一定有意義。我們來看看,",as,Ge,rs,H,z,ol,Ze,it='我們的模型預測第一句為<code>[-1.5607, 1.6123]</code>，第二句為<code>[ 4.1692, -3.3464]</code>。這些不是概率，而是<em>logits</em>，即模型最後一層輸出的原始非標準化分數。要轉換為概率，它們需要經過<a href="https://en.wikipedia.org/wiki/Softmax_function" rel="nofollow">SoftMax</a>層（所有🤗Transformers模型輸出logits，因為用於訓練的損耗函數通常會將最後的激活函數（如SoftMax）與實際損耗函數（如交叉熵）融合）：',ps,R,S,ml,W,B,yl,Ve,ct="現在我們可以看到，模型預測第一句為<code>[0.0402, 0.9598]</code>，第二句為<code>[0.9995, 0.0005]</code>。這些是可識別的概率分數。",is,He,Mt="為了獲得每個位置對應的標籤，我們可以檢查模型配置的<code>id2label</code>屬性（下一節將對此進行詳細介紹）：",cs,ze,Ms,Re,us,Se,ut="現在我們可以得出結論，該模型預測了以下幾點：",os,We,ot="<li>第一句：否定：0.0402，肯定：0.9598</li> <li>第二句：否定：0.9995，肯定：0.0005</li>",ms,Be,mt="我們已經成功地複製了管道的三個步驟：使用標記化器進行預處理、通過模型傳遞輸入以及後處理！現在，讓我們花一些時間深入瞭解這些步驟中的每一步。",ys,q,fs,Le,Ts,Tl,bs;u=new Kt({props:{fw:y[0]}}),d=new fl({props:{title:"管道的內部",local:"管道的內部",headingTag:"h1"}});const yt=[ln,en],Fe=[];function ft(e,t){return e[0]==="pt"?0:1}_=ft(y),$=Fe[_]=yt[_](y),X=new Ht({props:{$$slots:{default:[sn]},$$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}}),le=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 fl({props:{title:"使用分詞器進行預處理",local:"使用分詞器進行預處理",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 wt(e,t){return e[0]==="pt"?0:1}A=wt(y),v=Pe[A]=jt[A](y),fe=new fl({props:{title:"瀏覽模型",local:"瀏覽模型",headingTag:"h2"}});const dt=[un,Mn],qe=[];function ht(e,t){return e[0]==="pt"?0:1}x=ht(y),Q=qe[x]=dt[x](y),je=new fl({props:{title:"高維向量？",local:"高維向量",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 fl({props:{title:"模型頭：數字的意義",local:"模型頭數字的意義",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],el=[];function gt(e,t){return e[0]==="pt"?0:1}Z=gt(y),V=el[Z]=It[Z](y),De=new fl({props:{title:"對輸出進行後處理",local:"對輸出進行後處理",headingTag:"h2"}}),Ge=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const At=[Un,Jn],ll=[];function vt(e,t){return e[0]==="pt"?0:1}H=vt(y),z=ll[H]=At[H](y);const xt=[wn,jn],sl=[];function Qt(e,t){return e[0]==="pt"?0:1}R=Qt(y),S=sl[R]=xt[R](y);const Nt=[hn,dn],tl=[];function Dt(e,t){return e[0]==="pt"?0:1}return W=Dt(y),B=tl[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/zh-TW/chapter2/2.mdx"}}),{c(){s=f("meta"),r=c(),l=f("p"),i=c(),J(u.$$.fragment),p=c(),J(d.$$.fragment),bl=c(),$.c(),nl=c(),J(X.$$.fragment),Jl=c(),k.c(),al=c(),K=f("p"),K.innerHTML=As,Ul=c(),J(O.$$.fragment),jl=c(),ee=f("p"),ee.textContent=vs,wl=c(),J(le.$$.fragment),dl=c(),se=f("p"),se.innerHTML=xs,hl=c(),Y=f("div"),Y.innerHTML=Qs,_l=c(),te=f("p"),te.textContent=Ns,$l=c(),J(ne.$$.fragment),Cl=c(),ae=f("p"),ae.innerHTML=Ds,kl=c(),re=f("ul"),re.innerHTML=Es,Il=c(),pe=f("p"),pe.innerHTML=Gs,gl=c(),ie=f("p"),ie.innerHTML=Zs,Al=c(),J(ce.$$.fragment),vl=c(),Me=f("p"),Me.textContent=Vs,xl=c(),ue=f("p"),ue.innerHTML=Hs,Ql=c(),oe=f("p"),oe.innerHTML=zs,Nl=c(),g.c(),rl=c(),me=f("p"),me.textContent=Rs,Dl=c(),v.c(),pl=c(),ye=f("p"),ye.innerHTML=Ss,El=c(),J(fe.$$.fragment),Gl=c(),Q.c(),il=c(),Te=f("p"),Te.textContent=Ws,Zl=c(),be=f("p"),be.innerHTML=Bs,Vl=c(),Je=f("p"),Je.textContent=Ls,Hl=c(),Ue=f("p"),Ue.innerHTML=Fs,zl=c(),J(je.$$.fragment),Rl=c(),we=f("p"),we.textContent=Xs,Sl=c(),de=f("ul"),de.innerHTML=Ys,Wl=c(),he=f("p"),he.textContent=Ps,Bl=c(),_e=f("p"),_e.textContent=qs,Ll=c(),D.c(),cl=c(),$e=f("p"),$e.innerHTML=Ks,Fl=c(),J(Ce.$$.fragment),Xl=c(),ke=f("p"),ke.textContent=Os,Yl=c(),P=f("div"),P.innerHTML=et,Pl=c(),Ie=f("p"),Ie.textContent=lt,ql=c(),ge=f("p"),ge.textContent=st,Kl=c(),Ae=f("p"),Ae.textContent=tt,Ol=c(),ve=f("ul"),ve.innerHTML=nt,es=c(),G.c(),Ml=c(),xe=f("p"),xe.textContent=at,ls=c(),J(Qe.$$.fragment),ss=c(),V.c(),ul=c(),Ne=f("p"),Ne.textContent=rt,ts=c(),J(De.$$.fragment),ns=c(),Ee=f("p"),Ee.textContent=pt,as=c(),J(Ge.$$.fragment),rs=c(),z.c(),ol=c(),Ze=f("p"),Ze.innerHTML=it,ps=c(),S.c(),ml=c(),B.c(),yl=c(),Ve=f("p"),Ve.innerHTML=ct,is=c(),He=f("p"),He.innerHTML=Mt,cs=c(),J(ze.$$.fragment),Ms=c(),J(Re.$$.fragment),us=c(),Se=f("p"),Se.textContent=ut,os=c(),We=f("ul"),We.innerHTML=ot,ms=c(),Be=f("p"),Be.textContent=mt,ys=c(),J(q.$$.fragment),fs=c(),J(Le.$$.fragment),Ts=c(),Tl=f("p"),this.h()},l(e){const t=Xt("svelte-u9bgzb",document.head);s=T(t,"META",{name:!0,content:!0}),t.forEach(n),r=M(e),l=T(e,"P",{}),Vt(l).forEach(n),i=M(e),U(u.$$.fragment,e),p=M(e),U(d.$$.fragment,e),bl=M(e),$.l(e),nl=M(e),U(X.$$.fragment,e),Jl=M(e),k.l(e),al=M(e),K=T(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-nvd9ba"&&(K.innerHTML=As),Ul=M(e),U(O.$$.fragment,e),jl=M(e),ee=T(e,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-bils5v"&&(ee.textContent=vs),wl=M(e),U(le.$$.fragment,e),dl=M(e),se=T(e,"P",{"data-svelte-h":!0}),b(se)!=="svelte-1oei9tw"&&(se.innerHTML=xs),hl=M(e),Y=T(e,"DIV",{class:!0,"data-svelte-h":!0}),b(Y)!=="svelte-fbe70j"&&(Y.innerHTML=Qs),_l=M(e),te=T(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-rywcw6"&&(te.textContent=Ns),$l=M(e),U(ne.$$.fragment,e),Cl=M(e),ae=T(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-11m5v7r"&&(ae.innerHTML=Ds),kl=M(e),re=T(e,"UL",{"data-svelte-h":!0}),b(re)!=="svelte-1bfa88i"&&(re.innerHTML=Es),Il=M(e),pe=T(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-1iyi717"&&(pe.innerHTML=Gs),gl=M(e),ie=T(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-1qkgqm9"&&(ie.innerHTML=Zs),Al=M(e),U(ce.$$.fragment,e),vl=M(e),Me=T(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-g22vk4"&&(Me.textContent=Vs),xl=M(e),ue=T(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-1yh1c40"&&(ue.innerHTML=Hs),Ql=M(e),oe=T(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-1u4kbml"&&(oe.innerHTML=zs),Nl=M(e),g.l(e),rl=M(e),me=T(e,"P",{"data-svelte-h":!0}),b(me)!=="svelte-1not51i"&&(me.textContent=Rs),Dl=M(e),v.l(e),pl=M(e),ye=T(e,"P",{"data-svelte-h":!0}),b(ye)!=="svelte-10ofhdi"&&(ye.innerHTML=Ss),El=M(e),U(fe.$$.fragment,e),Gl=M(e),Q.l(e),il=M(e),Te=T(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-1emhbyd"&&(Te.textContent=Ws),Zl=M(e),be=T(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-1giocc"&&(be.innerHTML=Bs),Vl=M(e),Je=T(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-1ixrz19"&&(Je.textContent=Ls),Hl=M(e),Ue=T(e,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-7emi31"&&(Ue.innerHTML=Fs),zl=M(e),U(je.$$.fragment,e),Rl=M(e),we=T(e,"P",{"data-svelte-h":!0}),b(we)!=="svelte-axg514"&&(we.textContent=Xs),Sl=M(e),de=T(e,"UL",{"data-svelte-h":!0}),b(de)!=="svelte-1g7d8l7"&&(de.innerHTML=Ys),Wl=M(e),he=T(e,"P",{"data-svelte-h":!0}),b(he)!=="svelte-1u2ngi5"&&(he.textContent=Ps),Bl=M(e),_e=T(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-c1zwnr"&&(_e.textContent=qs),Ll=M(e),D.l(e),cl=M(e),$e=T(e,"P",{"data-svelte-h":!0}),b($e)!=="svelte-1jsmus7"&&($e.innerHTML=Ks),Fl=M(e),U(Ce.$$.fragment,e),Xl=M(e),ke=T(e,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-1cn1di6"&&(ke.textContent=Os),Yl=M(e),P=T(e,"DIV",{class:!0,"data-svelte-h":!0}),b(P)!=="svelte-8mo6lt"&&(P.innerHTML=et),Pl=M(e),Ie=T(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-1oznz2q"&&(Ie.textContent=lt),ql=M(e),ge=T(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-1wvp26o"&&(ge.textContent=st),Kl=M(e),Ae=T(e,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-3p6ux1"&&(Ae.textContent=tt),Ol=M(e),ve=T(e,"UL",{"data-svelte-h":!0}),b(ve)!=="svelte-dcpvgx"&&(ve.innerHTML=nt),es=M(e),G.l(e),Ml=M(e),xe=T(e,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-1d4npk5"&&(xe.textContent=at),ls=M(e),U(Qe.$$.fragment,e),ss=M(e),V.l(e),ul=M(e),Ne=T(e,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-r11wkj"&&(Ne.textContent=rt),ts=M(e),U(De.$$.fragment,e),ns=M(e),Ee=T(e,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-10szbun"&&(Ee.textContent=pt),as=M(e),U(Ge.$$.fragment,e),rs=M(e),z.l(e),ol=M(e),Ze=T(e,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-36s1p"&&(Ze.innerHTML=it),ps=M(e),S.l(e),ml=M(e),B.l(e),yl=M(e),Ve=T(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-1ct83wd"&&(Ve.innerHTML=ct),is=M(e),He=T(e,"P",{"data-svelte-h":!0}),b(He)!=="svelte-1yoo9"&&(He.innerHTML=Mt),cs=M(e),U(ze.$$.fragment,e),Ms=M(e),U(Re.$$.fragment,e),us=M(e),Se=T(e,"P",{"data-svelte-h":!0}),b(Se)!=="svelte-u0ha8z"&&(Se.textContent=ut),os=M(e),We=T(e,"UL",{"data-svelte-h":!0}),b(We)!=="svelte-hx5asi"&&(We.innerHTML=ot),ms=M(e),Be=T(e,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-wiok8c"&&(Be.textContent=mt),ys=M(e),U(q.$$.fragment,e),fs=M(e),U(Le.$$.fragment,e),Ts=M(e),Tl=T(e,"P",{}),Vt(Tl).forEach(n),this.h()},h(){Js(s,"name","hf:doc:metadata"),Js(s,"content",Cn),Js(Y,"class","flex justify-center"),Js(P,"class","flex justify-center")},m(e,t){Yt(document.head,s),a(e,r,t),a(e,l,t),a(e,i,t),j(u,e,t),a(e,p,t),j(d,e,t),a(e,bl,t),Fe[_].m(e,t),a(e,nl,t),j(X,e,t),a(e,Jl,t),Xe[C].m(e,t),a(e,al,t),a(e,K,t),a(e,Ul,t),j(O,e,t),a(e,jl,t),a(e,ee,t),a(e,wl,t),j(le,e,t),a(e,dl,t),a(e,se,t),a(e,hl,t),a(e,Y,t),a(e,_l,t),a(e,te,t),a(e,$l,t),j(ne,e,t),a(e,Cl,t),a(e,ae,t),a(e,kl,t),a(e,re,t),a(e,Il,t),a(e,pe,t),a(e,gl,t),a(e,ie,t),a(e,Al,t),j(ce,e,t),a(e,vl,t),a(e,Me,t),a(e,xl,t),a(e,ue,t),a(e,Ql,t),a(e,oe,t),a(e,Nl,t),Ye[I].m(e,t),a(e,rl,t),a(e,me,t),a(e,Dl,t),Pe[A].m(e,t),a(e,pl,t),a(e,ye,t),a(e,El,t),j(fe,e,t),a(e,Gl,t),qe[x].m(e,t),a(e,il,t),a(e,Te,t),a(e,Zl,t),a(e,be,t),a(e,Vl,t),a(e,Je,t),a(e,Hl,t),a(e,Ue,t),a(e,zl,t),j(je,e,t),a(e,Rl,t),a(e,we,t),a(e,Sl,t),a(e,de,t),a(e,Wl,t),a(e,he,t),a(e,Bl,t),a(e,_e,t),a(e,Ll,t),Ke[N].m(e,t),a(e,cl,t),a(e,$e,t),a(e,Fl,t),j(Ce,e,t),a(e,Xl,t),a(e,ke,t),a(e,Yl,t),a(e,P,t),a(e,Pl,t),a(e,Ie,t),a(e,ql,t),a(e,ge,t),a(e,Kl,t),a(e,Ae,t),a(e,Ol,t),a(e,ve,t),a(e,es,t),Oe[E].m(e,t),a(e,Ml,t),a(e,xe,t),a(e,ls,t),j(Qe,e,t),a(e,ss,t),el[Z].m(e,t),a(e,ul,t),a(e,Ne,t),a(e,ts,t),j(De,e,t),a(e,ns,t),a(e,Ee,t),a(e,as,t),j(Ge,e,t),a(e,rs,t),ll[H].m(e,t),a(e,ol,t),a(e,Ze,t),a(e,ps,t),sl[R].m(e,t),a(e,ml,t),tl[W].m(e,t),a(e,yl,t),a(e,Ve,t),a(e,is,t),a(e,He,t),a(e,cs,t),j(ze,e,t),a(e,Ms,t),j(Re,e,t),a(e,us,t),a(e,Se,t),a(e,os,t),a(e,We,t),a(e,ms,t),a(e,Be,t),a(e,ys,t),j(q,e,t),a(e,fs,t),j(Le,e,t),a(e,Ts,t),a(e,Tl,t),bs=!0},p(e,[t]){const Et={};t&1&&(Et.fw=e[0]),u.$set(Et);let Us=_;_=ft(e),_!==Us&&(F(),o(Fe[Us],1,1,()=>{Fe[Us]=null}),L(),$=Fe[_],$||($=Fe[_]=yt[_](e),$.c()),m($,1),$.m(nl.parentNode,nl));const Gt={};t&2&&(Gt.$$scope={dirty:t,ctx:e}),X.$set(Gt);let js=C;C=bt(e),C!==js&&(F(),o(Xe[js],1,1,()=>{Xe[js]=null}),L(),k=Xe[C],k||(k=Xe[C]=Tt[C](e),k.c()),m(k,1),k.m(al.parentNode,al));let ws=I;I=Ut(e),I!==ws&&(F(),o(Ye[ws],1,1,()=>{Ye[ws]=null}),L(),g=Ye[I],g||(g=Ye[I]=Jt[I](e),g.c()),m(g,1),g.m(rl.parentNode,rl));let ds=A;A=wt(e),A!==ds&&(F(),o(Pe[ds],1,1,()=>{Pe[ds]=null}),L(),v=Pe[A],v||(v=Pe[A]=jt[A](e),v.c()),m(v,1),v.m(pl.parentNode,pl));let hs=x;x=ht(e),x!==hs&&(F(),o(qe[hs],1,1,()=>{qe[hs]=null}),L(),Q=qe[x],Q||(Q=qe[x]=dt[x](e),Q.c()),m(Q,1),Q.m(il.parentNode,il));let _s=N;N=$t(e),N!==_s&&(F(),o(Ke[_s],1,1,()=>{Ke[_s]=null}),L(),D=Ke[N],D||(D=Ke[N]=_t[N](e),D.c()),m(D,1),D.m(cl.parentNode,cl));let $s=E;E=kt(e),E!==$s&&(F(),o(Oe[$s],1,1,()=>{Oe[$s]=null}),L(),G=Oe[E],G||(G=Oe[E]=Ct[E](e),G.c()),m(G,1),G.m(Ml.parentNode,Ml));let Cs=Z;Z=gt(e),Z!==Cs&&(F(),o(el[Cs],1,1,()=>{el[Cs]=null}),L(),V=el[Z],V||(V=el[Z]=It[Z](e),V.c()),m(V,1),V.m(ul.parentNode,ul));let ks=H;H=vt(e),H!==ks&&(F(),o(ll[ks],1,1,()=>{ll[ks]=null}),L(),z=ll[H],z||(z=ll[H]=At[H](e),z.c()),m(z,1),z.m(ol.parentNode,ol));let Is=R;R=Qt(e),R!==Is&&(F(),o(sl[Is],1,1,()=>{sl[Is]=null}),L(),S=sl[R],S||(S=sl[R]=xt[R](e),S.c()),m(S,1),S.m(ml.parentNode,ml));let gs=W;W=Dt(e),W!==gs&&(F(),o(tl[gs],1,1,()=>{tl[gs]=null}),L(),B=tl[W],B||(B=tl[W]=Nt[W](e),B.c()),m(B,1),B.m(yl.parentNode,yl));const Zt={};t&2&&(Zt.$$scope={dirty:t,ctx:e}),q.$set(Zt)},i(e){bs||(m(u.$$.fragment,e),m(d.$$.fragment,e),m($),m(X.$$.fragment,e),m(k),m(O.$$.fragment,e),m(le.$$.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(V),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),bs=!0)},o(e){o(u.$$.fragment,e),o(d.$$.fragment,e),o($),o(X.$$.fragment,e),o(k),o(O.$$.fragment,e),o(le.$$.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(V),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),bs=!1},d(e){e&&(n(r),n(l),n(i),n(p),n(bl),n(nl),n(Jl),n(al),n(K),n(Ul),n(jl),n(ee),n(wl),n(dl),n(se),n(hl),n(Y),n(_l),n(te),n($l),n(Cl),n(ae),n(kl),n(re),n(Il),n(pe),n(gl),n(ie),n(Al),n(vl),n(Me),n(xl),n(ue),n(Ql),n(oe),n(Nl),n(rl),n(me),n(Dl),n(pl),n(ye),n(El),n(Gl),n(il),n(Te),n(Zl),n(be),n(Vl),n(Je),n(Hl),n(Ue),n(zl),n(Rl),n(we),n(Sl),n(de),n(Wl),n(he),n(Bl),n(_e),n(Ll),n(cl),n($e),n(Fl),n(Xl),n(ke),n(Yl),n(P),n(Pl),n(Ie),n(ql),n(ge),n(Kl),n(Ae),n(Ol),n(ve),n(es),n(Ml),n(xe),n(ls),n(ss),n(ul),n(Ne),n(ts),n(ns),n(Ee),n(as),n(rs),n(ol),n(Ze),n(ps),n(ml),n(yl),n(Ve),n(is),n(He),n(cs),n(Ms),n(us),n(Se),n(os),n(We),n(ms),n(Be),n(ys),n(fs),n(Ts),n(Tl)),n(s),w(u,e),w(d,e),Fe[_].d(e),w(X,e),Xe[C].d(e),w(O,e),w(le,e),w(ne,e),w(ce,e),Ye[I].d(e),Pe[A].d(e),w(fe,e),qe[x].d(e),w(je,e),Ke[N].d(e),w(Ce,e),Oe[E].d(e),w(Qe,e),el[Z].d(e),w(De,e),w(Ge,e),ll[H].d(e),sl[R].d(e),tl[W].d(e),w(ze,e),w(Re,e),w(q,e),w(Le,e)}}}const Cn='{"title":"管道的內部","local":"管道的內部","sections":[{"title":"使用分詞器進行預處理","local":"使用分詞器進行預處理","sections":[],"depth":2},{"title":"瀏覽模型","local":"瀏覽模型","sections":[{"title":"高維向量？","local":"高維向量","sections":[],"depth":3},{"title":"模型頭：數字的意義","local":"模型頭數字的意義","sections":[],"depth":3}],"depth":2},{"title":"對輸出進行後處理","local":"對輸出進行後處理","sections":[],"depth":2}],"depth":1}';function kn(y,s,r){let l="pt";return Wt(()=>{const i=new URLSearchParams(window.location.search);r(0,l=i.get("fw")||"pt")}),[l]}class En extends Lt{constructor(s){super(),Ft(this,s,kn,$n,St,{})}}export{En as component};
