import{s as K,n as V,o as W}from"../chunks/scheduler.cc52f4b9.js";import{S as X,i as Z,e as o,s as a,c as b,h as tt,a as i,d as n,b as r,f as Q,g as v,j as w,k as I,l as et,m as l,n as y,t as E,o as P,p as T}from"../chunks/index.9480bb2b.js";import{C as nt,H as lt,E as at}from"../chunks/MermaidChart.svelte_svelte_type_style_lang.009dc98d.js";import{Y as rt}from"../chunks/Youtube.7b12d9e8.js";import{C as st}from"../chunks/CourseFloatingBanner.6488bde3.js";function ot(k){let s,L,C,M,m,R,f,B,p,q,u,z,$,D="编码器模型仅使用 Transformer 模型的编码器部分。在每次计算过程中，注意力层都能访问整个句子的所有单词，这些模型通常具有“双向”（向前/向后）注意力，被称为自编码模型。",H,c,F="这些模型的预训练通常会使用某种方式破坏给定的句子（例如：通过随机遮盖其中的单词），并让模型寻找或重建给定的句子。",S,g,G="“编码器”模型适用于需要理解完整句子的任务，例如：句子分类、命名实体识别（以及更普遍的单词分类）和阅读理解后回答问题。",A,h,J="该系列模型的典型代表有：",N,_,O='<li><a href="https://huggingface.co/transformers/model_doc/albert" rel="nofollow">ALBERT</a></li> <li><a href="https://huggingface.co/transformers/model_doc/bert" rel="nofollow">BERT</a></li> <li><a href="https://huggingface.co/transformers/model_doc/distilbert" rel="nofollow">DistilBERT</a></li> <li><a href="https://huggingface.co/transformers/model_doc/electra" rel="nofollow">ELECTRA</a></li> <li><a href="https://huggingface.co/transformers/model_doc/roberta" rel="nofollow">RoBERTa</a></li>',U,x,j,d,Y;return m=new nt({props:{containerStyle:"float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"}}),f=new lt({props:{title:"“编码器”模型",local:"“编码器”模型",headingTag:"h1"}}),p=new st({props:{chapter:1,classNames:"absolute z-10 right-0 top-0"}}),u=new rt({props:{id:"MUqNwgPjJvQ"}}),x=new at({props:{source:"https://github.com/huggingface/course/blob/main/chapters/zh-CN/chapter1/5.mdx"}}),{c(){s=o("meta"),L=a(),C=o("p"),M=a(),b(m.$$.fragment),R=a(),b(f.$$.fragment),B=a(),b(p.$$.fragment),q=a(),b(u.$$.fragment),z=a(),$=o("p"),$.textContent=D,H=a(),c=o("p"),c.textContent=F,S=a(),g=o("p"),g.textContent=G,A=a(),h=o("p"),h.textContent=J,N=a(),_=o("ul"),_.innerHTML=O,U=a(),b(x.$$.fragment),j=a(),d=o("p"),this.h()},l(t){const e=tt("svelte-u9bgzb",document.head);s=i(e,"META",{name:!0,content:!0}),e.forEach(n),L=r(t),C=i(t,"P",{}),Q(C).forEach(n),M=r(t),v(m.$$.fragment,t),R=r(t),v(f.$$.fragment,t),B=r(t),v(p.$$.fragment,t),q=r(t),v(u.$$.fragment,t),z=r(t),$=i(t,"P",{"data-svelte-h":!0}),w($)!=="svelte-1yw3v62"&&($.textContent=D),H=r(t),c=i(t,"P",{"data-svelte-h":!0}),w(c)!=="svelte-1i7ruql"&&(c.textContent=F),S=r(t),g=i(t,"P",{"data-svelte-h":!0}),w(g)!=="svelte-1ep4yy6"&&(g.textContent=G),A=r(t),h=i(t,"P",{"data-svelte-h":!0}),w(h)!=="svelte-rgo3yq"&&(h.textContent=J),N=r(t),_=i(t,"UL",{"data-svelte-h":!0}),w(_)!=="svelte-443clm"&&(_.innerHTML=O),U=r(t),v(x.$$.fragment,t),j=r(t),d=i(t,"P",{}),Q(d).forEach(n),this.h()},h(){I(s,"name","hf:doc:metadata"),I(s,"content",it)},m(t,e){et(document.head,s),l(t,L,e),l(t,C,e),l(t,M,e),y(m,t,e),l(t,R,e),y(f,t,e),l(t,B,e),y(p,t,e),l(t,q,e),y(u,t,e),l(t,z,e),l(t,$,e),l(t,H,e),l(t,c,e),l(t,S,e),l(t,g,e),l(t,A,e),l(t,h,e),l(t,N,e),l(t,_,e),l(t,U,e),y(x,t,e),l(t,j,e),l(t,d,e),Y=!0},p:V,i(t){Y||(E(m.$$.fragment,t),E(f.$$.fragment,t),E(p.$$.fragment,t),E(u.$$.fragment,t),E(x.$$.fragment,t),Y=!0)},o(t){P(m.$$.fragment,t),P(f.$$.fragment,t),P(p.$$.fragment,t),P(u.$$.fragment,t),P(x.$$.fragment,t),Y=!1},d(t){t&&(n(L),n(C),n(M),n(R),n(B),n(q),n(z),n($),n(H),n(c),n(S),n(g),n(A),n(h),n(N),n(_),n(U),n(j),n(d)),n(s),T(m,t),T(f,t),T(p,t),T(u,t),T(x,t)}}}const it='{"title":"“编码器”模型","local":"“编码器”模型","sections":[],"depth":1}';function mt(k){return W(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gt extends X{constructor(s){super(),Z(this,s,mt,ot,K,{})}}export{gt as component};
