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