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