import{s as Ra,o as qa,n as Wa}from"../chunks/scheduler.37c15a92.js";import{S as Ba,i as La,g as f,s as i,r as T,A as Fa,h as y,f as l,c as m,j as Va,u as J,x as b,k as Tt,y as Pa,a as n,v as U,t as u,b as B,d,w as j,m as Xa,n as Ya,p as L}from"../chunks/index.2bf4358c.js";import{T as Ha}from"../chunks/Tip.363c041f.js";import{Y as Za}from"../chunks/Youtube.1e50a667.js";import{C as h}from"../chunks/CodeBlock.4e987730.js";import{C as Sa}from"../chunks/CourseFloatingBanner.6add7356.js";import{F as Ka}from"../chunks/FrameworkSwitchCourse.8d4d4ab6.js";import{H as fs,E as Oa}from"../chunks/getInferenceSnippets.8b9eb92a.js";function el(M){let t,o;return t=new Sa({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 sl(M){let t,o;return t=new Sa({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 tl(M){let t;return{c(){t=Xa("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=Ya(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 al(M){let t,o;return t=new Za({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 ll(M){let t,o;return t=new Za({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 nl(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 ol(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 rl(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 pl(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 il(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 ml(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 cl(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 ul(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 dl(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 Ml(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 fl(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 yl(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 bl(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 Tl(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 Jl(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 Ul(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 jl(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 wl(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 hl(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:Wa,d(s){s&&l(t)}}}function _l(M){let t,o,s,p,c,r,w,bs,_,$,ls,F,Ts,C,k,ns,K,vt='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,O,Us,ee,At="tendo o resultado:",js,se,ws,te,xt='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:',hs,P,Nt='<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."/>',_s,ae,Qt="Vamos rever rapidamente cada um deles.",$s,le,Cs,ne,Dt="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:",ks,oe,Et="<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>",Is,re,zt='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).',gs,pe,Gt='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:',vs,ie,As,me,Vt="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.",xs,ce,Ht="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.",Ns,ue,Zt="Para especificar o tipo de tensores que queremos recuperar (PyTorch, TensorFlow ou NumPy), utilizamos o argumento <code>return_tensors</code>:",Qs,I,g,os,de,St="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).",Ds,v,A,rs,Me,Rt="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.",Es,fe,zs,x,N,ps,ye,qt="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.",Gs,be,Wt="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>.",Vs,Te,Bt="Se isto não faz sentido, não se preocupe com isso. Explicaremos tudo isso mais tarde.",Hs,Je,Lt='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.',Zs,Ue,Ss,je,Ft="A saída vetorial pelo módulo do Transformer é geralmente grande. Geralmente tem três dimensões:",Rs,we,Pt="<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>",qs,he,Xt="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).",Ws,_e,Yt="Podemos ver isso se alimentarmos os inputs que pré-processamos para nosso modelo:",Bs,Q,D,is,$e,Kt="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>).",Ls,Ce,Fs,ke,Ot="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:",Ps,X,ea='<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."/>',Xs,Ie,sa="A saída do Transformer é enviada diretamente para a <em>head</em> do modelo a ser processado.",Ys,ge,ta="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.",Ks,ve,aa="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:",Os,Ae,la="<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>",et,E,z,ms,xe,na="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):",st,Ne,tt,G,V,cs,Qe,oa="Como temos apenas duas sentenças e duas labels, o resultado que obtemos de nosso modelo é de tamanho 2 x 2.",at,De,lt,Ee,ra="Os valores que obtemos como resultado de nosso modelo não fazem necessariamente sentido sozinhos. Vamos dar uma olhada:",nt,ze,ot,H,Z,us,Ge,pa='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>):',rt,S,R,ds,q,W,Ms,Ve,ia="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.",pt,He,ma="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):",it,Ze,mt,Se,ct,Re,ca="Agora podemos concluir que o modelo previu o seguinte:",ut,qe,ua="<li>A primeira frase: NEGATIVE: 0.0402, POSITIVE: 0.9598</li> <li>Segunda frase: NEGATIVE: 0.9995, POSITIVE: 0.0005</li>",dt,We,da="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.",Mt,Y,ft,Be,yt,ys,bt;c=new Ka({props:{fw:M[0]}}),w=new fs({props:{title:"Por dentro da função pipeline",local:"por-dentro-da-função-pipeline",headingTag:"h1"}});const Ma=[sl,el],Le=[];function fa(e,a){return e[0]==="pt"?0:1}_=fa(M),$=Le[_]=Ma[_](M),F=new Ha({props:{$$slots:{default:[tl]},$$scope:{ctx:M}}});const ya=[ll,al],Fe=[];function ba(e,a){return e[0]==="pt"?0:1}C=ba(M),k=Fe[C]=ya[C](M),O=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKCUyMnNlbnRpbWVudC1hbmFseXNpcyUyMiklMEFjbGFzc2lmaWVyKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

classifier = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>)
classifier(
    [
        <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
        <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
    ]
)`,wrap:!1}}),se=new h({props:{code:"JTVCJTdCJ2xhYmVsJyUzQSUyMCdQT1NJVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45NTk4MDQ3MTM3MjYwNDM3JTdEJTJDJTBBJTIwJTdCJ2xhYmVsJyUzQSUyMCdORUdBVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45OTk0NTU4MDk1OTMyMDA3JTdEJTVE",highlighted:`[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9598047137260437</span>},
 {<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9994558095932007</span>}]`,wrap:!1}}),le=new fs({props:{title:"Pré-processamento com o tokenizer",local:"pré-processamento-com-o-tokenizer",headingTag:"h2"}}),ie=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 Ta=[ol,nl],Pe=[];function Ja(e,a){return e[0]==="pt"?0:1}I=Ja(M),g=Pe[I]=Ta[I](M);const Ua=[pl,rl],Xe=[];function ja(e,a){return e[0]==="pt"?0:1}v=ja(M),A=Xe[v]=Ua[v](M),fe=new fs({props:{title:"Indo adianta pelo modelo",local:"indo-adianta-pelo-modelo",headingTag:"h2"}});const wa=[ml,il],Ye=[];function ha(e,a){return e[0]==="pt"?0:1}x=ha(M),N=Ye[x]=wa[x](M),Ue=new fs({props:{title:"Um vetor de alta dimensionalidade?",local:"um-vetor-de-alta-dimensionalidade",headingTag:"h3"}});const _a=[ul,cl],Ke=[];function $a(e,a){return e[0]==="pt"?0:1}Q=$a(M),D=Ke[Q]=_a[Q](M),Ce=new fs({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 Ca=[Ml,dl],Oe=[];function ka(e,a){return e[0]==="pt"?0:1}E=ka(M),z=Oe[E]=Ca[E](M),Ne=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const Ia=[yl,fl],es=[];function ga(e,a){return e[0]==="pt"?0:1}G=ga(M),V=es[G]=Ia[G](M),De=new fs({props:{title:"Pós-processamento da saída",local:"pós-processamento-da-saída",headingTag:"h2"}}),ze=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const va=[Tl,bl],ss=[];function Aa(e,a){return e[0]==="pt"?0:1}H=Aa(M),Z=ss[H]=va[H](M);const xa=[Ul,Jl],ts=[];function Na(e,a){return e[0]==="pt"?0:1}S=Na(M),R=ts[S]=xa[S](M);const Qa=[wl,jl],as=[];function Da(e,a){return e[0]==="pt"?0:1}return q=Da(M),W=as[q]=Qa[q](M),Ze=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}}),Y=new Ha({props:{$$slots:{default:[hl]},$$scope:{ctx:M}}}),Be=new Oa({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),bs=i(),$.c(),ls=i(),T(F.$$.fragment),Ts=i(),k.c(),ns=i(),K=f("p"),K.innerHTML=vt,Js=i(),T(O.$$.fragment),Us=i(),ee=f("p"),ee.textContent=At,js=i(),T(se.$$.fragment),ws=i(),te=f("p"),te.innerHTML=xt,hs=i(),P=f("div"),P.innerHTML=Nt,_s=i(),ae=f("p"),ae.textContent=Qt,$s=i(),T(le.$$.fragment),Cs=i(),ne=f("p"),ne.innerHTML=Dt,ks=i(),oe=f("ul"),oe.innerHTML=Et,Is=i(),re=f("p"),re.innerHTML=zt,gs=i(),pe=f("p"),pe.innerHTML=Gt,vs=i(),T(ie.$$.fragment),As=i(),me=f("p"),me.textContent=Vt,xs=i(),ce=f("p"),ce.innerHTML=Ht,Ns=i(),ue=f("p"),ue.innerHTML=Zt,Qs=i(),g.c(),os=i(),de=f("p"),de.textContent=St,Ds=i(),A.c(),rs=i(),Me=f("p"),Me.innerHTML=Rt,Es=i(),T(fe.$$.fragment),zs=i(),N.c(),ps=i(),ye=f("p"),ye.textContent=qt,Gs=i(),be=f("p"),be.innerHTML=Wt,Vs=i(),Te=f("p"),Te.textContent=Bt,Hs=i(),Je=f("p"),Je.innerHTML=Lt,Zs=i(),T(Ue.$$.fragment),Ss=i(),je=f("p"),je.textContent=Ft,Rs=i(),we=f("ul"),we.innerHTML=Pt,qs=i(),he=f("p"),he.textContent=Xt,Ws=i(),_e=f("p"),_e.textContent=Yt,Bs=i(),D.c(),is=i(),$e=f("p"),$e.innerHTML=Kt,Ls=i(),T(Ce.$$.fragment),Fs=i(),ke=f("p"),ke.innerHTML=Ot,Ps=i(),X=f("div"),X.innerHTML=ea,Xs=i(),Ie=f("p"),Ie.innerHTML=sa,Ys=i(),ge=f("p"),ge.textContent=ta,Ks=i(),ve=f("p"),ve.innerHTML=aa,Os=i(),Ae=f("ul"),Ae.innerHTML=la,et=i(),z.c(),ms=i(),xe=f("p"),xe.innerHTML=na,st=i(),T(Ne.$$.fragment),tt=i(),V.c(),cs=i(),Qe=f("p"),Qe.textContent=oa,at=i(),T(De.$$.fragment),lt=i(),Ee=f("p"),Ee.textContent=ra,nt=i(),T(ze.$$.fragment),ot=i(),Z.c(),us=i(),Ge=f("p"),Ge.innerHTML=pa,rt=i(),R.c(),ds=i(),W.c(),Ms=i(),Ve=f("p"),Ve.innerHTML=ia,pt=i(),He=f("p"),He.innerHTML=ma,it=i(),T(Ze.$$.fragment),mt=i(),T(Se.$$.fragment),ct=i(),Re=f("p"),Re.textContent=ca,ut=i(),qe=f("ul"),qe.innerHTML=ua,dt=i(),We=f("p"),We.textContent=da,Mt=i(),T(Y.$$.fragment),ft=i(),T(Be.$$.fragment),yt=i(),ys=f("p"),this.h()},l(e){const a=Fa("svelte-u9bgzb",document.head);t=y(a,"META",{name:!0,content:!0}),a.forEach(l),o=m(e),s=y(e,"P",{}),Va(s).forEach(l),p=m(e),J(c.$$.fragment,e),r=m(e),J(w.$$.fragment,e),bs=m(e),$.l(e),ls=m(e),J(F.$$.fragment,e),Ts=m(e),k.l(e),ns=m(e),K=y(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-1hu1gln"&&(K.innerHTML=vt),Js=m(e),J(O.$$.fragment,e),Us=m(e),ee=y(e,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-16o7c40"&&(ee.textContent=At),js=m(e),J(se.$$.fragment,e),ws=m(e),te=y(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-10gtnzw"&&(te.innerHTML=xt),hs=m(e),P=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(P)!=="svelte-1i1x9tn"&&(P.innerHTML=Nt),_s=m(e),ae=y(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-u10duk"&&(ae.textContent=Qt),$s=m(e),J(le.$$.fragment,e),Cs=m(e),ne=y(e,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-1o120t2"&&(ne.innerHTML=Dt),ks=m(e),oe=y(e,"UL",{"data-svelte-h":!0}),b(oe)!=="svelte-1cust5m"&&(oe.innerHTML=Et),Is=m(e),re=y(e,"P",{"data-svelte-h":!0}),b(re)!=="svelte-bsmcjn"&&(re.innerHTML=zt),gs=m(e),pe=y(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-14am4b"&&(pe.innerHTML=Gt),vs=m(e),J(ie.$$.fragment,e),As=m(e),me=y(e,"P",{"data-svelte-h":!0}),b(me)!=="svelte-joqugb"&&(me.textContent=Vt),xs=m(e),ce=y(e,"P",{"data-svelte-h":!0}),b(ce)!=="svelte-1bzav03"&&(ce.innerHTML=Ht),Ns=m(e),ue=y(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-1djc94s"&&(ue.innerHTML=Zt),Qs=m(e),g.l(e),os=m(e),de=y(e,"P",{"data-svelte-h":!0}),b(de)!=="svelte-5y0yn0"&&(de.textContent=St),Ds=m(e),A.l(e),rs=m(e),Me=y(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-1emw500"&&(Me.innerHTML=Rt),Es=m(e),J(fe.$$.fragment,e),zs=m(e),N.l(e),ps=m(e),ye=y(e,"P",{"data-svelte-h":!0}),b(ye)!=="svelte-1gfubls"&&(ye.textContent=qt),Gs=m(e),be=y(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-1mu2n9p"&&(be.innerHTML=Wt),Vs=m(e),Te=y(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-3u8jeq"&&(Te.textContent=Bt),Hs=m(e),Je=y(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-seivcw"&&(Je.innerHTML=Lt),Zs=m(e),J(Ue.$$.fragment,e),Ss=m(e),je=y(e,"P",{"data-svelte-h":!0}),b(je)!=="svelte-1ynic3l"&&(je.textContent=Ft),Rs=m(e),we=y(e,"UL",{"data-svelte-h":!0}),b(we)!=="svelte-11traqf"&&(we.innerHTML=Pt),qs=m(e),he=y(e,"P",{"data-svelte-h":!0}),b(he)!=="svelte-3rmgti"&&(he.textContent=Xt),Ws=m(e),_e=y(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-eg8bct"&&(_e.textContent=Yt),Bs=m(e),D.l(e),is=m(e),$e=y(e,"P",{"data-svelte-h":!0}),b($e)!=="svelte-ar9pgz"&&($e.innerHTML=Kt),Ls=m(e),J(Ce.$$.fragment,e),Fs=m(e),ke=y(e,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-jycdds"&&(ke.innerHTML=Ot),Ps=m(e),X=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(X)!=="svelte-1st6np9"&&(X.innerHTML=ea),Xs=m(e),Ie=y(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-16wwrsv"&&(Ie.innerHTML=sa),Ys=m(e),ge=y(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-16drr5j"&&(ge.textContent=ta),Ks=m(e),ve=y(e,"P",{"data-svelte-h":!0}),b(ve)!=="svelte-bnquix"&&(ve.innerHTML=aa),Os=m(e),Ae=y(e,"UL",{"data-svelte-h":!0}),b(Ae)!=="svelte-b5prdf"&&(Ae.innerHTML=la),et=m(e),z.l(e),ms=m(e),xe=y(e,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-9gxo3g"&&(xe.innerHTML=na),st=m(e),J(Ne.$$.fragment,e),tt=m(e),V.l(e),cs=m(e),Qe=y(e,"P",{"data-svelte-h":!0}),b(Qe)!=="svelte-2un6sj"&&(Qe.textContent=oa),at=m(e),J(De.$$.fragment,e),lt=m(e),Ee=y(e,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-1wz4esi"&&(Ee.textContent=ra),nt=m(e),J(ze.$$.fragment,e),ot=m(e),Z.l(e),us=m(e),Ge=y(e,"P",{"data-svelte-h":!0}),b(Ge)!=="svelte-vmhj1o"&&(Ge.innerHTML=pa),rt=m(e),R.l(e),ds=m(e),W.l(e),Ms=m(e),Ve=y(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-nf25yn"&&(Ve.innerHTML=ia),pt=m(e),He=y(e,"P",{"data-svelte-h":!0}),b(He)!=="svelte-1o7bcmf"&&(He.innerHTML=ma),it=m(e),J(Ze.$$.fragment,e),mt=m(e),J(Se.$$.fragment,e),ct=m(e),Re=y(e,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-isr6ju"&&(Re.textContent=ca),ut=m(e),qe=y(e,"UL",{"data-svelte-h":!0}),b(qe)!=="svelte-1bchmkj"&&(qe.innerHTML=ua),dt=m(e),We=y(e,"P",{"data-svelte-h":!0}),b(We)!=="svelte-dpzgit"&&(We.textContent=da),Mt=m(e),J(Y.$$.fragment,e),ft=m(e),J(Be.$$.fragment,e),yt=m(e),ys=y(e,"P",{}),Va(ys).forEach(l),this.h()},h(){Tt(t,"name","hf:doc:metadata"),Tt(t,"content",$l),Tt(P,"class","flex justify-center"),Tt(X,"class","flex justify-center")},m(e,a){Pa(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,bs,a),Le[_].m(e,a),n(e,ls,a),U(F,e,a),n(e,Ts,a),Fe[C].m(e,a),n(e,ns,a),n(e,K,a),n(e,Js,a),U(O,e,a),n(e,Us,a),n(e,ee,a),n(e,js,a),U(se,e,a),n(e,ws,a),n(e,te,a),n(e,hs,a),n(e,P,a),n(e,_s,a),n(e,ae,a),n(e,$s,a),U(le,e,a),n(e,Cs,a),n(e,ne,a),n(e,ks,a),n(e,oe,a),n(e,Is,a),n(e,re,a),n(e,gs,a),n(e,pe,a),n(e,vs,a),U(ie,e,a),n(e,As,a),n(e,me,a),n(e,xs,a),n(e,ce,a),n(e,Ns,a),n(e,ue,a),n(e,Qs,a),Pe[I].m(e,a),n(e,os,a),n(e,de,a),n(e,Ds,a),Xe[v].m(e,a),n(e,rs,a),n(e,Me,a),n(e,Es,a),U(fe,e,a),n(e,zs,a),Ye[x].m(e,a),n(e,ps,a),n(e,ye,a),n(e,Gs,a),n(e,be,a),n(e,Vs,a),n(e,Te,a),n(e,Hs,a),n(e,Je,a),n(e,Zs,a),U(Ue,e,a),n(e,Ss,a),n(e,je,a),n(e,Rs,a),n(e,we,a),n(e,qs,a),n(e,he,a),n(e,Ws,a),n(e,_e,a),n(e,Bs,a),Ke[Q].m(e,a),n(e,is,a),n(e,$e,a),n(e,Ls,a),U(Ce,e,a),n(e,Fs,a),n(e,ke,a),n(e,Ps,a),n(e,X,a),n(e,Xs,a),n(e,Ie,a),n(e,Ys,a),n(e,ge,a),n(e,Ks,a),n(e,ve,a),n(e,Os,a),n(e,Ae,a),n(e,et,a),Oe[E].m(e,a),n(e,ms,a),n(e,xe,a),n(e,st,a),U(Ne,e,a),n(e,tt,a),es[G].m(e,a),n(e,cs,a),n(e,Qe,a),n(e,at,a),U(De,e,a),n(e,lt,a),n(e,Ee,a),n(e,nt,a),U(ze,e,a),n(e,ot,a),ss[H].m(e,a),n(e,us,a),n(e,Ge,a),n(e,rt,a),ts[S].m(e,a),n(e,ds,a),as[q].m(e,a),n(e,Ms,a),n(e,Ve,a),n(e,pt,a),n(e,He,a),n(e,it,a),U(Ze,e,a),n(e,mt,a),U(Se,e,a),n(e,ct,a),n(e,Re,a),n(e,ut,a),n(e,qe,a),n(e,dt,a),n(e,We,a),n(e,Mt,a),U(Y,e,a),n(e,ft,a),U(Be,e,a),n(e,yt,a),n(e,ys,a),bt=!0},p(e,[a]){const Ea={};a&1&&(Ea.fw=e[0]),c.$set(Ea);let Jt=_;_=fa(e),_!==Jt&&(L(),u(Le[Jt],1,1,()=>{Le[Jt]=null}),B(),$=Le[_],$||($=Le[_]=Ma[_](e),$.c()),d($,1),$.m(ls.parentNode,ls));const za={};a&2&&(za.$$scope={dirty:a,ctx:e}),F.$set(za);let Ut=C;C=ba(e),C!==Ut&&(L(),u(Fe[Ut],1,1,()=>{Fe[Ut]=null}),B(),k=Fe[C],k||(k=Fe[C]=ya[C](e),k.c()),d(k,1),k.m(ns.parentNode,ns));let jt=I;I=Ja(e),I!==jt&&(L(),u(Pe[jt],1,1,()=>{Pe[jt]=null}),B(),g=Pe[I],g||(g=Pe[I]=Ta[I](e),g.c()),d(g,1),g.m(os.parentNode,os));let wt=v;v=ja(e),v!==wt&&(L(),u(Xe[wt],1,1,()=>{Xe[wt]=null}),B(),A=Xe[v],A||(A=Xe[v]=Ua[v](e),A.c()),d(A,1),A.m(rs.parentNode,rs));let ht=x;x=ha(e),x!==ht&&(L(),u(Ye[ht],1,1,()=>{Ye[ht]=null}),B(),N=Ye[x],N||(N=Ye[x]=wa[x](e),N.c()),d(N,1),N.m(ps.parentNode,ps));let _t=Q;Q=$a(e),Q!==_t&&(L(),u(Ke[_t],1,1,()=>{Ke[_t]=null}),B(),D=Ke[Q],D||(D=Ke[Q]=_a[Q](e),D.c()),d(D,1),D.m(is.parentNode,is));let $t=E;E=ka(e),E!==$t&&(L(),u(Oe[$t],1,1,()=>{Oe[$t]=null}),B(),z=Oe[E],z||(z=Oe[E]=Ca[E](e),z.c()),d(z,1),z.m(ms.parentNode,ms));let Ct=G;G=ga(e),G!==Ct&&(L(),u(es[Ct],1,1,()=>{es[Ct]=null}),B(),V=es[G],V||(V=es[G]=Ia[G](e),V.c()),d(V,1),V.m(cs.parentNode,cs));let kt=H;H=Aa(e),H!==kt&&(L(),u(ss[kt],1,1,()=>{ss[kt]=null}),B(),Z=ss[H],Z||(Z=ss[H]=va[H](e),Z.c()),d(Z,1),Z.m(us.parentNode,us));let It=S;S=Na(e),S!==It&&(L(),u(ts[It],1,1,()=>{ts[It]=null}),B(),R=ts[S],R||(R=ts[S]=xa[S](e),R.c()),d(R,1),R.m(ds.parentNode,ds));let gt=q;q=Da(e),q!==gt&&(L(),u(as[gt],1,1,()=>{as[gt]=null}),B(),W=as[q],W||(W=as[q]=Qa[q](e),W.c()),d(W,1),W.m(Ms.parentNode,Ms));const Ga={};a&2&&(Ga.$$scope={dirty:a,ctx:e}),Y.$set(Ga)},i(e){bt||(d(c.$$.fragment,e),d(w.$$.fragment,e),d($),d(F.$$.fragment,e),d(k),d(O.$$.fragment,e),d(se.$$.fragment,e),d(le.$$.fragment,e),d(ie.$$.fragment,e),d(g),d(A),d(fe.$$.fragment,e),d(N),d(Ue.$$.fragment,e),d(D),d(Ce.$$.fragment,e),d(z),d(Ne.$$.fragment,e),d(V),d(De.$$.fragment,e),d(ze.$$.fragment,e),d(Z),d(R),d(W),d(Ze.$$.fragment,e),d(Se.$$.fragment,e),d(Y.$$.fragment,e),d(Be.$$.fragment,e),bt=!0)},o(e){u(c.$$.fragment,e),u(w.$$.fragment,e),u($),u(F.$$.fragment,e),u(k),u(O.$$.fragment,e),u(se.$$.fragment,e),u(le.$$.fragment,e),u(ie.$$.fragment,e),u(g),u(A),u(fe.$$.fragment,e),u(N),u(Ue.$$.fragment,e),u(D),u(Ce.$$.fragment,e),u(z),u(Ne.$$.fragment,e),u(V),u(De.$$.fragment,e),u(ze.$$.fragment,e),u(Z),u(R),u(W),u(Ze.$$.fragment,e),u(Se.$$.fragment,e),u(Y.$$.fragment,e),u(Be.$$.fragment,e),bt=!1},d(e){e&&(l(o),l(s),l(p),l(r),l(bs),l(ls),l(Ts),l(ns),l(K),l(Js),l(Us),l(ee),l(js),l(ws),l(te),l(hs),l(P),l(_s),l(ae),l($s),l(Cs),l(ne),l(ks),l(oe),l(Is),l(re),l(gs),l(pe),l(vs),l(As),l(me),l(xs),l(ce),l(Ns),l(ue),l(Qs),l(os),l(de),l(Ds),l(rs),l(Me),l(Es),l(zs),l(ps),l(ye),l(Gs),l(be),l(Vs),l(Te),l(Hs),l(Je),l(Zs),l(Ss),l(je),l(Rs),l(we),l(qs),l(he),l(Ws),l(_e),l(Bs),l(is),l($e),l(Ls),l(Fs),l(ke),l(Ps),l(X),l(Xs),l(Ie),l(Ys),l(ge),l(Ks),l(ve),l(Os),l(Ae),l(et),l(ms),l(xe),l(st),l(tt),l(cs),l(Qe),l(at),l(lt),l(Ee),l(nt),l(ot),l(us),l(Ge),l(rt),l(ds),l(Ms),l(Ve),l(pt),l(He),l(it),l(mt),l(ct),l(Re),l(ut),l(qe),l(dt),l(We),l(Mt),l(ft),l(yt),l(ys)),l(t),j(c,e),j(w,e),Le[_].d(e),j(F,e),Fe[C].d(e),j(O,e),j(se,e),j(le,e),j(ie,e),Pe[I].d(e),Xe[v].d(e),j(fe,e),Ye[x].d(e),j(Ue,e),Ke[Q].d(e),j(Ce,e),Oe[E].d(e),j(Ne,e),es[G].d(e),j(De,e),j(ze,e),ss[H].d(e),ts[S].d(e),as[q].d(e),j(Ze,e),j(Se,e),j(Y,e),j(Be,e)}}}const $l='{"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 Cl(M,t,o){let s="pt";return qa(()=>{const p=new URLSearchParams(window.location.search);o(0,s=p.get("fw")||"pt")}),[s]}class Dl extends Ba{constructor(t){super(),La(this,t,Cl,_l,Ra,{})}}export{Dl as component};
