import{s as Rs,o as Ws,n as Bs}from"../chunks/scheduler.37c15a92.js";import{S as Ls,i as Fs,g as d,s as p,r as T,A as Ps,h as y,f as n,c,j as Vs,u as J,x as b,k as Tl,y as Xs,a,v as j,t as m,b as L,d as M,w as U,m as Ys,n as qs,p as F}from"../chunks/index.2bf4358c.js";import{T as Zs}from"../chunks/Tip.363c041f.js";import{Y as Hs}from"../chunks/Youtube.1e50a667.js";import{C as h}from"../chunks/CodeBlock.4e987730.js";import{C as Ss}from"../chunks/CourseFloatingBanner.6add7356.js";import{F as Ks}from"../chunks/FrameworkSwitchCourse.8d4d4ab6.js";import{H as dt,E as Os}from"../chunks/getInferenceSnippets.1837c472.js";function en(f){let l,r;return l=new Ss({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/en/chapter2/section2_tf.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_tf.ipynb"}]}}),{c(){T(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function tn(f){let l,r;return l=new Ss({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/en/chapter2/section2_pt.ipynb"},{label:"Aws Studio",value:"https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/master/course/en/chapter2/section2_pt.ipynb"}]}}),{c(){T(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function ln(f){let l;return{c(){l=Ys("Aceasta este prima secțiune în care conținutul este ușor diferit în funcție de utilizarea PyTorch sau TensorFlow. Schimbați comutatorul din partea de sus a titlului pentru a selecta platforma pe care o preferați!")},l(r){l=qs(r,"Aceasta este prima secțiune în care conținutul este ușor diferit în funcție de utilizarea PyTorch sau TensorFlow. Schimbați comutatorul din partea de sus a titlului pentru a selecta platforma pe care o preferați!")},m(r,t){a(r,l,t)},d(r){r&&n(l)}}}function sn(f){let l,r;return l=new Hs({props:{id:"wVN12smEvqg"}}),{c(){T(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function nn(f){let l,r;return l=new Hs({props:{id:"1pedAIvTWXk"}}),{c(){T(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function an(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function rn(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function un(f){let l,r="Iată cum arată rezultatele ca tensori TensorFlow:",t,u,o;return u=new h({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUyQyUyMCUwQSUyMCUyMCUyMCUyMCdhdHRlbnRpb25fbWFzayclM0ElMjAlM0N0Zi5UZW5zb3IlM0ElMjBzaGFwZSUzRCgyJTJDJTIwMTYpJTJDJTIwZHR5cGUlM0RpbnQzMiUyQyUyMG51bXB5JTNEJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYXJyYXkoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QjElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlNUQlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUQlMkMlMjBkdHlwZSUzRGludDMyKSUzRSUwQSU3RA==",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">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>]
        ], dtype=int32)&gt;
}`,wrap:!1}}),{c(){l=d("p"),l.textContent=r,t=p(),T(u.$$.fragment)},l(i){l=y(i,"P",{"data-svelte-h":!0}),b(l)!=="svelte-i4ylal"&&(l.textContent=r),t=c(i),J(u.$$.fragment,i)},m(i,w){a(i,l,w),a(i,t,w),j(u,i,w),o=!0},i(i){o||(M(u.$$.fragment,i),o=!0)},o(i){m(u.$$.fragment,i),o=!1},d(i){i&&(n(l),n(t)),U(u,i)}}}function pn(f){let l,r="Iată cum arată rezultatele ca tensori PyTorch:",t,u,o;return u=new h({props:{code:"JTdCJTBBJTIwJTIwJTIwJTIwJ2lucHV0X2lkcyclM0ElMjB0ZW5zb3IoJTVCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCJTIwJTIwMTAxJTJDJTIwJTIwMTA0NSUyQyUyMCUyMDEwMDUlMkMlMjAlMjAyMzEwJTJDJTIwJTIwMjA0MiUyQyUyMCUyMDM0MDMlMkMlMjAlMjAyMDA1JTJDJTIwJTIwMTAzNyUyQyUyMDE3NjYyJTJDJTIwMTIxNzIlMkMlMjAyNjA3JTJDJTIwJTIwMjAyNiUyQyUyMCUyMDI4NzglMkMlMjAlMjAyMTY2JTJDJTIwJTIwMTAxMiUyQyUyMCUyMCUyMDEwMiU1RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU1QiUyMCUyMDEwMSUyQyUyMCUyMDEwNDUlMkMlMjAlMjA1MjIzJTJDJTIwJTIwMjAyMyUyQyUyMCUyMDIwNjElMkMlMjAlMjAyMTcyJTJDJTIwJTIwJTIwOTk5JTJDJTIwJTIwJTIwMTAyJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlMkMlMjAlMjAlMjAlMjAlMjAwJTJDJTIwJTIwJTIwJTIwJTIwMCUyQyUyMCUyMCUyMCUyMCUyMDAlNUQlMEElMjAlMjAlMjAlMjAlNUQpJTJDJTIwJTBBJTIwJTIwJTIwJTIwJ2F0dGVudGlvbl9tYXNrJyUzQSUyMHRlbnNvciglNUIlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlNUIxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTVEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTVCMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAxJTJDJTIwMSUyQyUyMDElMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCUyQyUyMDAlMkMlMjAwJTJDJTIwMCU1RCUwQSUyMCUyMCUyMCUyMCU1RCklMEElN0Q=",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">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>]
    ])
}`,wrap:!1}}),{c(){l=d("p"),l.textContent=r,t=p(),T(u.$$.fragment)},l(i){l=y(i,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1v5wbf9"&&(l.textContent=r),t=c(i),J(u.$$.fragment,i)},m(i,w){a(i,l,w),a(i,t,w),j(u,i,w),o=!0},i(i){o||(M(u.$$.fragment,i),o=!0)},o(i){m(u.$$.fragment,i),o=!1},d(i){i&&(n(l),n(t)),U(u,i)}}}function cn(f){let l,r="Putem descărca modelul nostru preantrenat în același mod în care am făcut-o cu tokenizatorul nostru. 🤗 Transformers oferă o clasă <code>TFAutoModel</code> care are și o metodă <code>from_pretrained</code>:",t,u,o;return u=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(){l=d("p"),l.innerHTML=r,t=p(),T(u.$$.fragment)},l(i){l=y(i,"P",{"data-svelte-h":!0}),b(l)!=="svelte-4pat4u"&&(l.innerHTML=r),t=c(i),J(u.$$.fragment,i)},m(i,w){a(i,l,w),a(i,t,w),j(u,i,w),o=!0},i(i){o||(M(u.$$.fragment,i),o=!0)},o(i){m(u.$$.fragment,i),o=!1},d(i){i&&(n(l),n(t)),U(u,i)}}}function on(f){let l,r="Putem descărca modelul nostru preantrenat în același mod în care am făcut-o cu tokenizatorul nostru. 🤗 Transformers oferă o clasă <code>AutoModel</code> care are și o metodă <code>from_pretrained()</code>:",t,u,o;return u=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(){l=d("p"),l.innerHTML=r,t=p(),T(u.$$.fragment)},l(i){l=y(i,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1q8q7eh"&&(l.innerHTML=r),t=c(i),J(u.$$.fragment,i)},m(i,w){a(i,l,w),a(i,t,w),j(u,i,w),o=!0},i(i){o||(M(u.$$.fragment,i),o=!0)},o(i){m(u.$$.fragment,i),o=!1},d(i){i&&(n(l),n(t)),U(u,i)}}}function mn(f){let l,r,t,u;return l=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKGlucHV0cyklMEFwcmludChvdXRwdXRzLmxhc3RfaGlkZGVuX3N0YXRlLnNoYXBlKQ==",highlighted:`outputs = model(inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),t=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(l.$$.fragment),r=p(),T(t.$$.fragment)},l(o){J(l.$$.fragment,o),r=c(o),J(t.$$.fragment,o)},m(o,i){j(l,o,i),a(o,r,i),j(t,o,i),u=!0},i(o){u||(M(l.$$.fragment,o),M(t.$$.fragment,o),u=!0)},o(o){m(l.$$.fragment,o),m(t.$$.fragment,o),u=!1},d(o){o&&n(r),U(l,o),U(t,o)}}}function Mn(f){let l,r,t,u;return l=new h({props:{code:"b3V0cHV0cyUyMCUzRCUyMG1vZGVsKCoqaW5wdXRzKSUwQXByaW50KG91dHB1dHMubGFzdF9oaWRkZW5fc3RhdGUuc2hhcGUp",highlighted:`outputs = model(**inputs)
<span class="hljs-built_in">print</span>(outputs.last_hidden_state.shape)`,wrap:!1}}),t=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(l.$$.fragment),r=p(),T(t.$$.fragment)},l(o){J(l.$$.fragment,o),r=c(o),J(t.$$.fragment,o)},m(o,i){j(l,o,i),a(o,r,i),j(t,o,i),u=!0},i(o){u||(M(l.$$.fragment,o),M(t.$$.fragment,o),u=!0)},o(o){m(l.$$.fragment,o),m(t.$$.fragment,o),u=!1},d(o){o&&n(r),U(l,o),U(t,o)}}}function fn(f){let l,r="Pentru exemplul nostru, vom avea nevoie de un model cu un head de clasificare a secvențelor (pentru a putea clasifica propozițiile ca fiind pozitive sau negative). Așadar, nu vom utiliza clasa <code>TFAutoModel</code>, ci <code>TFAutoModelForSequenceClassification</code>:",t,u,o;return u=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(){l=d("p"),l.innerHTML=r,t=p(),T(u.$$.fragment)},l(i){l=y(i,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1sftld7"&&(l.innerHTML=r),t=c(i),J(u.$$.fragment,i)},m(i,w){a(i,l,w),a(i,t,w),j(u,i,w),o=!0},i(i){o||(M(u.$$.fragment,i),o=!0)},o(i){m(u.$$.fragment,i),o=!1},d(i){i&&(n(l),n(t)),U(u,i)}}}function dn(f){let l,r="Pentru exemplul nostru, vom avea nevoie de un model cu un head de clasificare a secvențelor (pentru a putea clasifica propozițiile ca fiind pozitive sau negative). Așadar, nu vom utiliza clasa <code>AutoModel</code>, ci <code>AutoModelForSequenceClassification</code>:",t,u,o;return u=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(){l=d("p"),l.innerHTML=r,t=p(),T(u.$$.fragment)},l(i){l=y(i,"P",{"data-svelte-h":!0}),b(l)!=="svelte-1bhg9ur"&&(l.innerHTML=r),t=c(i),J(u.$$.fragment,i)},m(i,w){a(i,l,w),a(i,t,w),j(u,i,w),o=!0},i(i){o||(M(u.$$.fragment,i),o=!0)},o(i){m(u.$$.fragment,i),o=!1},d(i){i&&(n(l),n(t)),U(u,i)}}}function yn(f){let l,r;return l=new h({props:{code:"KDIlMkMlMjAyKQ==",highlighted:'(<span class="hljs-number">2</span>, <span class="hljs-number">2</span>)',wrap:!1}}),{c(){T(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function bn(f){let l,r;return l=new h({props:{code:"dG9yY2guU2l6ZSglNUIyJTJDJTIwMiU1RCk=",highlighted:'torch.Size([<span class="hljs-number">2</span>, <span class="hljs-number">2</span>])',wrap:!1}}),{c(){T(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function Tn(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function Jn(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function jn(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function Un(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function wn(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function hn(f){let l,r;return l=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(l.$$.fragment)},l(t){J(l.$$.fragment,t)},m(t,u){j(l,t,u),r=!0},i(t){r||(M(l.$$.fragment,t),r=!0)},o(t){m(l.$$.fragment,t),r=!1},d(t){U(l,t)}}}function _n(f){let l,r="✏️  <strong>Încercați!</strong> Alegeți două (sau mai multe) texte proprii și treceți-le prin conducta <code>sentiment-analysis</code>. Apoi repetați pașii pe care i-ați văzut aici și verificați dacă obțineți aceleași rezultate!";return{c(){l=d("p"),l.innerHTML=r},l(t){l=y(t,"P",{"data-svelte-h":!0}),b(l)!=="svelte-xj8a1l"&&(l.innerHTML=r)},m(t,u){a(t,l,u)},p:Bs,d(t){t&&n(l)}}}function $n(f){let l,r,t,u,o,i,w,bt,_,$,nt,P,Tt,C,k,at,K,vl='Să începem cu un exemplu complet, aruncând o privire la ceea ce s-a întâmplat în spate atunci când am executat următorul cod în <a href="/course/chapter1">Capitolul 1</a>:',Jt,O,jt,ee,Al="și am obținut:",Ut,te,wt,le,xl='După cum am văzut în <a href="/course/chapter1">Capitolul 1</a>, acest pipeline grupează trei etape: preprocesarea, trecerea intrărilor prin model și postprocesarea:',ht,X,zl='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline.svg" alt="The full NLP pipeline: tokenization of text, conversion to IDs, and inference through the Transformer model and the model head."/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/full_nlp_pipeline-dark.svg" alt="The full NLP pipeline: tokenization of text, conversion to IDs, and inference through the Transformer model and the model head."/>',_t,se,Dl="Să trecem rapid prin fiecare dintre acestea.",$t,ne,Ct,ae,Ql="La fel ca alte rețele neuronale, modelele Transformer nu pot procesa direct text brut, astfel încât primul pas al pipeline-ului nostru este de a converti intrările de text în numere pe care modelul le poate înțelege. Pentru a face acest lucru, folosim un <em>tokenizer</em>, care va fi responsabil pentru:",kt,re,Nl="<li>Împărțirea datelor de intrare în cuvinte, subcuvinte sau simboluri (cum ar fi punctuația) care se numesc <em>tokens</em></li> <li>Maparea fiecărui token într-un număr întreg</li> <li>Adăugarea de intrări suplimentare care pot fi utile pentru model</li>",It,ie,El='Toată această preprocesare trebuie efectuată exact în același mod ca atunci când modelul a fost preantrenat, așa că mai întâi trebuie să descărcăm aceste informații din <a href="https://huggingface.co/models" rel="nofollow">Model Hub</a>. Pentru a face acest lucru, folosim clasa <code>AutoTokenizer</code> și metoda sa <code>from_pretrained()</code>. Folosind numele checkpoint-ului modelului nostru, aceasta va prelua automat datele asociate cu tokenizer-ul modelului și le va stoca în cache (astfel încât acestea să fie descărcate doar prima dată când executați codul de mai jos).',gt,ue,Gl='Deoarece punctul de control implicit al pipeline-ului <code>sentiment-analysis</code> este <code>distilbert-base-uncased-finetuned-sst-2-english</code> (puteți vedea fișa modelului <a href="https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english" rel="nofollow">aici</a>), executăm următoarele:',vt,pe,At,ce,Vl="Odată ce avem tokenizatorul, putem să îi transmitem direct propozițiile noastre și vom primi înapoi un dicționar care este gata să fie introdus în modelul nostru! Singurul lucru rămas de făcut este să convertim lista de ID-uri de intrare în tensori.",xt,oe,Zl="Puteți utiliza 🤗 Transformers fără a trebui să vă faceți griji cu privire la cadrul ML utilizat ca backend; ar putea fi PyTorch sau TensorFlow, sau Flax pentru unele modele. Cu toate acestea, modelele Transformer acceptă numai <em>tensori</em> ca intrare. Dacă este prima dată când auziți despre tensori, vă puteți gândi la ei ca la array-uri NumPy. Un array NumPy poate fi un scalar (0D), un vector (1D), o matrice (2D) sau poate avea mai multe dimensiuni. Este de fapt un tensor; tensorii altor cadre ML se comportă similar și sunt de obicei la fel de simplu de instanțiat ca și array-urile NumPy.",zt,me,Hl="Pentru a specifica tipul de tensori pe care dorim să îi primim înapoi (PyTorch, TensorFlow sau NumPy simplu), folosim argumentul <code>return_tensors</code>:",Dt,I,g,rt,Me,Sl="Nu vă faceți încă griji cu privire la padding și trunchiere; le vom explica mai târziu. Principalele lucruri de reținut aici sunt că puteți trece o propoziție sau o listă de propoziții, precum și specificarea tipului de tensori pe care doriți să îi primiți înapoi (dacă nu este specificat niciun tip, veți primi o listă de liste ca rezultat).",Qt,v,A,it,fe,Rl="Rezultatul în sine este un dicționar care conține două chei, <code>input_ids</code> și <code>attention_mask</code>. <code>input_ids</code> conține două rânduri de numere întregi (unul pentru fiecare propoziție) care sunt identificatorii unici ai simbolurilor din fiecare propoziție. Vom explica ce este <code>attention_mask</code> mai târziu în acest capitol.",Nt,de,Et,x,z,ut,ye,Wl="În acest fragment de cod, am descărcat același checkpoint pe care l-am folosit anterior în pipeline-ul nostru (de fapt, ar fi trebuit să fie deja în cache) și am instanțiat un model cu acesta.",Gt,be,Bl="Această arhitectură conține doar modulul Transformer de bază: având în vedere anumite intrări, acesta produce ceea ce vom numi <em>stări ascunse</em>, cunoscute și ca <em>caracteristici</em>. Pentru fiecare intrare a modelului, vom extrage un vector multidimensional care reprezintă <strong>înțelegerea contextuală a intrării respective de către modelul Transformer</strong>.",Vt,Te,Ll="Dacă acest lucru nu are sens, nu vă faceți griji. Vom explica totul mai târziu.",Zt,Je,Fl='Deși aceste stări ascunse pot fi utile pe cont propriu, ele sunt de obicei intrări pentru o altă parte a modelului, cunoscută sub numele de <em>head</em>. În <a href="/course/chapter1">Capitolul 1</a>, diferitele sarcini ar fi putut fi efectuate cu aceeași arhitectură, dar fiecăreia dintre aceste sarcini îi va fi asociat un head diferit.',Ht,je,St,Ue,Pl="Vectorul emis de modulul Transformator este de obicei de dimensiuni mari. Acesta are în general trei dimensiuni:",Rt,we,Xl="<li><strong>Dimensiunea batch-ului</strong>: Numărul de secvențe prelucrate simultan (2 în exemplul nostru).</li> <li><strong>Lungimea secvenței</strong>: Lungimea reprezentării numerice a secvenței (16 în exemplul nostru).</li> <li><strong>Dimensiunea ascunsă</strong>: Dimensiunea vectorială a fiecărei intrări a modelului.</li>",Wt,he,Yl="Se spune că este multidimensional din cauza ultimei valori. Dimensiunea ascunsă poate fi foarte mare (768 este comună pentru modelele mai mici, iar în modelele mai mari aceasta poate ajunge la 3072 sau mai mult).",Bt,_e,ql="Putem vedea acest lucru dacă introducem în modelul nostru intrările pe care le-am preprocesat:",Lt,D,Q,pt,$e,Kl="Rețineți că ieșirile modelelor 🤗 Transformers se comportă ca <code>namedtuple</code>s sau dicționare. Puteți accesa elementele prin atribute (așa cum am făcut noi) sau prin cheie (<code>outputs[„last_hidden_state”]</code>), sau chiar prin index dacă știți exact unde se află lucrul pe care îl căutați (<code>outputs[0]</code>).",Ft,Ce,Pt,ke,Ol="Head-urile modelelor iau ca intrare vectorul multidimensional al stărilor ascunse și le proiectează pe o altă dimensiune. Acestea sunt de obicei compuse din unul sau câteva straturi liniare:",Xt,Y,es='<img class="block dark:hidden" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/transformer_and_head.svg" alt="A Transformer network alongside its head."/> <img class="hidden dark:block" src="https://huggingface.co/datasets/huggingface-course/documentation-images/resolve/main/en/chapter2/transformer_and_head-dark.svg" alt="A Transformer network alongside its head."/>',Yt,Ie,ts="Rezultatul modelului Transformer este trimis direct la head-ul modelului pentru a fi prelucrat.",qt,ge,ls="În această diagramă, modelul este reprezentat de stratul său de încorporare și de straturile următoare. Stratul de încorporare convertește fiecare ID de intrare din intrarea tokenizată într-un vector care reprezintă tokenul asociat. Straturile ulterioare manipulează acești vectori folosind mecanismul de atenție pentru a produce reprezentarea finală a propozițiilor.",Kt,ve,ss="Există multe arhitecturi diferite disponibile în 🤗 Transformers, fiecare fiind concepută în jurul abordării unei sarcini specifice. Iată o listă neexhaustivă:",Ot,Ae,ns="<li><code>*Model</code> (extragerea stărilor ascunse)</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>și altele 🤗</li>",el,N,E,ct,xe,as="Acum, dacă ne uităm la forma ieșirilor noastre, dimensiunea va fi mult mai mică: head-ul modelului ia ca intrare vectorii multidimensionali pe care i-am văzut înainte și scoate vectori care conțin două valori (una pentru fiecare etichetă):",tl,ze,ll,G,V,ot,De,rs="Deoarece avem doar două propoziții și două etichete, rezultatul pe care îl obținem din modelul nostru este de forma 2 x 2.",sl,Qe,nl,Ne,is="Valorile pe care le obținem ca rezultat al modelului nostru nu au neapărat sens în sine. Să aruncăm o privire:",al,Ee,rl,Z,H,mt,Ge,us='Modelul nostru a prezis <code>[-1.5607, 1.6123]</code> pentru prima propoziție și <code>[ 4.1692, -3.3464]</code> pentru cea de-a doua. Acestea nu sunt probabilități, ci <em>logits</em>, scorurile brute, nenormalizate, emise de ultimul strat al modelului. Pentru a fi convertite în probabilități, acestea trebuie să treacă printr-un strat <a href="https://en.wikipedia.org/wiki/Softmax_function" rel="nofollow">SoftMax</a> (toate modelele 🤗 Transformers produc logits, deoarece funcția de pierdere pentru formare va fuziona în general ultima funcție de activare, cum ar fi SoftMax, cu funcția de pierdere reală, cum ar fi entropia încrucișată):',il,S,R,Mt,W,B,ft,Ve,ps="Acum putem vedea că modelul a prezis <code>[0.0402, 0.9598]</code> pentru prima propoziție și <code>[0.9995, 0.0005]</code> pentru cea de-a doua. Acestea sunt scoruri de probabilitate care pot fi recunoscute.",ul,Ze,cs="Pentru a obține etichetele corespunzătoare fiecărei poziții, putem inspecta atributul <code>id2label</code> din configurația modelului (mai multe despre acest lucru în secțiunea următoare):",pl,He,cl,Se,ol,Re,os="Acum putem concluziona că modelul a prezis următoarele:",ml,We,ms="<li>Prima propoziție: NEGATIV: 0.0402, POZITIV: 0.9598</li> <li>A doua propoziție: NEGATIVĂ: 0.9995, POZITIVĂ: 0.0005</li>",Ml,Be,Ms="Am reprodus cu succes cele trei etape ale pipeline-ului: preprocesarea cu tokenizatoare, trecerea intrărilor prin model și postprocesarea! Acum haideți să analizăm în profunzime fiecare dintre aceste etape.",fl,q,dl,Le,yl,yt,bl;o=new Ks({props:{fw:f[0]}}),w=new dt({props:{title:"În spatele pipeline-ului",local:"în-spatele-pipeline-ului",headingTag:"h1"}});const fs=[tn,en],Fe=[];function ds(e,s){return e[0]==="pt"?0:1}_=ds(f),$=Fe[_]=fs[_](f),P=new Zs({props:{$$slots:{default:[ln]},$$scope:{ctx:f}}});const ys=[nn,sn],Pe=[];function bs(e,s){return e[0]==="pt"?0:1}C=bs(f),k=Pe[C]=ys[C](f),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}}),te=new h({props:{code:"JTVCJTdCJ2xhYmVsJyUzQSUyMCdQT1NJVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45NTk4MDQ3MTM3MjYwNDM3JTdEJTJDJTBBJTIwJTdCJ2xhYmVsJyUzQSUyMCdORUdBVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45OTk0NTU4MDk1OTMyMDA3JTdEJTVE",highlighted:`[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9598047137260437</span>},
 {<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9994558095932007</span>}]`,wrap:!1}}),ne=new dt({props:{title:"Preprocesarea cu un tokenizator",local:"preprocesarea-cu-un-tokenizator",headingTag:"h2"}}),pe=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 Ts=[rn,an],Xe=[];function Js(e,s){return e[0]==="pt"?0:1}I=Js(f),g=Xe[I]=Ts[I](f);const js=[pn,un],Ye=[];function Us(e,s){return e[0]==="pt"?0:1}v=Us(f),A=Ye[v]=js[v](f),de=new dt({props:{title:"Parcurgerea modelului",local:"parcurgerea-modelului",headingTag:"h2"}});const ws=[on,cn],qe=[];function hs(e,s){return e[0]==="pt"?0:1}x=hs(f),z=qe[x]=ws[x](f),je=new dt({props:{title:"Un vector multidimensional?",local:"un-vector-multidimensional",headingTag:"h3"}});const _s=[Mn,mn],Ke=[];function $s(e,s){return e[0]==="pt"?0:1}D=$s(f),Q=Ke[D]=_s[D](f),Ce=new dt({props:{title:"Modele de head-uri: Înțelegerea numerelor",local:"modele-de-head-uri-înțelegerea-numerelor",headingTag:"h3"}});const Cs=[dn,fn],Oe=[];function ks(e,s){return e[0]==="pt"?0:1}N=ks(f),E=Oe[N]=Cs[N](f),ze=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const Is=[bn,yn],et=[];function gs(e,s){return e[0]==="pt"?0:1}G=gs(f),V=et[G]=Is[G](f),Qe=new dt({props:{title:"Postprocesarea rezultatului",local:"postprocesarea-rezultatului",headingTag:"h2"}}),Ee=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const vs=[Jn,Tn],tt=[];function As(e,s){return e[0]==="pt"?0:1}Z=As(f),H=tt[Z]=vs[Z](f);const xs=[Un,jn],lt=[];function zs(e,s){return e[0]==="pt"?0:1}S=zs(f),R=lt[S]=xs[S](f);const Ds=[hn,wn],st=[];function Qs(e,s){return e[0]==="pt"?0:1}return W=Qs(f),B=st[W]=Ds[W](f),He=new h({props:{code:"bW9kZWwuY29uZmlnLmlkMmxhYmVs",highlighted:"model.config.id2label",wrap:!1}}),Se=new h({props:{code:"JTdCMCUzQSUyMCdORUdBVElWRSclMkMlMjAxJTNBJTIwJ1BPU0lUSVZFJyU3RA==",highlighted:'{<span class="hljs-number">0</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-number">1</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>}',wrap:!1}}),q=new Zs({props:{$$slots:{default:[_n]},$$scope:{ctx:f}}}),Le=new Os({props:{source:"https://github.com/huggingface/course/blob/main/chapters/rum/chapter2/2.mdx"}}),{c(){l=d("meta"),r=p(),t=d("p"),u=p(),T(o.$$.fragment),i=p(),T(w.$$.fragment),bt=p(),$.c(),nt=p(),T(P.$$.fragment),Tt=p(),k.c(),at=p(),K=d("p"),K.innerHTML=vl,Jt=p(),T(O.$$.fragment),jt=p(),ee=d("p"),ee.textContent=Al,Ut=p(),T(te.$$.fragment),wt=p(),le=d("p"),le.innerHTML=xl,ht=p(),X=d("div"),X.innerHTML=zl,_t=p(),se=d("p"),se.textContent=Dl,$t=p(),T(ne.$$.fragment),Ct=p(),ae=d("p"),ae.innerHTML=Ql,kt=p(),re=d("ul"),re.innerHTML=Nl,It=p(),ie=d("p"),ie.innerHTML=El,gt=p(),ue=d("p"),ue.innerHTML=Gl,vt=p(),T(pe.$$.fragment),At=p(),ce=d("p"),ce.textContent=Vl,xt=p(),oe=d("p"),oe.innerHTML=Zl,zt=p(),me=d("p"),me.innerHTML=Hl,Dt=p(),g.c(),rt=p(),Me=d("p"),Me.textContent=Sl,Qt=p(),A.c(),it=p(),fe=d("p"),fe.innerHTML=Rl,Nt=p(),T(de.$$.fragment),Et=p(),z.c(),ut=p(),ye=d("p"),ye.textContent=Wl,Gt=p(),be=d("p"),be.innerHTML=Bl,Vt=p(),Te=d("p"),Te.textContent=Ll,Zt=p(),Je=d("p"),Je.innerHTML=Fl,Ht=p(),T(je.$$.fragment),St=p(),Ue=d("p"),Ue.textContent=Pl,Rt=p(),we=d("ul"),we.innerHTML=Xl,Wt=p(),he=d("p"),he.textContent=Yl,Bt=p(),_e=d("p"),_e.textContent=ql,Lt=p(),Q.c(),pt=p(),$e=d("p"),$e.innerHTML=Kl,Ft=p(),T(Ce.$$.fragment),Pt=p(),ke=d("p"),ke.textContent=Ol,Xt=p(),Y=d("div"),Y.innerHTML=es,Yt=p(),Ie=d("p"),Ie.textContent=ts,qt=p(),ge=d("p"),ge.textContent=ls,Kt=p(),ve=d("p"),ve.textContent=ss,Ot=p(),Ae=d("ul"),Ae.innerHTML=ns,el=p(),E.c(),ct=p(),xe=d("p"),xe.textContent=as,tl=p(),T(ze.$$.fragment),ll=p(),V.c(),ot=p(),De=d("p"),De.textContent=rs,sl=p(),T(Qe.$$.fragment),nl=p(),Ne=d("p"),Ne.textContent=is,al=p(),T(Ee.$$.fragment),rl=p(),H.c(),mt=p(),Ge=d("p"),Ge.innerHTML=us,il=p(),R.c(),Mt=p(),B.c(),ft=p(),Ve=d("p"),Ve.innerHTML=ps,ul=p(),Ze=d("p"),Ze.innerHTML=cs,pl=p(),T(He.$$.fragment),cl=p(),T(Se.$$.fragment),ol=p(),Re=d("p"),Re.textContent=os,ml=p(),We=d("ul"),We.innerHTML=ms,Ml=p(),Be=d("p"),Be.textContent=Ms,fl=p(),T(q.$$.fragment),dl=p(),T(Le.$$.fragment),yl=p(),yt=d("p"),this.h()},l(e){const s=Ps("svelte-u9bgzb",document.head);l=y(s,"META",{name:!0,content:!0}),s.forEach(n),r=c(e),t=y(e,"P",{}),Vs(t).forEach(n),u=c(e),J(o.$$.fragment,e),i=c(e),J(w.$$.fragment,e),bt=c(e),$.l(e),nt=c(e),J(P.$$.fragment,e),Tt=c(e),k.l(e),at=c(e),K=y(e,"P",{"data-svelte-h":!0}),b(K)!=="svelte-11d45zi"&&(K.innerHTML=vl),Jt=c(e),J(O.$$.fragment,e),jt=c(e),ee=y(e,"P",{"data-svelte-h":!0}),b(ee)!=="svelte-m83ozi"&&(ee.textContent=Al),Ut=c(e),J(te.$$.fragment,e),wt=c(e),le=y(e,"P",{"data-svelte-h":!0}),b(le)!=="svelte-1o0dpe7"&&(le.innerHTML=xl),ht=c(e),X=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(X)!=="svelte-fbe70j"&&(X.innerHTML=zl),_t=c(e),se=y(e,"P",{"data-svelte-h":!0}),b(se)!=="svelte-13vns1w"&&(se.textContent=Dl),$t=c(e),J(ne.$$.fragment,e),Ct=c(e),ae=y(e,"P",{"data-svelte-h":!0}),b(ae)!=="svelte-f3ako0"&&(ae.innerHTML=Ql),kt=c(e),re=y(e,"UL",{"data-svelte-h":!0}),b(re)!=="svelte-fzwlwt"&&(re.innerHTML=Nl),It=c(e),ie=y(e,"P",{"data-svelte-h":!0}),b(ie)!=="svelte-1r8ozju"&&(ie.innerHTML=El),gt=c(e),ue=y(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-9higtt"&&(ue.innerHTML=Gl),vt=c(e),J(pe.$$.fragment,e),At=c(e),ce=y(e,"P",{"data-svelte-h":!0}),b(ce)!=="svelte-1d1j7xz"&&(ce.textContent=Vl),xt=c(e),oe=y(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-13v05xp"&&(oe.innerHTML=Zl),zt=c(e),me=y(e,"P",{"data-svelte-h":!0}),b(me)!=="svelte-1v36pk4"&&(me.innerHTML=Hl),Dt=c(e),g.l(e),rt=c(e),Me=y(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-f0s2c6"&&(Me.textContent=Sl),Qt=c(e),A.l(e),it=c(e),fe=y(e,"P",{"data-svelte-h":!0}),b(fe)!=="svelte-w8ucmi"&&(fe.innerHTML=Rl),Nt=c(e),J(de.$$.fragment,e),Et=c(e),z.l(e),ut=c(e),ye=y(e,"P",{"data-svelte-h":!0}),b(ye)!=="svelte-15nuf2g"&&(ye.textContent=Wl),Gt=c(e),be=y(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-c0e5t"&&(be.innerHTML=Bl),Vt=c(e),Te=y(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-80q3hn"&&(Te.textContent=Ll),Zt=c(e),Je=y(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-1u7c6fj"&&(Je.innerHTML=Fl),Ht=c(e),J(je.$$.fragment,e),St=c(e),Ue=y(e,"P",{"data-svelte-h":!0}),b(Ue)!=="svelte-1rt21zr"&&(Ue.textContent=Pl),Rt=c(e),we=y(e,"UL",{"data-svelte-h":!0}),b(we)!=="svelte-qv3rka"&&(we.innerHTML=Xl),Wt=c(e),he=y(e,"P",{"data-svelte-h":!0}),b(he)!=="svelte-jcsn5k"&&(he.textContent=Yl),Bt=c(e),_e=y(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-mucy9n"&&(_e.textContent=ql),Lt=c(e),Q.l(e),pt=c(e),$e=y(e,"P",{"data-svelte-h":!0}),b($e)!=="svelte-b29xip"&&($e.innerHTML=Kl),Ft=c(e),J(Ce.$$.fragment,e),Pt=c(e),ke=y(e,"P",{"data-svelte-h":!0}),b(ke)!=="svelte-1uzktdy"&&(ke.textContent=Ol),Xt=c(e),Y=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(Y)!=="svelte-8mo6lt"&&(Y.innerHTML=es),Yt=c(e),Ie=y(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-deuux2"&&(Ie.textContent=ts),qt=c(e),ge=y(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-1e8ohcj"&&(ge.textContent=ls),Kt=c(e),ve=y(e,"P",{"data-svelte-h":!0}),b(ve)!=="svelte-11eakkd"&&(ve.textContent=ss),Ot=c(e),Ae=y(e,"UL",{"data-svelte-h":!0}),b(Ae)!=="svelte-4zwack"&&(Ae.innerHTML=ns),el=c(e),E.l(e),ct=c(e),xe=y(e,"P",{"data-svelte-h":!0}),b(xe)!=="svelte-1l8u8o0"&&(xe.textContent=as),tl=c(e),J(ze.$$.fragment,e),ll=c(e),V.l(e),ot=c(e),De=y(e,"P",{"data-svelte-h":!0}),b(De)!=="svelte-pgym14"&&(De.textContent=rs),sl=c(e),J(Qe.$$.fragment,e),nl=c(e),Ne=y(e,"P",{"data-svelte-h":!0}),b(Ne)!=="svelte-g9nzfb"&&(Ne.textContent=is),al=c(e),J(Ee.$$.fragment,e),rl=c(e),H.l(e),mt=c(e),Ge=y(e,"P",{"data-svelte-h":!0}),b(Ge)!=="svelte-dllqx9"&&(Ge.innerHTML=us),il=c(e),R.l(e),Mt=c(e),B.l(e),ft=c(e),Ve=y(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-1jt7mpf"&&(Ve.innerHTML=ps),ul=c(e),Ze=y(e,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-17zq0ho"&&(Ze.innerHTML=cs),pl=c(e),J(He.$$.fragment,e),cl=c(e),J(Se.$$.fragment,e),ol=c(e),Re=y(e,"P",{"data-svelte-h":!0}),b(Re)!=="svelte-1n38jpx"&&(Re.textContent=os),ml=c(e),We=y(e,"UL",{"data-svelte-h":!0}),b(We)!=="svelte-1sdhh4r"&&(We.innerHTML=ms),Ml=c(e),Be=y(e,"P",{"data-svelte-h":!0}),b(Be)!=="svelte-1114vuz"&&(Be.textContent=Ms),fl=c(e),J(q.$$.fragment,e),dl=c(e),J(Le.$$.fragment,e),yl=c(e),yt=y(e,"P",{}),Vs(yt).forEach(n),this.h()},h(){Tl(l,"name","hf:doc:metadata"),Tl(l,"content",Cn),Tl(X,"class","flex justify-center"),Tl(Y,"class","flex justify-center")},m(e,s){Xs(document.head,l),a(e,r,s),a(e,t,s),a(e,u,s),j(o,e,s),a(e,i,s),j(w,e,s),a(e,bt,s),Fe[_].m(e,s),a(e,nt,s),j(P,e,s),a(e,Tt,s),Pe[C].m(e,s),a(e,at,s),a(e,K,s),a(e,Jt,s),j(O,e,s),a(e,jt,s),a(e,ee,s),a(e,Ut,s),j(te,e,s),a(e,wt,s),a(e,le,s),a(e,ht,s),a(e,X,s),a(e,_t,s),a(e,se,s),a(e,$t,s),j(ne,e,s),a(e,Ct,s),a(e,ae,s),a(e,kt,s),a(e,re,s),a(e,It,s),a(e,ie,s),a(e,gt,s),a(e,ue,s),a(e,vt,s),j(pe,e,s),a(e,At,s),a(e,ce,s),a(e,xt,s),a(e,oe,s),a(e,zt,s),a(e,me,s),a(e,Dt,s),Xe[I].m(e,s),a(e,rt,s),a(e,Me,s),a(e,Qt,s),Ye[v].m(e,s),a(e,it,s),a(e,fe,s),a(e,Nt,s),j(de,e,s),a(e,Et,s),qe[x].m(e,s),a(e,ut,s),a(e,ye,s),a(e,Gt,s),a(e,be,s),a(e,Vt,s),a(e,Te,s),a(e,Zt,s),a(e,Je,s),a(e,Ht,s),j(je,e,s),a(e,St,s),a(e,Ue,s),a(e,Rt,s),a(e,we,s),a(e,Wt,s),a(e,he,s),a(e,Bt,s),a(e,_e,s),a(e,Lt,s),Ke[D].m(e,s),a(e,pt,s),a(e,$e,s),a(e,Ft,s),j(Ce,e,s),a(e,Pt,s),a(e,ke,s),a(e,Xt,s),a(e,Y,s),a(e,Yt,s),a(e,Ie,s),a(e,qt,s),a(e,ge,s),a(e,Kt,s),a(e,ve,s),a(e,Ot,s),a(e,Ae,s),a(e,el,s),Oe[N].m(e,s),a(e,ct,s),a(e,xe,s),a(e,tl,s),j(ze,e,s),a(e,ll,s),et[G].m(e,s),a(e,ot,s),a(e,De,s),a(e,sl,s),j(Qe,e,s),a(e,nl,s),a(e,Ne,s),a(e,al,s),j(Ee,e,s),a(e,rl,s),tt[Z].m(e,s),a(e,mt,s),a(e,Ge,s),a(e,il,s),lt[S].m(e,s),a(e,Mt,s),st[W].m(e,s),a(e,ft,s),a(e,Ve,s),a(e,ul,s),a(e,Ze,s),a(e,pl,s),j(He,e,s),a(e,cl,s),j(Se,e,s),a(e,ol,s),a(e,Re,s),a(e,ml,s),a(e,We,s),a(e,Ml,s),a(e,Be,s),a(e,fl,s),j(q,e,s),a(e,dl,s),j(Le,e,s),a(e,yl,s),a(e,yt,s),bl=!0},p(e,[s]){const Ns={};s&1&&(Ns.fw=e[0]),o.$set(Ns);let Jl=_;_=ds(e),_!==Jl&&(F(),m(Fe[Jl],1,1,()=>{Fe[Jl]=null}),L(),$=Fe[_],$||($=Fe[_]=fs[_](e),$.c()),M($,1),$.m(nt.parentNode,nt));const Es={};s&2&&(Es.$$scope={dirty:s,ctx:e}),P.$set(Es);let jl=C;C=bs(e),C!==jl&&(F(),m(Pe[jl],1,1,()=>{Pe[jl]=null}),L(),k=Pe[C],k||(k=Pe[C]=ys[C](e),k.c()),M(k,1),k.m(at.parentNode,at));let Ul=I;I=Js(e),I!==Ul&&(F(),m(Xe[Ul],1,1,()=>{Xe[Ul]=null}),L(),g=Xe[I],g||(g=Xe[I]=Ts[I](e),g.c()),M(g,1),g.m(rt.parentNode,rt));let wl=v;v=Us(e),v!==wl&&(F(),m(Ye[wl],1,1,()=>{Ye[wl]=null}),L(),A=Ye[v],A||(A=Ye[v]=js[v](e),A.c()),M(A,1),A.m(it.parentNode,it));let hl=x;x=hs(e),x!==hl&&(F(),m(qe[hl],1,1,()=>{qe[hl]=null}),L(),z=qe[x],z||(z=qe[x]=ws[x](e),z.c()),M(z,1),z.m(ut.parentNode,ut));let _l=D;D=$s(e),D!==_l&&(F(),m(Ke[_l],1,1,()=>{Ke[_l]=null}),L(),Q=Ke[D],Q||(Q=Ke[D]=_s[D](e),Q.c()),M(Q,1),Q.m(pt.parentNode,pt));let $l=N;N=ks(e),N!==$l&&(F(),m(Oe[$l],1,1,()=>{Oe[$l]=null}),L(),E=Oe[N],E||(E=Oe[N]=Cs[N](e),E.c()),M(E,1),E.m(ct.parentNode,ct));let Cl=G;G=gs(e),G!==Cl&&(F(),m(et[Cl],1,1,()=>{et[Cl]=null}),L(),V=et[G],V||(V=et[G]=Is[G](e),V.c()),M(V,1),V.m(ot.parentNode,ot));let kl=Z;Z=As(e),Z!==kl&&(F(),m(tt[kl],1,1,()=>{tt[kl]=null}),L(),H=tt[Z],H||(H=tt[Z]=vs[Z](e),H.c()),M(H,1),H.m(mt.parentNode,mt));let Il=S;S=zs(e),S!==Il&&(F(),m(lt[Il],1,1,()=>{lt[Il]=null}),L(),R=lt[S],R||(R=lt[S]=xs[S](e),R.c()),M(R,1),R.m(Mt.parentNode,Mt));let gl=W;W=Qs(e),W!==gl&&(F(),m(st[gl],1,1,()=>{st[gl]=null}),L(),B=st[W],B||(B=st[W]=Ds[W](e),B.c()),M(B,1),B.m(ft.parentNode,ft));const Gs={};s&2&&(Gs.$$scope={dirty:s,ctx:e}),q.$set(Gs)},i(e){bl||(M(o.$$.fragment,e),M(w.$$.fragment,e),M($),M(P.$$.fragment,e),M(k),M(O.$$.fragment,e),M(te.$$.fragment,e),M(ne.$$.fragment,e),M(pe.$$.fragment,e),M(g),M(A),M(de.$$.fragment,e),M(z),M(je.$$.fragment,e),M(Q),M(Ce.$$.fragment,e),M(E),M(ze.$$.fragment,e),M(V),M(Qe.$$.fragment,e),M(Ee.$$.fragment,e),M(H),M(R),M(B),M(He.$$.fragment,e),M(Se.$$.fragment,e),M(q.$$.fragment,e),M(Le.$$.fragment,e),bl=!0)},o(e){m(o.$$.fragment,e),m(w.$$.fragment,e),m($),m(P.$$.fragment,e),m(k),m(O.$$.fragment,e),m(te.$$.fragment,e),m(ne.$$.fragment,e),m(pe.$$.fragment,e),m(g),m(A),m(de.$$.fragment,e),m(z),m(je.$$.fragment,e),m(Q),m(Ce.$$.fragment,e),m(E),m(ze.$$.fragment,e),m(V),m(Qe.$$.fragment,e),m(Ee.$$.fragment,e),m(H),m(R),m(B),m(He.$$.fragment,e),m(Se.$$.fragment,e),m(q.$$.fragment,e),m(Le.$$.fragment,e),bl=!1},d(e){e&&(n(r),n(t),n(u),n(i),n(bt),n(nt),n(Tt),n(at),n(K),n(Jt),n(jt),n(ee),n(Ut),n(wt),n(le),n(ht),n(X),n(_t),n(se),n($t),n(Ct),n(ae),n(kt),n(re),n(It),n(ie),n(gt),n(ue),n(vt),n(At),n(ce),n(xt),n(oe),n(zt),n(me),n(Dt),n(rt),n(Me),n(Qt),n(it),n(fe),n(Nt),n(Et),n(ut),n(ye),n(Gt),n(be),n(Vt),n(Te),n(Zt),n(Je),n(Ht),n(St),n(Ue),n(Rt),n(we),n(Wt),n(he),n(Bt),n(_e),n(Lt),n(pt),n($e),n(Ft),n(Pt),n(ke),n(Xt),n(Y),n(Yt),n(Ie),n(qt),n(ge),n(Kt),n(ve),n(Ot),n(Ae),n(el),n(ct),n(xe),n(tl),n(ll),n(ot),n(De),n(sl),n(nl),n(Ne),n(al),n(rl),n(mt),n(Ge),n(il),n(Mt),n(ft),n(Ve),n(ul),n(Ze),n(pl),n(cl),n(ol),n(Re),n(ml),n(We),n(Ml),n(Be),n(fl),n(dl),n(yl),n(yt)),n(l),U(o,e),U(w,e),Fe[_].d(e),U(P,e),Pe[C].d(e),U(O,e),U(te,e),U(ne,e),U(pe,e),Xe[I].d(e),Ye[v].d(e),U(de,e),qe[x].d(e),U(je,e),Ke[D].d(e),U(Ce,e),Oe[N].d(e),U(ze,e),et[G].d(e),U(Qe,e),U(Ee,e),tt[Z].d(e),lt[S].d(e),st[W].d(e),U(He,e),U(Se,e),U(q,e),U(Le,e)}}}const Cn='{"title":"În spatele pipeline-ului","local":"în-spatele-pipeline-ului","sections":[{"title":"Preprocesarea cu un tokenizator","local":"preprocesarea-cu-un-tokenizator","sections":[],"depth":2},{"title":"Parcurgerea modelului","local":"parcurgerea-modelului","sections":[{"title":"Un vector multidimensional?","local":"un-vector-multidimensional","sections":[],"depth":3},{"title":"Modele de head-uri: Înțelegerea numerelor","local":"modele-de-head-uri-înțelegerea-numerelor","sections":[],"depth":3}],"depth":2},{"title":"Postprocesarea rezultatului","local":"postprocesarea-rezultatului","sections":[],"depth":2}],"depth":1}';function kn(f,l,r){let t="pt";return Ws(()=>{const u=new URLSearchParams(window.location.search);r(0,t=u.get("fw")||"pt")}),[t]}class Nn extends Ls{constructor(l){super(),Fs(this,l,kn,$n,Rs,{})}}export{Nn as component};
