import{s as Wa,o as Ba,n as La}from"../chunks/scheduler.cc52f4b9.js";import{S as Fa,i as Pa,e as f,s as i,c as T,h as Xa,a as y,d as l,b as m,f as Za,g as J,j as b,k as Ut,l as Ya,m as n,n as U,o as u,u as B,t as d,p as j,q as Ka,r as Oa,v as L}from"../chunks/index.d2856393.js";import{T as Sa}from"../chunks/Tip.a5bdccc4.js";import{C as el,H as ys,E as sl}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.e6659d4e.js";import{Y as qa}from"../chunks/Youtube.00df107c.js";import{C as h}from"../chunks/CodeBlock.9c179ed7.js";import{C as Ra}from"../chunks/CourseFloatingBanner.1c404cc0.js";import{F as tl}from"../chunks/FrameworkSwitchCourse.22a5e932.js";function al(M){let t,o;return t=new Ra({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/pt/chapter2/section2_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/pt/chapter2/section2_tf.ipynb"}]}}),{c(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function ll(M){let t,o;return t=new Ra({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/pt/chapter2/section2_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/pt/chapter2/section2_pt.ipynb"}]}}),{c(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function nl(M){let t;return{c(){t=Ka("Esta é a primeira seção onde o conteúdo é ligeiramente diferente, dependendo se você usa PyTorch e TensorFlow. Para selecionar a plataforma que você prefere, basta alterar no botão no topo.")},l(o){t=Oa(o,"Esta é a primeira seção onde o conteúdo é ligeiramente diferente, dependendo se você usa PyTorch e TensorFlow. Para selecionar a plataforma que você prefere, basta alterar no botão no topo.")},m(o,s){n(o,t,s)},d(o){o&&l(t)}}}function ol(M){let t,o;return t=new qa({props:{id:"wVN12smEvqg"}}),{c(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function rl(M){let t,o;return t=new qa({props:{id:"1pedAIvTWXk"}}),{c(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function pl(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function il(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function ml(M){let t,o="Eis como são os resultados como tensores TensorFlow:",s,p,c;return p=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(){t=f("p"),t.textContent=o,s=i(),T(p.$$.fragment)},l(r){t=y(r,"P",{"data-svelte-h":!0}),b(t)!=="svelte-1o3xitq"&&(t.textContent=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,t,w),n(r,s,w),U(p,r,w),c=!0},i(r){c||(d(p.$$.fragment,r),c=!0)},o(r){u(p.$$.fragment,r),c=!1},d(r){r&&(l(t),l(s)),j(p,r)}}}function cl(M){let t,o="Eis como são os resultados como tensores PyTorch:",s,p,c;return p=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(){t=f("p"),t.textContent=o,s=i(),T(p.$$.fragment)},l(r){t=y(r,"P",{"data-svelte-h":!0}),b(t)!=="svelte-1txx0eu"&&(t.textContent=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,t,w),n(r,s,w),U(p,r,w),c=!0},i(r){c||(d(p.$$.fragment,r),c=!0)},o(r){u(p.$$.fragment,r),c=!1},d(r){r&&(l(t),l(s)),j(p,r)}}}function ul(M){let t,o="Podemos baixar nosso modelo pré-treinado da mesma forma que fizemos com nosso tokenizer. 🤗 Transformers fornece uma classe “TFAutoModel” que também tem um método “from_pretrained”:",s,p,c;return p=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(){t=f("p"),t.textContent=o,s=i(),T(p.$$.fragment)},l(r){t=y(r,"P",{"data-svelte-h":!0}),b(t)!=="svelte-1wemj46"&&(t.textContent=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,t,w),n(r,s,w),U(p,r,w),c=!0},i(r){c||(d(p.$$.fragment,r),c=!0)},o(r){u(p.$$.fragment,r),c=!1},d(r){r&&(l(t),l(s)),j(p,r)}}}function dl(M){let t,o="Podemos baixar nosso modelo pré-treinado da mesma forma que fizemos com nosso tokenizer. 🤗 Transformers fornece uma classe <code>AutoModel</code> que também tem um método <code>from_pretrained()</code>:",s,p,c;return p=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(){t=f("p"),t.innerHTML=o,s=i(),T(p.$$.fragment)},l(r){t=y(r,"P",{"data-svelte-h":!0}),b(t)!=="svelte-9i2qzf"&&(t.innerHTML=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,t,w),n(r,s,w),U(p,r,w),c=!0},i(r){c||(d(p.$$.fragment,r),c=!0)},o(r){u(p.$$.fragment,r),c=!1},d(r){r&&(l(t),l(s)),j(p,r)}}}function Ml(M){let t,o,s,p;return t=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFwcmludChvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`outputs = model(inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),s=new h({props:{code:"KDIlMkMlMjAxNiUyQyUyMDc2OCk=",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">16</span>, <span class="hljs-number">768</span>)',wrap:!1}}),{c(){T(t.$$.fragment),o=i(),T(s.$$.fragment)},l(c){J(t.$$.fragment,c),o=m(c),J(s.$$.fragment,c)},m(c,r){U(t,c,r),n(c,o,r),U(s,c,r),p=!0},i(c){p||(d(t.$$.fragment,c),d(s.$$.fragment,c),p=!0)},o(c){u(t.$$.fragment,c),u(s.$$.fragment,c),p=!1},d(c){c&&l(o),j(t,c),j(s,c)}}}function fl(M){let t,o,s,p;return t=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQXByaW50KG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUuc2hhcGUp",highlighted:`outputs = model(**inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),s=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMTYlMkMlMjA3NjglNUQp",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">16</span>, <span class="hljs-number">768</span>])',wrap:!1}}),{c(){T(t.$$.fragment),o=i(),T(s.$$.fragment)},l(c){J(t.$$.fragment,c),o=m(c),J(s.$$.fragment,c)},m(c,r){U(t,c,r),n(c,o,r),U(s,c,r),p=!0},i(c){p||(d(t.$$.fragment,c),d(s.$$.fragment,c),p=!0)},o(c){u(t.$$.fragment,c),u(s.$$.fragment,c),p=!1},d(c){c&&l(o),j(t,c),j(s,c)}}}function yl(M){let t,o="Para nosso exemplo, precisaremos de um modelo com uma <em>head</em> de classificação em sequencia (para poder classificar as sentenças como positivas ou negativas). Portanto, não utilizaremos a classe <code>TFAutoModel</code>, mas sim, a classe <code>TFAutoModelForSequenceClassification</code>:",s,p,c;return p=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(){t=f("p"),t.innerHTML=o,s=i(),T(p.$$.fragment)},l(r){t=y(r,"P",{"data-svelte-h":!0}),b(t)!=="svelte-1lez10n"&&(t.innerHTML=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,t,w),n(r,s,w),U(p,r,w),c=!0},i(r){c||(d(p.$$.fragment,r),c=!0)},o(r){u(p.$$.fragment,r),c=!1},d(r){r&&(l(t),l(s)),j(p,r)}}}function bl(M){let t,o="Para nosso exemplo, precisaremos de um modelo com uma <em>head</em> de classificação em sequencia (para poder classificar as sentenças como positivas ou negativas). Portanto, não utilizaremos a classe <code>AutoModel</code>, mas sim, a classe <code>AutoModelForSequenceClassification</code>:",s,p,c;return p=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(){t=f("p"),t.innerHTML=o,s=i(),T(p.$$.fragment)},l(r){t=y(r,"P",{"data-svelte-h":!0}),b(t)!=="svelte-1pqoxf"&&(t.innerHTML=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,t,w),n(r,s,w),U(p,r,w),c=!0},i(r){c||(d(p.$$.fragment,r),c=!0)},o(r){u(p.$$.fragment,r),c=!1},d(r){r&&(l(t),l(s)),j(p,r)}}}function Tl(M){let t,o;return t=new h({props:{code:"KDIlMkMlMjAyKQ==",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>)',wrap:!1}}),{c(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function Jl(M){let t,o;return t=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMiU1RCk=",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>])',wrap:!1}}),{c(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function Ul(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function jl(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function wl(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function hl(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function $l(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function _l(M){let t,o;return t=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(){T(t.$$.fragment)},l(s){J(t.$$.fragment,s)},m(s,p){U(t,s,p),o=!0},i(s){o||(d(t.$$.fragment,s),o=!0)},o(s){u(t.$$.fragment,s),o=!1},d(s){j(t,s)}}}function Cl(M){let t,o="✏️ <strong>Experimente!</strong> Escolha duas (ou mais) textos próprios e passe-os através do pipeline <code>sentiment-analysis</code>. Em seguida, replique as etapas que você mesmo viu aqui e verifique se você obtém os mesmos resultados!";return{c(){t=f("p"),t.innerHTML=o},l(s){t=y(s,"P",{"data-svelte-h":!0}),b(t)!=="svelte-1fdyacy"&&(t.innerHTML=o)},m(s,p){n(s,t,p)},p:La,d(s){s&&l(t)}}}function kl(M){let t,o,s,p,c,r,w,Ts,K,Js,$,_,ns,F,Us,C,k,os,O,xt='Vamos começar com um exemplo completo, dando uma olhada no que acontece dentro da função quando executamos o seguinte código no <a href="/course/pt/chapter1">Capítulo 1</a>:',js,ee,ws,se,Nt="tendo o resultado:",hs,te,$s,ae,Qt='Como visto no <a href="/course/pt/chapter1">Capítulo 1</a>, este pipeline agrupa os três passos: o pré-processamento, passagem das entradas através do modelo, e o pós-processamento:',_s,P,Dt='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline.svg" alt="O pipeline NLP completa: tokenização do texto, conversão para IDs, e inferência através do Transformer e pela &#39;cabeça&#39; do modelo."/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline-dark.svg" alt="O pipeline NLP completa: tokenização do texto, conversão para IDs, e inferência através do Transformer e pela &#39;cabeça&#39; do modelo."/>',Cs,le,Et="Vamos rever rapidamente cada um deles.",ks,ne,Is,oe,zt="Como outras redes neurais, os Transformers não podem processar texto bruto diretamente, portanto, o primeiro passo do nosso pipeline é converter as entradas de texto em números que o modelo possa fazer sentido. Para fazer isso, usamos um <em>tokenizer</em>, que será responsável por:",gs,re,Gt="<li>Dividir a entrada em palavras, sub-palavras ou símbolos (como pontuação) que são chamados de <em>tokens</em>.</li> <li>Mapeando cada ficha para um número inteiro</li> <li>Adicionando entradas adicionais que podem ser úteis ao modelo</li>",vs,pe,Vt='Todo esse pré-processamento precisa ser feito exatamente da mesma forma que quando o modelo foi pré-treinado, então precisamos primeiro baixar essas informações do <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>. Para isso, utilizamos a classe <code>AutoTokenizer</code> e seu método <code>from_pretrained()</code>. Utilizando o nome do ponto de verificação de nosso modelo, ele irá buscar automaticamente os dados associados ao tokenizer do modelo e armazená-los em cache (portanto, ele só é baixado na primeira vez que você executar o código abaixo).',As,ie,Ht='Desde que o checkpoint default do pipeline <code>sentiment-analysis</code> é <code>distilbert-base-uncased-finetuned-sst-2-english</code> (você pode ver o card do modelo <a href="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english" rel="nofollow">aqui</a>), então executamos o seguinte:',xs,me,Ns,ce,Zt="Assim que tivermos o tokenizer, podemos passar diretamente nossas frases para ele e receberemos de volta um dicionário que está pronto para alimentar nosso modelo! A única coisa que falta fazer é converter a lista de identificações de entrada em tensores.",Qs,ue,St="Você pode usar 🤗 Transformers sem ter que se preocupar com qual estrutura ML é usada como backend; pode ser PyTorch ou TensorFlow, ou Flax para alguns modelos. Entretanto, os Transformers só aceitam <em>tensores</em> como entrada. Se esta é a primeira vez que você ouve falar de tensores, você pode pensar neles como matrizes da NumPy. Uma matriz NumPy pode ser um escalar (0D), um vetor (1D), uma matriz (2D), ou ter mais dimensões. É efetivamente um tensor; os tensores de outras estruturas ML comportam-se de forma semelhante, e geralmente são tão simples de instanciar como os arrays da NumPy.",Ds,de,qt="Para especificar o tipo de tensores que queremos recuperar (PyTorch, TensorFlow ou NumPy), utilizamos o argumento <code>return_tensors</code>:",Es,I,g,rs,Me,Rt="Não se preocupe ainda com o truncamento e o padding; explicaremos isso mais tarde. As principais coisas a lembrar aqui são que você pode passar uma frase ou uma lista de frases, bem como especificar o tipo de tensores que você quer recuperar (se nenhum tipo for passado, você receberá uma lista de listas como resultado).",zs,v,A,ps,fe,Wt="A saída em si é um dicionário contendo duas chaves, <code>input_ids&#39; e </code>attention_mask’. O `input_ids’ contém duas linhas de inteiros (uma para cada frase) que são os identificadores únicos dos tokens em cada frase. Explicaremos o que é a “máscara de atenção” (attention mask) mais adiante neste capítulo.",Gs,ye,Vs,x,N,is,be,Bt="Neste trecho de código, fizemos o download do mesmo checkpoint que usamos anteriormente em nosso pipeline (já deveria estar em cache) e instanciamos um modelo com ele.",Hs,Te,Lt="Esta arquitetura contém apenas o módulo base do Transformer: dadas algumas entradas, ele produz o que chamaremos de <em>hidden states</em> (estados ocultos), também conhecidos como <em>features</em> (características). Para cada modelo de entrada, recuperaremos um vetor de alta dimensionalidade representando a <strong>compreensão contextual dessa entrada pelo Transformer*</strong>.",Zs,Je,Ft="Se isto não faz sentido, não se preocupe com isso. Explicaremos tudo isso mais tarde.",Ss,Ue,Pt='Embora estes hidden states possam ser úteis por si mesmos, eles geralmente são entradas para outra parte do modelo, conhecida como <em>head</em> (cabeça). No <a href="/course/pt/chapter1">Capítulo 1</a>, as diferentes tarefas poderiam ter sido realizadas com a mesma arquitetura, mas cada uma destas tarefas teria uma head diferente associada a ela.',qs,je,Rs,we,Xt="A saída vetorial pelo módulo do Transformer é geralmente grande. Geralmente tem três dimensões:",Ws,he,Yt="<li><strong>Tamanho do lote</strong> (Batch size): O número de sequências processadas de cada vez (2 em nosso exemplo).</li> <li><strong>Tamanho da sequencia</strong> (Sequence length): O comprimento da representação numérica da sequência (16 em nosso exemplo).</li> <li><strong>Tamanho oculto</strong> (Hidden size): A dimensão vetorial de cada modelo de entrada.</li>",Bs,$e,Kt="Diz-se que é “de alta dimensionalidade” por causa do último valor. O tamanho oculto pode ser muito grande (768 é comum para modelos menores, e em modelos maiores isto pode chegar a 3072 ou mais).",Ls,_e,Ot="Podemos ver isso se alimentarmos os inputs que pré-processamos para nosso modelo:",Fs,Q,D,ms,Ce,ea="Observe que as saídas dos 🤗 Transformer se comportam como ‘tuplas nomeadas’ (namedtuple) ou dicionários. Você pode acessar os elementos por atributos (como fizemos) ou por chave (<code>outputs[&quot;last_hidden_state&quot;]</code>), ou mesmo por índice se você souber exatamente onde o que está procurando (<code>outputs[0]</code>).",Ps,ke,Xs,Ie,sa="As <em>heads</em> do modelo usam o vetor de alta dimensionalidade dos hidden states como entrada e os projetam em uma dimensão diferente. Eles são geralmente compostos de uma ou algumas camadas lineares:",Ys,X,ta='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/transformer_and_head.svg" alt="Uma rede Transformer ao lado de sua 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="Uma rede Transformer ao lado de sua head."/>',Ks,ge,aa="A saída do Transformer é enviada diretamente para a <em>head</em> do modelo a ser processado.",Os,ve,la="Neste diagrama, o modelo é representado por sua camada de embeddings (vetores) e pelas camadas subsequentes. A camada de embeddings converte cada ID de entrada na entrada tokenizada em um vetor que representa o token associado. As camadas subsequentes manipulam esses vetores usando o mecanismo de atenção para produzir a representação final das sentenças.",et,Ae,na="Há muitas arquiteturas diferentes disponíveis no 🤗 Transformers, com cada uma projetada em torno de uma tarefa específica. Aqui está uma lista por <strong>algumas</strong> destas tarefas:",st,xe,oa="<li><code>*Model</code> (recuperar os 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>e outros 🤗</li>",tt,E,z,cs,Ne,ra="Agora se observarmos o tamanho dos nossos inputs, a dimensionalidade será muito menor: a <em>head</em> do modelo toma como entrada os vetores de alta dimensionalidade que vimos anteriormente, e os vetores de saída contendo dois valores (um por label):",at,Qe,lt,G,V,us,De,pa="Como temos apenas duas sentenças e duas labels, o resultado que obtemos de nosso modelo é de tamanho 2 x 2.",nt,Ee,ot,ze,ia="Os valores que obtemos como resultado de nosso modelo não fazem necessariamente sentido sozinhos. Vamos dar uma olhada:",rt,Ge,pt,H,Z,ds,Ve,ma='Nosso modelo previu <code>[-1.5607, 1.6123]</code> para a primeira frase e <code>[ 4.1692, -3.3464]</code> para a segunda. Essas não são probabilidades, mas <em>logits</em>, a pontuação bruta e não normalizada produzida pela última camada do modelo. Para serem convertidos em probabilidades, eles precisam passar por uma camada <a href="https://en.wikipedia.org/wiki/Softmax_function" rel="nofollow">SoftMax</a> (todas saídas dos 🤗 Transformers produzem  <em>logits</em>, já que a função de <em>loss</em> (perda) para treinamento geralmente fundirá a última função de ativação, como SoftMax, com a função de <em>loss</em> real, por exemplo a <em>cross entropy</em>):',it,S,q,Ms,R,W,fs,He,ca="Agora podemos ver que o modelo previu <code>[0.0402, 0.9598]</code> para a primeira frase e <code>[0.9995, 0.0005]</code> para a segunda. Estas são pontuações de probabilidade reconhecíveis.",mt,Ze,ua="Para obter as etiquetas correspondentes a cada posição, podemos inspecionar o atributo <code>id2label</code> da configuração do modelo (mais sobre isso na próxima seção):",ct,Se,ut,qe,dt,Re,da="Agora podemos concluir que o modelo previu o seguinte:",Mt,We,Ma="<li>A primeira frase: NEGATIVE: 0.0402, POSITIVE: 0.9598</li> <li>Segunda frase: NEGATIVE: 0.9995, POSITIVE: 0.0005</li>",ft,Be,fa="Reproduzimos com sucesso as três etapas do pipeline: o pré-processamento, passagem das entradas através do modelo, e o pós-processamento! Agora, vamos levar algum tempo para mergulhar mais fundo em cada uma dessas etapas.",yt,Y,bt,Le,Tt,bs,Jt;c=new tl({props:{fw:M[0]}}),w=new el({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),K=new ys({props:{title:"Por dentro da função pipeline",local:"por-dentro-da-função-pipeline",headingTag:"h1"}});const ya=[ll,al],Fe=[];function ba(e,a){return e[0]==="pt"?0:1}$=ba(M),_=Fe[$]=ya[$](M),F=new Sa({props:{$$slots:{default:[nl]},$$scope:{ctx:M}}});const Ta=[rl,ol],Pe=[];function Ja(e,a){return e[0]==="pt"?0:1}C=Ja(M),k=Pe[C]=Ta[C](M),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}}),te=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 ys({props:{title:"Pré-processamento com o tokenizer",local:"pré-processamento-com-o-tokenizer",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 Ua=[il,pl],Xe=[];function ja(e,a){return e[0]==="pt"?0:1}I=ja(M),g=Xe[I]=Ua[I](M);const wa=[cl,ml],Ye=[];function ha(e,a){return e[0]==="pt"?0:1}v=ha(M),A=Ye[v]=wa[v](M),ye=new ys({props:{title:"Indo adianta pelo modelo",local:"indo-adianta-pelo-modelo",headingTag:"h2"}});const $a=[dl,ul],Ke=[];function _a(e,a){return e[0]==="pt"?0:1}x=_a(M),N=Ke[x]=$a[x](M),je=new ys({props:{title:"Um vetor de alta dimensionalidade?",local:"um-vetor-de-alta-dimensionalidade",headingTag:"h3"}});const Ca=[fl,Ml],Oe=[];function ka(e,a){return e[0]==="pt"?0:1}Q=ka(M),D=Oe[Q]=Ca[Q](M),ke=new ys({props:{title:"Cabeça do modelo (model heads): Fazendo sentido a partir dos números",local:"cabeça-do-modelo-model-heads-fazendo-sentido-a-partir-dos-números",headingTag:"h3"}});const Ia=[bl,yl],es=[];function ga(e,a){return e[0]==="pt"?0:1}E=ga(M),z=es[E]=Ia[E](M),Qe=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const va=[Jl,Tl],ss=[];function Aa(e,a){return e[0]==="pt"?0:1}G=Aa(M),V=ss[G]=va[G](M),Ee=new ys({props:{title:"Pós-processamento da saída",local:"pós-processamento-da-saída",headingTag:"h2"}}),Ge=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const xa=[jl,Ul],ts=[];function Na(e,a){return e[0]==="pt"?0:1}H=Na(M),Z=ts[H]=xa[H](M);const Qa=[hl,wl],as=[];function Da(e,a){return e[0]==="pt"?0:1}S=Da(M),q=as[S]=Qa[S](M);const Ea=[_l,$l],ls=[];function za(e,a){return e[0]==="pt"?0:1}return R=za(M),W=ls[R]=Ea[R](M),Se=new h({props:{code:"bW9kZWwuY29uZmlnLmlkMmxhYmVs",highlighted:"model.config.id2label",wrap:!1}}),qe=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}}),Y=new Sa({props:{$$slots:{default:[Cl]},$$scope:{ctx:M}}}),Le=new sl({props:{source:"https://github.com/huggingface/course/blob/main/chapters/pt/chapter2/2.mdx"}}),{c(){t=f("meta"),o=i(),s=f("p"),p=i(),T(c.$$.fragment),r=i(),T(w.$$.fragment),Ts=i(),T(K.$$.fragment),Js=i(),_.c(),ns=i(),T(F.$$.fragment),Us=i(),k.c(),os=i(),O=f("p"),O.innerHTML=xt,js=i(),T(ee.$$.fragment),ws=i(),se=f("p"),se.textContent=Nt,hs=i(),T(te.$$.fragment),$s=i(),ae=f("p"),ae.innerHTML=Qt,_s=i(),P=f("div"),P.innerHTML=Dt,Cs=i(),le=f("p"),le.textContent=Et,ks=i(),T(ne.$$.fragment),Is=i(),oe=f("p"),oe.innerHTML=zt,gs=i(),re=f("ul"),re.innerHTML=Gt,vs=i(),pe=f("p"),pe.innerHTML=Vt,As=i(),ie=f("p"),ie.innerHTML=Ht,xs=i(),T(me.$$.fragment),Ns=i(),ce=f("p"),ce.textContent=Zt,Qs=i(),ue=f("p"),ue.innerHTML=St,Ds=i(),de=f("p"),de.innerHTML=qt,Es=i(),g.c(),rs=i(),Me=f("p"),Me.textContent=Rt,zs=i(),A.c(),ps=i(),fe=f("p"),fe.innerHTML=Wt,Gs=i(),T(ye.$$.fragment),Vs=i(),N.c(),is=i(),be=f("p"),be.textContent=Bt,Hs=i(),Te=f("p"),Te.innerHTML=Lt,Zs=i(),Je=f("p"),Je.textContent=Ft,Ss=i(),Ue=f("p"),Ue.innerHTML=Pt,qs=i(),T(je.$$.fragment),Rs=i(),we=f("p"),we.textContent=Xt,Ws=i(),he=f("ul"),he.innerHTML=Yt,Bs=i(),$e=f("p"),$e.textContent=Kt,Ls=i(),_e=f("p"),_e.textContent=Ot,Fs=i(),D.c(),ms=i(),Ce=f("p"),Ce.innerHTML=ea,Ps=i(),T(ke.$$.fragment),Xs=i(),Ie=f("p"),Ie.innerHTML=sa,Ys=i(),X=f("div"),X.innerHTML=ta,Ks=i(),ge=f("p"),ge.innerHTML=aa,Os=i(),ve=f("p"),ve.textContent=la,et=i(),Ae=f("p"),Ae.innerHTML=na,st=i(),xe=f("ul"),xe.innerHTML=oa,tt=i(),z.c(),cs=i(),Ne=f("p"),Ne.innerHTML=ra,at=i(),T(Qe.$$.fragment),lt=i(),V.c(),us=i(),De=f("p"),De.textContent=pa,nt=i(),T(Ee.$$.fragment),ot=i(),ze=f("p"),ze.textContent=ia,rt=i(),T(Ge.$$.fragment),pt=i(),Z.c(),ds=i(),Ve=f("p"),Ve.innerHTML=ma,it=i(),q.c(),Ms=i(),W.c(),fs=i(),He=f("p"),He.innerHTML=ca,mt=i(),Ze=f("p"),Ze.innerHTML=ua,ct=i(),T(Se.$$.fragment),ut=i(),T(qe.$$.fragment),dt=i(),Re=f("p"),Re.textContent=da,Mt=i(),We=f("ul"),We.innerHTML=Ma,ft=i(),Be=f("p"),Be.textContent=fa,yt=i(),T(Y.$$.fragment),bt=i(),T(Le.$$.fragment),Tt=i(),bs=f("p"),this.h()},l(e){const a=Xa("svelte-u9bgzb",document.head);t=y(a,"META",{name:!0,content:!0}),a.forEach(l),o=m(e),s=y(e,"P",{}),Za(s).forEach(l),p=m(e),J(c.$$.fragment,e),r=m(e),J(w.$$.fragment,e),Ts=m(e),J(K.$$.fragment,e),Js=m(e),_.l(e),ns=m(e),J(F.$$.fragment,e),Us=m(e),k.l(e),os=m(e),O=y(e,"P",{"data-svelte-h":!0}),b(O)!=="svelte-1hu1gln"&&(O.innerHTML=xt),js=m(e),J(ee.$$.fragment,e),ws=m(e),se=y(e,"P",{"data-svelte-h":!0}),b(se)!=="svelte-16o7c40"&&(se.textContent=Nt),hs=m(e),J(te.$$.fragment,e),$s=m(e),ae=y(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-10gtnzw"&&(ae.innerHTML=Qt),_s=m(e),P=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(P)!=="svelte-1i1x9tn"&&(P.innerHTML=Dt),Cs=m(e),le=y(e,"P",{"data-svelte-h":!0}),b(le)!=="svelte-u10duk"&&(le.textContent=Et),ks=m(e),J(ne.$$.fragment,e),Is=m(e),oe=y(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-1o120t2"&&(oe.innerHTML=zt),gs=m(e),re=y(e,"UL",{"data-svelte-h":!0}),b(re)!=="svelte-1cust5m"&&(re.innerHTML=Gt),vs=m(e),pe=y(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-bsmcjn"&&(pe.innerHTML=Vt),As=m(e),ie=y(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-14am4b"&&(ie.innerHTML=Ht),xs=m(e),J(me.$$.fragment,e),Ns=m(e),ce=y(e,"P",{"data-svelte-h":!0}),b(ce)!=="svelte-joqugb"&&(ce.textContent=Zt),Qs=m(e),ue=y(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-1bzav03"&&(ue.innerHTML=St),Ds=m(e),de=y(e,"P",{"data-svelte-h":!0}),b(de)!=="svelte-1djc94s"&&(de.innerHTML=qt),Es=m(e),g.l(e),rs=m(e),Me=y(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-5y0yn0"&&(Me.textContent=Rt),zs=m(e),A.l(e),ps=m(e),fe=y(e,"P",{"data-svelte-h":!0}),b(fe)!=="svelte-1emw500"&&(fe.innerHTML=Wt),Gs=m(e),J(ye.$$.fragment,e),Vs=m(e),N.l(e),is=m(e),be=y(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-1gfubls"&&(be.textContent=Bt),Hs=m(e),Te=y(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-1mu2n9p"&&(Te.innerHTML=Lt),Zs=m(e),Je=y(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-3u8jeq"&&(Je.textContent=Ft),Ss=m(e),Ue=y(e,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-seivcw"&&(Ue.innerHTML=Pt),qs=m(e),J(je.$$.fragment,e),Rs=m(e),we=y(e,"P",{"data-svelte-h":!0}),b(we)!=="svelte-1ynic3l"&&(we.textContent=Xt),Ws=m(e),he=y(e,"UL",{"data-svelte-h":!0}),b(he)!=="svelte-11traqf"&&(he.innerHTML=Yt),Bs=m(e),$e=y(e,"P",{"data-svelte-h":!0}),b($e)!=="svelte-3rmgti"&&($e.textContent=Kt),Ls=m(e),_e=y(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-eg8bct"&&(_e.textContent=Ot),Fs=m(e),D.l(e),ms=m(e),Ce=y(e,"P",{"data-svelte-h":!0}),b(Ce)!=="svelte-ar9pgz"&&(Ce.innerHTML=ea),Ps=m(e),J(ke.$$.fragment,e),Xs=m(e),Ie=y(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-jycdds"&&(Ie.innerHTML=sa),Ys=m(e),X=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(X)!=="svelte-1st6np9"&&(X.innerHTML=ta),Ks=m(e),ge=y(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-16wwrsv"&&(ge.innerHTML=aa),Os=m(e),ve=y(e,"P",{"data-svelte-h":!0}),b(ve)!=="svelte-16drr5j"&&(ve.textContent=la),et=m(e),Ae=y(e,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-bnquix"&&(Ae.innerHTML=na),st=m(e),xe=y(e,"UL",{"data-svelte-h":!0}),b(xe)!=="svelte-b5prdf"&&(xe.innerHTML=oa),tt=m(e),z.l(e),cs=m(e),Ne=y(e,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-9gxo3g"&&(Ne.innerHTML=ra),at=m(e),J(Qe.$$.fragment,e),lt=m(e),V.l(e),us=m(e),De=y(e,"P",{"data-svelte-h":!0}),b(De)!=="svelte-2un6sj"&&(De.textContent=pa),nt=m(e),J(Ee.$$.fragment,e),ot=m(e),ze=y(e,"P",{"data-svelte-h":!0}),b(ze)!=="svelte-1wz4esi"&&(ze.textContent=ia),rt=m(e),J(Ge.$$.fragment,e),pt=m(e),Z.l(e),ds=m(e),Ve=y(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-vmhj1o"&&(Ve.innerHTML=ma),it=m(e),q.l(e),Ms=m(e),W.l(e),fs=m(e),He=y(e,"P",{"data-svelte-h":!0}),b(He)!=="svelte-nf25yn"&&(He.innerHTML=ca),mt=m(e),Ze=y(e,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-1o7bcmf"&&(Ze.innerHTML=ua),ct=m(e),J(Se.$$.fragment,e),ut=m(e),J(qe.$$.fragment,e),dt=m(e),Re=y(e,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-isr6ju"&&(Re.textContent=da),Mt=m(e),We=y(e,"UL",{"data-svelte-h":!0}),b(We)!=="svelte-1bchmkj"&&(We.innerHTML=Ma),ft=m(e),Be=y(e,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-dpzgit"&&(Be.textContent=fa),yt=m(e),J(Y.$$.fragment,e),bt=m(e),J(Le.$$.fragment,e),Tt=m(e),bs=y(e,"P",{}),Za(bs).forEach(l),this.h()},h(){Ut(t,"name","hf:doc:metadata"),Ut(t,"content",Il),Ut(P,"class","flex justify-center"),Ut(X,"class","flex justify-center")},m(e,a){Ya(document.head,t),n(e,o,a),n(e,s,a),n(e,p,a),U(c,e,a),n(e,r,a),U(w,e,a),n(e,Ts,a),U(K,e,a),n(e,Js,a),Fe[$].m(e,a),n(e,ns,a),U(F,e,a),n(e,Us,a),Pe[C].m(e,a),n(e,os,a),n(e,O,a),n(e,js,a),U(ee,e,a),n(e,ws,a),n(e,se,a),n(e,hs,a),U(te,e,a),n(e,$s,a),n(e,ae,a),n(e,_s,a),n(e,P,a),n(e,Cs,a),n(e,le,a),n(e,ks,a),U(ne,e,a),n(e,Is,a),n(e,oe,a),n(e,gs,a),n(e,re,a),n(e,vs,a),n(e,pe,a),n(e,As,a),n(e,ie,a),n(e,xs,a),U(me,e,a),n(e,Ns,a),n(e,ce,a),n(e,Qs,a),n(e,ue,a),n(e,Ds,a),n(e,de,a),n(e,Es,a),Xe[I].m(e,a),n(e,rs,a),n(e,Me,a),n(e,zs,a),Ye[v].m(e,a),n(e,ps,a),n(e,fe,a),n(e,Gs,a),U(ye,e,a),n(e,Vs,a),Ke[x].m(e,a),n(e,is,a),n(e,be,a),n(e,Hs,a),n(e,Te,a),n(e,Zs,a),n(e,Je,a),n(e,Ss,a),n(e,Ue,a),n(e,qs,a),U(je,e,a),n(e,Rs,a),n(e,we,a),n(e,Ws,a),n(e,he,a),n(e,Bs,a),n(e,$e,a),n(e,Ls,a),n(e,_e,a),n(e,Fs,a),Oe[Q].m(e,a),n(e,ms,a),n(e,Ce,a),n(e,Ps,a),U(ke,e,a),n(e,Xs,a),n(e,Ie,a),n(e,Ys,a),n(e,X,a),n(e,Ks,a),n(e,ge,a),n(e,Os,a),n(e,ve,a),n(e,et,a),n(e,Ae,a),n(e,st,a),n(e,xe,a),n(e,tt,a),es[E].m(e,a),n(e,cs,a),n(e,Ne,a),n(e,at,a),U(Qe,e,a),n(e,lt,a),ss[G].m(e,a),n(e,us,a),n(e,De,a),n(e,nt,a),U(Ee,e,a),n(e,ot,a),n(e,ze,a),n(e,rt,a),U(Ge,e,a),n(e,pt,a),ts[H].m(e,a),n(e,ds,a),n(e,Ve,a),n(e,it,a),as[S].m(e,a),n(e,Ms,a),ls[R].m(e,a),n(e,fs,a),n(e,He,a),n(e,mt,a),n(e,Ze,a),n(e,ct,a),U(Se,e,a),n(e,ut,a),U(qe,e,a),n(e,dt,a),n(e,Re,a),n(e,Mt,a),n(e,We,a),n(e,ft,a),n(e,Be,a),n(e,yt,a),U(Y,e,a),n(e,bt,a),U(Le,e,a),n(e,Tt,a),n(e,bs,a),Jt=!0},p(e,[a]){const Ga={};a&1&&(Ga.fw=e[0]),c.$set(Ga);let jt=$;$=ba(e),$!==jt&&(L(),u(Fe[jt],1,1,()=>{Fe[jt]=null}),B(),_=Fe[$],_||(_=Fe[$]=ya[$](e),_.c()),d(_,1),_.m(ns.parentNode,ns));const Va={};a&2&&(Va.$$scope={dirty:a,ctx:e}),F.$set(Va);let wt=C;C=Ja(e),C!==wt&&(L(),u(Pe[wt],1,1,()=>{Pe[wt]=null}),B(),k=Pe[C],k||(k=Pe[C]=Ta[C](e),k.c()),d(k,1),k.m(os.parentNode,os));let ht=I;I=ja(e),I!==ht&&(L(),u(Xe[ht],1,1,()=>{Xe[ht]=null}),B(),g=Xe[I],g||(g=Xe[I]=Ua[I](e),g.c()),d(g,1),g.m(rs.parentNode,rs));let $t=v;v=ha(e),v!==$t&&(L(),u(Ye[$t],1,1,()=>{Ye[$t]=null}),B(),A=Ye[v],A||(A=Ye[v]=wa[v](e),A.c()),d(A,1),A.m(ps.parentNode,ps));let _t=x;x=_a(e),x!==_t&&(L(),u(Ke[_t],1,1,()=>{Ke[_t]=null}),B(),N=Ke[x],N||(N=Ke[x]=$a[x](e),N.c()),d(N,1),N.m(is.parentNode,is));let Ct=Q;Q=ka(e),Q!==Ct&&(L(),u(Oe[Ct],1,1,()=>{Oe[Ct]=null}),B(),D=Oe[Q],D||(D=Oe[Q]=Ca[Q](e),D.c()),d(D,1),D.m(ms.parentNode,ms));let kt=E;E=ga(e),E!==kt&&(L(),u(es[kt],1,1,()=>{es[kt]=null}),B(),z=es[E],z||(z=es[E]=Ia[E](e),z.c()),d(z,1),z.m(cs.parentNode,cs));let It=G;G=Aa(e),G!==It&&(L(),u(ss[It],1,1,()=>{ss[It]=null}),B(),V=ss[G],V||(V=ss[G]=va[G](e),V.c()),d(V,1),V.m(us.parentNode,us));let gt=H;H=Na(e),H!==gt&&(L(),u(ts[gt],1,1,()=>{ts[gt]=null}),B(),Z=ts[H],Z||(Z=ts[H]=xa[H](e),Z.c()),d(Z,1),Z.m(ds.parentNode,ds));let vt=S;S=Da(e),S!==vt&&(L(),u(as[vt],1,1,()=>{as[vt]=null}),B(),q=as[S],q||(q=as[S]=Qa[S](e),q.c()),d(q,1),q.m(Ms.parentNode,Ms));let At=R;R=za(e),R!==At&&(L(),u(ls[At],1,1,()=>{ls[At]=null}),B(),W=ls[R],W||(W=ls[R]=Ea[R](e),W.c()),d(W,1),W.m(fs.parentNode,fs));const Ha={};a&2&&(Ha.$$scope={dirty:a,ctx:e}),Y.$set(Ha)},i(e){Jt||(d(c.$$.fragment,e),d(w.$$.fragment,e),d(K.$$.fragment,e),d(_),d(F.$$.fragment,e),d(k),d(ee.$$.fragment,e),d(te.$$.fragment,e),d(ne.$$.fragment,e),d(me.$$.fragment,e),d(g),d(A),d(ye.$$.fragment,e),d(N),d(je.$$.fragment,e),d(D),d(ke.$$.fragment,e),d(z),d(Qe.$$.fragment,e),d(V),d(Ee.$$.fragment,e),d(Ge.$$.fragment,e),d(Z),d(q),d(W),d(Se.$$.fragment,e),d(qe.$$.fragment,e),d(Y.$$.fragment,e),d(Le.$$.fragment,e),Jt=!0)},o(e){u(c.$$.fragment,e),u(w.$$.fragment,e),u(K.$$.fragment,e),u(_),u(F.$$.fragment,e),u(k),u(ee.$$.fragment,e),u(te.$$.fragment,e),u(ne.$$.fragment,e),u(me.$$.fragment,e),u(g),u(A),u(ye.$$.fragment,e),u(N),u(je.$$.fragment,e),u(D),u(ke.$$.fragment,e),u(z),u(Qe.$$.fragment,e),u(V),u(Ee.$$.fragment,e),u(Ge.$$.fragment,e),u(Z),u(q),u(W),u(Se.$$.fragment,e),u(qe.$$.fragment,e),u(Y.$$.fragment,e),u(Le.$$.fragment,e),Jt=!1},d(e){e&&(l(o),l(s),l(p),l(r),l(Ts),l(Js),l(ns),l(Us),l(os),l(O),l(js),l(ws),l(se),l(hs),l($s),l(ae),l(_s),l(P),l(Cs),l(le),l(ks),l(Is),l(oe),l(gs),l(re),l(vs),l(pe),l(As),l(ie),l(xs),l(Ns),l(ce),l(Qs),l(ue),l(Ds),l(de),l(Es),l(rs),l(Me),l(zs),l(ps),l(fe),l(Gs),l(Vs),l(is),l(be),l(Hs),l(Te),l(Zs),l(Je),l(Ss),l(Ue),l(qs),l(Rs),l(we),l(Ws),l(he),l(Bs),l($e),l(Ls),l(_e),l(Fs),l(ms),l(Ce),l(Ps),l(Xs),l(Ie),l(Ys),l(X),l(Ks),l(ge),l(Os),l(ve),l(et),l(Ae),l(st),l(xe),l(tt),l(cs),l(Ne),l(at),l(lt),l(us),l(De),l(nt),l(ot),l(ze),l(rt),l(pt),l(ds),l(Ve),l(it),l(Ms),l(fs),l(He),l(mt),l(Ze),l(ct),l(ut),l(dt),l(Re),l(Mt),l(We),l(ft),l(Be),l(yt),l(bt),l(Tt),l(bs)),l(t),j(c,e),j(w,e),j(K,e),Fe[$].d(e),j(F,e),Pe[C].d(e),j(ee,e),j(te,e),j(ne,e),j(me,e),Xe[I].d(e),Ye[v].d(e),j(ye,e),Ke[x].d(e),j(je,e),Oe[Q].d(e),j(ke,e),es[E].d(e),j(Qe,e),ss[G].d(e),j(Ee,e),j(Ge,e),ts[H].d(e),as[S].d(e),ls[R].d(e),j(Se,e),j(qe,e),j(Y,e),j(Le,e)}}}const Il='{"title":"Por dentro da função pipeline","local":"por-dentro-da-função-pipeline","sections":[{"title":"Pré-processamento com o tokenizer","local":"pré-processamento-com-o-tokenizer","sections":[],"depth":2},{"title":"Indo adianta pelo modelo","local":"indo-adianta-pelo-modelo","sections":[{"title":"Um vetor de alta dimensionalidade?","local":"um-vetor-de-alta-dimensionalidade","sections":[],"depth":3},{"title":"Cabeça do modelo (model heads): Fazendo sentido a partir dos números","local":"cabeça-do-modelo-model-heads-fazendo-sentido-a-partir-dos-números","sections":[],"depth":3}],"depth":2},{"title":"Pós-processamento da saída","local":"pós-processamento-da-saída","sections":[],"depth":2}],"depth":1}';function gl(M,t,o){let s="pt";return Ba(()=>{const p=new URLSearchParams(window.location.search);o(0,s=p.get("fw")||"pt")}),[s]}class Gl extends Fa{constructor(t){super(),Pa(this,t,gl,kl,Wa,{})}}export{Gl as component};
