import{S as Re,i as Ie,s as Me,e as a,k as u,w as xe,t as i,M as Be,c as s,d as t,m as d,a as r,x as Te,h as c,b as l,G as o,g as h,y as ke,L as je,q as Se,o as Pe,B as Le,v as Ne}from"../../chunks/vendor-hf-doc-builder.js";import{Y as ze}from"../../chunks/Youtube-hf-doc-builder.js";import{I as Ce}from"../../chunks/IconCopyLink-hf-doc-builder.js";function Fe(he){let m,j,p,v,S,b,O,P,D,N,E,z,_,Q,L,V,W,C,w,X,q,Z,ee,F,T,te,U,k,oe,Y,f,R,y,ae,se,I,$,re,ne,M,A,le,ie,B,x,ce,G;return b=new Ce({}),E=new ze({props:{id:"0_4KEb08xrE"}}),{c(){m=a("meta"),j=u(),p=a("h1"),v=a("a"),S=a("span"),xe(b.$$.fragment),O=u(),P=a("span"),D=i("Sequence-to-sequence models"),N=u(),xe(E.$$.fragment),z=u(),_=a("p"),Q=i("Encoder-decoder models (also called "),L=a("em"),V=i("sequence-to-sequence models"),W=i(") use both parts of the Transformer architecture. At each stage, the attention layers of the encoder can access all the words in the initial sentence, whereas the attention layers of the decoder can only access the words positioned before a given word in the input."),C=u(),w=a("p"),X=i("The pretraining of these models can be done using the objectives of encoder or decoder models, but usually involves something a bit more complex. For instance, "),q=a("a"),Z=i("T5"),ee=i(" is pretrained by replacing random spans of text (that can contain several words) with a single mask special word, and the objective is then to predict the text that this mask word replaces."),F=u(),T=a("p"),te=i("Sequence-to-sequence models are best suited for tasks revolving around generating new sentences depending on a given input, such as summarization, translation, or generative question answering."),U=u(),k=a("p"),oe=i("Representatives of this family of models include:"),Y=u(),f=a("ul"),R=a("li"),y=a("a"),ae=i("BART"),se=u(),I=a("li"),$=a("a"),re=i("mBART"),ne=u(),M=a("li"),A=a("a"),le=i("Marian"),ie=u(),B=a("li"),x=a("a"),ce=i("T5"),this.h()},l(e){const n=Be('[data-svelte="svelte-1phssyn"]',document.head);m=s(n,"META",{name:!0,content:!0}),n.forEach(t),j=d(e),p=s(e,"H1",{class:!0});var H=r(p);v=s(H,"A",{id:!0,class:!0,href:!0});var fe=r(v);S=s(fe,"SPAN",{});var ue=r(S);Te(b.$$.fragment,ue),ue.forEach(t),fe.forEach(t),O=d(H),P=s(H,"SPAN",{});var de=r(P);D=c(de,"Sequence-to-sequence models"),de.forEach(t),H.forEach(t),N=d(e),Te(E.$$.fragment,e),z=d(e),_=s(e,"P",{});var J=r(_);Q=c(J,"Encoder-decoder models (also called "),L=s(J,"EM",{});var me=r(L);V=c(me,"sequence-to-sequence models"),me.forEach(t),W=c(J,") use both parts of the Transformer architecture. At each stage, the attention layers of the encoder can access all the words in the initial sentence, whereas the attention layers of the decoder can only access the words positioned before a given word in the input."),J.forEach(t),C=d(e),w=s(e,"P",{});var K=r(w);X=c(K,"The pretraining of these models can be done using the objectives of encoder or decoder models, but usually involves something a bit more complex. For instance, "),q=s(K,"A",{href:!0,rel:!0});var pe=r(q);Z=c(pe,"T5"),pe.forEach(t),ee=c(K," is pretrained by replacing random spans of text (that can contain several words) with a single mask special word, and the objective is then to predict the text that this mask word replaces."),K.forEach(t),F=d(e),T=s(e,"P",{});var ve=r(T);te=c(ve,"Sequence-to-sequence models are best suited for tasks revolving around generating new sentences depending on a given input, such as summarization, translation, or generative question answering."),ve.forEach(t),U=d(e),k=s(e,"P",{});var _e=r(k);oe=c(_e,"Representatives of this family of models include:"),_e.forEach(t),Y=d(e),f=s(e,"UL",{});var g=r(f);R=s(g,"LI",{});var we=r(R);y=s(we,"A",{href:!0,rel:!0});var ge=r(y);ae=c(ge,"BART"),ge.forEach(t),we.forEach(t),se=d(g),I=s(g,"LI",{});var be=r(I);$=s(be,"A",{href:!0,rel:!0});var Ee=r($);re=c(Ee,"mBART"),Ee.forEach(t),be.forEach(t),ne=d(g),M=s(g,"LI",{});var qe=r(M);A=s(qe,"A",{href:!0,rel:!0});var ye=r(A);le=c(ye,"Marian"),ye.forEach(t),qe.forEach(t),ie=d(g),B=s(g,"LI",{});var $e=r(B);x=s($e,"A",{href:!0,rel:!0});var Ae=r(x);ce=c(Ae,"T5"),Ae.forEach(t),$e.forEach(t),g.forEach(t),this.h()},h(){l(m,"name","hf:doc:metadata"),l(m,"content",JSON.stringify(Ue)),l(v,"id","sequencetosequence-models"),l(v,"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"),l(v,"href","#sequencetosequence-models"),l(p,"class","relative group"),l(q,"href","https://huggingface.co/t5-base"),l(q,"rel","nofollow"),l(y,"href","https://huggingface.co/transformers/model_doc/bart.html"),l(y,"rel","nofollow"),l($,"href","https://huggingface.co/transformers/model_doc/mbart.html"),l($,"rel","nofollow"),l(A,"href","https://huggingface.co/transformers/model_doc/marian.html"),l(A,"rel","nofollow"),l(x,"href","https://huggingface.co/transformers/model_doc/t5.html"),l(x,"rel","nofollow")},m(e,n){o(document.head,m),h(e,j,n),h(e,p,n),o(p,v),o(v,S),ke(b,S,null),o(p,O),o(p,P),o(P,D),h(e,N,n),ke(E,e,n),h(e,z,n),h(e,_,n),o(_,Q),o(_,L),o(L,V),o(_,W),h(e,C,n),h(e,w,n),o(w,X),o(w,q),o(q,Z),o(w,ee),h(e,F,n),h(e,T,n),o(T,te),h(e,U,n),h(e,k,n),o(k,oe),h(e,Y,n),h(e,f,n),o(f,R),o(R,y),o(y,ae),o(f,se),o(f,I),o(I,$),o($,re),o(f,ne),o(f,M),o(M,A),o(A,le),o(f,ie),o(f,B),o(B,x),o(x,ce),G=!0},p:je,i(e){G||(Se(b.$$.fragment,e),Se(E.$$.fragment,e),G=!0)},o(e){Pe(b.$$.fragment,e),Pe(E.$$.fragment,e),G=!1},d(e){t(m),e&&t(j),e&&t(p),Le(b),e&&t(N),Le(E,e),e&&t(z),e&&t(_),e&&t(C),e&&t(w),e&&t(F),e&&t(T),e&&t(U),e&&t(k),e&&t(Y),e&&t(f)}}}const Ue={local:"sequencetosequence-models",title:"Sequence-to-sequence models"};function Ye(he){return Ne(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ke extends Re{constructor(m){super();Ie(this,m,Ye,Fe,Me,{})}}export{Ke as default,Ue as metadata};
