import{s as I,n as J,o as Q}from"../chunks/scheduler.37c15a92.js";import{S as V,i as W,g as o,s as l,r as k,A as X,h as m,f as a,c as s,j as O,u as z,x as v,k as D,y as Z,a as n,v as B,d as R,t as S,w as N}from"../chunks/index.2bf4358c.js";import{Y as tt}from"../chunks/Youtube.1e50a667.js";import{C as et}from"../chunks/CourseFloatingBanner.06521e8b.js";import{H as at,E as nt}from"../chunks/EditOnGithub.8916dc7c.js";function lt(U){let r,b,x,C,i,w,f,T,p,P,u,Y="编码器-解码器模型（也称为序列到序列模型)同时使用Transformer架构的编码器和解码器两个部分。在每个阶段，编码器的注意力层可以访问初始句子中的所有单词，而解码器的注意力层只能访问位于输入中将要预测单词前面的单词。",E,c,j='这些模型的预训练可以使用训练编码器或解码器模型的方式来完成，但通常涉及更复杂的内容。例如，<a href="https://huggingface.co/t5-base" rel="nofollow">T5</a>通过将文本的随机跨度（可以包含多个单词）替换为单个特殊单词来进行预训练，然后目标是预测该掩码单词替换的文本。',y,h,F="序列到序列模型最适合于围绕根据给定输入生成新句子的任务，如摘要、翻译或生成性问答。",M,$,G="该系列模型的典型代表有：",H,_,K='<li><a href="https://huggingface.co/transformers/model_doc/bart.html" rel="nofollow">BART</a></li> <li><a href="https://huggingface.co/transformers/model_doc/mbart.html" rel="nofollow">mBART</a></li> <li><a href="https://huggingface.co/transformers/model_doc/marian.html" rel="nofollow">Marian</a></li> <li><a href="https://huggingface.co/transformers/model_doc/t5.html" rel="nofollow">T5</a></li>',L,g,q,d,A;return i=new at({props:{title:"序列到序列模型",local:"序列到序列模型",headingTag:"h1"}}),f=new et({props:{chapter:1,classNames:"absolute z-10 right-0 top-0"}}),p=new tt({props:{id:"0_4KEb08xrE"}}),g=new nt({props:{source:"https://github.com/huggingface/course/blob/main/chapters/zh-CN/chapter1/7.mdx"}}),{c(){r=o("meta"),b=l(),x=o("p"),C=l(),k(i.$$.fragment),w=l(),k(f.$$.fragment),T=l(),k(p.$$.fragment),P=l(),u=o("p"),u.textContent=Y,E=l(),c=o("p"),c.innerHTML=j,y=l(),h=o("p"),h.textContent=F,M=l(),$=o("p"),$.textContent=G,H=l(),_=o("ul"),_.innerHTML=K,L=l(),k(g.$$.fragment),q=l(),d=o("p"),this.h()},l(t){const e=X("svelte-u9bgzb",document.head);r=m(e,"META",{name:!0,content:!0}),e.forEach(a),b=s(t),x=m(t,"P",{}),O(x).forEach(a),C=s(t),z(i.$$.fragment,t),w=s(t),z(f.$$.fragment,t),T=s(t),z(p.$$.fragment,t),P=s(t),u=m(t,"P",{"data-svelte-h":!0}),v(u)!=="svelte-1pkvqmv"&&(u.textContent=Y),E=s(t),c=m(t,"P",{"data-svelte-h":!0}),v(c)!=="svelte-140lkq"&&(c.innerHTML=j),y=s(t),h=m(t,"P",{"data-svelte-h":!0}),v(h)!=="svelte-1x73vbl"&&(h.textContent=F),M=s(t),$=m(t,"P",{"data-svelte-h":!0}),v($)!=="svelte-rgo3yq"&&($.textContent=G),H=s(t),_=m(t,"UL",{"data-svelte-h":!0}),v(_)!=="svelte-1lyffe"&&(_.innerHTML=K),L=s(t),z(g.$$.fragment,t),q=s(t),d=m(t,"P",{}),O(d).forEach(a),this.h()},h(){D(r,"name","hf:doc:metadata"),D(r,"content",st)},m(t,e){Z(document.head,r),n(t,b,e),n(t,x,e),n(t,C,e),B(i,t,e),n(t,w,e),B(f,t,e),n(t,T,e),B(p,t,e),n(t,P,e),n(t,u,e),n(t,E,e),n(t,c,e),n(t,y,e),n(t,h,e),n(t,M,e),n(t,$,e),n(t,H,e),n(t,_,e),n(t,L,e),B(g,t,e),n(t,q,e),n(t,d,e),A=!0},p:J,i(t){A||(R(i.$$.fragment,t),R(f.$$.fragment,t),R(p.$$.fragment,t),R(g.$$.fragment,t),A=!0)},o(t){S(i.$$.fragment,t),S(f.$$.fragment,t),S(p.$$.fragment,t),S(g.$$.fragment,t),A=!1},d(t){t&&(a(b),a(x),a(C),a(w),a(T),a(P),a(u),a(E),a(c),a(y),a(h),a(M),a($),a(H),a(_),a(L),a(q),a(d)),a(r),N(i,t),N(f,t),N(p,t),N(g,t)}}}const st='{"title":"序列到序列模型","local":"序列到序列模型","sections":[],"depth":1}';function rt(U){return Q(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ut extends V{constructor(r){super(),W(this,r,rt,lt,I,{})}}export{ut as component};
