import{s as Bs,o as Ls,n as Fs}from"../chunks/scheduler.893fe8c9.js";import{S as Ps,i as Xs,e as d,s as p,c as T,h as Ys,a as y,d as n,b as c,f as Hs,g as J,j as b,k as jl,l as qs,m as a,n as j,o as m,D as L,t as M,p as U,q as Ks,r as Os,E as F}from"../chunks/index.6ee278c6.js";import{T as Ss}from"../chunks/Tip.eab0255c.js";import{C as en,H as yt,E as tn}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.ea3ad860.js";import{Y as Rs}from"../chunks/Youtube.59d04f41.js";import{C as h}from"../chunks/CodeBlock.8bdd5f33.js";import{C as Ws}from"../chunks/CourseFloatingBanner.c25cfa5e.js";import{F as ln}from"../chunks/FrameworkSwitchCourse.77a18d50.js";function sn(f){let l,r;return l=new Ws({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 nn(f){let l,r;return l=new Ws({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 an(f){let l;return{c(){l=Ks("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=Os(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 rn(f){let l,r;return l=new Rs({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 un(f){let l,r;return l=new Rs({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 pn(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 cn(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 on(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 mn(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 Mn(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 fn(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 dn(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 yn(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 bn(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 Tn(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 Jn(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 jn(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 Un(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 wn(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 hn(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 $n(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 _n(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 Cn(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 kn(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:Fs,d(t){t&&n(l)}}}function In(f){let l,r,t,u,o,i,w,Tt,K,Jt,$,_,at,P,jt,C,k,rt,O,xl='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>:',Ut,ee,wt,te,zl="și am obținut:",ht,le,$t,se,Dl='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:',_t,X,Ql='<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."/>',Ct,ne,Nl="Să trecem rapid prin fiecare dintre acestea.",kt,ae,It,re,El="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:",gt,ie,Gl="<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>",vt,ue,Vl='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).',At,pe,Zl='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:',xt,ce,zt,oe,Hl="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.",Dt,me,Sl="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.",Qt,Me,Rl="Pentru a specifica tipul de tensori pe care dorim să îi primim înapoi (PyTorch, TensorFlow sau NumPy simplu), folosim argumentul <code>return_tensors</code>:",Nt,I,g,it,fe,Wl="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).",Et,v,A,ut,de,Bl="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.",Gt,ye,Vt,x,z,pt,be,Ll="Î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.",Zt,Te,Fl="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>.",Ht,Je,Pl="Dacă acest lucru nu are sens, nu vă faceți griji. Vom explica totul mai târziu.",St,je,Xl='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.',Rt,Ue,Wt,we,Yl="Vectorul emis de modulul Transformator este de obicei de dimensiuni mari. Acesta are în general trei dimensiuni:",Bt,he,ql="<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>",Lt,$e,Kl="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).",Ft,_e,Ol="Putem vedea acest lucru dacă introducem în modelul nostru intrările pe care le-am preprocesat:",Pt,D,Q,ct,Ce,es="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>).",Xt,ke,Yt,Ie,ts="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:",qt,Y,ls='<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."/>',Kt,ge,ss="Rezultatul modelului Transformer este trimis direct la head-ul modelului pentru a fi prelucrat.",Ot,ve,ns="Î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.",el,Ae,as="Există multe arhitecturi diferite disponibile în 🤗 Transformers, fiecare fiind concepută în jurul abordării unei sarcini specifice. Iată o listă neexhaustivă:",tl,xe,rs="<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>",ll,N,E,ot,ze,is="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ă):",sl,De,nl,G,V,mt,Qe,us="Deoarece avem doar două propoziții și două etichete, rezultatul pe care îl obținem din modelul nostru este de forma 2 x 2.",al,Ne,rl,Ee,ps="Valorile pe care le obținem ca rezultat al modelului nostru nu au neapărat sens în sine. Să aruncăm o privire:",il,Ge,ul,Z,H,Mt,Ve,cs='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ă):',pl,S,R,ft,W,B,dt,Ze,os="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.",cl,He,ms="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):",ol,Se,ml,Re,Ml,We,Ms="Acum putem concluziona că modelul a prezis următoarele:",fl,Be,fs="<li>Prima propoziție: NEGATIV: 0.0402, POZITIV: 0.9598</li> <li>A doua propoziție: NEGATIVĂ: 0.9995, POZITIVĂ: 0.0005</li>",dl,Le,ds="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.",yl,q,bl,Fe,Tl,bt,Jl;o=new ln({props:{fw:f[0]}}),w=new en({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),K=new yt({props:{title:"În spatele pipeline-ului",local:"în-spatele-pipeline-ului",headingTag:"h1"}});const ys=[nn,sn],Pe=[];function bs(e,s){return e[0]==="pt"?0:1}$=bs(f),_=Pe[$]=ys[$](f),P=new Ss({props:{$$slots:{default:[an]},$$scope:{ctx:f}}});const Ts=[un,rn],Xe=[];function Js(e,s){return e[0]==="pt"?0:1}C=Js(f),k=Xe[C]=Ts[C](f),ee=new h({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMHBpcGVsaW5lJTBBJTBBY2xhc3NpZmllciUyMCUzRCUyMHBpcGVsaW5lKCUyMnNlbnRpbWVudC1hbmFseXNpcyUyMiklMEFjbGFzc2lmaWVyKCUwQSUyMCUyMCUyMCUyMCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkkndmUlMjBiZWVuJTIwd2FpdGluZyUyMGZvciUyMGElMjBIdWdnaW5nRmFjZSUyMGNvdXJzZSUyMG15JTIwd2hvbGUlMjBsaWZlLiUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMkklMjBoYXRlJTIwdGhpcyUyMHNvJTIwbXVjaCElMjIlMkMlMEElMjAlMjAlMjAlMjAlNUQlMEEp",highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> pipeline

classifier = pipeline(<span class="hljs-string">&quot;sentiment-analysis&quot;</span>)
classifier(
    [
        <span class="hljs-string">&quot;I&#x27;ve been waiting for a HuggingFace course my whole life.&quot;</span>,
        <span class="hljs-string">&quot;I hate this so much!&quot;</span>,
    ]
)`,wrap:!1}}),le=new h({props:{code:"JTVCJTdCJ2xhYmVsJyUzQSUyMCdQT1NJVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45NTk4MDQ3MTM3MjYwNDM3JTdEJTJDJTBBJTIwJTdCJ2xhYmVsJyUzQSUyMCdORUdBVElWRSclMkMlMjAnc2NvcmUnJTNBJTIwMC45OTk0NTU4MDk1OTMyMDA3JTdEJTVE",highlighted:`[{<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;POSITIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9598047137260437</span>},
 {<span class="hljs-string">&#x27;label&#x27;</span>: <span class="hljs-string">&#x27;NEGATIVE&#x27;</span>, <span class="hljs-string">&#x27;score&#x27;</span>: <span class="hljs-number">0.9994558095932007</span>}]`,wrap:!1}}),ae=new yt({props:{title:"Preprocesarea cu un tokenizator",local:"preprocesarea-cu-un-tokenizator",headingTag:"h2"}}),ce=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 js=[cn,pn],Ye=[];function Us(e,s){return e[0]==="pt"?0:1}I=Us(f),g=Ye[I]=js[I](f);const ws=[mn,on],qe=[];function hs(e,s){return e[0]==="pt"?0:1}v=hs(f),A=qe[v]=ws[v](f),ye=new yt({props:{title:"Parcurgerea modelului",local:"parcurgerea-modelului",headingTag:"h2"}});const $s=[fn,Mn],Ke=[];function _s(e,s){return e[0]==="pt"?0:1}x=_s(f),z=Ke[x]=$s[x](f),Ue=new yt({props:{title:"Un vector multidimensional?",local:"un-vector-multidimensional",headingTag:"h3"}});const Cs=[yn,dn],Oe=[];function ks(e,s){return e[0]==="pt"?0:1}D=ks(f),Q=Oe[D]=Cs[D](f),ke=new yt({props:{title:"Modele de head-uri: Înțelegerea numerelor",local:"modele-de-head-uri-înțelegerea-numerelor",headingTag:"h3"}});const Is=[Tn,bn],et=[];function gs(e,s){return e[0]==="pt"?0:1}N=gs(f),E=et[N]=Is[N](f),De=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMuc2hhcGUp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits.shape)',wrap:!1}});const vs=[jn,Jn],tt=[];function As(e,s){return e[0]==="pt"?0:1}G=As(f),V=tt[G]=vs[G](f),Ne=new yt({props:{title:"Postprocesarea rezultatului",local:"postprocesarea-rezultatului",headingTag:"h2"}}),Ge=new h({props:{code:"cHJpbnQob3V0cHV0cy5sb2dpdHMp",highlighted:'<span class="hljs-built_in">print</span>(outputs.logits)',wrap:!1}});const xs=[wn,Un],lt=[];function zs(e,s){return e[0]==="pt"?0:1}Z=zs(f),H=lt[Z]=xs[Z](f);const Ds=[$n,hn],st=[];function Qs(e,s){return e[0]==="pt"?0:1}S=Qs(f),R=st[S]=Ds[S](f);const Ns=[Cn,_n],nt=[];function Es(e,s){return e[0]==="pt"?0:1}return W=Es(f),B=nt[W]=Ns[W](f),Se=new h({props:{code:"bW9kZWwuY29uZmlnLmlkMmxhYmVs",highlighted:"model.config.id2label",wrap:!1}}),Re=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 Ss({props:{$$slots:{default:[kn]},$$scope:{ctx:f}}}),Fe=new tn({props:{source:"https://github.com/huggingface/course/blob/main/chapters/ro/chapter2/2.mdx"}}),{c(){l=d("meta"),r=p(),t=d("p"),u=p(),T(o.$$.fragment),i=p(),T(w.$$.fragment),Tt=p(),T(K.$$.fragment),Jt=p(),_.c(),at=p(),T(P.$$.fragment),jt=p(),k.c(),rt=p(),O=d("p"),O.innerHTML=xl,Ut=p(),T(ee.$$.fragment),wt=p(),te=d("p"),te.textContent=zl,ht=p(),T(le.$$.fragment),$t=p(),se=d("p"),se.innerHTML=Dl,_t=p(),X=d("div"),X.innerHTML=Ql,Ct=p(),ne=d("p"),ne.textContent=Nl,kt=p(),T(ae.$$.fragment),It=p(),re=d("p"),re.innerHTML=El,gt=p(),ie=d("ul"),ie.innerHTML=Gl,vt=p(),ue=d("p"),ue.innerHTML=Vl,At=p(),pe=d("p"),pe.innerHTML=Zl,xt=p(),T(ce.$$.fragment),zt=p(),oe=d("p"),oe.textContent=Hl,Dt=p(),me=d("p"),me.innerHTML=Sl,Qt=p(),Me=d("p"),Me.innerHTML=Rl,Nt=p(),g.c(),it=p(),fe=d("p"),fe.textContent=Wl,Et=p(),A.c(),ut=p(),de=d("p"),de.innerHTML=Bl,Gt=p(),T(ye.$$.fragment),Vt=p(),z.c(),pt=p(),be=d("p"),be.textContent=Ll,Zt=p(),Te=d("p"),Te.innerHTML=Fl,Ht=p(),Je=d("p"),Je.textContent=Pl,St=p(),je=d("p"),je.innerHTML=Xl,Rt=p(),T(Ue.$$.fragment),Wt=p(),we=d("p"),we.textContent=Yl,Bt=p(),he=d("ul"),he.innerHTML=ql,Lt=p(),$e=d("p"),$e.textContent=Kl,Ft=p(),_e=d("p"),_e.textContent=Ol,Pt=p(),Q.c(),ct=p(),Ce=d("p"),Ce.innerHTML=es,Xt=p(),T(ke.$$.fragment),Yt=p(),Ie=d("p"),Ie.textContent=ts,qt=p(),Y=d("div"),Y.innerHTML=ls,Kt=p(),ge=d("p"),ge.textContent=ss,Ot=p(),ve=d("p"),ve.textContent=ns,el=p(),Ae=d("p"),Ae.textContent=as,tl=p(),xe=d("ul"),xe.innerHTML=rs,ll=p(),E.c(),ot=p(),ze=d("p"),ze.textContent=is,sl=p(),T(De.$$.fragment),nl=p(),V.c(),mt=p(),Qe=d("p"),Qe.textContent=us,al=p(),T(Ne.$$.fragment),rl=p(),Ee=d("p"),Ee.textContent=ps,il=p(),T(Ge.$$.fragment),ul=p(),H.c(),Mt=p(),Ve=d("p"),Ve.innerHTML=cs,pl=p(),R.c(),ft=p(),B.c(),dt=p(),Ze=d("p"),Ze.innerHTML=os,cl=p(),He=d("p"),He.innerHTML=ms,ol=p(),T(Se.$$.fragment),ml=p(),T(Re.$$.fragment),Ml=p(),We=d("p"),We.textContent=Ms,fl=p(),Be=d("ul"),Be.innerHTML=fs,dl=p(),Le=d("p"),Le.textContent=ds,yl=p(),T(q.$$.fragment),bl=p(),T(Fe.$$.fragment),Tl=p(),bt=d("p"),this.h()},l(e){const s=Ys("svelte-u9bgzb",document.head);l=y(s,"META",{name:!0,content:!0}),s.forEach(n),r=c(e),t=y(e,"P",{}),Hs(t).forEach(n),u=c(e),J(o.$$.fragment,e),i=c(e),J(w.$$.fragment,e),Tt=c(e),J(K.$$.fragment,e),Jt=c(e),_.l(e),at=c(e),J(P.$$.fragment,e),jt=c(e),k.l(e),rt=c(e),O=y(e,"P",{"data-svelte-h":!0}),b(O)!=="svelte-11d45zi"&&(O.innerHTML=xl),Ut=c(e),J(ee.$$.fragment,e),wt=c(e),te=y(e,"P",{"data-svelte-h":!0}),b(te)!=="svelte-m83ozi"&&(te.textContent=zl),ht=c(e),J(le.$$.fragment,e),$t=c(e),se=y(e,"P",{"data-svelte-h":!0}),b(se)!=="svelte-1o0dpe7"&&(se.innerHTML=Dl),_t=c(e),X=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(X)!=="svelte-fbe70j"&&(X.innerHTML=Ql),Ct=c(e),ne=y(e,"P",{"data-svelte-h":!0}),b(ne)!=="svelte-13vns1w"&&(ne.textContent=Nl),kt=c(e),J(ae.$$.fragment,e),It=c(e),re=y(e,"P",{"data-svelte-h":!0}),b(re)!=="svelte-f3ako0"&&(re.innerHTML=El),gt=c(e),ie=y(e,"UL",{"data-svelte-h":!0}),b(ie)!=="svelte-fzwlwt"&&(ie.innerHTML=Gl),vt=c(e),ue=y(e,"P",{"data-svelte-h":!0}),b(ue)!=="svelte-1r8ozju"&&(ue.innerHTML=Vl),At=c(e),pe=y(e,"P",{"data-svelte-h":!0}),b(pe)!=="svelte-9higtt"&&(pe.innerHTML=Zl),xt=c(e),J(ce.$$.fragment,e),zt=c(e),oe=y(e,"P",{"data-svelte-h":!0}),b(oe)!=="svelte-1d1j7xz"&&(oe.textContent=Hl),Dt=c(e),me=y(e,"P",{"data-svelte-h":!0}),b(me)!=="svelte-13v05xp"&&(me.innerHTML=Sl),Qt=c(e),Me=y(e,"P",{"data-svelte-h":!0}),b(Me)!=="svelte-1v36pk4"&&(Me.innerHTML=Rl),Nt=c(e),g.l(e),it=c(e),fe=y(e,"P",{"data-svelte-h":!0}),b(fe)!=="svelte-f0s2c6"&&(fe.textContent=Wl),Et=c(e),A.l(e),ut=c(e),de=y(e,"P",{"data-svelte-h":!0}),b(de)!=="svelte-w8ucmi"&&(de.innerHTML=Bl),Gt=c(e),J(ye.$$.fragment,e),Vt=c(e),z.l(e),pt=c(e),be=y(e,"P",{"data-svelte-h":!0}),b(be)!=="svelte-15nuf2g"&&(be.textContent=Ll),Zt=c(e),Te=y(e,"P",{"data-svelte-h":!0}),b(Te)!=="svelte-c0e5t"&&(Te.innerHTML=Fl),Ht=c(e),Je=y(e,"P",{"data-svelte-h":!0}),b(Je)!=="svelte-80q3hn"&&(Je.textContent=Pl),St=c(e),je=y(e,"P",{"data-svelte-h":!0}),b(je)!=="svelte-1u7c6fj"&&(je.innerHTML=Xl),Rt=c(e),J(Ue.$$.fragment,e),Wt=c(e),we=y(e,"P",{"data-svelte-h":!0}),b(we)!=="svelte-1rt21zr"&&(we.textContent=Yl),Bt=c(e),he=y(e,"UL",{"data-svelte-h":!0}),b(he)!=="svelte-qv3rka"&&(he.innerHTML=ql),Lt=c(e),$e=y(e,"P",{"data-svelte-h":!0}),b($e)!=="svelte-jcsn5k"&&($e.textContent=Kl),Ft=c(e),_e=y(e,"P",{"data-svelte-h":!0}),b(_e)!=="svelte-mucy9n"&&(_e.textContent=Ol),Pt=c(e),Q.l(e),ct=c(e),Ce=y(e,"P",{"data-svelte-h":!0}),b(Ce)!=="svelte-b29xip"&&(Ce.innerHTML=es),Xt=c(e),J(ke.$$.fragment,e),Yt=c(e),Ie=y(e,"P",{"data-svelte-h":!0}),b(Ie)!=="svelte-1uzktdy"&&(Ie.textContent=ts),qt=c(e),Y=y(e,"DIV",{class:!0,"data-svelte-h":!0}),b(Y)!=="svelte-8mo6lt"&&(Y.innerHTML=ls),Kt=c(e),ge=y(e,"P",{"data-svelte-h":!0}),b(ge)!=="svelte-deuux2"&&(ge.textContent=ss),Ot=c(e),ve=y(e,"P",{"data-svelte-h":!0}),b(ve)!=="svelte-1e8ohcj"&&(ve.textContent=ns),el=c(e),Ae=y(e,"P",{"data-svelte-h":!0}),b(Ae)!=="svelte-11eakkd"&&(Ae.textContent=as),tl=c(e),xe=y(e,"UL",{"data-svelte-h":!0}),b(xe)!=="svelte-4zwack"&&(xe.innerHTML=rs),ll=c(e),E.l(e),ot=c(e),ze=y(e,"P",{"data-svelte-h":!0}),b(ze)!=="svelte-1l8u8o0"&&(ze.textContent=is),sl=c(e),J(De.$$.fragment,e),nl=c(e),V.l(e),mt=c(e),Qe=y(e,"P",{"data-svelte-h":!0}),b(Qe)!=="svelte-pgym14"&&(Qe.textContent=us),al=c(e),J(Ne.$$.fragment,e),rl=c(e),Ee=y(e,"P",{"data-svelte-h":!0}),b(Ee)!=="svelte-g9nzfb"&&(Ee.textContent=ps),il=c(e),J(Ge.$$.fragment,e),ul=c(e),H.l(e),Mt=c(e),Ve=y(e,"P",{"data-svelte-h":!0}),b(Ve)!=="svelte-dllqx9"&&(Ve.innerHTML=cs),pl=c(e),R.l(e),ft=c(e),B.l(e),dt=c(e),Ze=y(e,"P",{"data-svelte-h":!0}),b(Ze)!=="svelte-1jt7mpf"&&(Ze.innerHTML=os),cl=c(e),He=y(e,"P",{"data-svelte-h":!0}),b(He)!=="svelte-17zq0ho"&&(He.innerHTML=ms),ol=c(e),J(Se.$$.fragment,e),ml=c(e),J(Re.$$.fragment,e),Ml=c(e),We=y(e,"P",{"data-svelte-h":!0}),b(We)!=="svelte-1n38jpx"&&(We.textContent=Ms),fl=c(e),Be=y(e,"UL",{"data-svelte-h":!0}),b(Be)!=="svelte-1sdhh4r"&&(Be.innerHTML=fs),dl=c(e),Le=y(e,"P",{"data-svelte-h":!0}),b(Le)!=="svelte-1114vuz"&&(Le.textContent=ds),yl=c(e),J(q.$$.fragment,e),bl=c(e),J(Fe.$$.fragment,e),Tl=c(e),bt=y(e,"P",{}),Hs(bt).forEach(n),this.h()},h(){jl(l,"name","hf:doc:metadata"),jl(l,"content",gn),jl(X,"class","flex justify-center"),jl(Y,"class","flex justify-center")},m(e,s){qs(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,Tt,s),j(K,e,s),a(e,Jt,s),Pe[$].m(e,s),a(e,at,s),j(P,e,s),a(e,jt,s),Xe[C].m(e,s),a(e,rt,s),a(e,O,s),a(e,Ut,s),j(ee,e,s),a(e,wt,s),a(e,te,s),a(e,ht,s),j(le,e,s),a(e,$t,s),a(e,se,s),a(e,_t,s),a(e,X,s),a(e,Ct,s),a(e,ne,s),a(e,kt,s),j(ae,e,s),a(e,It,s),a(e,re,s),a(e,gt,s),a(e,ie,s),a(e,vt,s),a(e,ue,s),a(e,At,s),a(e,pe,s),a(e,xt,s),j(ce,e,s),a(e,zt,s),a(e,oe,s),a(e,Dt,s),a(e,me,s),a(e,Qt,s),a(e,Me,s),a(e,Nt,s),Ye[I].m(e,s),a(e,it,s),a(e,fe,s),a(e,Et,s),qe[v].m(e,s),a(e,ut,s),a(e,de,s),a(e,Gt,s),j(ye,e,s),a(e,Vt,s),Ke[x].m(e,s),a(e,pt,s),a(e,be,s),a(e,Zt,s),a(e,Te,s),a(e,Ht,s),a(e,Je,s),a(e,St,s),a(e,je,s),a(e,Rt,s),j(Ue,e,s),a(e,Wt,s),a(e,we,s),a(e,Bt,s),a(e,he,s),a(e,Lt,s),a(e,$e,s),a(e,Ft,s),a(e,_e,s),a(e,Pt,s),Oe[D].m(e,s),a(e,ct,s),a(e,Ce,s),a(e,Xt,s),j(ke,e,s),a(e,Yt,s),a(e,Ie,s),a(e,qt,s),a(e,Y,s),a(e,Kt,s),a(e,ge,s),a(e,Ot,s),a(e,ve,s),a(e,el,s),a(e,Ae,s),a(e,tl,s),a(e,xe,s),a(e,ll,s),et[N].m(e,s),a(e,ot,s),a(e,ze,s),a(e,sl,s),j(De,e,s),a(e,nl,s),tt[G].m(e,s),a(e,mt,s),a(e,Qe,s),a(e,al,s),j(Ne,e,s),a(e,rl,s),a(e,Ee,s),a(e,il,s),j(Ge,e,s),a(e,ul,s),lt[Z].m(e,s),a(e,Mt,s),a(e,Ve,s),a(e,pl,s),st[S].m(e,s),a(e,ft,s),nt[W].m(e,s),a(e,dt,s),a(e,Ze,s),a(e,cl,s),a(e,He,s),a(e,ol,s),j(Se,e,s),a(e,ml,s),j(Re,e,s),a(e,Ml,s),a(e,We,s),a(e,fl,s),a(e,Be,s),a(e,dl,s),a(e,Le,s),a(e,yl,s),j(q,e,s),a(e,bl,s),j(Fe,e,s),a(e,Tl,s),a(e,bt,s),Jl=!0},p(e,[s]){const Gs={};s&1&&(Gs.fw=e[0]),o.$set(Gs);let Ul=$;$=bs(e),$!==Ul&&(F(),m(Pe[Ul],1,1,()=>{Pe[Ul]=null}),L(),_=Pe[$],_||(_=Pe[$]=ys[$](e),_.c()),M(_,1),_.m(at.parentNode,at));const Vs={};s&2&&(Vs.$$scope={dirty:s,ctx:e}),P.$set(Vs);let wl=C;C=Js(e),C!==wl&&(F(),m(Xe[wl],1,1,()=>{Xe[wl]=null}),L(),k=Xe[C],k||(k=Xe[C]=Ts[C](e),k.c()),M(k,1),k.m(rt.parentNode,rt));let hl=I;I=Us(e),I!==hl&&(F(),m(Ye[hl],1,1,()=>{Ye[hl]=null}),L(),g=Ye[I],g||(g=Ye[I]=js[I](e),g.c()),M(g,1),g.m(it.parentNode,it));let $l=v;v=hs(e),v!==$l&&(F(),m(qe[$l],1,1,()=>{qe[$l]=null}),L(),A=qe[v],A||(A=qe[v]=ws[v](e),A.c()),M(A,1),A.m(ut.parentNode,ut));let _l=x;x=_s(e),x!==_l&&(F(),m(Ke[_l],1,1,()=>{Ke[_l]=null}),L(),z=Ke[x],z||(z=Ke[x]=$s[x](e),z.c()),M(z,1),z.m(pt.parentNode,pt));let Cl=D;D=ks(e),D!==Cl&&(F(),m(Oe[Cl],1,1,()=>{Oe[Cl]=null}),L(),Q=Oe[D],Q||(Q=Oe[D]=Cs[D](e),Q.c()),M(Q,1),Q.m(ct.parentNode,ct));let kl=N;N=gs(e),N!==kl&&(F(),m(et[kl],1,1,()=>{et[kl]=null}),L(),E=et[N],E||(E=et[N]=Is[N](e),E.c()),M(E,1),E.m(ot.parentNode,ot));let Il=G;G=As(e),G!==Il&&(F(),m(tt[Il],1,1,()=>{tt[Il]=null}),L(),V=tt[G],V||(V=tt[G]=vs[G](e),V.c()),M(V,1),V.m(mt.parentNode,mt));let gl=Z;Z=zs(e),Z!==gl&&(F(),m(lt[gl],1,1,()=>{lt[gl]=null}),L(),H=lt[Z],H||(H=lt[Z]=xs[Z](e),H.c()),M(H,1),H.m(Mt.parentNode,Mt));let vl=S;S=Qs(e),S!==vl&&(F(),m(st[vl],1,1,()=>{st[vl]=null}),L(),R=st[S],R||(R=st[S]=Ds[S](e),R.c()),M(R,1),R.m(ft.parentNode,ft));let Al=W;W=Es(e),W!==Al&&(F(),m(nt[Al],1,1,()=>{nt[Al]=null}),L(),B=nt[W],B||(B=nt[W]=Ns[W](e),B.c()),M(B,1),B.m(dt.parentNode,dt));const Zs={};s&2&&(Zs.$$scope={dirty:s,ctx:e}),q.$set(Zs)},i(e){Jl||(M(o.$$.fragment,e),M(w.$$.fragment,e),M(K.$$.fragment,e),M(_),M(P.$$.fragment,e),M(k),M(ee.$$.fragment,e),M(le.$$.fragment,e),M(ae.$$.fragment,e),M(ce.$$.fragment,e),M(g),M(A),M(ye.$$.fragment,e),M(z),M(Ue.$$.fragment,e),M(Q),M(ke.$$.fragment,e),M(E),M(De.$$.fragment,e),M(V),M(Ne.$$.fragment,e),M(Ge.$$.fragment,e),M(H),M(R),M(B),M(Se.$$.fragment,e),M(Re.$$.fragment,e),M(q.$$.fragment,e),M(Fe.$$.fragment,e),Jl=!0)},o(e){m(o.$$.fragment,e),m(w.$$.fragment,e),m(K.$$.fragment,e),m(_),m(P.$$.fragment,e),m(k),m(ee.$$.fragment,e),m(le.$$.fragment,e),m(ae.$$.fragment,e),m(ce.$$.fragment,e),m(g),m(A),m(ye.$$.fragment,e),m(z),m(Ue.$$.fragment,e),m(Q),m(ke.$$.fragment,e),m(E),m(De.$$.fragment,e),m(V),m(Ne.$$.fragment,e),m(Ge.$$.fragment,e),m(H),m(R),m(B),m(Se.$$.fragment,e),m(Re.$$.fragment,e),m(q.$$.fragment,e),m(Fe.$$.fragment,e),Jl=!1},d(e){e&&(n(r),n(t),n(u),n(i),n(Tt),n(Jt),n(at),n(jt),n(rt),n(O),n(Ut),n(wt),n(te),n(ht),n($t),n(se),n(_t),n(X),n(Ct),n(ne),n(kt),n(It),n(re),n(gt),n(ie),n(vt),n(ue),n(At),n(pe),n(xt),n(zt),n(oe),n(Dt),n(me),n(Qt),n(Me),n(Nt),n(it),n(fe),n(Et),n(ut),n(de),n(Gt),n(Vt),n(pt),n(be),n(Zt),n(Te),n(Ht),n(Je),n(St),n(je),n(Rt),n(Wt),n(we),n(Bt),n(he),n(Lt),n($e),n(Ft),n(_e),n(Pt),n(ct),n(Ce),n(Xt),n(Yt),n(Ie),n(qt),n(Y),n(Kt),n(ge),n(Ot),n(ve),n(el),n(Ae),n(tl),n(xe),n(ll),n(ot),n(ze),n(sl),n(nl),n(mt),n(Qe),n(al),n(rl),n(Ee),n(il),n(ul),n(Mt),n(Ve),n(pl),n(ft),n(dt),n(Ze),n(cl),n(He),n(ol),n(ml),n(Ml),n(We),n(fl),n(Be),n(dl),n(Le),n(yl),n(bl),n(Tl),n(bt)),n(l),U(o,e),U(w,e),U(K,e),Pe[$].d(e),U(P,e),Xe[C].d(e),U(ee,e),U(le,e),U(ae,e),U(ce,e),Ye[I].d(e),qe[v].d(e),U(ye,e),Ke[x].d(e),U(Ue,e),Oe[D].d(e),U(ke,e),et[N].d(e),U(De,e),tt[G].d(e),U(Ne,e),U(Ge,e),lt[Z].d(e),st[S].d(e),nt[W].d(e),U(Se,e),U(Re,e),U(q,e),U(Fe,e)}}}const gn='{"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 vn(f,l,r){let t="pt";return Ls(()=>{const u=new URLSearchParams(window.location.search);r(0,t=u.get("fw")||"pt")}),[t]}class Vn extends Ps{constructor(l){super(),Xs(this,l,vn,In,Bs,{})}}export{Vn as component};
