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