import{s as Zt,o as St,n as Rt}from"../chunks/scheduler.37c15a92.js";import{S as qt,i as Wt,g as f,s as i,r as T,A as Bt,h as y,f as l,c as m,j as zt,u as J,x as b,k as ya,y as Lt,a as n,v as U,t as u,b as B,d,w as j,m as Ft,n as Pt,p as L}from"../chunks/index.2bf4358c.js";import{T as Gt}from"../chunks/Tip.363c041f.js";import{Y as Vt}from"../chunks/Youtube.1e50a667.js";import{C as h}from"../chunks/CodeBlock.4f5fc1ad.js";import{C as Ht}from"../chunks/CourseFloatingBanner.15ba07e6.js";import{F as Xt}from"../chunks/FrameworkSwitchCourse.8d4d4ab6.js";import{H as Ms}from"../chunks/Heading.8ada512a.js";function Yt(M){let a,o;return a=new Ht({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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function Kt(M){let a,o;return a=new Ht({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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function Ot(M){let a;return{c(){a=Ft("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){a=Pt(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,a,s)},d(o){o&&l(a)}}}function el(M){let a,o;return a=new Vt({props:{id:"wVN12smEvqg"}}),{c(){T(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function sl(M){let a,o;return a=new Vt({props:{id:"1pedAIvTWXk"}}),{c(){T(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function al(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function tl(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function ll(M){let a,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(){a=f("p"),a.textContent=o,s=i(),T(p.$$.fragment)},l(r){a=y(r,"P",{"data-svelte-h":!0}),b(a)!=="svelte-1o3xitq"&&(a.textContent=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,a,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(a),l(s)),j(p,r)}}}function nl(M){let a,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(){a=f("p"),a.textContent=o,s=i(),T(p.$$.fragment)},l(r){a=y(r,"P",{"data-svelte-h":!0}),b(a)!=="svelte-1txx0eu"&&(a.textContent=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,a,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(a),l(s)),j(p,r)}}}function ol(M){let a,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(){a=f("p"),a.textContent=o,s=i(),T(p.$$.fragment)},l(r){a=y(r,"P",{"data-svelte-h":!0}),b(a)!=="svelte-1wemj46"&&(a.textContent=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,a,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(a),l(s)),j(p,r)}}}function rl(M){let a,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(){a=f("p"),a.innerHTML=o,s=i(),T(p.$$.fragment)},l(r){a=y(r,"P",{"data-svelte-h":!0}),b(a)!=="svelte-9i2qzf"&&(a.innerHTML=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,a,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(a),l(s)),j(p,r)}}}function pl(M){let a,o,s,p;return a=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(a.$$.fragment),o=i(),T(s.$$.fragment)},l(c){J(a.$$.fragment,c),o=m(c),J(s.$$.fragment,c)},m(c,r){U(a,c,r),n(c,o,r),U(s,c,r),p=!0},i(c){p||(d(a.$$.fragment,c),d(s.$$.fragment,c),p=!0)},o(c){u(a.$$.fragment,c),u(s.$$.fragment,c),p=!1},d(c){c&&l(o),j(a,c),j(s,c)}}}function il(M){let a,o,s,p;return a=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(a.$$.fragment),o=i(),T(s.$$.fragment)},l(c){J(a.$$.fragment,c),o=m(c),J(s.$$.fragment,c)},m(c,r){U(a,c,r),n(c,o,r),U(s,c,r),p=!0},i(c){p||(d(a.$$.fragment,c),d(s.$$.fragment,c),p=!0)},o(c){u(a.$$.fragment,c),u(s.$$.fragment,c),p=!1},d(c){c&&l(o),j(a,c),j(s,c)}}}function ml(M){let a,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(){a=f("p"),a.innerHTML=o,s=i(),T(p.$$.fragment)},l(r){a=y(r,"P",{"data-svelte-h":!0}),b(a)!=="svelte-1lez10n"&&(a.innerHTML=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,a,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(a),l(s)),j(p,r)}}}function cl(M){let a,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(){a=f("p"),a.innerHTML=o,s=i(),T(p.$$.fragment)},l(r){a=y(r,"P",{"data-svelte-h":!0}),b(a)!=="svelte-1pqoxf"&&(a.innerHTML=o),s=m(r),J(p.$$.fragment,r)},m(r,w){n(r,a,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(a),l(s)),j(p,r)}}}function ul(M){let a,o;return a=new h({props:{code:"KDIlMkMlMjAyKQ==",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>)',wrap:!1}}),{c(){T(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function dl(M){let a,o;return a=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMiU1RCk=",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>])',wrap:!1}}),{c(){T(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function Ml(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function fl(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function yl(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function bl(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function Tl(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function Jl(M){let a,o;return a=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(a.$$.fragment)},l(s){J(a.$$.fragment,s)},m(s,p){U(a,s,p),o=!0},i(s){o||(d(a.$$.fragment,s),o=!0)},o(s){u(a.$$.fragment,s),o=!1},d(s){j(a,s)}}}function Ul(M){let a,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(){a=f("p"),a.innerHTML=o},l(s){a=y(s,"P",{"data-svelte-h":!0}),b(a)!=="svelte-1fdyacy"&&(a.innerHTML=o)},m(s,p){n(s,a,p)},p:Rt,d(s){s&&l(a)}}}function jl(M){let a,o,s,p,c,r,w,ys,_,$,ts,F,bs,C,k,ls,K,Ia='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>:',Ts,O,Js,ee,ga="tendo o resultado:",Us,se,js,ae,va='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:',ws,P,Aa='<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."/>',hs,te,xa="Vamos rever rapidamente cada um deles.",_s,le,$s,ne,Na="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:",Cs,oe,Qa="<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>",ks,re,Da='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).',Is,pe,Ea='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:',gs,ie,vs,me,za="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.",As,ce,Ga="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.",xs,ue,Va="Para especificar o tipo de tensores que queremos recuperar (PyTorch, TensorFlow ou NumPy), utilizamos o argumento <code>return_tensors</code>:",Ns,I,g,ns,de,Ha="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).",Qs,v,A,os,Me,Za="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.",Ds,fe,Es,x,N,rs,ye,Sa="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.",zs,be,Ra="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>.",Gs,Te,qa="Se isto não faz sentido, não se preocupe com isso. Explicaremos tudo isso mais tarde.",Vs,Je,Wa='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.',Hs,Ue,Zs,je,Ba="A saída vetorial pelo módulo do Transformer é geralmente grande. Geralmente tem três dimensões:",Ss,we,La="<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>",Rs,he,Fa="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).",qs,_e,Pa="Podemos ver isso se alimentarmos os inputs que pré-processamos para nosso modelo:",Ws,Q,D,ps,$e,Xa="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>).",Bs,Ce,Ls,ke,Ya="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:",Fs,X,Ka='<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."/>',Ps,Ie,Oa="A saída do Transformer é enviada diretamente para a <em>head</em> do modelo a ser processado.",Xs,ge,et="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.",Ys,ve,st="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:",Ks,Ae,at="<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>",Os,E,z,is,xe,tt="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):",ea,Ne,sa,G,V,ms,Qe,lt="Como temos apenas duas sentenças e duas labels, o resultado que obtemos de nosso modelo é de tamanho 2 x 2.",aa,De,ta,Ee,nt="Os valores que obtemos como resultado de nosso modelo não fazem necessariamente sentido sozinhos. Vamos dar uma olhada:",la,ze,na,H,Z,cs,Ge,ot='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>):',oa,S,R,us,q,W,ds,Ve,rt="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.",ra,He,pt="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):",pa,Ze,ia,Se,ma,Re,it="Agora podemos concluir que o modelo previu o seguinte:",ca,qe,mt="<li>A primeira frase: NEGATIVE: 0.0402, POSITIVE: 0.9598</li> <li>Segunda frase: NEGATIVE: 0.9995, POSITIVE: 0.0005</li>",ua,We,ct="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.",da,Y,Ma,fs,fa;c=new Xt({props:{fw:M[0]}}),w=new Ms({props:{title:"Por dentro da função pipeline",local:"por-dentro-da-função-pipeline",headingTag:"h1"}});const ut=[Kt,Yt],Be=[];function dt(e,t){return e[0]==="pt"?0:1}_=dt(M),$=Be[_]=ut[_](M),F=new Gt({props:{$$slots:{default:[Ot]},$$scope:{ctx:M}}});const Mt=[sl,el],Le=[];function ft(e,t){return e[0]==="pt"?0:1}C=ft(M),k=Le[C]=Mt[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 Ms({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 yt=[tl,al],Fe=[];function bt(e,t){return e[0]==="pt"?0:1}I=bt(M),g=Fe[I]=yt[I](M);const Tt=[nl,ll],Pe=[];function Jt(e,t){return e[0]==="pt"?0:1}v=Jt(M),A=Pe[v]=Tt[v](M),fe=new Ms({props:{title:"Indo adianta pelo modelo",local:"indo-adianta-pelo-modelo",headingTag:"h2"}});const Ut=[rl,ol],Xe=[];function jt(e,t){return e[0]==="pt"?0:1}x=jt(M),N=Xe[x]=Ut[x](M),Ue=new Ms({props:{title:"Um vetor de alta dimensionalidade?",local:"um-vetor-de-alta-dimensionalidade",headingTag:"h3"}});const wt=[il,pl],Ye=[];function ht(e,t){return e[0]==="pt"?0:1}Q=ht(M),D=Ye[Q]=wt[Q](M),Ce=new Ms({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 _t=[cl,ml],Ke=[];function $t(e,t){return e[0]==="pt"?0:1}E=$t(M),z=Ke[E]=_t[E](M),Ne=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const Ct=[dl,ul],Oe=[];function kt(e,t){return e[0]==="pt"?0:1}G=kt(M),V=Oe[G]=Ct[G](M),De=new Ms({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 It=[fl,Ml],es=[];function gt(e,t){return e[0]==="pt"?0:1}H=gt(M),Z=es[H]=It[H](M);const vt=[bl,yl],ss=[];function At(e,t){return e[0]==="pt"?0:1}S=At(M),R=ss[S]=vt[S](M);const xt=[Jl,Tl],as=[];function Nt(e,t){return e[0]==="pt"?0:1}return q=Nt(M),W=as[q]=xt[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 Gt({props:{$$slots:{default:[Ul]},$$scope:{ctx:M}}}),{c(){a=f("meta"),o=i(),s=f("p"),p=i(),T(c.$$.fragment),r=i(),T(w.$$.fragment),ys=i(),$.c(),ts=i(),T(F.$$.fragment),bs=i(),k.c(),ls=i(),K=f("p"),K.innerHTML=Ia,Ts=i(),T(O.$$.fragment),Js=i(),ee=f("p"),ee.textContent=ga,Us=i(),T(se.$$.fragment),js=i(),ae=f("p"),ae.innerHTML=va,ws=i(),P=f("div"),P.innerHTML=Aa,hs=i(),te=f("p"),te.textContent=xa,_s=i(),T(le.$$.fragment),$s=i(),ne=f("p"),ne.innerHTML=Na,Cs=i(),oe=f("ul"),oe.innerHTML=Qa,ks=i(),re=f("p"),re.innerHTML=Da,Is=i(),pe=f("p"),pe.innerHTML=Ea,gs=i(),T(ie.$$.fragment),vs=i(),me=f("p"),me.textContent=za,As=i(),ce=f("p"),ce.innerHTML=Ga,xs=i(),ue=f("p"),ue.innerHTML=Va,Ns=i(),g.c(),ns=i(),de=f("p"),de.textContent=Ha,Qs=i(),A.c(),os=i(),Me=f("p"),Me.innerHTML=Za,Ds=i(),T(fe.$$.fragment),Es=i(),N.c(),rs=i(),ye=f("p"),ye.textContent=Sa,zs=i(),be=f("p"),be.innerHTML=Ra,Gs=i(),Te=f("p"),Te.textContent=qa,Vs=i(),Je=f("p"),Je.innerHTML=Wa,Hs=i(),T(Ue.$$.fragment),Zs=i(),je=f("p"),je.textContent=Ba,Ss=i(),we=f("ul"),we.innerHTML=La,Rs=i(),he=f("p"),he.textContent=Fa,qs=i(),_e=f("p"),_e.textContent=Pa,Ws=i(),D.c(),ps=i(),$e=f("p"),$e.innerHTML=Xa,Bs=i(),T(Ce.$$.fragment),Ls=i(),ke=f("p"),ke.innerHTML=Ya,Fs=i(),X=f("div"),X.innerHTML=Ka,Ps=i(),Ie=f("p"),Ie.innerHTML=Oa,Xs=i(),ge=f("p"),ge.textContent=et,Ys=i(),ve=f("p"),ve.innerHTML=st,Ks=i(),Ae=f("ul"),Ae.innerHTML=at,Os=i(),z.c(),is=i(),xe=f("p"),xe.innerHTML=tt,ea=i(),T(Ne.$$.fragment),sa=i(),V.c(),ms=i(),Qe=f("p"),Qe.textContent=lt,aa=i(),T(De.$$.fragment),ta=i(),Ee=f("p"),Ee.textContent=nt,la=i(),T(ze.$$.fragment),na=i(),Z.c(),cs=i(),Ge=f("p"),Ge.innerHTML=ot,oa=i(),R.c(),us=i(),W.c(),ds=i(),Ve=f("p"),Ve.innerHTML=rt,ra=i(),He=f("p"),He.innerHTML=pt,pa=i(),T(Ze.$$.fragment),ia=i(),T(Se.$$.fragment),ma=i(),Re=f("p"),Re.textContent=it,ca=i(),qe=f("ul"),qe.innerHTML=mt,ua=i(),We=f("p"),We.textContent=ct,da=i(),T(Y.$$.fragment),Ma=i(),fs=f("p"),this.h()},l(e){const t=Bt("svelte-u9bgzb",document.head);a=y(t,"META",{name:!0,content:!0}),t.forEach(l),o=m(e),s=y(e,"P",{}),zt(s).forEach(l),p=m(e),J(c.$$.fragment,e),r=m(e),J(w.$$.fragment,e),ys=m(e),$.l(e),ts=m(e),J(F.$$.fragment,e),bs=m(e),k.l(e),ls=m(e),K=y(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-1hu1gln"&&(K.innerHTML=Ia),Ts=m(e),J(O.$$.fragment,e),Js=m(e),ee=y(e,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-16o7c40"&&(ee.textContent=ga),Us=m(e),J(se.$$.fragment,e),js=m(e),ae=y(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-10gtnzw"&&(ae.innerHTML=va),ws=m(e),P=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(P)!=="svelte-1i1x9tn"&&(P.innerHTML=Aa),hs=m(e),te=y(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-u10duk"&&(te.textContent=xa),_s=m(e),J(le.$$.fragment,e),$s=m(e),ne=y(e,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-1o120t2"&&(ne.innerHTML=Na),Cs=m(e),oe=y(e,"UL",{"data-svelte-h":!0}),b(oe)!=="svelte-1cust5m"&&(oe.innerHTML=Qa),ks=m(e),re=y(e,"P",{"data-svelte-h":!0}),b(re)!=="svelte-bsmcjn"&&(re.innerHTML=Da),Is=m(e),pe=y(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-14am4b"&&(pe.innerHTML=Ea),gs=m(e),J(ie.$$.fragment,e),vs=m(e),me=y(e,"P",{"data-svelte-h":!0}),b(me)!=="svelte-joqugb"&&(me.textContent=za),As=m(e),ce=y(e,"P",{"data-svelte-h":!0}),b(ce)!=="svelte-1bzav03"&&(ce.innerHTML=Ga),xs=m(e),ue=y(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-1djc94s"&&(ue.innerHTML=Va),Ns=m(e),g.l(e),ns=m(e),de=y(e,"P",{"data-svelte-h":!0}),b(de)!=="svelte-5y0yn0"&&(de.textContent=Ha),Qs=m(e),A.l(e),os=m(e),Me=y(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-1emw500"&&(Me.innerHTML=Za),Ds=m(e),J(fe.$$.fragment,e),Es=m(e),N.l(e),rs=m(e),ye=y(e,"P",{"data-svelte-h":!0}),b(ye)!=="svelte-1gfubls"&&(ye.textContent=Sa),zs=m(e),be=y(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-1mu2n9p"&&(be.innerHTML=Ra),Gs=m(e),Te=y(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-3u8jeq"&&(Te.textContent=qa),Vs=m(e),Je=y(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-seivcw"&&(Je.innerHTML=Wa),Hs=m(e),J(Ue.$$.fragment,e),Zs=m(e),je=y(e,"P",{"data-svelte-h":!0}),b(je)!=="svelte-1ynic3l"&&(je.textContent=Ba),Ss=m(e),we=y(e,"UL",{"data-svelte-h":!0}),b(we)!=="svelte-11traqf"&&(we.innerHTML=La),Rs=m(e),he=y(e,"P",{"data-svelte-h":!0}),b(he)!=="svelte-3rmgti"&&(he.textContent=Fa),qs=m(e),_e=y(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-eg8bct"&&(_e.textContent=Pa),Ws=m(e),D.l(e),ps=m(e),$e=y(e,"P",{"data-svelte-h":!0}),b($e)!=="svelte-ar9pgz"&&($e.innerHTML=Xa),Bs=m(e),J(Ce.$$.fragment,e),Ls=m(e),ke=y(e,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-jycdds"&&(ke.innerHTML=Ya),Fs=m(e),X=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(X)!=="svelte-1st6np9"&&(X.innerHTML=Ka),Ps=m(e),Ie=y(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-16wwrsv"&&(Ie.innerHTML=Oa),Xs=m(e),ge=y(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-16drr5j"&&(ge.textContent=et),Ys=m(e),ve=y(e,"P",{"data-svelte-h":!0}),b(ve)!=="svelte-bnquix"&&(ve.innerHTML=st),Ks=m(e),Ae=y(e,"UL",{"data-svelte-h":!0}),b(Ae)!=="svelte-b5prdf"&&(Ae.innerHTML=at),Os=m(e),z.l(e),is=m(e),xe=y(e,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-9gxo3g"&&(xe.innerHTML=tt),ea=m(e),J(Ne.$$.fragment,e),sa=m(e),V.l(e),ms=m(e),Qe=y(e,"P",{"data-svelte-h":!0}),b(Qe)!=="svelte-2un6sj"&&(Qe.textContent=lt),aa=m(e),J(De.$$.fragment,e),ta=m(e),Ee=y(e,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-1wz4esi"&&(Ee.textContent=nt),la=m(e),J(ze.$$.fragment,e),na=m(e),Z.l(e),cs=m(e),Ge=y(e,"P",{"data-svelte-h":!0}),b(Ge)!=="svelte-vmhj1o"&&(Ge.innerHTML=ot),oa=m(e),R.l(e),us=m(e),W.l(e),ds=m(e),Ve=y(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-nf25yn"&&(Ve.innerHTML=rt),ra=m(e),He=y(e,"P",{"data-svelte-h":!0}),b(He)!=="svelte-1o7bcmf"&&(He.innerHTML=pt),pa=m(e),J(Ze.$$.fragment,e),ia=m(e),J(Se.$$.fragment,e),ma=m(e),Re=y(e,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-isr6ju"&&(Re.textContent=it),ca=m(e),qe=y(e,"UL",{"data-svelte-h":!0}),b(qe)!=="svelte-1bchmkj"&&(qe.innerHTML=mt),ua=m(e),We=y(e,"P",{"data-svelte-h":!0}),b(We)!=="svelte-dpzgit"&&(We.textContent=ct),da=m(e),J(Y.$$.fragment,e),Ma=m(e),fs=y(e,"P",{}),zt(fs).forEach(l),this.h()},h(){ya(a,"name","hf:doc:metadata"),ya(a,"content",wl),ya(P,"class","flex justify-center"),ya(X,"class","flex justify-center")},m(e,t){Lt(document.head,a),n(e,o,t),n(e,s,t),n(e,p,t),U(c,e,t),n(e,r,t),U(w,e,t),n(e,ys,t),Be[_].m(e,t),n(e,ts,t),U(F,e,t),n(e,bs,t),Le[C].m(e,t),n(e,ls,t),n(e,K,t),n(e,Ts,t),U(O,e,t),n(e,Js,t),n(e,ee,t),n(e,Us,t),U(se,e,t),n(e,js,t),n(e,ae,t),n(e,ws,t),n(e,P,t),n(e,hs,t),n(e,te,t),n(e,_s,t),U(le,e,t),n(e,$s,t),n(e,ne,t),n(e,Cs,t),n(e,oe,t),n(e,ks,t),n(e,re,t),n(e,Is,t),n(e,pe,t),n(e,gs,t),U(ie,e,t),n(e,vs,t),n(e,me,t),n(e,As,t),n(e,ce,t),n(e,xs,t),n(e,ue,t),n(e,Ns,t),Fe[I].m(e,t),n(e,ns,t),n(e,de,t),n(e,Qs,t),Pe[v].m(e,t),n(e,os,t),n(e,Me,t),n(e,Ds,t),U(fe,e,t),n(e,Es,t),Xe[x].m(e,t),n(e,rs,t),n(e,ye,t),n(e,zs,t),n(e,be,t),n(e,Gs,t),n(e,Te,t),n(e,Vs,t),n(e,Je,t),n(e,Hs,t),U(Ue,e,t),n(e,Zs,t),n(e,je,t),n(e,Ss,t),n(e,we,t),n(e,Rs,t),n(e,he,t),n(e,qs,t),n(e,_e,t),n(e,Ws,t),Ye[Q].m(e,t),n(e,ps,t),n(e,$e,t),n(e,Bs,t),U(Ce,e,t),n(e,Ls,t),n(e,ke,t),n(e,Fs,t),n(e,X,t),n(e,Ps,t),n(e,Ie,t),n(e,Xs,t),n(e,ge,t),n(e,Ys,t),n(e,ve,t),n(e,Ks,t),n(e,Ae,t),n(e,Os,t),Ke[E].m(e,t),n(e,is,t),n(e,xe,t),n(e,ea,t),U(Ne,e,t),n(e,sa,t),Oe[G].m(e,t),n(e,ms,t),n(e,Qe,t),n(e,aa,t),U(De,e,t),n(e,ta,t),n(e,Ee,t),n(e,la,t),U(ze,e,t),n(e,na,t),es[H].m(e,t),n(e,cs,t),n(e,Ge,t),n(e,oa,t),ss[S].m(e,t),n(e,us,t),as[q].m(e,t),n(e,ds,t),n(e,Ve,t),n(e,ra,t),n(e,He,t),n(e,pa,t),U(Ze,e,t),n(e,ia,t),U(Se,e,t),n(e,ma,t),n(e,Re,t),n(e,ca,t),n(e,qe,t),n(e,ua,t),n(e,We,t),n(e,da,t),U(Y,e,t),n(e,Ma,t),n(e,fs,t),fa=!0},p(e,[t]){const Qt={};t&1&&(Qt.fw=e[0]),c.$set(Qt);let ba=_;_=dt(e),_!==ba&&(L(),u(Be[ba],1,1,()=>{Be[ba]=null}),B(),$=Be[_],$||($=Be[_]=ut[_](e),$.c()),d($,1),$.m(ts.parentNode,ts));const Dt={};t&2&&(Dt.$$scope={dirty:t,ctx:e}),F.$set(Dt);let Ta=C;C=ft(e),C!==Ta&&(L(),u(Le[Ta],1,1,()=>{Le[Ta]=null}),B(),k=Le[C],k||(k=Le[C]=Mt[C](e),k.c()),d(k,1),k.m(ls.parentNode,ls));let Ja=I;I=bt(e),I!==Ja&&(L(),u(Fe[Ja],1,1,()=>{Fe[Ja]=null}),B(),g=Fe[I],g||(g=Fe[I]=yt[I](e),g.c()),d(g,1),g.m(ns.parentNode,ns));let Ua=v;v=Jt(e),v!==Ua&&(L(),u(Pe[Ua],1,1,()=>{Pe[Ua]=null}),B(),A=Pe[v],A||(A=Pe[v]=Tt[v](e),A.c()),d(A,1),A.m(os.parentNode,os));let ja=x;x=jt(e),x!==ja&&(L(),u(Xe[ja],1,1,()=>{Xe[ja]=null}),B(),N=Xe[x],N||(N=Xe[x]=Ut[x](e),N.c()),d(N,1),N.m(rs.parentNode,rs));let wa=Q;Q=ht(e),Q!==wa&&(L(),u(Ye[wa],1,1,()=>{Ye[wa]=null}),B(),D=Ye[Q],D||(D=Ye[Q]=wt[Q](e),D.c()),d(D,1),D.m(ps.parentNode,ps));let ha=E;E=$t(e),E!==ha&&(L(),u(Ke[ha],1,1,()=>{Ke[ha]=null}),B(),z=Ke[E],z||(z=Ke[E]=_t[E](e),z.c()),d(z,1),z.m(is.parentNode,is));let _a=G;G=kt(e),G!==_a&&(L(),u(Oe[_a],1,1,()=>{Oe[_a]=null}),B(),V=Oe[G],V||(V=Oe[G]=Ct[G](e),V.c()),d(V,1),V.m(ms.parentNode,ms));let $a=H;H=gt(e),H!==$a&&(L(),u(es[$a],1,1,()=>{es[$a]=null}),B(),Z=es[H],Z||(Z=es[H]=It[H](e),Z.c()),d(Z,1),Z.m(cs.parentNode,cs));let Ca=S;S=At(e),S!==Ca&&(L(),u(ss[Ca],1,1,()=>{ss[Ca]=null}),B(),R=ss[S],R||(R=ss[S]=vt[S](e),R.c()),d(R,1),R.m(us.parentNode,us));let ka=q;q=Nt(e),q!==ka&&(L(),u(as[ka],1,1,()=>{as[ka]=null}),B(),W=as[q],W||(W=as[q]=xt[q](e),W.c()),d(W,1),W.m(ds.parentNode,ds));const Et={};t&2&&(Et.$$scope={dirty:t,ctx:e}),Y.$set(Et)},i(e){fa||(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),fa=!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),fa=!1},d(e){e&&(l(o),l(s),l(p),l(r),l(ys),l(ts),l(bs),l(ls),l(K),l(Ts),l(Js),l(ee),l(Us),l(js),l(ae),l(ws),l(P),l(hs),l(te),l(_s),l($s),l(ne),l(Cs),l(oe),l(ks),l(re),l(Is),l(pe),l(gs),l(vs),l(me),l(As),l(ce),l(xs),l(ue),l(Ns),l(ns),l(de),l(Qs),l(os),l(Me),l(Ds),l(Es),l(rs),l(ye),l(zs),l(be),l(Gs),l(Te),l(Vs),l(Je),l(Hs),l(Zs),l(je),l(Ss),l(we),l(Rs),l(he),l(qs),l(_e),l(Ws),l(ps),l($e),l(Bs),l(Ls),l(ke),l(Fs),l(X),l(Ps),l(Ie),l(Xs),l(ge),l(Ys),l(ve),l(Ks),l(Ae),l(Os),l(is),l(xe),l(ea),l(sa),l(ms),l(Qe),l(aa),l(ta),l(Ee),l(la),l(na),l(cs),l(Ge),l(oa),l(us),l(ds),l(Ve),l(ra),l(He),l(pa),l(ia),l(ma),l(Re),l(ca),l(qe),l(ua),l(We),l(da),l(Ma),l(fs)),l(a),j(c,e),j(w,e),Be[_].d(e),j(F,e),Le[C].d(e),j(O,e),j(se,e),j(le,e),j(ie,e),Fe[I].d(e),Pe[v].d(e),j(fe,e),Xe[x].d(e),j(Ue,e),Ye[Q].d(e),j(Ce,e),Ke[E].d(e),j(Ne,e),Oe[G].d(e),j(De,e),j(ze,e),es[H].d(e),ss[S].d(e),as[q].d(e),j(Ze,e),j(Se,e),j(Y,e)}}}const wl='{"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 hl(M,a,o){let s="pt";return St(()=>{const p=new URLSearchParams(window.location.search);o(0,s=p.get("fw")||"pt")}),[s]}class xl extends qt{constructor(a){super(),Wt(this,a,hl,jl,Zt,{})}}export{xl as component};
