import{s as Q,n as I,o as K}from"../chunks/scheduler.37c15a92.js";import{S as V,i as W,g as r,s,r as A,A as X,h as i,f as n,c as o,j as J,u as B,x as w,k as O,y as Z,a,v as q,d as j,t as z,w as S}from"../chunks/index.2bf4358c.js";import{Y as ee}from"../chunks/Youtube.1e50a667.js";import{C as te}from"../chunks/CourseFloatingBanner.15ba07e6.js";import{H as ne,E as ae}from"../chunks/EditOnGithub.8916dc7c.js";function se(U){let l,b,_,x,m,E,f,C,c,T,d,N="Encoder models use only the encoder of a Transformer model. At each stage, the attention layers can access all the words in the initial sentence. These models are often characterized as having “bi-directional” attention, and are often called <em>auto-encoding models</em>.",y,u,Y="The pretraining of these models usually revolves around somehow corrupting a given sentence (for instance, by masking random words in it) and tasking the model with finding or reconstructing the initial sentence.",P,p,D="Encoder models are best suited for tasks requiring an understanding of the full sentence, such as sentence classification, named entity recognition (and more generally word classification), and extractive question answering.",L,h,F="Representatives of this family of models include:",R,g,G='<li><a href="https://huggingface.co/docs/transformers/model_doc/albert" rel="nofollow">ALBERT</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/bert" rel="nofollow">BERT</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/distilbert" rel="nofollow">DistilBERT</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/electra" rel="nofollow">ELECTRA</a></li> <li><a href="https://huggingface.co/docs/transformers/model_doc/roberta" rel="nofollow">RoBERTa</a></li>',M,$,H,v,k;return m=new ne({props:{title:"Encoder models",local:"encoder-models",headingTag:"h1"}}),f=new te({props:{chapter:1,classNames:"absolute z-10 right-0 top-0"}}),c=new ee({props:{id:"MUqNwgPjJvQ"}}),$=new ae({props:{source:"https://github.com/huggingface/course/blob/main/chapters/en/chapter1/5.mdx"}}),{c(){l=r("meta"),b=s(),_=r("p"),x=s(),A(m.$$.fragment),E=s(),A(f.$$.fragment),C=s(),A(c.$$.fragment),T=s(),d=r("p"),d.innerHTML=N,y=s(),u=r("p"),u.textContent=Y,P=s(),p=r("p"),p.textContent=D,L=s(),h=r("p"),h.textContent=F,R=s(),g=r("ul"),g.innerHTML=G,M=s(),A($.$$.fragment),H=s(),v=r("p"),this.h()},l(e){const t=X("svelte-u9bgzb",document.head);l=i(t,"META",{name:!0,content:!0}),t.forEach(n),b=o(e),_=i(e,"P",{}),J(_).forEach(n),x=o(e),B(m.$$.fragment,e),E=o(e),B(f.$$.fragment,e),C=o(e),B(c.$$.fragment,e),T=o(e),d=i(e,"P",{"data-svelte-h":!0}),w(d)!=="svelte-rb0n0h"&&(d.innerHTML=N),y=o(e),u=i(e,"P",{"data-svelte-h":!0}),w(u)!=="svelte-h6rvk4"&&(u.textContent=Y),P=o(e),p=i(e,"P",{"data-svelte-h":!0}),w(p)!=="svelte-1l771dj"&&(p.textContent=D),L=o(e),h=i(e,"P",{"data-svelte-h":!0}),w(h)!=="svelte-s27rrg"&&(h.textContent=F),R=o(e),g=i(e,"UL",{"data-svelte-h":!0}),w(g)!=="svelte-17o0nd4"&&(g.innerHTML=G),M=o(e),B($.$$.fragment,e),H=o(e),v=i(e,"P",{}),J(v).forEach(n),this.h()},h(){O(l,"name","hf:doc:metadata"),O(l,"content",oe)},m(e,t){Z(document.head,l),a(e,b,t),a(e,_,t),a(e,x,t),q(m,e,t),a(e,E,t),q(f,e,t),a(e,C,t),q(c,e,t),a(e,T,t),a(e,d,t),a(e,y,t),a(e,u,t),a(e,P,t),a(e,p,t),a(e,L,t),a(e,h,t),a(e,R,t),a(e,g,t),a(e,M,t),q($,e,t),a(e,H,t),a(e,v,t),k=!0},p:I,i(e){k||(j(m.$$.fragment,e),j(f.$$.fragment,e),j(c.$$.fragment,e),j($.$$.fragment,e),k=!0)},o(e){z(m.$$.fragment,e),z(f.$$.fragment,e),z(c.$$.fragment,e),z($.$$.fragment,e),k=!1},d(e){e&&(n(b),n(_),n(x),n(E),n(C),n(T),n(d),n(y),n(u),n(P),n(p),n(L),n(h),n(R),n(g),n(M),n(H),n(v)),n(l),S(m,e),S(f,e),S(c,e),S($,e)}}}const oe='{"title":"Encoder models","local":"encoder-models","sections":[],"depth":1}';function le(U){return K(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class de extends V{constructor(l){super(),W(this,l,le,se,Q,{})}}export{de as component};
