import{s as D,n as I,o as J}from"../chunks/scheduler.37c15a92.js";import{S as Q,i as V,g as o,s as l,r as z,A as X,h as m,f as a,c as r,j as O,u as B,x as b,k as W,y as Z,a as n,v as R,d as S,t as k,w as U}from"../chunks/index.2bf4358c.js";import{Y as tt}from"../chunks/Youtube.1e50a667.js";import{C as et}from"../chunks/CourseFloatingBanner.9ff4c771.js";import{H as at,E as nt}from"../chunks/index.49fc26ef.js";function lt(Y){let s,v,d,w,i,C,f,T,p,P,u,q="編碼器-解碼器模型（也稱爲序列到序列模型)同時使用 Transformer 架構的編碼器和解碼器兩個部分。在每個階段，編碼器的注意力層可以訪問初始句子中的所有單詞，而解碼器的注意力層只能訪問位於輸入中將要預測單詞前面的單詞。",E,c,F='這些模型的預訓練可以使用訓練編碼器或解碼器模型的方式來完成，但通常涉及更復雜的內容。例如，<a href="https://huggingface.co/t5-base" rel="nofollow">T5</a>通過將文本的隨機跨度（可以包含多個單詞）替換爲單個特殊單詞來進行預訓練，然後目標是預測該掩碼單詞替換的文本。',M,h,G="序列到序列模型最適合於圍繞根據給定輸入生成新句子的任務，如摘要、翻譯或生成性問答。",y,$,K="該系列模型的典型代表有：",H,_,N='<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,A,x,j;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-TW/chapter1/7.mdx"}}),{c(){s=o("meta"),v=l(),d=o("p"),w=l(),z(i.$$.fragment),C=l(),z(f.$$.fragment),T=l(),z(p.$$.fragment),P=l(),u=o("p"),u.textContent=q,E=l(),c=o("p"),c.innerHTML=F,M=l(),h=o("p"),h.textContent=G,y=l(),$=o("p"),$.textContent=K,H=l(),_=o("ul"),_.innerHTML=N,L=l(),z(g.$$.fragment),A=l(),x=o("p"),this.h()},l(t){const e=X("svelte-u9bgzb",document.head);s=m(e,"META",{name:!0,content:!0}),e.forEach(a),v=r(t),d=m(t,"P",{}),O(d).forEach(a),w=r(t),B(i.$$.fragment,t),C=r(t),B(f.$$.fragment,t),T=r(t),B(p.$$.fragment,t),P=r(t),u=m(t,"P",{"data-svelte-h":!0}),b(u)!=="svelte-110rerd"&&(u.textContent=q),E=r(t),c=m(t,"P",{"data-svelte-h":!0}),b(c)!=="svelte-1oj1w9e"&&(c.innerHTML=F),M=r(t),h=m(t,"P",{"data-svelte-h":!0}),b(h)!=="svelte-150k9e3"&&(h.textContent=G),y=r(t),$=m(t,"P",{"data-svelte-h":!0}),b($)!=="svelte-rjc8nv"&&($.textContent=K),H=r(t),_=m(t,"UL",{"data-svelte-h":!0}),b(_)!=="svelte-1lyffe"&&(_.innerHTML=N),L=r(t),B(g.$$.fragment,t),A=r(t),x=m(t,"P",{}),O(x).forEach(a),this.h()},h(){W(s,"name","hf:doc:metadata"),W(s,"content",rt)},m(t,e){Z(document.head,s),n(t,v,e),n(t,d,e),n(t,w,e),R(i,t,e),n(t,C,e),R(f,t,e),n(t,T,e),R(p,t,e),n(t,P,e),n(t,u,e),n(t,E,e),n(t,c,e),n(t,M,e),n(t,h,e),n(t,y,e),n(t,$,e),n(t,H,e),n(t,_,e),n(t,L,e),R(g,t,e),n(t,A,e),n(t,x,e),j=!0},p:I,i(t){j||(S(i.$$.fragment,t),S(f.$$.fragment,t),S(p.$$.fragment,t),S(g.$$.fragment,t),j=!0)},o(t){k(i.$$.fragment,t),k(f.$$.fragment,t),k(p.$$.fragment,t),k(g.$$.fragment,t),j=!1},d(t){t&&(a(v),a(d),a(w),a(C),a(T),a(P),a(u),a(E),a(c),a(M),a(h),a(y),a($),a(H),a(_),a(L),a(A),a(x)),a(s),U(i,t),U(f,t),U(p,t),U(g,t)}}}const rt='{"title":"序列到序列模型","local":"序列到序列模型","sections":[],"depth":1}';function st(Y){return J(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ut extends Q{constructor(s){super(),V(this,s,st,lt,D,{})}}export{ut as component};
