import{D as fs,S as De,i as Me,s as Ae,O as x,P as q,a as c,d as o,b as n,g as v,G as s,L as be,t as u,h as d,e as g,w as L,k as y,c as $,x as B,m as D,y as F,Q as ja,q as C,o as M,B as H,n as rt,p as lt,Y as ps,v as cs,Z as Wt,X as us,V as ds,F as jt,H as zt,I as Ct,J as xt,M as ms}from"../../chunks/vendor-hf-doc-builder.js";import{T as kt}from"../../chunks/Tip-hf-doc-builder.js";import{Y as hs}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Ut,C as we}from"../../chunks/CodeBlock-hf-doc-builder.js";var xe=(f=>(f.OPEN="OPEN",f.CLOSED="CLOSED",f.HASHASHLINK="HASHASHLINK",f))(xe||{});const ka={};function _s(f){return ka[f]||(ka[f]=fs("OPEN")),ka[f]}function gs(f){let e,r,t,a,i,p;return{c(){e=x("svg"),r=x("defs"),t=x("clipPath"),a=x("rect"),i=x("g"),p=x("path"),this.h()},l(m){e=q(m,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var _=c(e);r=q(_,"defs",{});var w=c(r);t=q(w,"clipPath",{id:!0});var b=c(t);a=q(b,"rect",{x:!0,y:!0,width:!0,height:!0,fill:!0}),c(a).forEach(o),b.forEach(o),w.forEach(o),i=q(_,"g",{"clip-path":!0});var E=c(i);p=q(E,"path",{d:!0,fill:!0}),c(p).forEach(o),E.forEach(o),_.forEach(o),this.h()},h(){n(a,"x","3.05"),n(a,"y","0.5"),n(a,"width","25.73"),n(a,"height","31"),n(a,"fill","none"),n(t,"id","a"),n(p,"d","M24.94,9.51a12.81,12.81,0,0,1,0,18.16,12.68,12.68,0,0,1-18,0,12.81,12.81,0,0,1,0-18.16l9-9V5l-.84.83-6,6a9.58,9.58,0,1,0,13.55,0ZM20.44,9a1.68,1.68,0,1,1,1.67-1.67A1.68,1.68,0,0,1,20.44,9Z"),n(p,"fill","#ee4c2c"),n(i,"clip-path","url(#a)"),n(e,"class",f[0]),n(e,"xmlns","http://www.w3.org/2000/svg"),n(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),n(e,"aria-hidden","true"),n(e,"focusable","false"),n(e,"role","img"),n(e,"width","1em"),n(e,"height","1em"),n(e,"preserveAspectRatio","xMidYMid meet"),n(e,"viewBox","0 0 32 32")},m(m,_){v(m,e,_),s(e,r),s(r,t),s(t,a),s(e,i),s(i,p)},p(m,[_]){_&1&&n(e,"class",m[0])},i:be,o:be,d(m){m&&o(e)}}}function $s(f,e,r){let{classNames:t=""}=e;return f.$$set=a=>{"classNames"in a&&r(0,t=a.classNames)},[t]}class vs extends De{constructor(e){super();Me(this,e,$s,gs,Ae,{classNames:0})}}function ws(f){let e,r,t,a;return{c(){e=x("svg"),r=x("path"),t=x("path"),a=x("path"),this.h()},l(i){e=q(i,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var p=c(e);r=q(p,"path",{d:!0,fill:!0}),c(r).forEach(o),t=q(p,"path",{d:!0,fill:!0}),c(t).forEach(o),a=q(p,"path",{d:!0,fill:!0}),c(a).forEach(o),p.forEach(o),this.h()},h(){n(r,"d","M145.726 42.065v42.07l72.861 42.07v-42.07l-72.86-42.07zM0 84.135v42.07l36.43 21.03V105.17L0 84.135zm109.291 21.035l-36.43 21.034v126.2l36.43 21.035v-84.135l36.435 21.035v-42.07l-36.435-21.034V105.17z"),n(r,"fill","#E55B2D"),n(t,"d","M145.726 42.065L36.43 105.17v42.065l72.861-42.065v42.065l36.435-21.03v-84.14zM255.022 63.1l-36.435 21.035v42.07l36.435-21.035V63.1zm-72.865 84.135l-36.43 21.035v42.07l36.43-21.036v-42.07zm-36.43 63.104l-36.436-21.035v84.135l36.435-21.035V210.34z"),n(t,"fill","#ED8E24"),n(a,"d","M145.726 0L0 84.135l36.43 21.035l109.296-63.105l72.861 42.07L255.022 63.1L145.726 0zm0 126.204l-36.435 21.03l36.435 21.036l36.43-21.035l-36.43-21.03z"),n(a,"fill","#F8BF3C"),n(e,"class",f[0]),n(e,"xmlns","http://www.w3.org/2000/svg"),n(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),n(e,"aria-hidden","true"),n(e,"focusable","false"),n(e,"role","img"),n(e,"width","0.94em"),n(e,"height","1em"),n(e,"preserveAspectRatio","xMidYMid meet"),n(e,"viewBox","0 0 256 274")},m(i,p){v(i,e,p),s(e,r),s(e,t),s(e,a)},p(i,[p]){p&1&&n(e,"class",i[0])},i:be,o:be,d(i){i&&o(e)}}}function bs(f,e,r){let{classNames:t=""}=e;return f.$$set=a=>{"classNames"in a&&r(0,t=a.classNames)},[t]}class Es extends De{constructor(e){super();Me(this,e,bs,ws,Ae,{classNames:0})}}function ks(f){let e,r,t,a,i,p,m,_,w,b,E,P,N,O,W,K,S,I,Y,ee,z,V,J,R,G,de,Q,oe,te,le,ne,ie,Z,ce,ae,me,k,A,fe,X,pe;return{c(){e=x("svg"),r=x("style"),t=u(`.J {
			stroke: #dce0df;
		}
		.K {
			stroke-linejoin: round;
		}
	`),a=x("g"),i=x("path"),p=x("path"),m=x("path"),_=x("path"),w=x("path"),b=x("path"),E=x("path"),P=x("path"),N=x("g"),O=x("path"),W=x("path"),K=x("path"),S=x("g"),I=x("path"),Y=x("path"),ee=x("path"),z=x("g"),V=x("path"),J=x("path"),R=x("g"),G=x("path"),de=x("path"),Q=x("path"),oe=x("path"),te=x("path"),le=x("path"),ne=x("path"),ie=x("path"),Z=x("g"),ce=x("path"),ae=x("path"),me=x("path"),k=x("path"),A=x("g"),fe=x("path"),X=x("path"),pe=x("path"),this.h()},l(se){e=q(se,"svg",{class:!0,xmlns:!0,"xmlns:xlink":!0,"aria-hidden":!0,focusable:!0,role:!0,width:!0,height:!0,preserveAspectRatio:!0,viewBox:!0});var U=c(e);r=q(U,"style",{});var ge=c(r);t=d(ge,`.J {
			stroke: #dce0df;
		}
		.K {
			stroke-linejoin: round;
		}
	`),ge.forEach(o),a=q(U,"g",{fill:!0,class:!0});var re=c(a);i=q(re,"path",{d:!0}),c(i).forEach(o),p=q(re,"path",{d:!0}),c(p).forEach(o),m=q(re,"path",{d:!0}),c(m).forEach(o),_=q(re,"path",{d:!0}),c(_).forEach(o),w=q(re,"path",{d:!0}),c(w).forEach(o),b=q(re,"path",{d:!0}),c(b).forEach(o),E=q(re,"path",{d:!0}),c(E).forEach(o),P=q(re,"path",{d:!0}),c(P).forEach(o),re.forEach(o),N=q(U,"g",{fill:!0,class:!0});var he=c(N);O=q(he,"path",{d:!0}),c(O).forEach(o),W=q(he,"path",{d:!0}),c(W).forEach(o),K=q(he,"path",{d:!0}),c(K).forEach(o),he.forEach(o),S=q(U,"g",{fill:!0,class:!0});var ue=c(S);I=q(ue,"path",{d:!0}),c(I).forEach(o),Y=q(ue,"path",{d:!0}),c(Y).forEach(o),ue.forEach(o),ee=q(U,"path",{d:!0,fill:!0,class:!0}),c(ee).forEach(o),z=q(U,"g",{fill:!0,class:!0});var _e=c(z);V=q(_e,"path",{d:!0}),c(V).forEach(o),J=q(_e,"path",{d:!0}),c(J).forEach(o),_e.forEach(o),R=q(U,"g",{fill:!0,class:!0});var h=c(R);G=q(h,"path",{d:!0}),c(G).forEach(o),de=q(h,"path",{d:!0}),c(de).forEach(o),Q=q(h,"path",{d:!0}),c(Q).forEach(o),oe=q(h,"path",{d:!0}),c(oe).forEach(o),te=q(h,"path",{d:!0}),c(te).forEach(o),le=q(h,"path",{d:!0}),c(le).forEach(o),ne=q(h,"path",{d:!0}),c(ne).forEach(o),h.forEach(o),ie=q(U,"path",{d:!0,fill:!0,class:!0}),c(ie).forEach(o),Z=q(U,"g",{fill:!0,class:!0});var T=c(Z);ce=q(T,"path",{d:!0}),c(ce).forEach(o),ae=q(T,"path",{d:!0}),c(ae).forEach(o),me=q(T,"path",{d:!0}),c(me).forEach(o),k=q(T,"path",{d:!0}),c(k).forEach(o),T.forEach(o),A=q(U,"g",{fill:!0,class:!0});var $e=c(A);fe=q($e,"path",{d:!0}),c(fe).forEach(o),X=q($e,"path",{d:!0}),c(X).forEach(o),pe=q($e,"path",{d:!0}),c(pe).forEach(o),$e.forEach(o),U.forEach(o),this.h()},h(){n(i,"d","M50.5 130.4l-25 43.31h50l25-43.31h-50z"),n(p,"d","M.5 217.01l25-43.3h50l-25 43.3H.5z"),n(m,"d","M125.5 173.71h-50l-25 43.3h50l25-43.3z"),n(_,"d","M175.5 173.71h-50l-25 43.3h50l25-43.3z"),n(w,"d","M150.5 130.4l-25 43.31h50l25-43.31h-50z"),n(b,"d","M175.5 87.1l-25 43.3h50l25-43.3h-50z"),n(E,"d","M200.5 43.8l-25 43.3h50l25-43.3h-50z"),n(P,"d","M225.5.5l-25 43.3h50l25-43.3h-50z"),n(a,"fill","#5e97f6"),n(a,"class","J K"),n(O,"d","M.5 217.01l25 43.3h50l-25-43.3H.5z"),n(W,"d","M125.5 260.31h-50l-25-43.3h50l25 43.3z"),n(K,"d","M175.5 260.31h-50l-25-43.3h50l25 43.3z"),n(N,"fill","#2a56c6"),n(N,"class","J K"),n(I,"d","M200.5 217.01l-25-43.3-25 43.3 25 43.3 25-43.3zm50-86.61l-25-43.3-25 43.3h50z"),n(Y,"d","M250.5 43.8l-25 43.3 25 43.3 25-43.3-25-43.3z"),n(S,"fill","#00796b"),n(S,"class","J K"),n(ee,"d","M125.5 173.71l-25-43.31-25 43.31h50z"),n(ee,"fill","#3367d6"),n(ee,"class","J K"),n(V,"d","M250.5 130.4h-50l-25 43.31h50l25-43.31z"),n(J,"d","M300.5 130.4h-50l-25 43.31h50l25-43.31z"),n(z,"fill","#26a69a"),n(z,"class","J K"),n(G,"d","M350.5 43.8L325.5.5l-25 43.3 25 43.3 25-43.3z"),n(de,"d","M375.5 87.1l-25-43.3-25 43.3 25 43.3 25-43.3z"),n(Q,"d","M400.5 130.4l-25-43.3-25 43.3 25 43.31 25-43.31z"),n(oe,"d","M425.5 173.71l-25-43.31-25 43.31 25 43.3 25-43.3z"),n(te,"d","M450.5 217.01l-25-43.3-25 43.3 25 43.3 25-43.3zM425.5.5l-25 43.3 25 43.3 25-43.3-25-43.3z"),n(le,"d","M375.5 87.1l25-43.3 25 43.3-25 43.3-25-43.3zm-25 43.3l-25 43.31 25 43.3 25-43.3-25-43.31z"),n(ne,"d","M325.5 260.31l-25-43.3 25-43.3 25 43.3-25 43.3z"),n(R,"fill","#9c27b0"),n(R,"class","J K"),n(ie,"d","M275.5 260.31l-25-43.3h50l25 43.3h-50z"),n(ie,"fill","#6a1b9a"),n(ie,"class","J K"),n(ce,"d","M225.5 173.71h-50l25 43.3h50l-25-43.3z"),n(ae,"d","M275.5 173.71h-50l25 43.3 25-43.3zm0-86.61l25 43.3h50l-25-43.3h-50z"),n(me,"d","M300.5 43.8h-50l25 43.3h50l-25-43.3zm125 216.51l-25-43.3h-50l25 43.3h50z"),n(k,"d","M375.5 173.71l-25 43.3h50l-25-43.3z"),n(Z,"fill","#00695c"),n(Z,"class","J K"),n(fe,"d","M325.5.5h-50l-25 43.3h50l25-43.3zm0 173.21h-50l-25 43.3h50l25-43.3z"),n(X,"d","M350.5 130.4h-50l-25 43.31h50l25-43.31zM425.5.5h-50l-25 43.3h50l25-43.3z"),n(pe,"d","M375.5 87.1l-25-43.3h50l-25 43.3z"),n(A,"fill","#ea80fc"),n(A,"class","J K"),n(e,"class",f[0]),n(e,"xmlns","http://www.w3.org/2000/svg"),n(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),n(e,"aria-hidden","true"),n(e,"focusable","false"),n(e,"role","img"),n(e,"width","1.73em"),n(e,"height","1em"),n(e,"preserveAspectRatio","xMidYMid meet"),n(e,"viewBox","0 0 451 260.81")},m(se,U){v(se,e,U),s(e,r),s(r,t),s(e,a),s(a,i),s(a,p),s(a,m),s(a,_),s(a,w),s(a,b),s(a,E),s(a,P),s(e,N),s(N,O),s(N,W),s(N,K),s(e,S),s(S,I),s(S,Y),s(e,ee),s(e,z),s(z,V),s(z,J),s(e,R),s(R,G),s(R,de),s(R,Q),s(R,oe),s(R,te),s(R,le),s(R,ne),s(e,ie),s(e,Z),s(Z,ce),s(Z,ae),s(Z,me),s(Z,k),s(e,A),s(A,fe),s(A,X),s(A,pe)},p(se,[U]){U&1&&n(e,"class",se[0])},i:be,o:be,d(se){se&&o(e)}}}function js(f,e,r){let{classNames:t=""}=e;return f.$$set=a=>{"classNames"in a&&r(0,t=a.classNames)},[t]}class zs extends De{constructor(e){super();Me(this,e,js,ks,Ae,{classNames:0})}}function Cs(f){let e,r;return{c(){e=x("svg"),r=x("path"),this.h()},l(t){e=q(t,"svg",{class:!0,width:!0,height:!0,viewBox:!0,fill:!0,xmlns:!0});var a=c(e);r=q(a,"path",{d:!0,fill:!0}),c(r).forEach(o),a.forEach(o),this.h()},h(){n(r,"d","M0 4.50001C0.390979 2.37042 2.25728 0.756592 4.5 0.756592C6.74272 0.756592 8.60861 2.37042 9 4.50001C8.60902 6.62959 6.74272 8.24342 4.5 8.24342C2.25728 8.24342 0.391395 6.62959 0 4.50001ZM4.5 6.57968C5.05156 6.57968 5.58054 6.36057 5.97055 5.97056C6.36057 5.58054 6.57967 5.05157 6.57967 4.50001C6.57967 3.94844 6.36057 3.41947 5.97055 3.02945C5.58054 2.63944 5.05156 2.42033 4.5 2.42033C3.94844 2.42033 3.41946 2.63944 3.02945 3.02945C2.63943 3.41947 2.42033 3.94844 2.42033 4.50001C2.42033 5.05157 2.63943 5.58054 3.02945 5.97056C3.41946 6.36057 3.94844 6.57968 4.5 6.57968ZM4.5 5.74781C4.16906 5.74781 3.85168 5.61635 3.61767 5.38234C3.38366 5.14833 3.2522 4.83094 3.2522 4.50001C3.2522 4.16907 3.38366 3.85168 3.61767 3.61767C3.85168 3.38367 4.16906 3.2522 4.5 3.2522C4.83094 3.2522 5.14832 3.38367 5.38233 3.61767C5.61634 3.85168 5.7478 4.16907 5.7478 4.50001C5.7478 4.83094 5.61634 5.14833 5.38233 5.38234C5.14832 5.61635 4.83094 5.74781 4.5 5.74781Z"),n(r,"fill","currentColor"),n(e,"class",f[0]),n(e,"width",f[1]),n(e,"height",f[1]),n(e,"viewBox","0 0 9 9"),n(e,"fill","currentColor"),n(e,"xmlns","http://www.w3.org/2000/svg")},m(t,a){v(t,e,a),s(e,r)},p(t,[a]){a&1&&n(e,"class",t[0]),a&2&&n(e,"width",t[1]),a&2&&n(e,"height",t[1])},i:be,o:be,d(t){t&&o(e)}}}function xs(f,e,r){let{classNames:t=""}=e,{size:a="1em"}=e;return f.$$set=i=>{"classNames"in i&&r(0,t=i.classNames),"size"in i&&r(1,a=i.size)},[t,a]}class qs extends De{constructor(e){super();Me(this,e,xs,Cs,Ae,{classNames:0,size:1})}}function ys(f){let e,r;return{c(){e=x("svg"),r=x("path"),this.h()},l(t){e=q(t,"svg",{class:!0,width:!0,height:!0,viewBox:!0,fill:!0,xmlns:!0});var a=c(e);r=q(a,"path",{d:!0,fill:!0}),c(r).forEach(o),a.forEach(o),this.h()},h(){n(r,"d","M1.39125 1.9725L0.0883333 0.669997L0.677917 0.0804138L8.9275 8.33041L8.33792 8.91958L6.95875 7.54041C6.22592 8.00523 5.37572 8.25138 4.50792 8.25C2.26125 8.25 0.392083 6.63333 0 4.5C0.179179 3.52946 0.667345 2.64287 1.39167 1.9725H1.39125ZM5.65667 6.23833L5.04667 5.62833C4.81335 5.73996 4.55116 5.77647 4.29622 5.73282C4.04129 5.68918 3.80617 5.56752 3.62328 5.38463C3.44039 5.20175 3.31874 4.96663 3.27509 4.71169C3.23144 4.45676 3.26795 4.19456 3.37958 3.96125L2.76958 3.35125C2.50447 3.75187 2.38595 4.2318 2.4341 4.70978C2.48225 5.18777 2.6941 5.63442 3.0338 5.97411C3.37349 6.31381 3.82015 6.52567 4.29813 6.57382C4.77611 6.62197 5.25605 6.50345 5.65667 6.23833ZM2.83042 1.06666C3.35 0.862497 3.91625 0.749997 4.50792 0.749997C6.75458 0.749997 8.62375 2.36666 9.01583 4.5C8.88816 5.19404 8.60119 5.84899 8.1775 6.41333L6.56917 4.805C6.61694 4.48317 6.58868 4.15463 6.48664 3.84569C6.3846 3.53675 6.21162 3.256 5.98156 3.02594C5.7515 2.79588 5.47075 2.6229 5.16181 2.52086C4.85287 2.41882 4.52433 2.39056 4.2025 2.43833L2.83042 1.06708V1.06666Z"),n(r,"fill","currentColor"),n(e,"class",f[0]),n(e,"width",f[1]),n(e,"height",f[1]),n(e,"viewBox","0 0 10 9"),n(e,"fill","currentColor"),n(e,"xmlns","http://www.w3.org/2000/svg")},m(t,a){v(t,e,a),s(e,r)},p(t,[a]){a&1&&n(e,"class",t[0]),a&2&&n(e,"width",t[1]),a&2&&n(e,"height",t[1])},i:be,o:be,d(t){t&&o(e)}}}function Ds(f,e,r){let{classNames:t=""}=e,{size:a="1em"}=e;return f.$$set=i=>{"classNames"in i&&r(0,t=i.classNames),"size"in i&&r(1,a=i.size)},[t,a]}class Ms extends De{constructor(e){super();Me(this,e,Ds,ys,Ae,{classNames:0,size:1})}}const{window:As}=us;function ts(f){let e,r,t,a,i,p,m,_,w,b;return r=new Ms({props:{size:"0.9em"}}),{c(){e=g("div"),L(r.$$.fragment),t=y(),a=g("span"),i=u("Hide "),p=u(f[3]),m=u(" content"),this.h()},l(E){e=$(E,"DIV",{class:!0});var P=c(e);B(r.$$.fragment,P),t=D(P),a=$(P,"SPAN",{});var N=c(a);i=d(N,"Hide "),p=d(N,f[3]),m=d(N," content"),N.forEach(o),P.forEach(o),this.h()},h(){n(e,"class","cursor-pointer flex items-center justify-center space-x-1 text-sm px-2 bg-white dark:bg-gray-950 hover:underline leading-none")},m(E,P){v(E,e,P),F(r,e,null),s(e,t),s(e,a),s(a,i),s(a,p),s(a,m),_=!0,w||(b=ja(e,"click",f[5]),w=!0)},p:be,i(E){_||(C(r.$$.fragment,E),_=!0)},o(E){M(r.$$.fragment,E),_=!1},d(E){E&&o(e),H(r),w=!1,b()}}}function Ps(f){let e,r;const t=f[10].default,a=jt(t,f,f[9],null);return{c(){e=g("div"),a&&a.c(),this.h()},l(i){e=$(i,"DIV",{class:!0});var p=c(e);a&&a.l(p),p.forEach(o),this.h()},h(){n(e,"class","framework-content")},m(i,p){v(i,e,p),a&&a.m(e,null),r=!0},p(i,p){a&&a.p&&(!r||p&512)&&zt(a,t,i,i[9],r?xt(t,i[9],p,null):Ct(i[9]),null)},i(i){r||(C(a,i),r=!0)},o(i){M(a,i),r=!1},d(i){i&&o(e),a&&a.d(i)}}}function Ss(f){let e,r,t,a,i,p,m,_,w,b;return r=new qs({props:{size:"0.9em"}}),{c(){e=g("div"),L(r.$$.fragment),t=y(),a=g("span"),i=u("Show "),p=u(f[3]),m=u(" content"),this.h()},l(E){e=$(E,"DIV",{class:!0});var P=c(e);B(r.$$.fragment,P),t=D(P),a=$(P,"SPAN",{});var N=c(a);i=d(N,"Show "),p=d(N,f[3]),m=d(N," content"),N.forEach(o),P.forEach(o),this.h()},h(){n(e,"class","cursor-pointer mt-[-12.5px] flex items-center justify-center space-x-1 py-4 text-sm hover:underline leading-none")},m(E,P){v(E,e,P),F(r,e,null),s(e,t),s(e,a),s(a,i),s(a,p),s(a,m),_=!0,w||(b=ja(e,"click",f[5]),w=!0)},p:be,i(E){_||(C(r.$$.fragment,E),_=!0)},o(E){M(r.$$.fragment,E),_=!1},d(E){E&&o(e),H(r),w=!1,b()}}}function Ts(f){let e,r,t,a,i,p,m,_,w,b,E,P,N,O;var W=f[2];function K(z){return{}}W&&(a=new W(K()));let S=!f[1]&&ts(f);const I=[Ss,Ps],Y=[];function ee(z,V){return z[1]?0:1}return b=ee(f),E=Y[b]=I[b](f),{c(){e=g("div"),r=g("div"),t=g("div"),a&&L(a.$$.fragment),i=y(),p=g("span"),m=u(f[3]),_=y(),S&&S.c(),w=y(),E.c(),this.h()},l(z){e=$(z,"DIV",{class:!0});var V=c(e);r=$(V,"DIV",{class:!0});var J=c(r);t=$(J,"DIV",{class:!0});var R=c(t);a&&B(a.$$.fragment,R),i=D(R),p=$(R,"SPAN",{});var G=c(p);m=d(G,f[3]),G.forEach(o),R.forEach(o),_=D(J),S&&S.l(J),J.forEach(o),w=D(V),E.l(V),V.forEach(o),this.h()},h(){n(t,"class","flex px-1 items-center space-x-1 bg-white dark:bg-gray-950"),n(r,"class","flex h-[22px] mt-[-12.5px] justify-between leading-none"),n(e,"class","border border-gray-200 rounded-xl px-4 relative")},m(z,V){v(z,e,V),s(e,r),s(r,t),a&&F(a,t,null),s(t,i),s(t,p),s(p,m),s(r,_),S&&S.m(r,null),s(e,w),Y[b].m(e,null),f[11](e),P=!0,N||(O=ja(As,"hashchange",f[6]),N=!0)},p(z,[V]){if(W!==(W=z[2])){if(a){rt();const R=a;M(R.$$.fragment,1,0,()=>{H(R,1)}),lt()}W?(a=new W(K()),L(a.$$.fragment),C(a.$$.fragment,1),F(a,t,i)):a=null}z[1]?S&&(rt(),M(S,1,1,()=>{S=null}),lt()):S?(S.p(z,V),V&2&&C(S,1)):(S=ts(z),S.c(),C(S,1),S.m(r,null));let J=b;b=ee(z),b===J?Y[b].p(z,V):(rt(),M(Y[J],1,1,()=>{Y[J]=null}),lt(),E=Y[b],E?E.p(z,V):(E=Y[b]=I[b](z),E.c()),C(E,1),E.m(e,null))},i(z){P||(a&&C(a.$$.fragment,z),C(S),C(E),P=!0)},o(z){a&&M(a.$$.fragment,z),M(S),M(E),P=!1},d(z){z&&o(e),a&&H(a),S&&S.d(),Y[b].d(),f[11](null),N=!1,O()}}}function Ns(f,e,r){let t,a,{$$slots:i={},$$scope:p}=e,{framework:m}=e,_,w=new Set;const b={pytorch:{Icon:vs,label:"Pytorch"},tensorflow:{Icon:Es,label:"TensorFlow"},jax:{Icon:zs,label:"JAX"}},{Icon:E,label:P}=b[m],N=`hf_doc_framework_${m}_is_hidden`,O=_s(m);ps(f,O,I=>r(8,a=I));function W(){Wt(O,a=a!==xe.CLOSED?xe.CLOSED:xe.OPEN,a),localStorage.setItem(N,a)}function K(){const I=window.location.hash.slice(1);w.has(I)&&(Wt(O,a=xe.HASHASHLINK,a),localStorage.setItem(N,a))}cs(()=>{const I=window.location.hash.slice(1),Y="header-link",ee=_.querySelectorAll(`.${Y}`);w=new Set([...ee].map(V=>V.id));const z=localStorage.getItem(N);w.has(I)?Wt(O,a=xe.HASHASHLINK,a):z===xe.CLOSED&&a!==xe.HASHASHLINK&&Wt(O,a=xe.CLOSED,a)});function S(I){ds[I?"unshift":"push"](()=>{_=I,r(0,_)})}return f.$$set=I=>{"framework"in I&&r(7,m=I.framework),"$$scope"in I&&r(9,p=I.$$scope)},f.$$.update=()=>{f.$$.dirty&256&&r(1,t=a===xe.CLOSED)},[_,t,E,P,O,W,K,m,a,p,i,S]}class za extends De{constructor(e){super();Me(this,e,Ns,Ts,Ae,{framework:7})}}const Is=f=>({}),as=f=>({}),Os=f=>({}),ss=f=>({}),Ls=f=>({}),os=f=>({});function rs(f){let e,r;return e=new za({props:{framework:"pytorch",$$slots:{default:[Fs]},$$scope:{ctx:f}}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p(t,a){const i={};a&16&&(i.$$scope={dirty:a,ctx:t}),e.$set(i)},i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function Fs(f){let e;const r=f[3].pytorch,t=jt(r,f,f[4],os);return{c(){t&&t.c()},l(a){t&&t.l(a)},m(a,i){t&&t.m(a,i),e=!0},p(a,i){t&&t.p&&(!e||i&16)&&zt(t,r,a,a[4],e?xt(r,a[4],i,Ls):Ct(a[4]),os)},i(a){e||(C(t,a),e=!0)},o(a){M(t,a),e=!1},d(a){t&&t.d(a)}}}function ls(f){let e,r;return e=new za({props:{framework:"tensorflow",$$slots:{default:[Hs]},$$scope:{ctx:f}}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p(t,a){const i={};a&16&&(i.$$scope={dirty:a,ctx:t}),e.$set(i)},i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function Hs(f){let e;const r=f[3].tensorflow,t=jt(r,f,f[4],ss);return{c(){t&&t.c()},l(a){t&&t.l(a)},m(a,i){t&&t.m(a,i),e=!0},p(a,i){t&&t.p&&(!e||i&16)&&zt(t,r,a,a[4],e?xt(r,a[4],i,Os):Ct(a[4]),ss)},i(a){e||(C(t,a),e=!0)},o(a){M(t,a),e=!1},d(a){t&&t.d(a)}}}function ns(f){let e,r;return e=new za({props:{framework:"jax",$$slots:{default:[Bs]},$$scope:{ctx:f}}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p(t,a){const i={};a&16&&(i.$$scope={dirty:a,ctx:t}),e.$set(i)},i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function Bs(f){let e;const r=f[3].jax,t=jt(r,f,f[4],as);return{c(){t&&t.c()},l(a){t&&t.l(a)},m(a,i){t&&t.m(a,i),e=!0},p(a,i){t&&t.p&&(!e||i&16)&&zt(t,r,a,a[4],e?xt(r,a[4],i,Is):Ct(a[4]),as)},i(a){e||(C(t,a),e=!0)},o(a){M(t,a),e=!1},d(a){t&&t.d(a)}}}function Ks(f){let e,r,t,a,i=f[0]&&rs(f),p=f[1]&&ls(f),m=f[2]&&ns(f);return{c(){e=g("div"),i&&i.c(),r=y(),p&&p.c(),t=y(),m&&m.c(),this.h()},l(_){e=$(_,"DIV",{class:!0});var w=c(e);i&&i.l(w),r=D(w),p&&p.l(w),t=D(w),m&&m.l(w),w.forEach(o),this.h()},h(){n(e,"class","space-y-10 py-6 2xl:py-8 2xl:-mx-4")},m(_,w){v(_,e,w),i&&i.m(e,null),s(e,r),p&&p.m(e,null),s(e,t),m&&m.m(e,null),a=!0},p(_,[w]){_[0]?i?(i.p(_,w),w&1&&C(i,1)):(i=rs(_),i.c(),C(i,1),i.m(e,r)):i&&(rt(),M(i,1,1,()=>{i=null}),lt()),_[1]?p?(p.p(_,w),w&2&&C(p,1)):(p=ls(_),p.c(),C(p,1),p.m(e,t)):p&&(rt(),M(p,1,1,()=>{p=null}),lt()),_[2]?m?(m.p(_,w),w&4&&C(m,1)):(m=ns(_),m.c(),C(m,1),m.m(e,null)):m&&(rt(),M(m,1,1,()=>{m=null}),lt())},i(_){a||(C(i),C(p),C(m),a=!0)},o(_){M(i),M(p),M(m),a=!1},d(_){_&&o(e),i&&i.d(),p&&p.d(),m&&m.d()}}}function Rs(f,e,r){let{$$slots:t={},$$scope:a}=e,{pytorch:i=!1}=e,{tensorflow:p=!1}=e,{jax:m=!1}=e;return f.$$set=_=>{"pytorch"in _&&r(0,i=_.pytorch),"tensorflow"in _&&r(1,p=_.tensorflow),"jax"in _&&r(2,m=_.jax),"$$scope"in _&&r(4,a=_.$$scope)},[i,p,m,t,a]}class is extends De{constructor(e){super();Me(this,e,Rs,Ks,Ae,{pytorch:0,tensorflow:1,jax:2})}}function Vs(f){let e;const r=f[1].default,t=jt(r,f,f[0],null);return{c(){t&&t.c()},l(a){t&&t.l(a)},m(a,i){t&&t.m(a,i),e=!0},p(a,[i]){t&&t.p&&(!e||i&1)&&zt(t,r,a,a[0],e?xt(r,a[0],i,null):Ct(a[0]),null)},i(a){e||(C(t,a),e=!0)},o(a){M(t,a),e=!1},d(a){t&&t.d(a)}}}function Js(f,e,r){let{$$slots:t={},$$scope:a}=e;return f.$$set=i=>{"$$scope"in i&&r(0,a=i.$$scope)},[a,t]}class Zt extends De{constructor(e){super();Me(this,e,Js,Vs,Ae,{})}}function Ws(f){let e,r,t,a,i;return{c(){e=g("p"),r=u("Consulte a "),t=g("a"),a=u("p\xE1gina de tarefas de classifica\xE7\xE3o de texto"),i=u(" para obter mais informa\xE7\xF5es sobre outras formas de classifica\xE7\xE3o de texto e seus modelos, conjuntos de dados e m\xE9tricas associados."),this.h()},l(p){e=$(p,"P",{});var m=c(e);r=d(m,"Consulte a "),t=$(m,"A",{href:!0,rel:!0});var _=c(t);a=d(_,"p\xE1gina de tarefas de classifica\xE7\xE3o de texto"),_.forEach(o),i=d(m," para obter mais informa\xE7\xF5es sobre outras formas de classifica\xE7\xE3o de texto e seus modelos, conjuntos de dados e m\xE9tricas associados."),m.forEach(o),this.h()},h(){n(t,"href","https://huggingface.co/tasks/text-classification"),n(t,"rel","nofollow")},m(p,m){v(p,e,m),s(e,r),s(e,t),s(t,a),s(e,i)},d(p){p&&o(e)}}}function Us(f){let e,r;return e=new we({props:{code:`from transformers import DataCollatorWithPadding

data_collator = DataCollatorWithPadding(tokenizer=tokenizer)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorWithPadding

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorWithPadding(tokenizer=tokenizer)`}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p:be,i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function Zs(f){let e,r;return e=new Zt({props:{$$slots:{default:[Us]},$$scope:{ctx:f}}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p(t,a){const i={};a&2&&(i.$$scope={dirty:a,ctx:t}),e.$set(i)},i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function Ys(f){let e,r;return e=new we({props:{code:`from transformers import DataCollatorWithPadding

data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors="tf")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> DataCollatorWithPadding

<span class="hljs-meta">&gt;&gt;&gt; </span>data_collator = DataCollatorWithPadding(tokenizer=tokenizer, return_tensors=<span class="hljs-string">&quot;tf&quot;</span>)`}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p:be,i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function Gs(f){let e,r;return e=new Zt({props:{$$slots:{default:[Ys]},$$scope:{ctx:f}}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p(t,a){const i={};a&2&&(i.$$scope={dirty:a,ctx:t}),e.$set(i)},i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function Qs(f){let e,r,t,a,i,p,m,_;return{c(){e=g("p"),r=u("Se voc\xEA n\xE3o estiver familiarizado com o fine-tuning de um modelo com o "),t=g("code"),a=u("Trainer"),i=u(", d\xEA uma olhada no tutorial b\xE1sico "),p=g("a"),m=u("aqui"),_=u("!"),this.h()},l(w){e=$(w,"P",{});var b=c(e);r=d(b,"Se voc\xEA n\xE3o estiver familiarizado com o fine-tuning de um modelo com o "),t=$(b,"CODE",{});var E=c(t);a=d(E,"Trainer"),E.forEach(o),i=d(b,", d\xEA uma olhada no tutorial b\xE1sico "),p=$(b,"A",{href:!0});var P=c(p);m=d(P,"aqui"),P.forEach(o),_=d(b,"!"),b.forEach(o),this.h()},h(){n(p,"href","../training#finetune-with-trainer")},m(w,b){v(w,e,b),s(e,r),s(e,t),s(t,a),s(e,i),s(e,p),s(p,m),s(e,_)},d(w){w&&o(e)}}}function Xs(f){let e,r,t,a,i,p,m,_;return{c(){e=g("p"),r=u("O "),t=g("code"),a=u("Trainer"),i=u(" aplicar\xE1 o preenchimento din\xE2mico por padr\xE3o quando voc\xEA definir o argumento "),p=g("code"),m=u("tokenizer"),_=u(" dele. Nesse caso, voc\xEA n\xE3o precisa especificar um data collator explicitamente.")},l(w){e=$(w,"P",{});var b=c(e);r=d(b,"O "),t=$(b,"CODE",{});var E=c(t);a=d(E,"Trainer"),E.forEach(o),i=d(b," aplicar\xE1 o preenchimento din\xE2mico por padr\xE3o quando voc\xEA definir o argumento "),p=$(b,"CODE",{});var P=c(p);m=d(P,"tokenizer"),P.forEach(o),_=d(b," dele. Nesse caso, voc\xEA n\xE3o precisa especificar um data collator explicitamente."),b.forEach(o)},m(w,b){v(w,e,b),s(e,r),s(e,t),s(t,a),s(e,i),s(e,p),s(p,m),s(e,_)},d(w){w&&o(e)}}}function eo(f){let e,r,t,a,i,p,m,_,w,b,E,P,N,O,W,K,S,I,Y,ee,z,V,J,R,G,de,Q,oe,te,le,ne,ie,Z,ce,ae,me;return m=new we({props:{code:`from transformers import AutoModelForSequenceClassification, TrainingArguments, Trainer

model = AutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModelForSequenceClassification, TrainingArguments, Trainer

<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, num_labels=<span class="hljs-number">2</span>)`}}),w=new kt({props:{$$slots:{default:[Qs]},$$scope:{ctx:f}}}),Z=new we({props:{code:`training_args = TrainingArguments(
    output_dir="./results",
    learning_rate=2e-5,
    per_device_train_batch_size=16,
    per_device_eval_batch_size=16,
    num_train_epochs=5,
    weight_decay=0.01,
)

trainer = Trainer(
    model=model,
    args=training_args,
    train_dataset=tokenized_imdb["train"],
    eval_dataset=tokenized_imdb["test"],
    tokenizer=tokenizer,
    data_collator=data_collator,
)

trainer.train()`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>training_args = TrainingArguments(
<span class="hljs-meta">... </span>    output_dir=<span class="hljs-string">&quot;./results&quot;</span>,
<span class="hljs-meta">... </span>    learning_rate=<span class="hljs-number">2e-5</span>,
<span class="hljs-meta">... </span>    per_device_train_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    per_device_eval_batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    num_train_epochs=<span class="hljs-number">5</span>,
<span class="hljs-meta">... </span>    weight_decay=<span class="hljs-number">0.01</span>,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer = Trainer(
<span class="hljs-meta">... </span>    model=model,
<span class="hljs-meta">... </span>    args=training_args,
<span class="hljs-meta">... </span>    train_dataset=tokenized_imdb[<span class="hljs-string">&quot;train&quot;</span>],
<span class="hljs-meta">... </span>    eval_dataset=tokenized_imdb[<span class="hljs-string">&quot;test&quot;</span>],
<span class="hljs-meta">... </span>    tokenizer=tokenizer,
<span class="hljs-meta">... </span>    data_collator=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>trainer.train()`}}),ae=new kt({props:{$$slots:{default:[Xs]},$$scope:{ctx:f}}}),{c(){e=g("p"),r=u("Carregue o DistilBERT com "),t=g("code"),a=u("AutoModelForSequenceClassification"),i=u(" junto com o n\xFAmero de r\xF3tulos esperados:"),p=y(),L(m.$$.fragment),_=y(),L(w.$$.fragment),b=y(),E=g("p"),P=u("Nesse ponto, restam apenas tr\xEAs passos:"),N=y(),O=g("ol"),W=g("li"),K=u("Definir seus hiperpar\xE2metros de treinamento em "),S=g("code"),I=u("TrainingArguments"),Y=u("."),ee=y(),z=g("li"),V=u("Passar os argumentos de treinamento para o "),J=g("code"),R=u("Trainer"),G=u(" junto com o modelo, conjunto de dados, tokenizador e o data collator."),de=y(),Q=g("li"),oe=u("Chamar a fun\xE7\xE3o "),te=g("code"),le=u("train()"),ne=u(" para executar o fine-tuning do seu modelo."),ie=y(),L(Z.$$.fragment),ce=y(),L(ae.$$.fragment)},l(k){e=$(k,"P",{});var A=c(e);r=d(A,"Carregue o DistilBERT com "),t=$(A,"CODE",{});var fe=c(t);a=d(fe,"AutoModelForSequenceClassification"),fe.forEach(o),i=d(A," junto com o n\xFAmero de r\xF3tulos esperados:"),A.forEach(o),p=D(k),B(m.$$.fragment,k),_=D(k),B(w.$$.fragment,k),b=D(k),E=$(k,"P",{});var X=c(E);P=d(X,"Nesse ponto, restam apenas tr\xEAs passos:"),X.forEach(o),N=D(k),O=$(k,"OL",{});var pe=c(O);W=$(pe,"LI",{});var se=c(W);K=d(se,"Definir seus hiperpar\xE2metros de treinamento em "),S=$(se,"CODE",{});var U=c(S);I=d(U,"TrainingArguments"),U.forEach(o),Y=d(se,"."),se.forEach(o),ee=D(pe),z=$(pe,"LI",{});var ge=c(z);V=d(ge,"Passar os argumentos de treinamento para o "),J=$(ge,"CODE",{});var re=c(J);R=d(re,"Trainer"),re.forEach(o),G=d(ge," junto com o modelo, conjunto de dados, tokenizador e o data collator."),ge.forEach(o),de=D(pe),Q=$(pe,"LI",{});var he=c(Q);oe=d(he,"Chamar a fun\xE7\xE3o "),te=$(he,"CODE",{});var ue=c(te);le=d(ue,"train()"),ue.forEach(o),ne=d(he," para executar o fine-tuning do seu modelo."),he.forEach(o),pe.forEach(o),ie=D(k),B(Z.$$.fragment,k),ce=D(k),B(ae.$$.fragment,k)},m(k,A){v(k,e,A),s(e,r),s(e,t),s(t,a),s(e,i),v(k,p,A),F(m,k,A),v(k,_,A),F(w,k,A),v(k,b,A),v(k,E,A),s(E,P),v(k,N,A),v(k,O,A),s(O,W),s(W,K),s(W,S),s(S,I),s(W,Y),s(O,ee),s(O,z),s(z,V),s(z,J),s(J,R),s(z,G),s(O,de),s(O,Q),s(Q,oe),s(Q,te),s(te,le),s(Q,ne),v(k,ie,A),F(Z,k,A),v(k,ce,A),F(ae,k,A),me=!0},p(k,A){const fe={};A&2&&(fe.$$scope={dirty:A,ctx:k}),w.$set(fe);const X={};A&2&&(X.$$scope={dirty:A,ctx:k}),ae.$set(X)},i(k){me||(C(m.$$.fragment,k),C(w.$$.fragment,k),C(Z.$$.fragment,k),C(ae.$$.fragment,k),me=!0)},o(k){M(m.$$.fragment,k),M(w.$$.fragment,k),M(Z.$$.fragment,k),M(ae.$$.fragment,k),me=!1},d(k){k&&o(e),k&&o(p),H(m,k),k&&o(_),H(w,k),k&&o(b),k&&o(E),k&&o(N),k&&o(O),k&&o(ie),H(Z,k),k&&o(ce),H(ae,k)}}}function to(f){let e,r;return e=new Zt({props:{$$slots:{default:[eo]},$$scope:{ctx:f}}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p(t,a){const i={};a&2&&(i.$$scope={dirty:a,ctx:t}),e.$set(i)},i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function ao(f){let e,r,t,a,i;return{c(){e=g("p"),r=u("Se voc\xEA n\xE3o estiver familiarizado com o fine-tuning de um modelo com o Keras, d\xEA uma olhada no tutorial b\xE1sico "),t=g("a"),a=u("aqui"),i=u("!"),this.h()},l(p){e=$(p,"P",{});var m=c(e);r=d(m,"Se voc\xEA n\xE3o estiver familiarizado com o fine-tuning de um modelo com o Keras, d\xEA uma olhada no tutorial b\xE1sico "),t=$(m,"A",{href:!0});var _=c(t);a=d(_,"aqui"),_.forEach(o),i=d(m,"!"),m.forEach(o),this.h()},h(){n(t,"href","training#finetune-with-keras")},m(p,m){v(p,e,m),s(e,r),s(e,t),s(t,a),s(e,i)},d(p){p&&o(e)}}}function so(f){let e,r,t,a,i,p,m,_,w,b,E,P,N,O,W,K,S,I,Y,ee,z,V,J,R,G,de,Q,oe,te,le,ne,ie,Z,ce,ae,me,k,A,fe,X,pe,se,U,ge,re,he,ue,_e;return O=new we({props:{code:`tf_train_set = tokenized_imdb["train"].to_tf_dataset(
    columns=["attention_mask", "input_ids", "label"],
    shuffle=True,
    batch_size=16,
    collate_fn=data_collator,
)

tf_validation_set = tokenized_imdb["test"].to_tf_dataset(
    columns=["attention_mask", "input_ids", "label"],
    shuffle=False,
    batch_size=16,
    collate_fn=data_collator,
)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>tf_train_set = tokenized_imdb[<span class="hljs-string">&quot;train&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;label&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">True</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>tf_validation_set = tokenized_imdb[<span class="hljs-string">&quot;test&quot;</span>].to_tf_dataset(
<span class="hljs-meta">... </span>    columns=[<span class="hljs-string">&quot;attention_mask&quot;</span>, <span class="hljs-string">&quot;input_ids&quot;</span>, <span class="hljs-string">&quot;label&quot;</span>],
<span class="hljs-meta">... </span>    shuffle=<span class="hljs-literal">False</span>,
<span class="hljs-meta">... </span>    batch_size=<span class="hljs-number">16</span>,
<span class="hljs-meta">... </span>    collate_fn=data_collator,
<span class="hljs-meta">... </span>)`}}),K=new kt({props:{$$slots:{default:[ao]},$$scope:{ctx:f}}}),z=new we({props:{code:`from transformers import create_optimizer
import tensorflow as tf

batch_size = 16
num_epochs = 5
batches_per_epoch = len(tokenized_imdb["train"]) // batch_size
total_train_steps = int(batches_per_epoch * num_epochs)
optimizer, schedule = create_optimizer(init_lr=2e-5, num_warmup_steps=0, num_train_steps=total_train_steps)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> create_optimizer
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>batch_size = <span class="hljs-number">16</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>num_epochs = <span class="hljs-number">5</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>batches_per_epoch = <span class="hljs-built_in">len</span>(tokenized_imdb[<span class="hljs-string">&quot;train&quot;</span>]) // batch_size
<span class="hljs-meta">&gt;&gt;&gt; </span>total_train_steps = <span class="hljs-built_in">int</span>(batches_per_epoch * num_epochs)
<span class="hljs-meta">&gt;&gt;&gt; </span>optimizer, schedule = create_optimizer(init_lr=<span class="hljs-number">2e-5</span>, num_warmup_steps=<span class="hljs-number">0</span>, num_train_steps=total_train_steps)`}}),te=new we({props:{code:`from transformers import TFAutoModelForSequenceClassification

model = TFAutoModelForSequenceClassification.from_pretrained("distilbert-base-uncased", num_labels=2)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> TFAutoModelForSequenceClassification

<span class="hljs-meta">&gt;&gt;&gt; </span>model = TFAutoModelForSequenceClassification.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>, num_labels=<span class="hljs-number">2</span>)`}}),A=new we({props:{code:`import tensorflow as tf

model.compile(optimizer=optimizer)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> tensorflow <span class="hljs-keyword">as</span> tf

<span class="hljs-meta">&gt;&gt;&gt; </span>model.<span class="hljs-built_in">compile</span>(optimizer=optimizer)`}}),ue=new we({props:{code:"model.fit(x=tf_train_set, validation_data=tf_validation_set, epochs=3)",highlighted:'<span class="hljs-meta">&gt;&gt;&gt; </span>model.fit(x=tf_train_set, validation_data=tf_validation_set, epochs=<span class="hljs-number">3</span>)'}}),{c(){e=g("p"),r=u("Para executar o fine-tuning de um modelo no TensorFlow, comece convertendo seu conjunto de dados para o formato "),t=g("code"),a=u("tf.data.Dataset"),i=u(" com "),p=g("a"),m=g("code"),_=u("to_tf_dataset"),w=u(". Nessa execu\xE7\xE3o voc\xEA dever\xE1 especificar as entradas e r\xF3tulos (no par\xE2metro "),b=g("code"),E=u("columns"),P=u("), se deseja embaralhar o conjunto de dados, o tamanho do batch e o data collator:"),N=y(),L(O.$$.fragment),W=y(),L(K.$$.fragment),S=y(),I=g("p"),Y=u("Configure o otimizador e alguns hiperpar\xE2metros de treinamento:"),ee=y(),L(z.$$.fragment),V=y(),J=g("p"),R=u("Carregue o DistilBERT com "),G=g("code"),de=u("TFAutoModelForSequenceClassification"),Q=u(" junto com o n\xFAmero de r\xF3tulos esperados:"),oe=y(),L(te.$$.fragment),le=y(),ne=g("p"),ie=u("Configure o modelo para treinamento com o m\xE9todo "),Z=g("a"),ce=g("code"),ae=u("compile"),me=u(":"),k=y(),L(A.$$.fragment),fe=y(),X=g("p"),pe=u("Chame o m\xE9todo "),se=g("a"),U=g("code"),ge=u("fit"),re=u(" para executar o fine-tuning do modelo:"),he=y(),L(ue.$$.fragment),this.h()},l(h){e=$(h,"P",{});var T=c(e);r=d(T,"Para executar o fine-tuning de um modelo no TensorFlow, comece convertendo seu conjunto de dados para o formato "),t=$(T,"CODE",{});var $e=c(t);a=d($e,"tf.data.Dataset"),$e.forEach(o),i=d(T," com "),p=$(T,"A",{href:!0,rel:!0});var Ge=c(p);m=$(Ge,"CODE",{});var Qe=c(m);_=d(Qe,"to_tf_dataset"),Qe.forEach(o),Ge.forEach(o),w=d(T,". Nessa execu\xE7\xE3o voc\xEA dever\xE1 especificar as entradas e r\xF3tulos (no par\xE2metro "),b=$(T,"CODE",{});var Ee=c(b);E=d(Ee,"columns"),Ee.forEach(o),P=d(T,"), se deseja embaralhar o conjunto de dados, o tamanho do batch e o data collator:"),T.forEach(o),N=D(h),B(O.$$.fragment,h),W=D(h),B(K.$$.fragment,h),S=D(h),I=$(h,"P",{});var Pe=c(I);Y=d(Pe,"Configure o otimizador e alguns hiperpar\xE2metros de treinamento:"),Pe.forEach(o),ee=D(h),B(z.$$.fragment,h),V=D(h),J=$(h,"P",{});var Se=c(J);R=d(Se,"Carregue o DistilBERT com "),G=$(Se,"CODE",{});var Xe=c(G);de=d(Xe,"TFAutoModelForSequenceClassification"),Xe.forEach(o),Q=d(Se," junto com o n\xFAmero de r\xF3tulos esperados:"),Se.forEach(o),oe=D(h),B(te.$$.fragment,h),le=D(h),ne=$(h,"P",{});var je=c(ne);ie=d(je,"Configure o modelo para treinamento com o m\xE9todo "),Z=$(je,"A",{href:!0,rel:!0});var et=c(Z);ce=$(et,"CODE",{});var tt=c(ce);ae=d(tt,"compile"),tt.forEach(o),et.forEach(o),me=d(je,":"),je.forEach(o),k=D(h),B(A.$$.fragment,h),fe=D(h),X=$(h,"P",{});var ze=c(X);pe=d(ze,"Chame o m\xE9todo "),se=$(ze,"A",{href:!0,rel:!0});var at=c(se);U=$(at,"CODE",{});var st=c(U);ge=d(st,"fit"),st.forEach(o),at.forEach(o),re=d(ze," para executar o fine-tuning do modelo:"),ze.forEach(o),he=D(h),B(ue.$$.fragment,h),this.h()},h(){n(p,"href","https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.to_tf_dataset"),n(p,"rel","nofollow"),n(Z,"href","https://keras.io/api/models/model_training_apis/#compile-method"),n(Z,"rel","nofollow"),n(se,"href","https://keras.io/api/models/model_training_apis/#fit-method"),n(se,"rel","nofollow")},m(h,T){v(h,e,T),s(e,r),s(e,t),s(t,a),s(e,i),s(e,p),s(p,m),s(m,_),s(e,w),s(e,b),s(b,E),s(e,P),v(h,N,T),F(O,h,T),v(h,W,T),F(K,h,T),v(h,S,T),v(h,I,T),s(I,Y),v(h,ee,T),F(z,h,T),v(h,V,T),v(h,J,T),s(J,R),s(J,G),s(G,de),s(J,Q),v(h,oe,T),F(te,h,T),v(h,le,T),v(h,ne,T),s(ne,ie),s(ne,Z),s(Z,ce),s(ce,ae),s(ne,me),v(h,k,T),F(A,h,T),v(h,fe,T),v(h,X,T),s(X,pe),s(X,se),s(se,U),s(U,ge),s(X,re),v(h,he,T),F(ue,h,T),_e=!0},p(h,T){const $e={};T&2&&($e.$$scope={dirty:T,ctx:h}),K.$set($e)},i(h){_e||(C(O.$$.fragment,h),C(K.$$.fragment,h),C(z.$$.fragment,h),C(te.$$.fragment,h),C(A.$$.fragment,h),C(ue.$$.fragment,h),_e=!0)},o(h){M(O.$$.fragment,h),M(K.$$.fragment,h),M(z.$$.fragment,h),M(te.$$.fragment,h),M(A.$$.fragment,h),M(ue.$$.fragment,h),_e=!1},d(h){h&&o(e),h&&o(N),H(O,h),h&&o(W),H(K,h),h&&o(S),h&&o(I),h&&o(ee),H(z,h),h&&o(V),h&&o(J),h&&o(oe),H(te,h),h&&o(le),h&&o(ne),h&&o(k),H(A,h),h&&o(fe),h&&o(X),h&&o(he),H(ue,h)}}}function oo(f){let e,r;return e=new Zt({props:{$$slots:{default:[so]},$$scope:{ctx:f}}}),{c(){L(e.$$.fragment)},l(t){B(e.$$.fragment,t)},m(t,a){F(e,t,a),r=!0},p(t,a){const i={};a&2&&(i.$$scope={dirty:a,ctx:t}),e.$set(i)},i(t){r||(C(e.$$.fragment,t),r=!0)},o(t){M(e.$$.fragment,t),r=!1},d(t){H(e,t)}}}function ro(f){let e,r,t,a,i,p,m,_;return{c(){e=g("p"),r=u("Para obter um exemplo mais aprofundado de como executar o fine-tuning de um modelo para classifica\xE7\xE3o de texto, d\xEA uma olhada nesse "),t=g("a"),a=u("notebook utilizando PyTorch"),i=u(" ou nesse "),p=g("a"),m=u("notebook utilizando TensorFlow"),_=u("."),this.h()},l(w){e=$(w,"P",{});var b=c(e);r=d(b,"Para obter um exemplo mais aprofundado de como executar o fine-tuning de um modelo para classifica\xE7\xE3o de texto, d\xEA uma olhada nesse "),t=$(b,"A",{href:!0,rel:!0});var E=c(t);a=d(E,"notebook utilizando PyTorch"),E.forEach(o),i=d(b," ou nesse "),p=$(b,"A",{href:!0,rel:!0});var P=c(p);m=d(P,"notebook utilizando TensorFlow"),P.forEach(o),_=d(b,"."),b.forEach(o),this.h()},h(){n(t,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb"),n(t,"rel","nofollow"),n(p,"href","https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb"),n(p,"rel","nofollow")},m(w,b){v(w,e,b),s(e,r),s(e,t),s(t,a),s(e,i),s(e,p),s(p,m),s(e,_)},d(w){w&&o(e)}}}function lo(f){let e,r,t,a,i,p,m,_,w,b,E,P,N,O,W,K,S,I,Y,ee,z,V,J,R,G,de,Q,oe,te,le,ne,ie,Z,ce,ae,me,k,A,fe,X,pe,se,U,ge,re,he,ue,_e,h,T,$e,Ge,Qe,Ee,Pe,Se,Xe,je,et,tt,ze,at,st,qt,qe,Te,nt,Ke,Yt,it,Gt,yt,Ne,Qt,ct,Xt,ea,Dt,Re,Mt,Ie,ta,ft,aa,sa,At,Ve,Pt,ke,oa,Je,pt,ra,la,ut,na,ia,dt,ca,fa,St,We,Tt,ve,pa,mt,ua,da,ht,ma,ha,_t,_a,ga,gt,$a,va,Nt,Oe,It,ye,Le,$t,Ue,wa,vt,ba,Ot,Fe,Lt,He,Ft;return p=new Ut({}),E=new hs({props:{id:"leNG9fN9FQU"}}),G=new kt({props:{$$slots:{default:[Ws]},$$scope:{ctx:f}}}),le=new Ut({}),A=new we({props:{code:`from datasets import load_dataset

imdb = load_dataset("imdb")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> datasets <span class="hljs-keyword">import</span> load_dataset

<span class="hljs-meta">&gt;&gt;&gt; </span>imdb = load_dataset(<span class="hljs-string">&quot;imdb&quot;</span>)`}}),U=new we({props:{code:'imdb["test"][0]',highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>imdb[<span class="hljs-string">&quot;test&quot;</span>][<span class="hljs-number">0</span>]
{
    <span class="hljs-string">&quot;label&quot;</span>: <span class="hljs-number">0</span>,
    <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;I love sci-fi and am willing to put up with a lot. Sci-fi movies/TV are usually underfunded, under-appreciated and misunderstood. I tried to like this, I really did, but it is to good TV sci-fi as Babylon 5 is to Star Trek (the original). Silly prosthetics, cheap cardboard sets, stilted dialogues, CG that doesn&#x27;t match the background, and painfully one-dimensional characters cannot be overcome with a &#x27;sci-fi&#x27; setting. (I&#x27;m sure there are those of you out there who think Babylon 5 is good sci-fi TV. It&#x27;s not. It&#x27;s clich\xE9d and uninspiring.) While US viewers might like emotion and character development, sci-fi is a genre that does not take itself seriously (cf. Star Trek). It may treat important issues, yet not as a serious philosophy. It&#x27;s really difficult to care about the characters here as they are not simply foolish, just missing a spark of life. Their actions and reactions are wooden and predictable, often painful to watch. The makers of Earth KNOW it&#x27;s rubbish as they have to always say \\&quot;Gene Roddenberry&#x27;s Earth...\\&quot; otherwise people would not continue watching. Roddenberry&#x27;s ashes must be turning in their orbit as this dull, cheap, poorly edited (watching it without advert breaks really brings this home) trudging Trabant of a show lumbers into space. Spoiler. So, kill off a main character. And then bring him back as another actor. Jeeez! Dallas all over again.&quot;</span>,
}`}}),Ke=new Ut({}),Re=new we({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("distilbert-base-uncased")`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;distilbert-base-uncased&quot;</span>)`}}),Ve=new we({props:{code:`def preprocess_function(examples):
    return tokenizer(examples["text"], truncation=True)`,highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">def</span> <span class="hljs-title function_">preprocess_function</span>(<span class="hljs-params">examples</span>):
<span class="hljs-meta">... </span>    <span class="hljs-keyword">return</span> tokenizer(examples[<span class="hljs-string">&quot;text&quot;</span>], truncation=<span class="hljs-literal">True</span>)`}}),We=new we({props:{code:"tokenized_imdb = imdb.map(preprocess_function, batched=True)",highlighted:'tokenized_imdb = imdb.<span class="hljs-built_in">map</span>(preprocess_function, batched=<span class="hljs-literal">True</span>)'}}),Oe=new is({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[Gs],pytorch:[Zs]},$$scope:{ctx:f}}}),Ue=new Ut({}),Fe=new is({props:{pytorch:!0,tensorflow:!0,jax:!1,$$slots:{tensorflow:[oo],pytorch:[to]},$$scope:{ctx:f}}}),He=new kt({props:{$$slots:{default:[ro]},$$scope:{ctx:f}}}),{c(){e=g("meta"),r=y(),t=g("h1"),a=g("a"),i=g("span"),L(p.$$.fragment),m=y(),_=g("span"),w=u("Classifica\xE7\xE3o de texto"),b=y(),L(E.$$.fragment),P=y(),N=g("p"),O=u("A classifica\xE7\xE3o de texto \xE9 uma tarefa comum de NLP que atribui um r\xF3tulo ou classe a um texto. Existem muitas aplica\xE7\xF5es pr\xE1ticas de classifica\xE7\xE3o de texto amplamente utilizadas em produ\xE7\xE3o por algumas das maiores empresas da atualidade. Uma das formas mais populares de classifica\xE7\xE3o de texto \xE9 a an\xE1lise de sentimento, que atribui um r\xF3tulo como positivo, negativo ou neutro a um texto."),W=y(),K=g("p"),S=u("Este guia mostrar\xE1 como realizar o fine-tuning do "),I=g("a"),Y=u("DistilBERT"),ee=u(" no conjunto de dados "),z=g("a"),V=u("IMDb"),J=u(" para determinar se a cr\xEDtica de filme \xE9 positiva ou negativa."),R=y(),L(G.$$.fragment),de=y(),Q=g("h2"),oe=g("a"),te=g("span"),L(le.$$.fragment),ne=y(),ie=g("span"),Z=u("Carregue o conjunto de dados IMDb"),ce=y(),ae=g("p"),me=u("Carregue o conjunto de dados IMDb utilizando a biblioteca \u{1F917} Datasets:"),k=y(),L(A.$$.fragment),fe=y(),X=g("p"),pe=u("Em seguida, d\xEA uma olhada em um exemplo:"),se=y(),L(U.$$.fragment),ge=y(),re=g("p"),he=u("Existem dois campos neste dataset:"),ue=y(),_e=g("ul"),h=g("li"),T=g("code"),$e=u("text"),Ge=u(": uma string contendo o texto da cr\xEDtica do filme."),Qe=y(),Ee=g("li"),Pe=g("code"),Se=u("label"),Xe=u(": um valor que pode ser "),je=g("code"),et=u("0"),tt=u(" para uma cr\xEDtica negativa ou "),ze=g("code"),at=u("1"),st=u(" para uma cr\xEDtica positiva."),qt=y(),qe=g("h2"),Te=g("a"),nt=g("span"),L(Ke.$$.fragment),Yt=y(),it=g("span"),Gt=u("Pr\xE9-processamento dos dados"),yt=y(),Ne=g("p"),Qt=u("Carregue o tokenizador do DistilBERT para processar o campo "),ct=g("code"),Xt=u("text"),ea=u(":"),Dt=y(),L(Re.$$.fragment),Mt=y(),Ie=g("p"),ta=u("Crie uma fun\xE7\xE3o de pr\xE9-processamento para tokenizar o campo "),ft=g("code"),aa=u("text"),sa=u(" e truncar as sequ\xEAncias para que n\xE3o sejam maiores que o comprimento m\xE1ximo de entrada do DistilBERT:"),At=y(),L(Ve.$$.fragment),Pt=y(),ke=g("p"),oa=u("Use a fun\xE7\xE3o "),Je=g("a"),pt=g("code"),ra=u("map"),la=u(" do \u{1F917} Datasets para aplicar a fun\xE7\xE3o de pr\xE9-processamento em todo o conjunto de dados. Voc\xEA pode acelerar a fun\xE7\xE3o "),ut=g("code"),na=u("map"),ia=u(" definindo "),dt=g("code"),ca=u("batched=True"),fa=u(" para processar v\xE1rios elementos do conjunto de dados de uma s\xF3 vez:"),St=y(),L(We.$$.fragment),Tt=y(),ve=g("p"),pa=u("Use o "),mt=g("code"),ua=u("DataCollatorWithPadding"),da=u(" para criar um batch de exemplos. Ele tamb\xE9m "),ht=g("em"),ma=u("preencher\xE1 dinamicamente"),ha=u(" seu texto at\xE9 o comprimento do elemento mais longo em seu batch, para que os exemplos do batch tenham um comprimento uniforme. Embora seja poss\xEDvel preencher seu texto com a fun\xE7\xE3o "),_t=g("code"),_a=u("tokenizer"),ga=u(" definindo "),gt=g("code"),$a=u("padding=True"),va=u(", o preenchimento din\xE2mico utilizando um data collator \xE9 mais eficiente."),Nt=y(),L(Oe.$$.fragment),It=y(),ye=g("h2"),Le=g("a"),$t=g("span"),L(Ue.$$.fragment),wa=y(),vt=g("span"),ba=u("Train"),Ot=y(),L(Fe.$$.fragment),Lt=y(),L(He.$$.fragment),this.h()},l(l){const j=ms('[data-svelte="svelte-1phssyn"]',document.head);e=$(j,"META",{name:!0,content:!0}),j.forEach(o),r=D(l),t=$(l,"H1",{class:!0});var Ze=c(t);a=$(Ze,"A",{id:!0,class:!0,href:!0});var wt=c(a);i=$(wt,"SPAN",{});var bt=c(i);B(p.$$.fragment,bt),bt.forEach(o),wt.forEach(o),m=D(Ze),_=$(Ze,"SPAN",{});var Et=c(_);w=d(Et,"Classifica\xE7\xE3o de texto"),Et.forEach(o),Ze.forEach(o),b=D(l),B(E.$$.fragment,l),P=D(l),N=$(l,"P",{});var Ca=c(N);O=d(Ca,"A classifica\xE7\xE3o de texto \xE9 uma tarefa comum de NLP que atribui um r\xF3tulo ou classe a um texto. Existem muitas aplica\xE7\xF5es pr\xE1ticas de classifica\xE7\xE3o de texto amplamente utilizadas em produ\xE7\xE3o por algumas das maiores empresas da atualidade. Uma das formas mais populares de classifica\xE7\xE3o de texto \xE9 a an\xE1lise de sentimento, que atribui um r\xF3tulo como positivo, negativo ou neutro a um texto."),Ca.forEach(o),W=D(l),K=$(l,"P",{});var ot=c(K);S=d(ot,"Este guia mostrar\xE1 como realizar o fine-tuning do "),I=$(ot,"A",{href:!0,rel:!0});var xa=c(I);Y=d(xa,"DistilBERT"),xa.forEach(o),ee=d(ot," no conjunto de dados "),z=$(ot,"A",{href:!0,rel:!0});var qa=c(z);V=d(qa,"IMDb"),qa.forEach(o),J=d(ot," para determinar se a cr\xEDtica de filme \xE9 positiva ou negativa."),ot.forEach(o),R=D(l),B(G.$$.fragment,l),de=D(l),Q=$(l,"H2",{class:!0});var Ht=c(Q);oe=$(Ht,"A",{id:!0,class:!0,href:!0});var ya=c(oe);te=$(ya,"SPAN",{});var Da=c(te);B(le.$$.fragment,Da),Da.forEach(o),ya.forEach(o),ne=D(Ht),ie=$(Ht,"SPAN",{});var Ma=c(ie);Z=d(Ma,"Carregue o conjunto de dados IMDb"),Ma.forEach(o),Ht.forEach(o),ce=D(l),ae=$(l,"P",{});var Aa=c(ae);me=d(Aa,"Carregue o conjunto de dados IMDb utilizando a biblioteca \u{1F917} Datasets:"),Aa.forEach(o),k=D(l),B(A.$$.fragment,l),fe=D(l),X=$(l,"P",{});var Pa=c(X);pe=d(Pa,"Em seguida, d\xEA uma olhada em um exemplo:"),Pa.forEach(o),se=D(l),B(U.$$.fragment,l),ge=D(l),re=$(l,"P",{});var Sa=c(re);he=d(Sa,"Existem dois campos neste dataset:"),Sa.forEach(o),ue=D(l),_e=$(l,"UL",{});var Bt=c(_e);h=$(Bt,"LI",{});var Ea=c(h);T=$(Ea,"CODE",{});var Ta=c(T);$e=d(Ta,"text"),Ta.forEach(o),Ge=d(Ea,": uma string contendo o texto da cr\xEDtica do filme."),Ea.forEach(o),Qe=D(Bt),Ee=$(Bt,"LI",{});var Ye=c(Ee);Pe=$(Ye,"CODE",{});var Na=c(Pe);Se=d(Na,"label"),Na.forEach(o),Xe=d(Ye,": um valor que pode ser "),je=$(Ye,"CODE",{});var Ia=c(je);et=d(Ia,"0"),Ia.forEach(o),tt=d(Ye," para uma cr\xEDtica negativa ou "),ze=$(Ye,"CODE",{});var Oa=c(ze);at=d(Oa,"1"),Oa.forEach(o),st=d(Ye," para uma cr\xEDtica positiva."),Ye.forEach(o),Bt.forEach(o),qt=D(l),qe=$(l,"H2",{class:!0});var Kt=c(qe);Te=$(Kt,"A",{id:!0,class:!0,href:!0});var La=c(Te);nt=$(La,"SPAN",{});var Fa=c(nt);B(Ke.$$.fragment,Fa),Fa.forEach(o),La.forEach(o),Yt=D(Kt),it=$(Kt,"SPAN",{});var Ha=c(it);Gt=d(Ha,"Pr\xE9-processamento dos dados"),Ha.forEach(o),Kt.forEach(o),yt=D(l),Ne=$(l,"P",{});var Rt=c(Ne);Qt=d(Rt,"Carregue o tokenizador do DistilBERT para processar o campo "),ct=$(Rt,"CODE",{});var Ba=c(ct);Xt=d(Ba,"text"),Ba.forEach(o),ea=d(Rt,":"),Rt.forEach(o),Dt=D(l),B(Re.$$.fragment,l),Mt=D(l),Ie=$(l,"P",{});var Vt=c(Ie);ta=d(Vt,"Crie uma fun\xE7\xE3o de pr\xE9-processamento para tokenizar o campo "),ft=$(Vt,"CODE",{});var Ka=c(ft);aa=d(Ka,"text"),Ka.forEach(o),sa=d(Vt," e truncar as sequ\xEAncias para que n\xE3o sejam maiores que o comprimento m\xE1ximo de entrada do DistilBERT:"),Vt.forEach(o),At=D(l),B(Ve.$$.fragment,l),Pt=D(l),ke=$(l,"P",{});var Be=c(ke);oa=d(Be,"Use a fun\xE7\xE3o "),Je=$(Be,"A",{href:!0,rel:!0});var Ra=c(Je);pt=$(Ra,"CODE",{});var Va=c(pt);ra=d(Va,"map"),Va.forEach(o),Ra.forEach(o),la=d(Be," do \u{1F917} Datasets para aplicar a fun\xE7\xE3o de pr\xE9-processamento em todo o conjunto de dados. Voc\xEA pode acelerar a fun\xE7\xE3o "),ut=$(Be,"CODE",{});var Ja=c(ut);na=d(Ja,"map"),Ja.forEach(o),ia=d(Be," definindo "),dt=$(Be,"CODE",{});var Wa=c(dt);ca=d(Wa,"batched=True"),Wa.forEach(o),fa=d(Be," para processar v\xE1rios elementos do conjunto de dados de uma s\xF3 vez:"),Be.forEach(o),St=D(l),B(We.$$.fragment,l),Tt=D(l),ve=$(l,"P",{});var Ce=c(ve);pa=d(Ce,"Use o "),mt=$(Ce,"CODE",{});var Ua=c(mt);ua=d(Ua,"DataCollatorWithPadding"),Ua.forEach(o),da=d(Ce," para criar um batch de exemplos. Ele tamb\xE9m "),ht=$(Ce,"EM",{});var Za=c(ht);ma=d(Za,"preencher\xE1 dinamicamente"),Za.forEach(o),ha=d(Ce," seu texto at\xE9 o comprimento do elemento mais longo em seu batch, para que os exemplos do batch tenham um comprimento uniforme. Embora seja poss\xEDvel preencher seu texto com a fun\xE7\xE3o "),_t=$(Ce,"CODE",{});var Ya=c(_t);_a=d(Ya,"tokenizer"),Ya.forEach(o),ga=d(Ce," definindo "),gt=$(Ce,"CODE",{});var Ga=c(gt);$a=d(Ga,"padding=True"),Ga.forEach(o),va=d(Ce,", o preenchimento din\xE2mico utilizando um data collator \xE9 mais eficiente."),Ce.forEach(o),Nt=D(l),B(Oe.$$.fragment,l),It=D(l),ye=$(l,"H2",{class:!0});var Jt=c(ye);Le=$(Jt,"A",{id:!0,class:!0,href:!0});var Qa=c(Le);$t=$(Qa,"SPAN",{});var Xa=c($t);B(Ue.$$.fragment,Xa),Xa.forEach(o),Qa.forEach(o),wa=D(Jt),vt=$(Jt,"SPAN",{});var es=c(vt);ba=d(es,"Train"),es.forEach(o),Jt.forEach(o),Ot=D(l),B(Fe.$$.fragment,l),Lt=D(l),B(He.$$.fragment,l),this.h()},h(){n(e,"name","hf:doc:metadata"),n(e,"content",JSON.stringify(no)),n(a,"id","classificao-de-texto"),n(a,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(a,"href","#classificao-de-texto"),n(t,"class","relative group"),n(I,"href","https://huggingface.co/distilbert-base-uncased"),n(I,"rel","nofollow"),n(z,"href","https://huggingface.co/datasets/imdb"),n(z,"rel","nofollow"),n(oe,"id","carregue-o-conjunto-de-dados-imdb"),n(oe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(oe,"href","#carregue-o-conjunto-de-dados-imdb"),n(Q,"class","relative group"),n(Te,"id","prprocessamento-dos-dados"),n(Te,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(Te,"href","#prprocessamento-dos-dados"),n(qe,"class","relative group"),n(Je,"href","https://huggingface.co/docs/datasets/package_reference/main_classes.html#datasets.Dataset.map"),n(Je,"rel","nofollow"),n(Le,"id","train"),n(Le,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),n(Le,"href","#train"),n(ye,"class","relative group")},m(l,j){s(document.head,e),v(l,r,j),v(l,t,j),s(t,a),s(a,i),F(p,i,null),s(t,m),s(t,_),s(_,w),v(l,b,j),F(E,l,j),v(l,P,j),v(l,N,j),s(N,O),v(l,W,j),v(l,K,j),s(K,S),s(K,I),s(I,Y),s(K,ee),s(K,z),s(z,V),s(K,J),v(l,R,j),F(G,l,j),v(l,de,j),v(l,Q,j),s(Q,oe),s(oe,te),F(le,te,null),s(Q,ne),s(Q,ie),s(ie,Z),v(l,ce,j),v(l,ae,j),s(ae,me),v(l,k,j),F(A,l,j),v(l,fe,j),v(l,X,j),s(X,pe),v(l,se,j),F(U,l,j),v(l,ge,j),v(l,re,j),s(re,he),v(l,ue,j),v(l,_e,j),s(_e,h),s(h,T),s(T,$e),s(h,Ge),s(_e,Qe),s(_e,Ee),s(Ee,Pe),s(Pe,Se),s(Ee,Xe),s(Ee,je),s(je,et),s(Ee,tt),s(Ee,ze),s(ze,at),s(Ee,st),v(l,qt,j),v(l,qe,j),s(qe,Te),s(Te,nt),F(Ke,nt,null),s(qe,Yt),s(qe,it),s(it,Gt),v(l,yt,j),v(l,Ne,j),s(Ne,Qt),s(Ne,ct),s(ct,Xt),s(Ne,ea),v(l,Dt,j),F(Re,l,j),v(l,Mt,j),v(l,Ie,j),s(Ie,ta),s(Ie,ft),s(ft,aa),s(Ie,sa),v(l,At,j),F(Ve,l,j),v(l,Pt,j),v(l,ke,j),s(ke,oa),s(ke,Je),s(Je,pt),s(pt,ra),s(ke,la),s(ke,ut),s(ut,na),s(ke,ia),s(ke,dt),s(dt,ca),s(ke,fa),v(l,St,j),F(We,l,j),v(l,Tt,j),v(l,ve,j),s(ve,pa),s(ve,mt),s(mt,ua),s(ve,da),s(ve,ht),s(ht,ma),s(ve,ha),s(ve,_t),s(_t,_a),s(ve,ga),s(ve,gt),s(gt,$a),s(ve,va),v(l,Nt,j),F(Oe,l,j),v(l,It,j),v(l,ye,j),s(ye,Le),s(Le,$t),F(Ue,$t,null),s(ye,wa),s(ye,vt),s(vt,ba),v(l,Ot,j),F(Fe,l,j),v(l,Lt,j),F(He,l,j),Ft=!0},p(l,[j]){const Ze={};j&2&&(Ze.$$scope={dirty:j,ctx:l}),G.$set(Ze);const wt={};j&2&&(wt.$$scope={dirty:j,ctx:l}),Oe.$set(wt);const bt={};j&2&&(bt.$$scope={dirty:j,ctx:l}),Fe.$set(bt);const Et={};j&2&&(Et.$$scope={dirty:j,ctx:l}),He.$set(Et)},i(l){Ft||(C(p.$$.fragment,l),C(E.$$.fragment,l),C(G.$$.fragment,l),C(le.$$.fragment,l),C(A.$$.fragment,l),C(U.$$.fragment,l),C(Ke.$$.fragment,l),C(Re.$$.fragment,l),C(Ve.$$.fragment,l),C(We.$$.fragment,l),C(Oe.$$.fragment,l),C(Ue.$$.fragment,l),C(Fe.$$.fragment,l),C(He.$$.fragment,l),Ft=!0)},o(l){M(p.$$.fragment,l),M(E.$$.fragment,l),M(G.$$.fragment,l),M(le.$$.fragment,l),M(A.$$.fragment,l),M(U.$$.fragment,l),M(Ke.$$.fragment,l),M(Re.$$.fragment,l),M(Ve.$$.fragment,l),M(We.$$.fragment,l),M(Oe.$$.fragment,l),M(Ue.$$.fragment,l),M(Fe.$$.fragment,l),M(He.$$.fragment,l),Ft=!1},d(l){o(e),l&&o(r),l&&o(t),H(p),l&&o(b),H(E,l),l&&o(P),l&&o(N),l&&o(W),l&&o(K),l&&o(R),H(G,l),l&&o(de),l&&o(Q),H(le),l&&o(ce),l&&o(ae),l&&o(k),H(A,l),l&&o(fe),l&&o(X),l&&o(se),H(U,l),l&&o(ge),l&&o(re),l&&o(ue),l&&o(_e),l&&o(qt),l&&o(qe),H(Ke),l&&o(yt),l&&o(Ne),l&&o(Dt),H(Re,l),l&&o(Mt),l&&o(Ie),l&&o(At),H(Ve,l),l&&o(Pt),l&&o(ke),l&&o(St),H(We,l),l&&o(Tt),l&&o(ve),l&&o(Nt),H(Oe,l),l&&o(It),l&&o(ye),H(Ue),l&&o(Ot),H(Fe,l),l&&o(Lt),H(He,l)}}}const no={local:"classificao-de-texto",sections:[{local:"carregue-o-conjunto-de-dados-imdb",title:"Carregue o conjunto de dados IMDb"},{local:"prprocessamento-dos-dados",title:"Pr\xE9-processamento dos dados"},{local:"train",title:"Train"}],title:"Classifica\xE7\xE3o de texto"};function io(f){return cs(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class mo extends De{constructor(e){super();Me(this,e,io,lo,Ae,{})}}export{mo as default,no as metadata};
