import{S as cv,i as lv,s as hv,e as r,k as d,w as h,t as o,M as pv,c as a,d as t,m as c,a as s,x as p,h as n,b as l,G as e,g as $,y as m,q as f,o as u,B as _,v as mv,L as iv}from"../../chunks/vendor-hf-doc-builder.js";import{T as av}from"../../chunks/Tip-hf-doc-builder.js";import{D as T}from"../../chunks/Docstring-hf-doc-builder.js";import{C as dv}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Gi}from"../../chunks/IconCopyLink-hf-doc-builder.js";import{E as sv}from"../../chunks/ExampleCodeBlock-hf-doc-builder.js";function fv(pe){let y,L,q,E,B;return E=new dv({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")

# Push the tokenizer to your namespace with the name "my-finetuned-bert".
tokenizer.push_to_hub("my-finetuned-bert")

# Push the tokenizer to an organization with the name "my-finetuned-bert".
tokenizer.push_to_hub("huggingface/my-finetuned-bert")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)

<span class="hljs-comment"># Push the tokenizer to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the tokenizer to an organization with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`}}),{c(){y=r("p"),L=o("Examples:"),q=d(),h(E.$$.fragment)},l(v){y=a(v,"P",{});var I=s(y);L=n(I,"Examples:"),I.forEach(t),q=c(v),p(E.$$.fragment,v)},m(v,I){$(v,y,I),e(y,L),$(v,q,I),m(E,v,I),B=!0},p:iv,i(v){B||(f(E.$$.fragment,v),B=!0)},o(v){u(E.$$.fragment,v),B=!1},d(v){v&&t(y),v&&t(q),_(E,v)}}}function uv(pe){let y,L;return{c(){y=r("p"),L=o(`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`)},l(q){y=a(q,"P",{});var E=s(y);L=n(E,`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`),E.forEach(t)},m(q,E){$(q,y,E),e(y,L)},d(q){q&&t(y)}}}function _v(pe){let y,L,q,E,B;return E=new dv({props:{code:`from transformers import AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased")

# Push the tokenizer to your namespace with the name "my-finetuned-bert".
tokenizer.push_to_hub("my-finetuned-bert")

# Push the tokenizer to an organization with the name "my-finetuned-bert".
tokenizer.push_to_hub("huggingface/my-finetuned-bert")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;bert-base-cased&quot;</span>)

<span class="hljs-comment"># Push the tokenizer to your namespace with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

<span class="hljs-comment"># Push the tokenizer to an organization with the name &quot;my-finetuned-bert&quot;.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;huggingface/my-finetuned-bert&quot;</span>)`}}),{c(){y=r("p"),L=o("Examples:"),q=d(),h(E.$$.fragment)},l(v){y=a(v,"P",{});var I=s(y);L=n(I,"Examples:"),I.forEach(t),q=c(v),p(E.$$.fragment,v)},m(v,I){$(v,y,I),e(y,L),$(v,q,I),m(E,v,I),B=!0},p:iv,i(v){B||(f(E.$$.fragment,v),B=!0)},o(v){u(E.$$.fragment,v),B=!1},d(v){v&&t(y),v&&t(q),_(E,v)}}}function gv(pe){let y,L;return{c(){y=r("p"),L=o(`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`)},l(q){y=a(q,"P",{});var E=s(y);L=n(E,`This encodes a dummy input and checks the number of added tokens, and is therefore not efficient. Do not put
this inside your training loop.`),E.forEach(t)},m(q,E){$(q,y,E),e(y,L)},d(q){q&&t(y)}}}function kv(pe){let y,L,q,E,B,v,I,Bn,ji,Us,He,Hi,Tt,Mi,Xi,Vs,Me,Wn,Yi,Ji,Rn,Ki,Gs,W,Qi,Oo,Zi,ed,So,td,od,Bo,nd,rd,Wo,ad,sd,js,Ie,Ro,id,dd,Uo,cd,ld,Hs,me,Un,hd,pd,Vn,md,fd,Gn,ud,Ms,D,Vo,_d,gd,Go,kd,bd,jn,vd,Td,Hn,yd,wd,Mn,zd,xd,Xn,Ed,$d,Yn,Pd,qd,yt,Dd,Ld,Xs,Ne,Xe,Jn,wt,Fd,Kn,Id,Ys,g,zt,Nd,Qn,Ad,Cd,xt,Od,jo,Sd,Bd,Wd,Zn,Rd,Ud,er,Vd,Gd,tr,jd,Hd,N,fe,or,Md,Xd,nr,Yd,Jd,rr,Kd,Qd,Zd,R,ar,ec,tc,sr,oc,nc,ir,rc,ac,dr,sc,ic,cr,dc,cc,lc,Q,lr,hc,pc,hr,mc,fc,pr,uc,_c,mr,gc,kc,bc,U,fr,vc,Tc,ur,yc,wc,_r,zc,xc,gr,Ec,$c,Ho,Pc,qc,Dc,Ye,kr,Lc,Fc,br,Ic,Nc,Ac,Z,vr,Cc,Oc,Tr,Sc,Bc,yr,Wc,Rc,wr,Uc,Vc,Gc,ee,zr,jc,Hc,xr,Mc,Xc,Er,Yc,Jc,$r,Kc,Qc,Zc,Je,Et,el,Pr,tl,ol,Ke,$t,nl,qr,rl,al,ue,Pt,sl,Dr,il,dl,qt,cl,Lr,ll,hl,pl,_e,Dt,ml,Fr,fl,ul,Lt,_l,Ir,gl,kl,bl,ge,Ft,vl,It,Tl,Nr,yl,wl,zl,Qe,xl,Ze,Nt,El,Ar,$l,Pl,et,At,ql,Cr,Dl,Ll,tt,Ct,Fl,Or,Il,Nl,ke,Ot,Al,Sr,Cl,Ol,ot,Sl,be,St,Bl,Br,Wl,Rl,Ae,Ul,Wr,Vl,Gl,Rr,jl,Hl,Ml,ve,Bt,Xl,Ur,Yl,Jl,Vr,Kl,Js,Ce,nt,Gr,Wt,Ql,jr,Zl,Ks,te,eh,Mo,th,oh,Rt,nh,rh,Xo,ah,sh,Qs,k,Ut,ih,Hr,dh,ch,Vt,lh,Yo,hh,ph,mh,Mr,fh,uh,Xr,_h,gh,Yr,kh,bh,A,Te,Jr,vh,Th,Kr,yh,wh,Qr,zh,xh,Eh,V,Zr,$h,Ph,ea,qh,Dh,ta,Lh,Fh,oa,Ih,Nh,na,Ah,Ch,Oh,oe,ra,Sh,Bh,aa,Wh,Rh,sa,Uh,Vh,ia,Gh,jh,Hh,G,da,Mh,Xh,ca,Yh,Jh,la,Kh,Qh,ha,Zh,ep,Jo,tp,op,np,rt,pa,rp,ap,ma,sp,ip,dp,ne,fa,cp,lp,ua,hp,pp,_a,mp,fp,ga,up,_p,gp,re,ka,kp,bp,ba,vp,Tp,va,yp,wp,Ta,zp,xp,Ep,at,Gt,$p,ya,Pp,qp,st,jt,Dp,wa,Lp,Fp,ye,Ht,Ip,za,Np,Ap,Mt,Cp,xa,Op,Sp,Bp,we,Xt,Wp,Ea,Rp,Up,Yt,Vp,$a,Gp,jp,Hp,ze,Jt,Mp,Kt,Xp,Pa,Yp,Jp,Kp,it,Qp,dt,Qt,Zp,qa,em,tm,ct,Zt,om,Da,nm,rm,lt,eo,am,La,sm,im,xe,to,dm,Fa,cm,lm,ht,hm,Ee,oo,pm,Ia,mm,fm,Na,um,_m,pt,no,gm,Aa,km,Zs,Oe,mt,Ca,ro,bm,Oa,vm,ei,w,ao,Tm,ie,ym,so,Sa,wm,zm,xm,Ko,Em,$m,Qo,Pm,qm,Dm,Ba,Lm,Fm,j,io,Im,Wa,Nm,Am,Ra,Cm,Om,co,Zo,Ua,Sm,Bm,Wm,en,Va,Rm,Um,Vm,Ga,Gm,jm,H,lo,Hm,ja,Mm,Xm,Ha,Ym,Jm,ho,tn,Ma,Km,Qm,Zm,on,Xa,ef,tf,of,Ya,nf,rf,ft,po,af,Ja,sf,df,$e,mo,cf,Ka,lf,hf,Se,nn,Qa,pf,mf,ff,rn,Za,uf,_f,gf,an,es,kf,bf,vf,ut,fo,Tf,uo,yf,ts,wf,zf,xf,O,_o,Ef,os,$f,Pf,go,qf,sn,Df,Lf,Ff,ko,dn,ns,If,Nf,Af,cn,rs,Cf,Of,Sf,as,Bf,Wf,bo,ln,ss,Rf,Uf,Vf,hn,is,Gf,jf,Hf,M,vo,Mf,Be,Xf,ds,Yf,Jf,cs,Kf,Qf,Zf,ls,eu,tu,To,pn,hs,ou,nu,ru,mn,ps,au,su,iu,ms,du,cu,X,yo,lu,fs,hu,pu,us,mu,fu,wo,fn,_s,uu,_u,gu,un,gs,ku,bu,vu,ks,Tu,yu,_t,zo,wu,bs,zu,xu,gt,xo,Eu,vs,$u,Pu,S,Eo,qu,Ts,Du,Lu,ys,Fu,Iu,$o,ws,Nu,Au,zs,Cu,Ou,xs,Su,Bu,Po,_n,Es,Wu,Ru,Uu,gn,$s,Vu,Gu,ju,F,qo,Hu,Ps,Mu,Xu,Do,Yu,kn,Ju,Ku,Qu,Lo,bn,qs,Zu,e_,t_,vn,Ds,o_,n_,r_,Ls,a_,s_,Fo,Tn,Fs,i_,d_,c_,yn,Is,l_,h_,p_,Ns,m_,f_,kt,Io,u_,As,__,ti;return v=new Gi({}),wt=new Gi({}),zt=new T({props:{name:"class transformers.PreTrainedTokenizer",anchor:"transformers.PreTrainedTokenizer",parameters:[{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.model_max_length",description:`<strong>model_max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length (in number of tokens) for the inputs to the transformer model. When the tokenizer is
loaded with <a href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained">from_pretrained()</a>, this will be set to the
value stored for the associated model in <code>max_model_input_sizes</code> (see above). If no value is provided, will
default to VERY_LARGE_INTEGER (<code>int(1e30)</code>).`,name:"model_max_length"},{anchor:"transformers.PreTrainedTokenizer.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have padding applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizer.truncation_side",description:`<strong>truncation_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have truncation applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"truncation_side"},{anchor:"transformers.PreTrainedTokenizer.model_input_names",description:`<strong>model_input_names</strong> (<code>List[string]</code>, <em>optional</em>) &#x2014;
The list of inputs accepted by the forward pass of the model (like <code>&quot;token_type_ids&quot;</code> or
<code>&quot;attention_mask&quot;</code>). Default value is picked from the class attribute of the same name.`,name:"model_input_names"},{anchor:"transformers.PreTrainedTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the beginning of a sentence. Will be associated to <code>self.bos_token</code> and
<code>self.bos_token_id</code>.`,name:"bos_token"},{anchor:"transformers.PreTrainedTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the end of a sentence. Will be associated to <code>self.eos_token</code> and
<code>self.eos_token_id</code>.`,name:"eos_token"},{anchor:"transformers.PreTrainedTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing an out-of-vocabulary token. Will be associated to <code>self.unk_token</code> and
<code>self.unk_token_id</code>.`,name:"unk_token"},{anchor:"transformers.PreTrainedTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token separating two different sentences in the same input (used by BERT for instance). Will be
associated to <code>self.sep_token</code> and <code>self.sep_token_id</code>.`,name:"sep_token"},{anchor:"transformers.PreTrainedTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation. Will be associated to <code>self.pad_token</code> and <code>self.pad_token_id</code>.`,name:"pad_token"},{anchor:"transformers.PreTrainedTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the class of the input (used by BERT for instance). Will be associated to
<code>self.cls_token</code> and <code>self.cls_token_id</code>.`,name:"cls_token"},{anchor:"transformers.PreTrainedTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing a masked token (used by masked-language modeling pretraining objectives, like
BERT). Will be associated to <code>self.mask_token</code> and <code>self.mask_token_id</code>.`,name:"mask_token"},{anchor:"transformers.PreTrainedTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (tuple or list of <code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A tuple or a list of additional special tokens. Add them here to ensure they won&#x2019;t be split by the
tokenization process. Will be associated to <code>self.additional_special_tokens</code> and
<code>self.additional_special_tokens_ids</code>.`,name:"additional_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should cleanup the spaces that were added when splitting the input text during the
tokenization process.`,name:"clean_up_tokenization_spaces"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils.py#L333"}}),Et=new T({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizer.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizer.__call__.text_target",description:`<strong>text_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_target"},{anchor:"transformers.PreTrainedTokenizer.__call__.text_pair_target",description:`<strong>text_pair_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair_target"},{anchor:"transformers.PreTrainedTokenizer.__call__.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizer.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizer.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizer.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizer.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.PreTrainedTokenizer.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.PreTrainedTokenizer.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L2474",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> \u2014 List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> \u2014 List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>\u201Ctoken_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>overflowing_tokens</strong> \u2014 List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> \u2014 Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> \u2014 List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> \u2014 The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),$t=new T({props:{name:"batch_decode",anchor:"transformers.PreTrainedTokenizer.batch_decode",parameters:[{name:"sequences",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.batch_decode.sequences",description:`<strong>sequences</strong> (<code>Union[List[int], List[List[int]], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"sequences"},{anchor:"transformers.PreTrainedTokenizer.batch_decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.batch_decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizer.batch_decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L3432",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Pt=new T({props:{name:"decode",anchor:"transformers.PreTrainedTokenizer.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.PreTrainedTokenizer.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizer.decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L3466",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),Dt=new T({props:{name:"encode",anchor:"transformers.PreTrainedTokenizer.encode",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[int]]"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[int], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.encode.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>) &#x2014;
The first sequence to be encoded. This can be a string, a list of strings (tokenized string using the
<code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.encode.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second sequence to be encoded. This can be a string, a list of strings (tokenized string using
the <code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizer.encode.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizer.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizer.encode.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizer.encode.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizer.encode.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizer.encode.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizer.encode.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizer.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>
<p>**kwargs &#x2014; Passed along to the <code>.tokenize()</code> method.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L2282",returnDescription:`
<p>The tokenized ids of the text.</p>
`,returnType:`
<p><code>List[int]</code>, <code>torch.Tensor</code>, <code>tf.Tensor</code> or <code>np.ndarray</code></p>
`}}),Ft=new T({props:{name:"push_to_hub",anchor:"transformers.PreTrainedTokenizer.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"use_auth_token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your tokenizer to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload tokenizer&quot;</code>.`,name:"commit_message"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.use_auth_token",description:`<strong>use_auth_token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"use_auth_token"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>).`,name:"max_shard_size"},{anchor:"transformers.PreTrainedTokenizer.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/utils/hub.py#L712"}}),Qe=new sv({props:{anchor:"transformers.PreTrainedTokenizer.push_to_hub.example",$$slots:{default:[fv]},$$scope:{ctx:pe}}}),Nt=new T({props:{name:"convert_ids_to_tokens",anchor:"transformers.PreTrainedTokenizer.convert_ids_to_tokens",parameters:[{name:"ids",val:": typing.Union[int, typing.List[int]]"},{name:"skip_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.convert_ids_to_tokens.ids",description:`<strong>ids</strong> (<code>int</code> or <code>List[int]</code>) &#x2014;
The token id (or token ids) to convert to tokens.`,name:"ids"},{anchor:"transformers.PreTrainedTokenizer.convert_ids_to_tokens.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils.py#L883",returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),At=new T({props:{name:"convert_tokens_to_ids",anchor:"transformers.PreTrainedTokenizer.convert_tokens_to_ids",parameters:[{name:"tokens",val:": typing.Union[str, typing.List[str]]"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.convert_tokens_to_ids.tokens",description:"<strong>tokens</strong> (<code>str</code> or <code>List[str]</code>) &#x2014; One or several token(s) to convert to token id(s).",name:"tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils.py#L560",returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),Ct=new T({props:{name:"get_added_vocab",anchor:"transformers.PreTrainedTokenizer.get_added_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils.py#L369",returnDescription:`
<p>The added tokens.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),Ot=new T({props:{name:"num_special_tokens_to_add",anchor:"transformers.PreTrainedTokenizer.num_special_tokens_to_add",parameters:[{name:"pair",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.num_special_tokens_to_add.pair",description:`<strong>pair</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the number of added tokens should be computed in the case of a sequence pair or a single
sequence.`,name:"pair"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils.py#L458",returnDescription:`
<p>Number of special tokens added to sequences.</p>
`,returnType:`
<p><code>int</code></p>
`}}),ot=new av({props:{$$slots:{default:[uv]},$$scope:{ctx:pe}}}),St=new T({props:{name:"prepare_for_tokenization",anchor:"transformers.PreTrainedTokenizer.prepare_for_tokenization",parameters:[{name:"text",val:": str"},{name:"is_split_into_words",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.prepare_for_tokenization.text",description:`<strong>text</strong> (<code>str</code>) &#x2014;
The text to prepare.`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.prepare_for_tokenization.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.
kwargs &#x2014;
Keyword arguments to use for the tokenization.`,name:"is_split_into_words"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils.py#L821",returnDescription:`
<p>The prepared text and the unused kwargs.</p>
`,returnType:`
<p><code>Tuple[str, Dict[str, Any]]</code></p>
`}}),Bt=new T({props:{name:"tokenize",anchor:"transformers.PreTrainedTokenizer.tokenize",parameters:[{name:"text",val:": str"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizer.tokenize.text",description:`<strong>text</strong> (<code>str</code>) &#x2014;
The sequence to be encoded.`,name:"text"},{anchor:"transformers.PreTrainedTokenizer.tokenize.*kwargs",description:`*<strong>*kwargs</strong> (additional keyword arguments) &#x2014;
Passed along to the model-specific <code>prepare_for_tokenization</code> preprocessing method.`,name:"*kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils.py#L481",returnDescription:`
<p>The list of tokens.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Wt=new Gi({}),Ut=new T({props:{name:"class transformers.PreTrainedTokenizerFast",anchor:"transformers.PreTrainedTokenizerFast",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.model_max_length",description:`<strong>model_max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The maximum length (in number of tokens) for the inputs to the transformer model. When the tokenizer is
loaded with <a href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained">from_pretrained()</a>, this will be set to the
value stored for the associated model in <code>max_model_input_sizes</code> (see above). If no value is provided, will
default to VERY_LARGE_INTEGER (<code>int(1e30)</code>).`,name:"model_max_length"},{anchor:"transformers.PreTrainedTokenizerFast.padding_side",description:`<strong>padding_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have padding applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"padding_side"},{anchor:"transformers.PreTrainedTokenizerFast.truncation_side",description:`<strong>truncation_side</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The side on which the model should have truncation applied. Should be selected between [&#x2018;right&#x2019;, &#x2018;left&#x2019;].
Default value is picked from the class attribute of the same name.`,name:"truncation_side"},{anchor:"transformers.PreTrainedTokenizerFast.model_input_names",description:`<strong>model_input_names</strong> (<code>List[string]</code>, <em>optional</em>) &#x2014;
The list of inputs accepted by the forward pass of the model (like <code>&quot;token_type_ids&quot;</code> or
<code>&quot;attention_mask&quot;</code>). Default value is picked from the class attribute of the same name.`,name:"model_input_names"},{anchor:"transformers.PreTrainedTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the beginning of a sentence. Will be associated to <code>self.bos_token</code> and
<code>self.bos_token_id</code>.`,name:"bos_token"},{anchor:"transformers.PreTrainedTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the end of a sentence. Will be associated to <code>self.eos_token</code> and
<code>self.eos_token_id</code>.`,name:"eos_token"},{anchor:"transformers.PreTrainedTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing an out-of-vocabulary token. Will be associated to <code>self.unk_token</code> and
<code>self.unk_token_id</code>.`,name:"unk_token"},{anchor:"transformers.PreTrainedTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token separating two different sentences in the same input (used by BERT for instance). Will be
associated to <code>self.sep_token</code> and <code>self.sep_token_id</code>.`,name:"sep_token"},{anchor:"transformers.PreTrainedTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token used to make arrays of tokens the same size for batching purpose. Will then be ignored by
attention mechanisms or loss computation. Will be associated to <code>self.pad_token</code> and <code>self.pad_token_id</code>.`,name:"pad_token"},{anchor:"transformers.PreTrainedTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing the class of the input (used by BERT for instance). Will be associated to
<code>self.cls_token</code> and <code>self.cls_token_id</code>.`,name:"cls_token"},{anchor:"transformers.PreTrainedTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A special token representing a masked token (used by masked-language modeling pretraining objectives, like
BERT). Will be associated to <code>self.mask_token</code> and <code>self.mask_token_id</code>.`,name:"mask_token"},{anchor:"transformers.PreTrainedTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (tuple or list of <code>str</code> or <code>tokenizers.AddedToken</code>, <em>optional</em>) &#x2014;
A tuple or a list of additional special tokens. Add them here to ensure they won&#x2019;t be split by the
tokenization process. Will be associated to <code>self.additional_special_tokens</code> and
<code>self.additional_special_tokens_ids</code>.`,name:"additional_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not the model should cleanup the spaces that were added when splitting the input text during the
tokenization process.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerFast.tokenizer_object",description:`<strong>tokenizer_object</strong> (<a href="https://huggingface.co/docs/tokenizers/v0.13.3/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a>) &#x2014;
A <a href="https://huggingface.co/docs/tokenizers/v0.13.3/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a> object from &#x1F917; tokenizers to instantiate from. See <a href="../fast_tokenizers">Using tokenizers from &#x1F917;
tokenizers</a> for more information.`,name:"tokenizer_object"},{anchor:"transformers.PreTrainedTokenizerFast.tokenizer_file",description:`<strong>tokenizer_file</strong> (<code>str</code>) &#x2014;
A path to a local JSON file representing a previously serialized <a href="https://huggingface.co/docs/tokenizers/v0.13.3/en/api/tokenizer#tokenizers.Tokenizer" rel="nofollow">tokenizers.Tokenizer</a> object from &#x1F917;
tokenizers.`,name:"tokenizer_file"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_fast.py#L78"}}),Gt=new T({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizerFast.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"text_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair_target",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"is_split_into_words",val:": bool = False"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence can be a string or a list of strings
(pretokenized string). If the sequences are provided as list of strings (pretokenized), you must set
<code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.text_target",description:`<strong>text_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_target"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.text_pair_target",description:`<strong>text_pair_target</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>, <em>optional</em>) &#x2014;
The sequence or batch of sequences to be encoded as target texts. Each sequence can be a string or a
list of strings (pretokenized string). If the sequences are provided as list of strings (pretokenized),
you must set <code>is_split_into_words=True</code> (to lift the ambiguity with a batch of sequences).`,name:"text_pair_target"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>`,name:"return_tensors"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_token_type_ids",description:`<strong>return_token_type_ids</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return token type IDs. If left to the default, will return the token type IDs according to
the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a>`,name:"return_token_type_ids"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_attention_mask",description:`<strong>return_attention_mask</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether to return the attention mask. If left to the default, will return the attention mask according
to the specific tokenizer&#x2019;s default, defined by the <code>return_outputs</code> attribute.</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a>`,name:"return_attention_mask"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_overflowing_tokens",description:`<strong>return_overflowing_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return overflowing token sequences. If a pair of sequences of input ids (or a batch
of pairs) is provided with <code>truncation_strategy = longest_first</code> or <code>True</code>, an error is raised instead
of returning overflowing tokens.`,name:"return_overflowing_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_special_tokens_mask",description:`<strong>return_special_tokens_mask</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return special tokens mask information.`,name:"return_special_tokens_mask"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_offsets_mapping",description:`<strong>return_offsets_mapping</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return <code>(char_start, char_end)</code> for each token.</p>
<p>This is only available on fast tokenizers inheriting from <a href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>, if using
Python&#x2019;s tokenizer, this method will raise <code>NotImplementedError</code>.`,name:"return_offsets_mapping"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.return_length",description:`<strong>return_length</strong>  (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to return the lengths of the encoded inputs.`,name:"return_length"},{anchor:"transformers.PreTrainedTokenizerFast.__call__.verbose",description:`<strong>verbose</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to print more information and warnings.
**kwargs &#x2014; passed to the <code>self.tokenize()</code> method`,name:"verbose"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L2474",returnDescription:`
<p>A <a
  href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a> with the following fields:</p>
<ul>
<li>
<p><strong>input_ids</strong> \u2014 List of token ids to be fed to a model.</p>
<p><a href="../glossary#input-ids">What are input IDs?</a></p>
</li>
<li>
<p><strong>token_type_ids</strong> \u2014 List of token type ids to be fed to a model (when <code>return_token_type_ids=True</code> or
if <em>\u201Ctoken_type_ids\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#token-type-ids">What are token type IDs?</a></p>
</li>
<li>
<p><strong>attention_mask</strong> \u2014 List of indices specifying which tokens should be attended to by the model (when
<code>return_attention_mask=True</code> or if <em>\u201Cattention_mask\u201D</em> is in <code>self.model_input_names</code>).</p>
<p><a href="../glossary#attention-mask">What are attention masks?</a></p>
</li>
<li>
<p><strong>overflowing_tokens</strong> \u2014 List of overflowing tokens sequences (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>num_truncated_tokens</strong> \u2014 Number of tokens truncated (when a <code>max_length</code> is specified and
<code>return_overflowing_tokens=True</code>).</p>
</li>
<li>
<p><strong>special_tokens_mask</strong> \u2014 List of 0s and 1s, with 1 specifying added special tokens and 0 specifying
regular sequence tokens (when <code>add_special_tokens=True</code> and <code>return_special_tokens_mask=True</code>).</p>
</li>
<li>
<p><strong>length</strong> \u2014 The length of the inputs (when <code>return_length=True</code>)</p>
</li>
</ul>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),jt=new T({props:{name:"batch_decode",anchor:"transformers.PreTrainedTokenizerFast.batch_decode",parameters:[{name:"sequences",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.sequences",description:`<strong>sequences</strong> (<code>Union[List[int], List[List[int]], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"sequences"},{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerFast.batch_decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L3432",returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Ht=new T({props:{name:"decode",anchor:"transformers.PreTrainedTokenizerFast.decode",parameters:[{name:"token_ids",val:": typing.Union[int, typing.List[int], ForwardRef('np.ndarray'), ForwardRef('torch.Tensor'), ForwardRef('tf.Tensor')]"},{name:"skip_special_tokens",val:": bool = False"},{name:"clean_up_tokenization_spaces",val:": bool = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.decode.token_ids",description:`<strong>token_ids</strong> (<code>Union[int, List[int], np.ndarray, torch.Tensor, tf.Tensor]</code>) &#x2014;
List of tokenized input ids. Can be obtained using the <code>__call__</code> method.`,name:"token_ids"},{anchor:"transformers.PreTrainedTokenizerFast.decode.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.decode.clean_up_tokenization_spaces",description:`<strong>clean_up_tokenization_spaces</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to clean up the tokenization spaces. If <code>None</code>, will default to
<code>self.clean_up_tokenization_spaces</code>.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerFast.decode.kwargs",description:`<strong>kwargs</strong> (additional keyword arguments, <em>optional</em>) &#x2014;
Will be passed to the underlying model specific decode method.`,name:"kwargs"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L3466",returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),Xt=new T({props:{name:"encode",anchor:"transformers.PreTrainedTokenizerFast.encode",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[int]]"},{name:"text_pair",val:": typing.Union[str, typing.List[str], typing.List[int], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = None"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.encode.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>) &#x2014;
The first sequence to be encoded. This can be a string, a list of strings (tokenized string using the
<code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text"},{anchor:"transformers.PreTrainedTokenizerFast.encode.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code> or <code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second sequence to be encoded. This can be a string, a list of strings (tokenized string using
the <code>tokenize</code> method) or a list of integers (tokenized string ids using the <code>convert_tokens_to_ids</code>
method).`,name:"text_pair"},{anchor:"transformers.PreTrainedTokenizerFast.encode.add_special_tokens",description:`<strong>add_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to encode the sequences with the special tokens relative to their model.`,name:"add_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.PreTrainedTokenizerFast.encode.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls truncation. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or
to the maximum acceptable input length for the model if that argument is not provided. This will
truncate token by token, removing a token from the longest sequence in the pair if a pair of
sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_first&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the first sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>&apos;only_second&apos;</code>: Truncate to a maximum length specified with the argument <code>max_length</code> or to the
maximum acceptable input length for the model if that argument is not provided. This will only
truncate the second sequence of a pair if a pair of sequences (or a batch of pairs) is provided.</li>
<li><code>False</code> or <code>&apos;do_not_truncate&apos;</code> (default): No truncation (i.e., can output batch with sequence lengths
greater than the model maximum admissible input size).</li>
</ul>`,name:"truncation"},{anchor:"transformers.PreTrainedTokenizerFast.encode.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Controls the maximum length to use by one of the truncation/padding parameters.</p>
<p>If left unset or set to <code>None</code>, this will use the predefined model maximum length if a maximum length
is required by one of the truncation/padding parameters. If the model has no specific maximum input
length (like XLNet) truncation/padding to a maximum length will be deactivated.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerFast.encode.stride",description:`<strong>stride</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If set to a number along with <code>max_length</code>, the overflowing tokens returned when
<code>return_overflowing_tokens=True</code> will contain some tokens from the end of the truncated sequence
returned to provide some overlap between truncated and overflowing sequences. The value of this
argument defines the number of overlapping tokens.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizerFast.encode.is_split_into_words",description:`<strong>is_split_into_words</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the input is already pre-tokenized (e.g., split into words). If set to <code>True</code>, the
tokenizer assumes the input is already split into words (for instance, by splitting it on whitespace)
which it will tokenize. This is useful for NER or token classification.`,name:"is_split_into_words"},{anchor:"transformers.PreTrainedTokenizerFast.encode.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. Requires <code>padding</code> to be activated.
This is especially useful to enable the use of Tensor Cores on NVIDIA hardware with compute capability
<code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerFast.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
If set, will return tensors instead of list of python integers. Acceptable values are:</p>
<ul>
<li><code>&apos;tf&apos;</code>: Return TensorFlow <code>tf.constant</code> objects.</li>
<li><code>&apos;pt&apos;</code>: Return PyTorch <code>torch.Tensor</code> objects.</li>
<li><code>&apos;np&apos;</code>: Return Numpy <code>np.ndarray</code> objects.</li>
</ul>
<p>**kwargs &#x2014; Passed along to the <code>.tokenize()</code> method.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L2282",returnDescription:`
<p>The tokenized ids of the text.</p>
`,returnType:`
<p><code>List[int]</code>, <code>torch.Tensor</code>, <code>tf.Tensor</code> or <code>np.ndarray</code></p>
`}}),Jt=new T({props:{name:"push_to_hub",anchor:"transformers.PreTrainedTokenizerFast.push_to_hub",parameters:[{name:"repo_id",val:": str"},{name:"use_temp_dir",val:": typing.Optional[bool] = None"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"use_auth_token",val:": typing.Union[bool, str, NoneType] = None"},{name:"max_shard_size",val:": typing.Union[int, str, NoneType] = '10GB'"},{name:"create_pr",val:": bool = False"},{name:"**deprecated_kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.repo_id",description:`<strong>repo_id</strong> (<code>str</code>) &#x2014;
The name of the repository you want to push your tokenizer to. It should contain your organization name
when pushing to a given organization.`,name:"repo_id"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub.
Will default to <code>True</code> if there is no directory named like <code>repo_id</code>, <code>False</code> otherwise.`,name:"use_temp_dir"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.commit_message",description:`<strong>commit_message</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Message to commit while pushing. Will default to <code>&quot;Upload tokenizer&quot;</code>.`,name:"commit_message"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private.`,name:"private"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.use_auth_token",description:`<strong>use_auth_token</strong> (<code>bool</code> or <code>str</code>, <em>optional</em>) &#x2014;
The token to use as HTTP bearer authorization for remote files. If <code>True</code>, will use the token generated
when running <code>huggingface-cli login</code> (stored in <code>~/.huggingface</code>). Will default to <code>True</code> if <code>repo_url</code>
is not specified.`,name:"use_auth_token"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.max_shard_size",description:`<strong>max_shard_size</strong> (<code>int</code> or <code>str</code>, <em>optional</em>, defaults to <code>&quot;10GB&quot;</code>) &#x2014;
Only applicable for models. The maximum size for a checkpoint before being sharded. Checkpoints shard
will then be each of size lower than this size. If expressed as a string, needs to be digits followed
by a unit (like <code>&quot;5MB&quot;</code>).`,name:"max_shard_size"},{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.create_pr",description:`<strong>create_pr</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to create a PR with the uploaded files or directly commit.`,name:"create_pr"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/utils/hub.py#L712"}}),it=new sv({props:{anchor:"transformers.PreTrainedTokenizerFast.push_to_hub.example",$$slots:{default:[_v]},$$scope:{ctx:pe}}}),Qt=new T({props:{name:"convert_ids_to_tokens",anchor:"transformers.PreTrainedTokenizerFast.convert_ids_to_tokens",parameters:[{name:"ids",val:": typing.Union[int, typing.List[int]]"},{name:"skip_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.convert_ids_to_tokens.ids",description:`<strong>ids</strong> (<code>int</code> or <code>List[int]</code>) &#x2014;
The token id (or token ids) to convert to tokens.`,name:"ids"},{anchor:"transformers.PreTrainedTokenizerFast.convert_ids_to_tokens.skip_special_tokens",description:`<strong>skip_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to remove special tokens in the decoding.`,name:"skip_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_fast.py#L293",returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),Zt=new T({props:{name:"convert_tokens_to_ids",anchor:"transformers.PreTrainedTokenizerFast.convert_tokens_to_ids",parameters:[{name:"tokens",val:": typing.Union[str, typing.List[str]]"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.convert_tokens_to_ids.tokens",description:"<strong>tokens</strong> (<code>str</code> or <code>List[str]</code>) &#x2014; One or several token(s) to convert to token id(s).",name:"tokens"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_fast.py#L235",returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),eo=new T({props:{name:"get_added_vocab",anchor:"transformers.PreTrainedTokenizerFast.get_added_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_fast.py#L156",returnDescription:`
<p>The added tokens.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),to=new T({props:{name:"num_special_tokens_to_add",anchor:"transformers.PreTrainedTokenizerFast.num_special_tokens_to_add",parameters:[{name:"pair",val:": bool = False"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.num_special_tokens_to_add.pair",description:`<strong>pair</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether the number of added tokens should be computed in the case of a sequence pair or a single
sequence.`,name:"pair"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_fast.py#L272",returnDescription:`
<p>Number of special tokens added to sequences.</p>
`,returnType:`
<p><code>int</code></p>
`}}),ht=new av({props:{$$slots:{default:[gv]},$$scope:{ctx:pe}}}),oo=new T({props:{name:"set_truncation_and_padding",anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding",parameters:[{name:"padding_strategy",val:": PaddingStrategy"},{name:"truncation_strategy",val:": TruncationStrategy"},{name:"max_length",val:": int"},{name:"stride",val:": int"},{name:"pad_to_multiple_of",val:": typing.Optional[int]"}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.padding_strategy",description:`<strong>padding_strategy</strong> (<a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>) &#x2014;
The kind of padding that will be applied to the input`,name:"padding_strategy"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.truncation_strategy",description:`<strong>truncation_strategy</strong> (<a href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.tokenization_utils_base.TruncationStrategy">TruncationStrategy</a>) &#x2014;
The kind of truncation that will be applied to the input`,name:"truncation_strategy"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.max_length",description:`<strong>max_length</strong> (<code>int</code>) &#x2014;
The maximum size of a sequence.`,name:"max_length"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.stride",description:`<strong>stride</strong> (<code>int</code>) &#x2014;
The stride to use when handling overflow.`,name:"stride"},{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.pad_to_multiple_of",description:`<strong>pad_to_multiple_of</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If set will pad the sequence to a multiple of the provided value. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability <code>&gt;= 7.5</code> (Volta).`,name:"pad_to_multiple_of"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_fast.py#L322"}}),no=new T({props:{name:"train_new_from_iterator",anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator",parameters:[{name:"text_iterator",val:""},{name:"vocab_size",val:""},{name:"length",val:" = None"},{name:"new_special_tokens",val:" = None"},{name:"special_tokens_map",val:" = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.text_iterator",description:`<strong>text_iterator</strong> (generator of <code>List[str]</code>) &#x2014;
The training corpus. Should be a generator of batches of texts, for instance a list of lists of texts
if you have everything in memory.`,name:"text_iterator"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.vocab_size",description:`<strong>vocab_size</strong> (<code>int</code>) &#x2014;
The size of the vocabulary you want for your tokenizer.`,name:"vocab_size"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.length",description:`<strong>length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
The total number of sequences in the iterator. This is used to provide meaningful progress tracking`,name:"length"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.new_special_tokens",description:`<strong>new_special_tokens</strong> (list of <code>str</code> or <code>AddedToken</code>, <em>optional</em>) &#x2014;
A list of new special tokens to add to the tokenizer you are training.`,name:"new_special_tokens"},{anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator.special_tokens_map",description:`<strong>special_tokens_map</strong> (<code>Dict[str, str]</code>, <em>optional</em>) &#x2014;
If you want to rename some of the special tokens this tokenizer uses, pass along a mapping old special
token name to new special token name in this argument.
kwargs &#x2014;
Additional keyword arguments passed along to the trainer from the &#x1F917; Tokenizers library.`,name:"special_tokens_map"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_fast.py#L610",returnDescription:`
<p>A new tokenizer of the same type as the original one, trained on
<code>text_iterator</code>.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"
>PreTrainedTokenizerFast</a></p>
`}}),ro=new Gi({}),ao=new T({props:{name:"class transformers.BatchEncoding",anchor:"transformers.BatchEncoding",parameters:[{name:"data",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"encoding",val:": typing.Union[tokenizers.Encoding, typing.Sequence[tokenizers.Encoding], NoneType] = None"},{name:"tensor_type",val:": typing.Union[NoneType, str, transformers.utils.generic.TensorType] = None"},{name:"prepend_batch_axis",val:": bool = False"},{name:"n_sequences",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.data",description:`<strong>data</strong> (<code>dict</code>) &#x2014;
Dictionary of lists/arrays/tensors returned by the <code>__call__</code>/<code>encode_plus</code>/<code>batch_encode_plus</code> methods
(&#x2018;input_ids&#x2019;, &#x2018;attention_mask&#x2019;, etc.).`,name:"data"},{anchor:"transformers.BatchEncoding.encoding",description:`<strong>encoding</strong> (<code>tokenizers.Encoding</code> or <code>Sequence[tokenizers.Encoding]</code>, <em>optional</em>) &#x2014;
If the tokenizer is a fast tokenizer which outputs additional information like mapping from word/character
space to token space the <code>tokenizers.Encoding</code> instance or list of instance (for batches) hold this
information.`,name:"encoding"},{anchor:"transformers.BatchEncoding.tensor_type",description:`<strong>tensor_type</strong> (<code>Union[None, str, TensorType]</code>, <em>optional</em>) &#x2014;
You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.`,name:"tensor_type"},{anchor:"transformers.BatchEncoding.prepend_batch_axis",description:`<strong>prepend_batch_axis</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add a batch axis when converting to tensors (see <code>tensor_type</code> above).`,name:"prepend_batch_axis"},{anchor:"transformers.BatchEncoding.n_sequences",description:`<strong>n_sequences</strong> (<code>Optional[int]</code>, <em>optional</em>) &#x2014;
You can give a tensor_type here to convert the lists of integers in PyTorch/TensorFlow/Numpy Tensors at
initialization.`,name:"n_sequences"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L164"}}),io=new T({props:{name:"char_to_token",anchor:"transformers.BatchEncoding.char_to_token",parameters:[{name:"batch_or_char_index",val:": int"},{name:"char_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.char_to_token.batch_or_char_index",description:`<strong>batch_or_char_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the word in the sequence`,name:"batch_or_char_index"},{anchor:"transformers.BatchEncoding.char_to_token.char_index",description:`<strong>char_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the word in the
sequence.`,name:"char_index"},{anchor:"transformers.BatchEncoding.char_to_token.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided character index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L538",returnDescription:`
<p>Index of the token.</p>
`,returnType:`
<p><code>int</code></p>
`}}),lo=new T({props:{name:"char_to_word",anchor:"transformers.BatchEncoding.char_to_word",parameters:[{name:"batch_or_char_index",val:": int"},{name:"char_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.char_to_word.batch_or_char_index",description:`<strong>batch_or_char_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the character in the original string.`,name:"batch_or_char_index"},{anchor:"transformers.BatchEncoding.char_to_word.char_index",description:`<strong>char_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the character in the
original string.`,name:"char_index"},{anchor:"transformers.BatchEncoding.char_to_word.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided character index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L624",returnDescription:`
<p>Index or indices of the associated encoded token(s).</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),po=new T({props:{name:"convert_to_tensors",anchor:"transformers.BatchEncoding.convert_to_tensors",parameters:[{name:"tensor_type",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"prepend_batch_axis",val:": bool = False"}],parametersDescription:[{anchor:"transformers.BatchEncoding.convert_to_tensors.tensor_type",description:`<strong>tensor_type</strong> (<code>str</code> or <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.TensorType">TensorType</a>, <em>optional</em>) &#x2014;
The type of tensors to use. If <code>str</code>, should be one of the values of the enum <a href="/docs/transformers/v4.29.0/en/internal/file_utils#transformers.TensorType">TensorType</a>. If
<code>None</code>, no modification is done.`,name:"tensor_type"},{anchor:"transformers.BatchEncoding.convert_to_tensors.prepend_batch_axis",description:`<strong>prepend_batch_axis</strong> (<code>int</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to add the batch dimension during the conversion.`,name:"prepend_batch_axis"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L663"}}),mo=new T({props:{name:"sequence_ids",anchor:"transformers.BatchEncoding.sequence_ids",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.sequence_ids.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L302",returnDescription:`
<p>A list indicating the sequence id corresponding to each token. Special tokens added
by the tokenizer are mapped to <code>None</code> and other tokens are mapped to the index of their corresponding
sequence.</p>
`,returnType:`
<p><code>List[Optional[int]]</code></p>
`}}),fo=new T({props:{name:"to",anchor:"transformers.BatchEncoding.to",parameters:[{name:"device",val:": typing.Union[str, ForwardRef('torch.device')]"}],parametersDescription:[{anchor:"transformers.BatchEncoding.to.device",description:"<strong>device</strong> (<code>str</code> or <code>torch.device</code>) &#x2014; The device to put the tensors on.",name:"device"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L743",returnDescription:`
<p>The same instance after modification.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),_o=new T({props:{name:"token_to_chars",anchor:"transformers.BatchEncoding.token_to_chars",parameters:[{name:"batch_or_token_index",val:": int"},{name:"token_index",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.token_to_chars.batch_or_token_index",description:`<strong>batch_or_token_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the token in the sequence.`,name:"batch_or_token_index"},{anchor:"transformers.BatchEncoding.token_to_chars.token_index",description:`<strong>token_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the token or tokens in
the sequence.`,name:"token_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L499",returnDescription:`
<p>Span of characters in the original string, or None, if the token
(e.g. <s>, </s>) doesn\u2019t correspond to any chars in the origin string.</p>
`,returnType:`
<p><a
  href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.CharSpan"
>CharSpan</a></p>
`}}),vo=new T({props:{name:"token_to_sequence",anchor:"transformers.BatchEncoding.token_to_sequence",parameters:[{name:"batch_or_token_index",val:": int"},{name:"token_index",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.token_to_sequence.batch_or_token_index",description:`<strong>batch_or_token_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprises one sequence, this can be the index of
the token in the sequence.`,name:"batch_or_token_index"},{anchor:"transformers.BatchEncoding.token_to_sequence.token_index",description:`<strong>token_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the token in the
sequence.`,name:"token_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L369",returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),yo=new T({props:{name:"token_to_word",anchor:"transformers.BatchEncoding.token_to_word",parameters:[{name:"batch_or_token_index",val:": int"},{name:"token_index",val:": typing.Optional[int] = None"}],parametersDescription:[{anchor:"transformers.BatchEncoding.token_to_word.batch_or_token_index",description:`<strong>batch_or_token_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the token in the sequence.`,name:"batch_or_token_index"},{anchor:"transformers.BatchEncoding.token_to_word.token_index",description:`<strong>token_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the token in the
sequence.`,name:"token_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L408",returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),zo=new T({props:{name:"tokens",anchor:"transformers.BatchEncoding.tokens",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.tokens.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L284",returnDescription:`
<p>The list of tokens at that index.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),xo=new T({props:{name:"word_ids",anchor:"transformers.BatchEncoding.word_ids",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.word_ids.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L350",returnDescription:`
<p>A list indicating the word corresponding to each token. Special tokens added by the
tokenizer are mapped to <code>None</code> and other tokens are mapped to the index of their corresponding word
(several tokens will be mapped to the same word index if they are parts of that word).</p>
`,returnType:`
<p><code>List[Optional[int]]</code></p>
`}}),Eo=new T({props:{name:"word_to_chars",anchor:"transformers.BatchEncoding.word_to_chars",parameters:[{name:"batch_or_word_index",val:": int"},{name:"word_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.word_to_chars.batch_or_word_index",description:`<strong>batch_or_word_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprise one sequence, this can be the index of
the word in the sequence`,name:"batch_or_word_index"},{anchor:"transformers.BatchEncoding.word_to_chars.word_index",description:`<strong>word_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the word in the
sequence.`,name:"word_index"},{anchor:"transformers.BatchEncoding.word_to_chars.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided word index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L579",returnDescription:`
<p>Span(s) of the associated character or characters in the string. CharSpan
are NamedTuple with:</p>
<ul>
<li>start: index of the first character associated to the token in the original string</li>
<li>end: index of the character following the last character associated to the token in the original
string</li>
</ul>
`,returnType:`
<p><code>CharSpan</code> or <code>List[CharSpan]</code></p>
`}}),qo=new T({props:{name:"word_to_tokens",anchor:"transformers.BatchEncoding.word_to_tokens",parameters:[{name:"batch_or_word_index",val:": int"},{name:"word_index",val:": typing.Optional[int] = None"},{name:"sequence_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.word_to_tokens.batch_or_word_index",description:`<strong>batch_or_word_index</strong> (<code>int</code>) &#x2014;
Index of the sequence in the batch. If the batch only comprises one sequence, this can be the index of
the word in the sequence.`,name:"batch_or_word_index"},{anchor:"transformers.BatchEncoding.word_to_tokens.word_index",description:`<strong>word_index</strong> (<code>int</code>, <em>optional</em>) &#x2014;
If a batch index is provided in <em>batch_or_token_index</em>, this can be the index of the word in the
sequence.`,name:"word_index"},{anchor:"transformers.BatchEncoding.word_to_tokens.sequence_index",description:`<strong>sequence_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014;
If pair of sequences are encoded in the batch this can be used to specify which sequence in the pair (0
or 1) the provided word index belongs to.`,name:"sequence_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L446",returnDescription:`
<p>Span of tokens in the encoded sequence. Returns
<code>None</code> if no tokens correspond to the word. This can happen especially when the token is a special token
that has been used to format the tokenization. For example when we add a class token at the very beginning
of the tokenization.</p>
`,returnType:`
<p>(<a
  href="/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.TokenSpan"
>TokenSpan</a>, <em>optional</em>)</p>
`}}),Io=new T({props:{name:"words",anchor:"transformers.BatchEncoding.words",parameters:[{name:"batch_index",val:": int = 0"}],parametersDescription:[{anchor:"transformers.BatchEncoding.words.batch_index",description:"<strong>batch_index</strong> (<code>int</code>, <em>optional</em>, defaults to 0) &#x2014; The index to access in the batch.",name:"batch_index"}],source:"https://github.com/huggingface/transformers/blob/v4.29.0/src/transformers/tokenization_utils_base.py#L326",returnDescription:`
<p>A list indicating the word corresponding to each token. Special tokens added by the
tokenizer are mapped to <code>None</code> and other tokens are mapped to the index of their corresponding word
(several tokens will be mapped to the same word index if they are parts of that word).</p>
`,returnType:`
<p><code>List[Optional[int]]</code></p>
`}}),{c(){y=r("meta"),L=d(),q=r("h1"),E=r("a"),B=r("span"),h(v.$$.fragment),I=d(),Bn=r("span"),ji=o("Tokenizer"),Us=d(),He=r("p"),Hi=o(`A tokenizer is in charge of preparing the inputs for a model. The library contains tokenizers for all the models. Most
of the tokenizers are available in two flavors: a full python implementation and a \u201CFast\u201D implementation based on the
Rust library `),Tt=r("a"),Mi=o("\u{1F917} Tokenizers"),Xi=o(". The \u201CFast\u201D implementations allows:"),Vs=d(),Me=r("ol"),Wn=r("li"),Yi=o("a significant speed-up in particular when doing batched tokenization and"),Ji=d(),Rn=r("li"),Ki=o(`additional methods to map between the original string (character and words) and the token space (e.g. getting the
index of the token comprising a given character or the span of characters corresponding to a given token).`),Gs=d(),W=r("p"),Qi=o("The base classes "),Oo=r("a"),Zi=o("PreTrainedTokenizer"),ed=o(" and "),So=r("a"),td=o("PreTrainedTokenizerFast"),od=o(`
implement the common methods for encoding string inputs in model inputs (see below) and instantiating/saving python and
\u201CFast\u201D tokenizers either from a local file or directory or from a pretrained tokenizer provided by the library
(downloaded from HuggingFace\u2019s AWS S3 repository). They both rely on
`),Bo=r("a"),nd=o("PreTrainedTokenizerBase"),rd=o(` that contains the common methods, and
`),Wo=r("a"),ad=o("SpecialTokensMixin"),sd=o("."),js=d(),Ie=r("p"),Ro=r("a"),id=o("PreTrainedTokenizer"),dd=o(" and "),Uo=r("a"),cd=o("PreTrainedTokenizerFast"),ld=o(` thus implement the main
methods for using all the tokenizers:`),Hs=d(),me=r("ul"),Un=r("li"),hd=o(`Tokenizing (splitting strings in sub-word token strings), converting tokens strings to ids and back, and
encoding/decoding (i.e., tokenizing and converting to integers).`),pd=d(),Vn=r("li"),md=o("Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),fd=d(),Gn=r("li"),ud=o(`Managing special tokens (like mask, beginning-of-sentence, etc.): adding them, assigning them to attributes in the
tokenizer for easy access and making sure they are not split during tokenization.`),Ms=d(),D=r("p"),Vo=r("a"),_d=o("BatchEncoding"),gd=o(` holds the output of the
`),Go=r("a"),kd=o("PreTrainedTokenizerBase"),bd=o("\u2019s encoding methods ("),jn=r("code"),vd=o("__call__"),Td=o(`,
`),Hn=r("code"),yd=o("encode_plus"),wd=o(" and "),Mn=r("code"),zd=o("batch_encode_plus"),xd=o(`) and is derived from a Python dictionary. When the tokenizer is a pure python
tokenizer, this class behaves just like a standard python dictionary and holds the various model inputs computed by
these methods (`),Xn=r("code"),Ed=o("input_ids"),$d=o(", "),Yn=r("code"),Pd=o("attention_mask"),qd=o(`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),yt=r("a"),Dd=o("tokenizers library"),Ld=o(`), this class provides in addition
several advanced alignment methods which can be used to map between the original string (character and words) and the
token space (e.g., getting the index of the token comprising a given character or the span of characters corresponding
to a given token).`),Xs=d(),Ne=r("h2"),Xe=r("a"),Jn=r("span"),h(wt.$$.fragment),Fd=d(),Kn=r("span"),Id=o("PreTrainedTokenizer"),Ys=d(),g=r("div"),h(zt.$$.fragment),Nd=d(),Qn=r("p"),Ad=o("Base class for all slow tokenizers."),Cd=d(),xt=r("p"),Od=o("Inherits from "),jo=r("a"),Sd=o("PreTrainedTokenizerBase"),Bd=o("."),Wd=d(),Zn=r("p"),Rd=o(`Handle all the shared methods for tokenization and special tokens as well as methods downloading/caching/loading
pretrained tokenizers as well as adding tokens to the vocabulary.`),Ud=d(),er=r("p"),Vd=o(`This class also contain the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),Gd=d(),tr=r("p"),jd=o("Class attributes (overridden by derived classes)"),Hd=d(),N=r("ul"),fe=r("li"),or=r("strong"),Md=o("vocab_files_names"),Xd=o(" ("),nr=r("code"),Yd=o("Dict[str, str]"),Jd=o(") \u2014 A dictionary with, as keys, the "),rr=r("code"),Kd=o("__init__"),Qd=o(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Zd=d(),R=r("li"),ar=r("strong"),ec=o("pretrained_vocab_files_map"),tc=o(" ("),sr=r("code"),oc=o("Dict[str, Dict[str, str]]"),nc=o(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ir=r("code"),rc=o("__init__"),ac=o(` keyword name of each vocabulary file required by the model, the
low-level being the `),dr=r("code"),sc=o("short-cut-names"),ic=o(" of the pretrained models with, as associated values, the "),cr=r("code"),dc=o("url"),cc=o(` to the
associated pretrained vocabulary file.`),lc=d(),Q=r("li"),lr=r("strong"),hc=o("max_model_input_sizes"),pc=o(" ("),hr=r("code"),mc=o("Dict[str, Optional[int]]"),fc=o(") \u2014 A dictionary with, as keys, the "),pr=r("code"),uc=o("short-cut-names"),_c=o(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),mr=r("code"),gc=o("None"),kc=o(" if the model has no maximum input size."),bc=d(),U=r("li"),fr=r("strong"),vc=o("pretrained_init_configuration"),Tc=o(" ("),ur=r("code"),yc=o("Dict[str, Dict[str, Any]]"),wc=o(`) \u2014 A dictionary with, as keys, the
`),_r=r("code"),zc=o("short-cut-names"),xc=o(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),gr=r("code"),Ec=o("__init__"),$c=o(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Ho=r("a"),Pc=o("from_pretrained()"),qc=o(" method."),Dc=d(),Ye=r("li"),kr=r("strong"),Lc=o("model_input_names"),Fc=o(" ("),br=r("code"),Ic=o("List[str]"),Nc=o(") \u2014 A list of inputs expected in the forward pass of the model."),Ac=d(),Z=r("li"),vr=r("strong"),Cc=o("padding_side"),Oc=o(" ("),Tr=r("code"),Sc=o("str"),Bc=o(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),yr=r("code"),Wc=o("'right'"),Rc=o(" or "),wr=r("code"),Uc=o("'left'"),Vc=o("."),Gc=d(),ee=r("li"),zr=r("strong"),jc=o("truncation_side"),Hc=o(" ("),xr=r("code"),Mc=o("str"),Xc=o(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),Er=r("code"),Yc=o("'right'"),Jc=o(" or "),$r=r("code"),Kc=o("'left'"),Qc=o("."),Zc=d(),Je=r("div"),h(Et.$$.fragment),el=d(),Pr=r("p"),tl=o(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),ol=d(),Ke=r("div"),h($t.$$.fragment),nl=d(),qr=r("p"),rl=o("Convert a list of lists of token ids into a list of strings by calling decode."),al=d(),ue=r("div"),h(Pt.$$.fragment),sl=d(),Dr=r("p"),il=o(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),dl=d(),qt=r("p"),cl=o("Similar to doing "),Lr=r("code"),ll=o("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),hl=o("."),pl=d(),_e=r("div"),h(Dt.$$.fragment),ml=d(),Fr=r("p"),fl=o("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),ul=d(),Lt=r("p"),_l=o("Same as doing "),Ir=r("code"),gl=o("self.convert_tokens_to_ids(self.tokenize(text))"),kl=o("."),bl=d(),ge=r("div"),h(Ft.$$.fragment),vl=d(),It=r("p"),Tl=o(`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Nr=r("code"),yl=o("repo_path_or_name"),wl=o("."),zl=d(),h(Qe.$$.fragment),xl=d(),Ze=r("div"),h(Nt.$$.fragment),El=d(),Ar=r("p"),$l=o(`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Pl=d(),et=r("div"),h(At.$$.fragment),ql=d(),Cr=r("p"),Dl=o(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Ll=d(),tt=r("div"),h(Ct.$$.fragment),Fl=d(),Or=r("p"),Il=o("Returns the added tokens in the vocabulary as a dictionary of token to index."),Nl=d(),ke=r("div"),h(Ot.$$.fragment),Al=d(),Sr=r("p"),Cl=o("Returns the number of added tokens when encoding a sequence with special tokens."),Ol=d(),h(ot.$$.fragment),Sl=d(),be=r("div"),h(St.$$.fragment),Bl=d(),Br=r("p"),Wl=o("Performs any necessary transformations before tokenization."),Rl=d(),Ae=r("p"),Ul=o("This method should pop the arguments from kwargs and return the remaining "),Wr=r("code"),Vl=o("kwargs"),Gl=o(` as well. We test the
`),Rr=r("code"),jl=o("kwargs"),Hl=o(" at the end of the encoding process to be sure all the arguments have been used."),Ml=d(),ve=r("div"),h(Bt.$$.fragment),Xl=d(),Ur=r("p"),Yl=o("Converts a string in a sequence of tokens, using the tokenizer."),Jl=d(),Vr=r("p"),Kl=o(`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),Js=d(),Ce=r("h2"),nt=r("a"),Gr=r("span"),h(Wt.$$.fragment),Ql=d(),jr=r("span"),Zl=o("PreTrainedTokenizerFast"),Ks=d(),te=r("p"),eh=o("The "),Mo=r("a"),th=o("PreTrainedTokenizerFast"),oh=o(" depend on the "),Rt=r("a"),nh=o("tokenizers"),rh=o(` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),Xo=r("a"),ah=o("Using tokenizers from \u{1F917} tokenizers"),sh=o(" page to understand how this is done."),Qs=d(),k=r("div"),h(Ut.$$.fragment),ih=d(),Hr=r("p"),dh=o("Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),ch=d(),Vt=r("p"),lh=o("Inherits from "),Yo=r("a"),hh=o("PreTrainedTokenizerBase"),ph=o("."),mh=d(),Mr=r("p"),fh=o(`Handles all the shared methods for tokenization and special tokens, as well as methods for
downloading/caching/loading pretrained tokenizers, as well as adding tokens to the vocabulary.`),uh=d(),Xr=r("p"),_h=o(`This class also contains the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),gh=d(),Yr=r("p"),kh=o("Class attributes (overridden by derived classes)"),bh=d(),A=r("ul"),Te=r("li"),Jr=r("strong"),vh=o("vocab_files_names"),Th=o(" ("),Kr=r("code"),yh=o("Dict[str, str]"),wh=o(") \u2014 A dictionary with, as keys, the "),Qr=r("code"),zh=o("__init__"),xh=o(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Eh=d(),V=r("li"),Zr=r("strong"),$h=o("pretrained_vocab_files_map"),Ph=o(" ("),ea=r("code"),qh=o("Dict[str, Dict[str, str]]"),Dh=o(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ta=r("code"),Lh=o("__init__"),Fh=o(` keyword name of each vocabulary file required by the model, the
low-level being the `),oa=r("code"),Ih=o("short-cut-names"),Nh=o(" of the pretrained models with, as associated values, the "),na=r("code"),Ah=o("url"),Ch=o(` to the
associated pretrained vocabulary file.`),Oh=d(),oe=r("li"),ra=r("strong"),Sh=o("max_model_input_sizes"),Bh=o(" ("),aa=r("code"),Wh=o("Dict[str, Optional[int]]"),Rh=o(") \u2014 A dictionary with, as keys, the "),sa=r("code"),Uh=o("short-cut-names"),Vh=o(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),ia=r("code"),Gh=o("None"),jh=o(" if the model has no maximum input size."),Hh=d(),G=r("li"),da=r("strong"),Mh=o("pretrained_init_configuration"),Xh=o(" ("),ca=r("code"),Yh=o("Dict[str, Dict[str, Any]]"),Jh=o(`) \u2014 A dictionary with, as keys, the
`),la=r("code"),Kh=o("short-cut-names"),Qh=o(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ha=r("code"),Zh=o("__init__"),ep=o(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Jo=r("a"),tp=o("from_pretrained()"),op=o(" method."),np=d(),rt=r("li"),pa=r("strong"),rp=o("model_input_names"),ap=o(" ("),ma=r("code"),sp=o("List[str]"),ip=o(") \u2014 A list of inputs expected in the forward pass of the model."),dp=d(),ne=r("li"),fa=r("strong"),cp=o("padding_side"),lp=o(" ("),ua=r("code"),hp=o("str"),pp=o(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),_a=r("code"),mp=o("'right'"),fp=o(" or "),ga=r("code"),up=o("'left'"),_p=o("."),gp=d(),re=r("li"),ka=r("strong"),kp=o("truncation_side"),bp=o(" ("),ba=r("code"),vp=o("str"),Tp=o(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),va=r("code"),yp=o("'right'"),wp=o(" or "),Ta=r("code"),zp=o("'left'"),xp=o("."),Ep=d(),at=r("div"),h(Gt.$$.fragment),$p=d(),ya=r("p"),Pp=o(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),qp=d(),st=r("div"),h(jt.$$.fragment),Dp=d(),wa=r("p"),Lp=o("Convert a list of lists of token ids into a list of strings by calling decode."),Fp=d(),ye=r("div"),h(Ht.$$.fragment),Ip=d(),za=r("p"),Np=o(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Ap=d(),Mt=r("p"),Cp=o("Similar to doing "),xa=r("code"),Op=o("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Sp=o("."),Bp=d(),we=r("div"),h(Xt.$$.fragment),Wp=d(),Ea=r("p"),Rp=o("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Up=d(),Yt=r("p"),Vp=o("Same as doing "),$a=r("code"),Gp=o("self.convert_tokens_to_ids(self.tokenize(text))"),jp=o("."),Hp=d(),ze=r("div"),h(Jt.$$.fragment),Mp=d(),Kt=r("p"),Xp=o(`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Pa=r("code"),Yp=o("repo_path_or_name"),Jp=o("."),Kp=d(),h(it.$$.fragment),Qp=d(),dt=r("div"),h(Qt.$$.fragment),Zp=d(),qa=r("p"),em=o(`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),tm=d(),ct=r("div"),h(Zt.$$.fragment),om=d(),Da=r("p"),nm=o(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),rm=d(),lt=r("div"),h(eo.$$.fragment),am=d(),La=r("p"),sm=o("Returns the added tokens in the vocabulary as a dictionary of token to index."),im=d(),xe=r("div"),h(to.$$.fragment),dm=d(),Fa=r("p"),cm=o("Returns the number of added tokens when encoding a sequence with special tokens."),lm=d(),h(ht.$$.fragment),hm=d(),Ee=r("div"),h(oo.$$.fragment),pm=d(),Ia=r("p"),mm=o(`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),fm=d(),Na=r("p"),um=o(`The provided tokenizer has no padding / truncation strategy before the managed section. If your tokenizer set a
padding / truncation strategy before, then it will be reset to no padding / truncation when exiting the managed
section.`),_m=d(),pt=r("div"),h(no.$$.fragment),gm=d(),Aa=r("p"),km=o(`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),Zs=d(),Oe=r("h2"),mt=r("a"),Ca=r("span"),h(ro.$$.fragment),bm=d(),Oa=r("span"),vm=o("BatchEncoding"),ei=d(),w=r("div"),h(ao.$$.fragment),Tm=d(),ie=r("p"),ym=o("Holds the output of the "),so=r("a"),Sa=r("strong"),wm=o("call"),zm=o("()"),xm=o(`,
`),Ko=r("a"),Em=o("encode_plus()"),$m=o(` and
`),Qo=r("a"),Pm=o("batch_encode_plus()"),qm=o(" methods (tokens, attention_masks, etc)."),Dm=d(),Ba=r("p"),Lm=o(`This class is derived from a python dictionary and can be used as a dictionary. In addition, this class exposes
utility methods to map from word/character space to token space.`),Fm=d(),j=r("div"),h(io.$$.fragment),Im=d(),Wa=r("p"),Nm=o(`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),Am=d(),Ra=r("p"),Cm=o("Can be called as:"),Om=d(),co=r("ul"),Zo=r("li"),Ua=r("code"),Sm=o("self.char_to_token(char_index)"),Bm=o(" if batch size is 1"),Wm=d(),en=r("li"),Va=r("code"),Rm=o("self.char_to_token(batch_index, char_index)"),Um=o(" if batch size is greater or equal to 1"),Vm=d(),Ga=r("p"),Gm=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),jm=d(),H=r("div"),h(lo.$$.fragment),Hm=d(),ja=r("p"),Mm=o(`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),Xm=d(),Ha=r("p"),Ym=o("Can be called as:"),Jm=d(),ho=r("ul"),tn=r("li"),Ma=r("code"),Km=o("self.char_to_word(char_index)"),Qm=o(" if batch size is 1"),Zm=d(),on=r("li"),Xa=r("code"),ef=o("self.char_to_word(batch_index, char_index)"),tf=o(" if batch size is greater than 1"),of=d(),Ya=r("p"),nf=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),rf=d(),ft=r("div"),h(po.$$.fragment),af=d(),Ja=r("p"),sf=o("Convert the inner content to tensors."),df=d(),$e=r("div"),h(mo.$$.fragment),cf=d(),Ka=r("p"),lf=o("Return a list mapping the tokens to the id of their original sentences:"),hf=d(),Se=r("ul"),nn=r("li"),Qa=r("code"),pf=o("None"),mf=o(" for special tokens added around or between sequences,"),ff=d(),rn=r("li"),Za=r("code"),uf=o("0"),_f=o(" for tokens corresponding to words in the first sequence,"),gf=d(),an=r("li"),es=r("code"),kf=o("1"),bf=o(` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),vf=d(),ut=r("div"),h(fo.$$.fragment),Tf=d(),uo=r("p"),yf=o("Send all values to device by calling "),ts=r("code"),wf=o("v.to(device)"),zf=o(" (PyTorch only)."),xf=d(),O=r("div"),h(_o.$$.fragment),Ef=d(),os=r("p"),$f=o("Get the character span corresponding to an encoded token in a sequence of the batch."),Pf=d(),go=r("p"),qf=o("Character spans are returned as a "),sn=r("a"),Df=o("CharSpan"),Lf=o(" with:"),Ff=d(),ko=r("ul"),dn=r("li"),ns=r("strong"),If=o("start"),Nf=o(" \u2014 Index of the first character in the original string associated to the token."),Af=d(),cn=r("li"),rs=r("strong"),Cf=o("end"),Of=o(` \u2014 Index of the character following the last character in the original string associated to the
token.`),Sf=d(),as=r("p"),Bf=o("Can be called as:"),Wf=d(),bo=r("ul"),ln=r("li"),ss=r("code"),Rf=o("self.token_to_chars(token_index)"),Uf=o(" if batch size is 1"),Vf=d(),hn=r("li"),is=r("code"),Gf=o("self.token_to_chars(batch_index, token_index)"),jf=o(" if batch size is greater or equal to 1"),Hf=d(),M=r("div"),h(vo.$$.fragment),Mf=d(),Be=r("p"),Xf=o("Get the index of the sequence represented by the given token. In the general use case, this method returns "),ds=r("code"),Yf=o("0"),Jf=o(`
for a single sequence or the first sequence of a pair, and `),cs=r("code"),Kf=o("1"),Qf=o(" for the second sequence of a pair"),Zf=d(),ls=r("p"),eu=o("Can be called as:"),tu=d(),To=r("ul"),pn=r("li"),hs=r("code"),ou=o("self.token_to_sequence(token_index)"),nu=o(" if batch size is 1"),ru=d(),mn=r("li"),ps=r("code"),au=o("self.token_to_sequence(batch_index, token_index)"),su=o(" if batch size is greater than 1"),iu=d(),ms=r("p"),du=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),cu=d(),X=r("div"),h(yo.$$.fragment),lu=d(),fs=r("p"),hu=o("Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),pu=d(),us=r("p"),mu=o("Can be called as:"),fu=d(),wo=r("ul"),fn=r("li"),_s=r("code"),uu=o("self.token_to_word(token_index)"),_u=o(" if batch size is 1"),gu=d(),un=r("li"),gs=r("code"),ku=o("self.token_to_word(batch_index, token_index)"),bu=o(" if batch size is greater than 1"),vu=d(),ks=r("p"),Tu=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),yu=d(),_t=r("div"),h(zo.$$.fragment),wu=d(),bs=r("p"),zu=o(`Return the list of tokens (sub-parts of the input strings after word/subword splitting and before conversion to
integer indices) at a given batch index (only works for the output of a fast tokenizer).`),xu=d(),gt=r("div"),h(xo.$$.fragment),Eu=d(),vs=r("p"),$u=o("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),Pu=d(),S=r("div"),h(Eo.$$.fragment),qu=d(),Ts=r("p"),Du=o("Get the character span in the original string corresponding to given word in a sequence of the batch."),Lu=d(),ys=r("p"),Fu=o("Character spans are returned as a CharSpan NamedTuple with:"),Iu=d(),$o=r("ul"),ws=r("li"),Nu=o("start: index of the first character in the original string"),Au=d(),zs=r("li"),Cu=o("end: index of the character following the last character in the original string"),Ou=d(),xs=r("p"),Su=o("Can be called as:"),Bu=d(),Po=r("ul"),_n=r("li"),Es=r("code"),Wu=o("self.word_to_chars(word_index)"),Ru=o(" if batch size is 1"),Uu=d(),gn=r("li"),$s=r("code"),Vu=o("self.word_to_chars(batch_index, word_index)"),Gu=o(" if batch size is greater or equal to 1"),ju=d(),F=r("div"),h(qo.$$.fragment),Hu=d(),Ps=r("p"),Mu=o("Get the encoded token span corresponding to a word in a sequence of the batch."),Xu=d(),Do=r("p"),Yu=o("Token spans are returned as a "),kn=r("a"),Ju=o("TokenSpan"),Ku=o(" with:"),Qu=d(),Lo=r("ul"),bn=r("li"),qs=r("strong"),Zu=o("start"),e_=o(" \u2014 Index of the first token."),t_=d(),vn=r("li"),Ds=r("strong"),o_=o("end"),n_=o(" \u2014 Index of the token following the last token."),r_=d(),Ls=r("p"),a_=o("Can be called as:"),s_=d(),Fo=r("ul"),Tn=r("li"),Fs=r("code"),i_=o("self.word_to_tokens(word_index, sequence_index: int = 0)"),d_=o(" if batch size is 1"),c_=d(),yn=r("li"),Is=r("code"),l_=o("self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),h_=o(` if batch size is greater or equal to
1`),p_=d(),Ns=r("p"),m_=o(`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),f_=d(),kt=r("div"),h(Io.$$.fragment),u_=d(),As=r("p"),__=o("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),this.h()},l(i){const b=pv('[data-svelte="svelte-1phssyn"]',document.head);y=a(b,"META",{name:!0,content:!0}),b.forEach(t),L=c(i),q=a(i,"H1",{class:!0});var No=s(q);E=a(No,"A",{id:!0,class:!0,href:!0});var Cs=s(E);B=a(Cs,"SPAN",{});var Os=s(B);p(v.$$.fragment,Os),Os.forEach(t),Cs.forEach(t),I=c(No),Bn=a(No,"SPAN",{});var Ss=s(Bn);ji=n(Ss,"Tokenizer"),Ss.forEach(t),No.forEach(t),Us=c(i),He=a(i,"P",{});var oi=s(He);Hi=n(oi,`A tokenizer is in charge of preparing the inputs for a model. The library contains tokenizers for all the models. Most
of the tokenizers are available in two flavors: a full python implementation and a \u201CFast\u201D implementation based on the
Rust library `),Tt=a(oi,"A",{href:!0,rel:!0});var B_=s(Tt);Mi=n(B_,"\u{1F917} Tokenizers"),B_.forEach(t),Xi=n(oi,". The \u201CFast\u201D implementations allows:"),oi.forEach(t),Vs=c(i),Me=a(i,"OL",{});var ni=s(Me);Wn=a(ni,"LI",{});var W_=s(Wn);Yi=n(W_,"a significant speed-up in particular when doing batched tokenization and"),W_.forEach(t),Ji=c(ni),Rn=a(ni,"LI",{});var R_=s(Rn);Ki=n(R_,`additional methods to map between the original string (character and words) and the token space (e.g. getting the
index of the token comprising a given character or the span of characters corresponding to a given token).`),R_.forEach(t),ni.forEach(t),Gs=c(i),W=a(i,"P",{});var Pe=s(W);Qi=n(Pe,"The base classes "),Oo=a(Pe,"A",{href:!0});var U_=s(Oo);Zi=n(U_,"PreTrainedTokenizer"),U_.forEach(t),ed=n(Pe," and "),So=a(Pe,"A",{href:!0});var V_=s(So);td=n(V_,"PreTrainedTokenizerFast"),V_.forEach(t),od=n(Pe,`
implement the common methods for encoding string inputs in model inputs (see below) and instantiating/saving python and
\u201CFast\u201D tokenizers either from a local file or directory or from a pretrained tokenizer provided by the library
(downloaded from HuggingFace\u2019s AWS S3 repository). They both rely on
`),Bo=a(Pe,"A",{href:!0});var G_=s(Bo);nd=n(G_,"PreTrainedTokenizerBase"),G_.forEach(t),rd=n(Pe,` that contains the common methods, and
`),Wo=a(Pe,"A",{href:!0});var j_=s(Wo);ad=n(j_,"SpecialTokensMixin"),j_.forEach(t),sd=n(Pe,"."),Pe.forEach(t),js=c(i),Ie=a(i,"P",{});var Bs=s(Ie);Ro=a(Bs,"A",{href:!0});var H_=s(Ro);id=n(H_,"PreTrainedTokenizer"),H_.forEach(t),dd=n(Bs," and "),Uo=a(Bs,"A",{href:!0});var M_=s(Uo);cd=n(M_,"PreTrainedTokenizerFast"),M_.forEach(t),ld=n(Bs,` thus implement the main
methods for using all the tokenizers:`),Bs.forEach(t),Hs=c(i),me=a(i,"UL",{});var wn=s(me);Un=a(wn,"LI",{});var X_=s(Un);hd=n(X_,`Tokenizing (splitting strings in sub-word token strings), converting tokens strings to ids and back, and
encoding/decoding (i.e., tokenizing and converting to integers).`),X_.forEach(t),pd=c(wn),Vn=a(wn,"LI",{});var Y_=s(Vn);md=n(Y_,"Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),Y_.forEach(t),fd=c(wn),Gn=a(wn,"LI",{});var J_=s(Gn);ud=n(J_,`Managing special tokens (like mask, beginning-of-sentence, etc.): adding them, assigning them to attributes in the
tokenizer for easy access and making sure they are not split during tokenization.`),J_.forEach(t),wn.forEach(t),Ms=c(i),D=a(i,"P",{});var C=s(D);Vo=a(C,"A",{href:!0});var K_=s(Vo);_d=n(K_,"BatchEncoding"),K_.forEach(t),gd=n(C,` holds the output of the
`),Go=a(C,"A",{href:!0});var Q_=s(Go);kd=n(Q_,"PreTrainedTokenizerBase"),Q_.forEach(t),bd=n(C,"\u2019s encoding methods ("),jn=a(C,"CODE",{});var Z_=s(jn);vd=n(Z_,"__call__"),Z_.forEach(t),Td=n(C,`,
`),Hn=a(C,"CODE",{});var eg=s(Hn);yd=n(eg,"encode_plus"),eg.forEach(t),wd=n(C," and "),Mn=a(C,"CODE",{});var tg=s(Mn);zd=n(tg,"batch_encode_plus"),tg.forEach(t),xd=n(C,`) and is derived from a Python dictionary. When the tokenizer is a pure python
tokenizer, this class behaves just like a standard python dictionary and holds the various model inputs computed by
these methods (`),Xn=a(C,"CODE",{});var og=s(Xn);Ed=n(og,"input_ids"),og.forEach(t),$d=n(C,", "),Yn=a(C,"CODE",{});var ng=s(Yn);Pd=n(ng,"attention_mask"),ng.forEach(t),qd=n(C,`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),yt=a(C,"A",{href:!0,rel:!0});var rg=s(yt);Dd=n(rg,"tokenizers library"),rg.forEach(t),Ld=n(C,`), this class provides in addition
several advanced alignment methods which can be used to map between the original string (character and words) and the
token space (e.g., getting the index of the token comprising a given character or the span of characters corresponding
to a given token).`),C.forEach(t),Xs=c(i),Ne=a(i,"H2",{class:!0});var ri=s(Ne);Xe=a(ri,"A",{id:!0,class:!0,href:!0});var ag=s(Xe);Jn=a(ag,"SPAN",{});var sg=s(Jn);p(wt.$$.fragment,sg),sg.forEach(t),ag.forEach(t),Fd=c(ri),Kn=a(ri,"SPAN",{});var ig=s(Kn);Id=n(ig,"PreTrainedTokenizer"),ig.forEach(t),ri.forEach(t),Ys=c(i),g=a(i,"DIV",{class:!0});var z=s(g);p(zt.$$.fragment,z),Nd=c(z),Qn=a(z,"P",{});var dg=s(Qn);Ad=n(dg,"Base class for all slow tokenizers."),dg.forEach(t),Cd=c(z),xt=a(z,"P",{});var ai=s(xt);Od=n(ai,"Inherits from "),jo=a(ai,"A",{href:!0});var cg=s(jo);Sd=n(cg,"PreTrainedTokenizerBase"),cg.forEach(t),Bd=n(ai,"."),ai.forEach(t),Wd=c(z),Zn=a(z,"P",{});var lg=s(Zn);Rd=n(lg,`Handle all the shared methods for tokenization and special tokens as well as methods downloading/caching/loading
pretrained tokenizers as well as adding tokens to the vocabulary.`),lg.forEach(t),Ud=c(z),er=a(z,"P",{});var hg=s(er);Vd=n(hg,`This class also contain the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),hg.forEach(t),Gd=c(z),tr=a(z,"P",{});var pg=s(tr);jd=n(pg,"Class attributes (overridden by derived classes)"),pg.forEach(t),Hd=c(z),N=a(z,"UL",{});var Y=s(N);fe=a(Y,"LI",{});var Ao=s(fe);or=a(Ao,"STRONG",{});var mg=s(or);Md=n(mg,"vocab_files_names"),mg.forEach(t),Xd=n(Ao," ("),nr=a(Ao,"CODE",{});var fg=s(nr);Yd=n(fg,"Dict[str, str]"),fg.forEach(t),Jd=n(Ao,") \u2014 A dictionary with, as keys, the "),rr=a(Ao,"CODE",{});var ug=s(rr);Kd=n(ug,"__init__"),ug.forEach(t),Qd=n(Ao,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Ao.forEach(t),Zd=c(Y),R=a(Y,"LI",{});var de=s(R);ar=a(de,"STRONG",{});var _g=s(ar);ec=n(_g,"pretrained_vocab_files_map"),_g.forEach(t),tc=n(de," ("),sr=a(de,"CODE",{});var gg=s(sr);oc=n(gg,"Dict[str, Dict[str, str]]"),gg.forEach(t),nc=n(de,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ir=a(de,"CODE",{});var kg=s(ir);rc=n(kg,"__init__"),kg.forEach(t),ac=n(de,` keyword name of each vocabulary file required by the model, the
low-level being the `),dr=a(de,"CODE",{});var bg=s(dr);sc=n(bg,"short-cut-names"),bg.forEach(t),ic=n(de," of the pretrained models with, as associated values, the "),cr=a(de,"CODE",{});var vg=s(cr);dc=n(vg,"url"),vg.forEach(t),cc=n(de,` to the
associated pretrained vocabulary file.`),de.forEach(t),lc=c(Y),Q=a(Y,"LI",{});var We=s(Q);lr=a(We,"STRONG",{});var Tg=s(lr);hc=n(Tg,"max_model_input_sizes"),Tg.forEach(t),pc=n(We," ("),hr=a(We,"CODE",{});var yg=s(hr);mc=n(yg,"Dict[str, Optional[int]]"),yg.forEach(t),fc=n(We,") \u2014 A dictionary with, as keys, the "),pr=a(We,"CODE",{});var wg=s(pr);uc=n(wg,"short-cut-names"),wg.forEach(t),_c=n(We,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),mr=a(We,"CODE",{});var zg=s(mr);gc=n(zg,"None"),zg.forEach(t),kc=n(We," if the model has no maximum input size."),We.forEach(t),bc=c(Y),U=a(Y,"LI",{});var ce=s(U);fr=a(ce,"STRONG",{});var xg=s(fr);vc=n(xg,"pretrained_init_configuration"),xg.forEach(t),Tc=n(ce," ("),ur=a(ce,"CODE",{});var Eg=s(ur);yc=n(Eg,"Dict[str, Dict[str, Any]]"),Eg.forEach(t),wc=n(ce,`) \u2014 A dictionary with, as keys, the
`),_r=a(ce,"CODE",{});var $g=s(_r);zc=n($g,"short-cut-names"),$g.forEach(t),xc=n(ce,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),gr=a(ce,"CODE",{});var Pg=s(gr);Ec=n(Pg,"__init__"),Pg.forEach(t),$c=n(ce,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Ho=a(ce,"A",{href:!0});var qg=s(Ho);Pc=n(qg,"from_pretrained()"),qg.forEach(t),qc=n(ce," method."),ce.forEach(t),Dc=c(Y),Ye=a(Y,"LI",{});var Ws=s(Ye);kr=a(Ws,"STRONG",{});var Dg=s(kr);Lc=n(Dg,"model_input_names"),Dg.forEach(t),Fc=n(Ws," ("),br=a(Ws,"CODE",{});var Lg=s(br);Ic=n(Lg,"List[str]"),Lg.forEach(t),Nc=n(Ws,") \u2014 A list of inputs expected in the forward pass of the model."),Ws.forEach(t),Ac=c(Y),Z=a(Y,"LI",{});var Re=s(Z);vr=a(Re,"STRONG",{});var Fg=s(vr);Cc=n(Fg,"padding_side"),Fg.forEach(t),Oc=n(Re," ("),Tr=a(Re,"CODE",{});var Ig=s(Tr);Sc=n(Ig,"str"),Ig.forEach(t),Bc=n(Re,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),yr=a(Re,"CODE",{});var Ng=s(yr);Wc=n(Ng,"'right'"),Ng.forEach(t),Rc=n(Re," or "),wr=a(Re,"CODE",{});var Ag=s(wr);Uc=n(Ag,"'left'"),Ag.forEach(t),Vc=n(Re,"."),Re.forEach(t),Gc=c(Y),ee=a(Y,"LI",{});var Ue=s(ee);zr=a(Ue,"STRONG",{});var Cg=s(zr);jc=n(Cg,"truncation_side"),Cg.forEach(t),Hc=n(Ue," ("),xr=a(Ue,"CODE",{});var Og=s(xr);Mc=n(Og,"str"),Og.forEach(t),Xc=n(Ue,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),Er=a(Ue,"CODE",{});var Sg=s(Er);Yc=n(Sg,"'right'"),Sg.forEach(t),Jc=n(Ue," or "),$r=a(Ue,"CODE",{});var Bg=s($r);Kc=n(Bg,"'left'"),Bg.forEach(t),Qc=n(Ue,"."),Ue.forEach(t),Y.forEach(t),Zc=c(z),Je=a(z,"DIV",{class:!0});var si=s(Je);p(Et.$$.fragment,si),el=c(si),Pr=a(si,"P",{});var Wg=s(Pr);tl=n(Wg,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Wg.forEach(t),si.forEach(t),ol=c(z),Ke=a(z,"DIV",{class:!0});var ii=s(Ke);p($t.$$.fragment,ii),nl=c(ii),qr=a(ii,"P",{});var Rg=s(qr);rl=n(Rg,"Convert a list of lists of token ids into a list of strings by calling decode."),Rg.forEach(t),ii.forEach(t),al=c(z),ue=a(z,"DIV",{class:!0});var zn=s(ue);p(Pt.$$.fragment,zn),sl=c(zn),Dr=a(zn,"P",{});var Ug=s(Dr);il=n(Ug,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Ug.forEach(t),dl=c(zn),qt=a(zn,"P",{});var di=s(qt);cl=n(di,"Similar to doing "),Lr=a(di,"CODE",{});var Vg=s(Lr);ll=n(Vg,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Vg.forEach(t),hl=n(di,"."),di.forEach(t),zn.forEach(t),pl=c(z),_e=a(z,"DIV",{class:!0});var xn=s(_e);p(Dt.$$.fragment,xn),ml=c(xn),Fr=a(xn,"P",{});var Gg=s(Fr);fl=n(Gg,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Gg.forEach(t),ul=c(xn),Lt=a(xn,"P",{});var ci=s(Lt);_l=n(ci,"Same as doing "),Ir=a(ci,"CODE",{});var jg=s(Ir);gl=n(jg,"self.convert_tokens_to_ids(self.tokenize(text))"),jg.forEach(t),kl=n(ci,"."),ci.forEach(t),xn.forEach(t),bl=c(z),ge=a(z,"DIV",{class:!0});var En=s(ge);p(Ft.$$.fragment,En),vl=c(En),It=a(En,"P",{});var li=s(It);Tl=n(li,`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Nr=a(li,"CODE",{});var Hg=s(Nr);yl=n(Hg,"repo_path_or_name"),Hg.forEach(t),wl=n(li,"."),li.forEach(t),zl=c(En),p(Qe.$$.fragment,En),En.forEach(t),xl=c(z),Ze=a(z,"DIV",{class:!0});var hi=s(Ze);p(Nt.$$.fragment,hi),El=c(hi),Ar=a(hi,"P",{});var Mg=s(Ar);$l=n(Mg,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Mg.forEach(t),hi.forEach(t),Pl=c(z),et=a(z,"DIV",{class:!0});var pi=s(et);p(At.$$.fragment,pi),ql=c(pi),Cr=a(pi,"P",{});var Xg=s(Cr);Dl=n(Xg,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Xg.forEach(t),pi.forEach(t),Ll=c(z),tt=a(z,"DIV",{class:!0});var mi=s(tt);p(Ct.$$.fragment,mi),Fl=c(mi),Or=a(mi,"P",{});var Yg=s(Or);Il=n(Yg,"Returns the added tokens in the vocabulary as a dictionary of token to index."),Yg.forEach(t),mi.forEach(t),Nl=c(z),ke=a(z,"DIV",{class:!0});var $n=s(ke);p(Ot.$$.fragment,$n),Al=c($n),Sr=a($n,"P",{});var Jg=s(Sr);Cl=n(Jg,"Returns the number of added tokens when encoding a sequence with special tokens."),Jg.forEach(t),Ol=c($n),p(ot.$$.fragment,$n),$n.forEach(t),Sl=c(z),be=a(z,"DIV",{class:!0});var Pn=s(be);p(St.$$.fragment,Pn),Bl=c(Pn),Br=a(Pn,"P",{});var Kg=s(Br);Wl=n(Kg,"Performs any necessary transformations before tokenization."),Kg.forEach(t),Rl=c(Pn),Ae=a(Pn,"P",{});var qn=s(Ae);Ul=n(qn,"This method should pop the arguments from kwargs and return the remaining "),Wr=a(qn,"CODE",{});var Qg=s(Wr);Vl=n(Qg,"kwargs"),Qg.forEach(t),Gl=n(qn,` as well. We test the
`),Rr=a(qn,"CODE",{});var Zg=s(Rr);jl=n(Zg,"kwargs"),Zg.forEach(t),Hl=n(qn," at the end of the encoding process to be sure all the arguments have been used."),qn.forEach(t),Pn.forEach(t),Ml=c(z),ve=a(z,"DIV",{class:!0});var Dn=s(ve);p(Bt.$$.fragment,Dn),Xl=c(Dn),Ur=a(Dn,"P",{});var ek=s(Ur);Yl=n(ek,"Converts a string in a sequence of tokens, using the tokenizer."),ek.forEach(t),Jl=c(Dn),Vr=a(Dn,"P",{});var tk=s(Vr);Kl=n(tk,`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),tk.forEach(t),Dn.forEach(t),z.forEach(t),Js=c(i),Ce=a(i,"H2",{class:!0});var fi=s(Ce);nt=a(fi,"A",{id:!0,class:!0,href:!0});var ok=s(nt);Gr=a(ok,"SPAN",{});var nk=s(Gr);p(Wt.$$.fragment,nk),nk.forEach(t),ok.forEach(t),Ql=c(fi),jr=a(fi,"SPAN",{});var rk=s(jr);Zl=n(rk,"PreTrainedTokenizerFast"),rk.forEach(t),fi.forEach(t),Ks=c(i),te=a(i,"P",{});var bt=s(te);eh=n(bt,"The "),Mo=a(bt,"A",{href:!0});var ak=s(Mo);th=n(ak,"PreTrainedTokenizerFast"),ak.forEach(t),oh=n(bt," depend on the "),Rt=a(bt,"A",{href:!0,rel:!0});var sk=s(Rt);nh=n(sk,"tokenizers"),sk.forEach(t),rh=n(bt,` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),Xo=a(bt,"A",{href:!0});var ik=s(Xo);ah=n(ik,"Using tokenizers from \u{1F917} tokenizers"),ik.forEach(t),sh=n(bt," page to understand how this is done."),bt.forEach(t),Qs=c(i),k=a(i,"DIV",{class:!0});var x=s(k);p(Ut.$$.fragment,x),ih=c(x),Hr=a(x,"P",{});var dk=s(Hr);dh=n(dk,"Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),dk.forEach(t),ch=c(x),Vt=a(x,"P",{});var ui=s(Vt);lh=n(ui,"Inherits from "),Yo=a(ui,"A",{href:!0});var ck=s(Yo);hh=n(ck,"PreTrainedTokenizerBase"),ck.forEach(t),ph=n(ui,"."),ui.forEach(t),mh=c(x),Mr=a(x,"P",{});var lk=s(Mr);fh=n(lk,`Handles all the shared methods for tokenization and special tokens, as well as methods for
downloading/caching/loading pretrained tokenizers, as well as adding tokens to the vocabulary.`),lk.forEach(t),uh=c(x),Xr=a(x,"P",{});var hk=s(Xr);_h=n(hk,`This class also contains the added tokens in a unified way on top of all tokenizers so we don\u2019t have to handle the
specific vocabulary augmentation methods of the various underlying dictionary structures (BPE, sentencepiece\u2026).`),hk.forEach(t),gh=c(x),Yr=a(x,"P",{});var pk=s(Yr);kh=n(pk,"Class attributes (overridden by derived classes)"),pk.forEach(t),bh=c(x),A=a(x,"UL",{});var J=s(A);Te=a(J,"LI",{});var Co=s(Te);Jr=a(Co,"STRONG",{});var mk=s(Jr);vh=n(mk,"vocab_files_names"),mk.forEach(t),Th=n(Co," ("),Kr=a(Co,"CODE",{});var fk=s(Kr);yh=n(fk,"Dict[str, str]"),fk.forEach(t),wh=n(Co,") \u2014 A dictionary with, as keys, the "),Qr=a(Co,"CODE",{});var uk=s(Qr);zh=n(uk,"__init__"),uk.forEach(t),xh=n(Co,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Co.forEach(t),Eh=c(J),V=a(J,"LI",{});var le=s(V);Zr=a(le,"STRONG",{});var _k=s(Zr);$h=n(_k,"pretrained_vocab_files_map"),_k.forEach(t),Ph=n(le," ("),ea=a(le,"CODE",{});var gk=s(ea);qh=n(gk,"Dict[str, Dict[str, str]]"),gk.forEach(t),Dh=n(le,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),ta=a(le,"CODE",{});var kk=s(ta);Lh=n(kk,"__init__"),kk.forEach(t),Fh=n(le,` keyword name of each vocabulary file required by the model, the
low-level being the `),oa=a(le,"CODE",{});var bk=s(oa);Ih=n(bk,"short-cut-names"),bk.forEach(t),Nh=n(le," of the pretrained models with, as associated values, the "),na=a(le,"CODE",{});var vk=s(na);Ah=n(vk,"url"),vk.forEach(t),Ch=n(le,` to the
associated pretrained vocabulary file.`),le.forEach(t),Oh=c(J),oe=a(J,"LI",{});var Ve=s(oe);ra=a(Ve,"STRONG",{});var Tk=s(ra);Sh=n(Tk,"max_model_input_sizes"),Tk.forEach(t),Bh=n(Ve," ("),aa=a(Ve,"CODE",{});var yk=s(aa);Wh=n(yk,"Dict[str, Optional[int]]"),yk.forEach(t),Rh=n(Ve,") \u2014 A dictionary with, as keys, the "),sa=a(Ve,"CODE",{});var wk=s(sa);Uh=n(wk,"short-cut-names"),wk.forEach(t),Vh=n(Ve,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),ia=a(Ve,"CODE",{});var zk=s(ia);Gh=n(zk,"None"),zk.forEach(t),jh=n(Ve," if the model has no maximum input size."),Ve.forEach(t),Hh=c(J),G=a(J,"LI",{});var he=s(G);da=a(he,"STRONG",{});var xk=s(da);Mh=n(xk,"pretrained_init_configuration"),xk.forEach(t),Xh=n(he," ("),ca=a(he,"CODE",{});var Ek=s(ca);Yh=n(Ek,"Dict[str, Dict[str, Any]]"),Ek.forEach(t),Jh=n(he,`) \u2014 A dictionary with, as keys, the
`),la=a(he,"CODE",{});var $k=s(la);Kh=n($k,"short-cut-names"),$k.forEach(t),Qh=n(he,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ha=a(he,"CODE",{});var Pk=s(ha);Zh=n(Pk,"__init__"),Pk.forEach(t),ep=n(he,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Jo=a(he,"A",{href:!0});var qk=s(Jo);tp=n(qk,"from_pretrained()"),qk.forEach(t),op=n(he," method."),he.forEach(t),np=c(J),rt=a(J,"LI",{});var Rs=s(rt);pa=a(Rs,"STRONG",{});var Dk=s(pa);rp=n(Dk,"model_input_names"),Dk.forEach(t),ap=n(Rs," ("),ma=a(Rs,"CODE",{});var Lk=s(ma);sp=n(Lk,"List[str]"),Lk.forEach(t),ip=n(Rs,") \u2014 A list of inputs expected in the forward pass of the model."),Rs.forEach(t),dp=c(J),ne=a(J,"LI",{});var Ge=s(ne);fa=a(Ge,"STRONG",{});var Fk=s(fa);cp=n(Fk,"padding_side"),Fk.forEach(t),lp=n(Ge," ("),ua=a(Ge,"CODE",{});var Ik=s(ua);hp=n(Ik,"str"),Ik.forEach(t),pp=n(Ge,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),_a=a(Ge,"CODE",{});var Nk=s(_a);mp=n(Nk,"'right'"),Nk.forEach(t),fp=n(Ge," or "),ga=a(Ge,"CODE",{});var Ak=s(ga);up=n(Ak,"'left'"),Ak.forEach(t),_p=n(Ge,"."),Ge.forEach(t),gp=c(J),re=a(J,"LI",{});var je=s(re);ka=a(je,"STRONG",{});var Ck=s(ka);kp=n(Ck,"truncation_side"),Ck.forEach(t),bp=n(je," ("),ba=a(je,"CODE",{});var Ok=s(ba);vp=n(Ok,"str"),Ok.forEach(t),Tp=n(je,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),va=a(je,"CODE",{});var Sk=s(va);yp=n(Sk,"'right'"),Sk.forEach(t),wp=n(je," or "),Ta=a(je,"CODE",{});var Bk=s(Ta);zp=n(Bk,"'left'"),Bk.forEach(t),xp=n(je,"."),je.forEach(t),J.forEach(t),Ep=c(x),at=a(x,"DIV",{class:!0});var _i=s(at);p(Gt.$$.fragment,_i),$p=c(_i),ya=a(_i,"P",{});var Wk=s(ya);Pp=n(Wk,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Wk.forEach(t),_i.forEach(t),qp=c(x),st=a(x,"DIV",{class:!0});var gi=s(st);p(jt.$$.fragment,gi),Dp=c(gi),wa=a(gi,"P",{});var Rk=s(wa);Lp=n(Rk,"Convert a list of lists of token ids into a list of strings by calling decode."),Rk.forEach(t),gi.forEach(t),Fp=c(x),ye=a(x,"DIV",{class:!0});var Ln=s(ye);p(Ht.$$.fragment,Ln),Ip=c(Ln),za=a(Ln,"P",{});var Uk=s(za);Np=n(Uk,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Uk.forEach(t),Ap=c(Ln),Mt=a(Ln,"P",{});var ki=s(Mt);Cp=n(ki,"Similar to doing "),xa=a(ki,"CODE",{});var Vk=s(xa);Op=n(Vk,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Vk.forEach(t),Sp=n(ki,"."),ki.forEach(t),Ln.forEach(t),Bp=c(x),we=a(x,"DIV",{class:!0});var Fn=s(we);p(Xt.$$.fragment,Fn),Wp=c(Fn),Ea=a(Fn,"P",{});var Gk=s(Ea);Rp=n(Gk,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Gk.forEach(t),Up=c(Fn),Yt=a(Fn,"P",{});var bi=s(Yt);Vp=n(bi,"Same as doing "),$a=a(bi,"CODE",{});var jk=s($a);Gp=n(jk,"self.convert_tokens_to_ids(self.tokenize(text))"),jk.forEach(t),jp=n(bi,"."),bi.forEach(t),Fn.forEach(t),Hp=c(x),ze=a(x,"DIV",{class:!0});var In=s(ze);p(Jt.$$.fragment,In),Mp=c(In),Kt=a(In,"P",{});var vi=s(Kt);Xp=n(vi,`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Pa=a(vi,"CODE",{});var Hk=s(Pa);Yp=n(Hk,"repo_path_or_name"),Hk.forEach(t),Jp=n(vi,"."),vi.forEach(t),Kp=c(In),p(it.$$.fragment,In),In.forEach(t),Qp=c(x),dt=a(x,"DIV",{class:!0});var Ti=s(dt);p(Qt.$$.fragment,Ti),Zp=c(Ti),qa=a(Ti,"P",{});var Mk=s(qa);em=n(Mk,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Mk.forEach(t),Ti.forEach(t),tm=c(x),ct=a(x,"DIV",{class:!0});var yi=s(ct);p(Zt.$$.fragment,yi),om=c(yi),Da=a(yi,"P",{});var Xk=s(Da);nm=n(Xk,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Xk.forEach(t),yi.forEach(t),rm=c(x),lt=a(x,"DIV",{class:!0});var wi=s(lt);p(eo.$$.fragment,wi),am=c(wi),La=a(wi,"P",{});var Yk=s(La);sm=n(Yk,"Returns the added tokens in the vocabulary as a dictionary of token to index."),Yk.forEach(t),wi.forEach(t),im=c(x),xe=a(x,"DIV",{class:!0});var Nn=s(xe);p(to.$$.fragment,Nn),dm=c(Nn),Fa=a(Nn,"P",{});var Jk=s(Fa);cm=n(Jk,"Returns the number of added tokens when encoding a sequence with special tokens."),Jk.forEach(t),lm=c(Nn),p(ht.$$.fragment,Nn),Nn.forEach(t),hm=c(x),Ee=a(x,"DIV",{class:!0});var An=s(Ee);p(oo.$$.fragment,An),pm=c(An),Ia=a(An,"P",{});var Kk=s(Ia);mm=n(Kk,`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),Kk.forEach(t),fm=c(An),Na=a(An,"P",{});var Qk=s(Na);um=n(Qk,`The provided tokenizer has no padding / truncation strategy before the managed section. If your tokenizer set a
padding / truncation strategy before, then it will be reset to no padding / truncation when exiting the managed
section.`),Qk.forEach(t),An.forEach(t),_m=c(x),pt=a(x,"DIV",{class:!0});var zi=s(pt);p(no.$$.fragment,zi),gm=c(zi),Aa=a(zi,"P",{});var Zk=s(Aa);km=n(Zk,`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),Zk.forEach(t),zi.forEach(t),x.forEach(t),Zs=c(i),Oe=a(i,"H2",{class:!0});var xi=s(Oe);mt=a(xi,"A",{id:!0,class:!0,href:!0});var eb=s(mt);Ca=a(eb,"SPAN",{});var tb=s(Ca);p(ro.$$.fragment,tb),tb.forEach(t),eb.forEach(t),bm=c(xi),Oa=a(xi,"SPAN",{});var ob=s(Oa);vm=n(ob,"BatchEncoding"),ob.forEach(t),xi.forEach(t),ei=c(i),w=a(i,"DIV",{class:!0});var P=s(w);p(ao.$$.fragment,P),Tm=c(P),ie=a(P,"P",{});var vt=s(ie);ym=n(vt,"Holds the output of the "),so=a(vt,"A",{href:!0});var g_=s(so);Sa=a(g_,"STRONG",{});var nb=s(Sa);wm=n(nb,"call"),nb.forEach(t),zm=n(g_,"()"),g_.forEach(t),xm=n(vt,`,
`),Ko=a(vt,"A",{href:!0});var rb=s(Ko);Em=n(rb,"encode_plus()"),rb.forEach(t),$m=n(vt,` and
`),Qo=a(vt,"A",{href:!0});var ab=s(Qo);Pm=n(ab,"batch_encode_plus()"),ab.forEach(t),qm=n(vt," methods (tokens, attention_masks, etc)."),vt.forEach(t),Dm=c(P),Ba=a(P,"P",{});var sb=s(Ba);Lm=n(sb,`This class is derived from a python dictionary and can be used as a dictionary. In addition, this class exposes
utility methods to map from word/character space to token space.`),sb.forEach(t),Fm=c(P),j=a(P,"DIV",{class:!0});var qe=s(j);p(io.$$.fragment,qe),Im=c(qe),Wa=a(qe,"P",{});var ib=s(Wa);Nm=n(ib,`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),ib.forEach(t),Am=c(qe),Ra=a(qe,"P",{});var db=s(Ra);Cm=n(db,"Can be called as:"),db.forEach(t),Om=c(qe),co=a(qe,"UL",{});var Ei=s(co);Zo=a(Ei,"LI",{});var k_=s(Zo);Ua=a(k_,"CODE",{});var cb=s(Ua);Sm=n(cb,"self.char_to_token(char_index)"),cb.forEach(t),Bm=n(k_," if batch size is 1"),k_.forEach(t),Wm=c(Ei),en=a(Ei,"LI",{});var b_=s(en);Va=a(b_,"CODE",{});var lb=s(Va);Rm=n(lb,"self.char_to_token(batch_index, char_index)"),lb.forEach(t),Um=n(b_," if batch size is greater or equal to 1"),b_.forEach(t),Ei.forEach(t),Vm=c(qe),Ga=a(qe,"P",{});var hb=s(Ga);Gm=n(hb,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),hb.forEach(t),qe.forEach(t),jm=c(P),H=a(P,"DIV",{class:!0});var De=s(H);p(lo.$$.fragment,De),Hm=c(De),ja=a(De,"P",{});var pb=s(ja);Mm=n(pb,`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),pb.forEach(t),Xm=c(De),Ha=a(De,"P",{});var mb=s(Ha);Ym=n(mb,"Can be called as:"),mb.forEach(t),Jm=c(De),ho=a(De,"UL",{});var $i=s(ho);tn=a($i,"LI",{});var v_=s(tn);Ma=a(v_,"CODE",{});var fb=s(Ma);Km=n(fb,"self.char_to_word(char_index)"),fb.forEach(t),Qm=n(v_," if batch size is 1"),v_.forEach(t),Zm=c($i),on=a($i,"LI",{});var T_=s(on);Xa=a(T_,"CODE",{});var ub=s(Xa);ef=n(ub,"self.char_to_word(batch_index, char_index)"),ub.forEach(t),tf=n(T_," if batch size is greater than 1"),T_.forEach(t),$i.forEach(t),of=c(De),Ya=a(De,"P",{});var _b=s(Ya);nf=n(_b,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),_b.forEach(t),De.forEach(t),rf=c(P),ft=a(P,"DIV",{class:!0});var Pi=s(ft);p(po.$$.fragment,Pi),af=c(Pi),Ja=a(Pi,"P",{});var gb=s(Ja);sf=n(gb,"Convert the inner content to tensors."),gb.forEach(t),Pi.forEach(t),df=c(P),$e=a(P,"DIV",{class:!0});var Cn=s($e);p(mo.$$.fragment,Cn),cf=c(Cn),Ka=a(Cn,"P",{});var kb=s(Ka);lf=n(kb,"Return a list mapping the tokens to the id of their original sentences:"),kb.forEach(t),hf=c(Cn),Se=a(Cn,"UL",{});var On=s(Se);nn=a(On,"LI",{});var y_=s(nn);Qa=a(y_,"CODE",{});var bb=s(Qa);pf=n(bb,"None"),bb.forEach(t),mf=n(y_," for special tokens added around or between sequences,"),y_.forEach(t),ff=c(On),rn=a(On,"LI",{});var w_=s(rn);Za=a(w_,"CODE",{});var vb=s(Za);uf=n(vb,"0"),vb.forEach(t),_f=n(w_," for tokens corresponding to words in the first sequence,"),w_.forEach(t),gf=c(On),an=a(On,"LI",{});var z_=s(an);es=a(z_,"CODE",{});var Tb=s(es);kf=n(Tb,"1"),Tb.forEach(t),bf=n(z_,` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),z_.forEach(t),On.forEach(t),Cn.forEach(t),vf=c(P),ut=a(P,"DIV",{class:!0});var qi=s(ut);p(fo.$$.fragment,qi),Tf=c(qi),uo=a(qi,"P",{});var Di=s(uo);yf=n(Di,"Send all values to device by calling "),ts=a(Di,"CODE",{});var yb=s(ts);wf=n(yb,"v.to(device)"),yb.forEach(t),zf=n(Di," (PyTorch only)."),Di.forEach(t),qi.forEach(t),xf=c(P),O=a(P,"DIV",{class:!0});var ae=s(O);p(_o.$$.fragment,ae),Ef=c(ae),os=a(ae,"P",{});var wb=s(os);$f=n(wb,"Get the character span corresponding to an encoded token in a sequence of the batch."),wb.forEach(t),Pf=c(ae),go=a(ae,"P",{});var Li=s(go);qf=n(Li,"Character spans are returned as a "),sn=a(Li,"A",{href:!0});var zb=s(sn);Df=n(zb,"CharSpan"),zb.forEach(t),Lf=n(Li," with:"),Li.forEach(t),Ff=c(ae),ko=a(ae,"UL",{});var Fi=s(ko);dn=a(Fi,"LI",{});var x_=s(dn);ns=a(x_,"STRONG",{});var xb=s(ns);If=n(xb,"start"),xb.forEach(t),Nf=n(x_," \u2014 Index of the first character in the original string associated to the token."),x_.forEach(t),Af=c(Fi),cn=a(Fi,"LI",{});var E_=s(cn);rs=a(E_,"STRONG",{});var Eb=s(rs);Cf=n(Eb,"end"),Eb.forEach(t),Of=n(E_,` \u2014 Index of the character following the last character in the original string associated to the
token.`),E_.forEach(t),Fi.forEach(t),Sf=c(ae),as=a(ae,"P",{});var $b=s(as);Bf=n($b,"Can be called as:"),$b.forEach(t),Wf=c(ae),bo=a(ae,"UL",{});var Ii=s(bo);ln=a(Ii,"LI",{});var $_=s(ln);ss=a($_,"CODE",{});var Pb=s(ss);Rf=n(Pb,"self.token_to_chars(token_index)"),Pb.forEach(t),Uf=n($_," if batch size is 1"),$_.forEach(t),Vf=c(Ii),hn=a(Ii,"LI",{});var P_=s(hn);is=a(P_,"CODE",{});var qb=s(is);Gf=n(qb,"self.token_to_chars(batch_index, token_index)"),qb.forEach(t),jf=n(P_," if batch size is greater or equal to 1"),P_.forEach(t),Ii.forEach(t),ae.forEach(t),Hf=c(P),M=a(P,"DIV",{class:!0});var Le=s(M);p(vo.$$.fragment,Le),Mf=c(Le),Be=a(Le,"P",{});var Sn=s(Be);Xf=n(Sn,"Get the index of the sequence represented by the given token. In the general use case, this method returns "),ds=a(Sn,"CODE",{});var Db=s(ds);Yf=n(Db,"0"),Db.forEach(t),Jf=n(Sn,`
for a single sequence or the first sequence of a pair, and `),cs=a(Sn,"CODE",{});var Lb=s(cs);Kf=n(Lb,"1"),Lb.forEach(t),Qf=n(Sn," for the second sequence of a pair"),Sn.forEach(t),Zf=c(Le),ls=a(Le,"P",{});var Fb=s(ls);eu=n(Fb,"Can be called as:"),Fb.forEach(t),tu=c(Le),To=a(Le,"UL",{});var Ni=s(To);pn=a(Ni,"LI",{});var q_=s(pn);hs=a(q_,"CODE",{});var Ib=s(hs);ou=n(Ib,"self.token_to_sequence(token_index)"),Ib.forEach(t),nu=n(q_," if batch size is 1"),q_.forEach(t),ru=c(Ni),mn=a(Ni,"LI",{});var D_=s(mn);ps=a(D_,"CODE",{});var Nb=s(ps);au=n(Nb,"self.token_to_sequence(batch_index, token_index)"),Nb.forEach(t),su=n(D_," if batch size is greater than 1"),D_.forEach(t),Ni.forEach(t),iu=c(Le),ms=a(Le,"P",{});var Ab=s(ms);du=n(Ab,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),Ab.forEach(t),Le.forEach(t),cu=c(P),X=a(P,"DIV",{class:!0});var Fe=s(X);p(yo.$$.fragment,Fe),lu=c(Fe),fs=a(Fe,"P",{});var Cb=s(fs);hu=n(Cb,"Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),Cb.forEach(t),pu=c(Fe),us=a(Fe,"P",{});var Ob=s(us);mu=n(Ob,"Can be called as:"),Ob.forEach(t),fu=c(Fe),wo=a(Fe,"UL",{});var Ai=s(wo);fn=a(Ai,"LI",{});var L_=s(fn);_s=a(L_,"CODE",{});var Sb=s(_s);uu=n(Sb,"self.token_to_word(token_index)"),Sb.forEach(t),_u=n(L_," if batch size is 1"),L_.forEach(t),gu=c(Ai),un=a(Ai,"LI",{});var F_=s(un);gs=a(F_,"CODE",{});var Bb=s(gs);ku=n(Bb,"self.token_to_word(batch_index, token_index)"),Bb.forEach(t),bu=n(F_," if batch size is greater than 1"),F_.forEach(t),Ai.forEach(t),vu=c(Fe),ks=a(Fe,"P",{});var Wb=s(ks);Tu=n(Wb,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e.,
words are defined by the user). In this case it allows to easily associate encoded tokens with provided
tokenized words.`),Wb.forEach(t),Fe.forEach(t),yu=c(P),_t=a(P,"DIV",{class:!0});var Ci=s(_t);p(zo.$$.fragment,Ci),wu=c(Ci),bs=a(Ci,"P",{});var Rb=s(bs);zu=n(Rb,`Return the list of tokens (sub-parts of the input strings after word/subword splitting and before conversion to
integer indices) at a given batch index (only works for the output of a fast tokenizer).`),Rb.forEach(t),Ci.forEach(t),xu=c(P),gt=a(P,"DIV",{class:!0});var Oi=s(gt);p(xo.$$.fragment,Oi),Eu=c(Oi),vs=a(Oi,"P",{});var Ub=s(vs);$u=n(Ub,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),Ub.forEach(t),Oi.forEach(t),Pu=c(P),S=a(P,"DIV",{class:!0});var se=s(S);p(Eo.$$.fragment,se),qu=c(se),Ts=a(se,"P",{});var Vb=s(Ts);Du=n(Vb,"Get the character span in the original string corresponding to given word in a sequence of the batch."),Vb.forEach(t),Lu=c(se),ys=a(se,"P",{});var Gb=s(ys);Fu=n(Gb,"Character spans are returned as a CharSpan NamedTuple with:"),Gb.forEach(t),Iu=c(se),$o=a(se,"UL",{});var Si=s($o);ws=a(Si,"LI",{});var jb=s(ws);Nu=n(jb,"start: index of the first character in the original string"),jb.forEach(t),Au=c(Si),zs=a(Si,"LI",{});var Hb=s(zs);Cu=n(Hb,"end: index of the character following the last character in the original string"),Hb.forEach(t),Si.forEach(t),Ou=c(se),xs=a(se,"P",{});var Mb=s(xs);Su=n(Mb,"Can be called as:"),Mb.forEach(t),Bu=c(se),Po=a(se,"UL",{});var Bi=s(Po);_n=a(Bi,"LI",{});var I_=s(_n);Es=a(I_,"CODE",{});var Xb=s(Es);Wu=n(Xb,"self.word_to_chars(word_index)"),Xb.forEach(t),Ru=n(I_," if batch size is 1"),I_.forEach(t),Uu=c(Bi),gn=a(Bi,"LI",{});var N_=s(gn);$s=a(N_,"CODE",{});var Yb=s($s);Vu=n(Yb,"self.word_to_chars(batch_index, word_index)"),Yb.forEach(t),Gu=n(N_," if batch size is greater or equal to 1"),N_.forEach(t),Bi.forEach(t),se.forEach(t),ju=c(P),F=a(P,"DIV",{class:!0});var K=s(F);p(qo.$$.fragment,K),Hu=c(K),Ps=a(K,"P",{});var Jb=s(Ps);Mu=n(Jb,"Get the encoded token span corresponding to a word in a sequence of the batch."),Jb.forEach(t),Xu=c(K),Do=a(K,"P",{});var Wi=s(Do);Yu=n(Wi,"Token spans are returned as a "),kn=a(Wi,"A",{href:!0});var Kb=s(kn);Ju=n(Kb,"TokenSpan"),Kb.forEach(t),Ku=n(Wi," with:"),Wi.forEach(t),Qu=c(K),Lo=a(K,"UL",{});var Ri=s(Lo);bn=a(Ri,"LI",{});var A_=s(bn);qs=a(A_,"STRONG",{});var Qb=s(qs);Zu=n(Qb,"start"),Qb.forEach(t),e_=n(A_," \u2014 Index of the first token."),A_.forEach(t),t_=c(Ri),vn=a(Ri,"LI",{});var C_=s(vn);Ds=a(C_,"STRONG",{});var Zb=s(Ds);o_=n(Zb,"end"),Zb.forEach(t),n_=n(C_," \u2014 Index of the token following the last token."),C_.forEach(t),Ri.forEach(t),r_=c(K),Ls=a(K,"P",{});var ev=s(Ls);a_=n(ev,"Can be called as:"),ev.forEach(t),s_=c(K),Fo=a(K,"UL",{});var Ui=s(Fo);Tn=a(Ui,"LI",{});var O_=s(Tn);Fs=a(O_,"CODE",{});var tv=s(Fs);i_=n(tv,"self.word_to_tokens(word_index, sequence_index: int = 0)"),tv.forEach(t),d_=n(O_," if batch size is 1"),O_.forEach(t),c_=c(Ui),yn=a(Ui,"LI",{});var S_=s(yn);Is=a(S_,"CODE",{});var ov=s(Is);l_=n(ov,"self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),ov.forEach(t),h_=n(S_,` if batch size is greater or equal to
1`),S_.forEach(t),Ui.forEach(t),p_=c(K),Ns=a(K,"P",{});var nv=s(Ns);m_=n(nv,`This method is particularly suited when the input sequences are provided as pre-tokenized sequences (i.e. words
are defined by the user). In this case it allows to easily associate encoded tokens with provided tokenized
words.`),nv.forEach(t),K.forEach(t),f_=c(P),kt=a(P,"DIV",{class:!0});var Vi=s(kt);p(Io.$$.fragment,Vi),u_=c(Vi),As=a(Vi,"P",{});var rv=s(As);__=n(rv,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),rv.forEach(t),Vi.forEach(t),P.forEach(t),this.h()},h(){l(y,"name","hf:doc:metadata"),l(y,"content",JSON.stringify(bv)),l(E,"id","tokenizer"),l(E,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(E,"href","#tokenizer"),l(q,"class","relative group"),l(Tt,"href","https://github.com/huggingface/tokenizers"),l(Tt,"rel","nofollow"),l(Oo,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(So,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Bo,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Wo,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.SpecialTokensMixin"),l(Ro,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Uo,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Vo,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.BatchEncoding"),l(Go,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(yt,"href","https://github.com/huggingface/tokenizers"),l(yt,"rel","nofollow"),l(Xe,"id","transformers.PreTrainedTokenizer"),l(Xe,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(Xe,"href","#transformers.PreTrainedTokenizer"),l(Ne,"class","relative group"),l(jo,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Ho,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),l(Je,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ue,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(et,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(tt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ke,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(be,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ve,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(nt,"id","transformers.PreTrainedTokenizerFast"),l(nt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(nt,"href","#transformers.PreTrainedTokenizerFast"),l(Ce,"class","relative group"),l(Mo,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Rt,"href","https://huggingface.co/docs/tokenizers"),l(Rt,"rel","nofollow"),l(Xo,"href","../fast_tokenizers"),l(Yo,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Jo,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),l(at,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(st,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ye,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(we,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ze,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(dt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ct,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(lt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(xe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(Ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(pt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(mt,"id","transformers.BatchEncoding"),l(mt,"class","header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full"),l(mt,"href","#transformers.BatchEncoding"),l(Oe,"class","relative group"),l(so,"href","/docs/transformers/v4.29.0/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast.__call__"),l(Ko,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode_plus"),l(Qo,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.batch_encode_plus"),l(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ft,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l($e,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ut,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(sn,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.CharSpan"),l(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_t,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(gt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(kn,"href","/docs/transformers/v4.29.0/en/internal/tokenization_utils#transformers.TokenSpan"),l(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(kt,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(w,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(i,b){e(document.head,y),$(i,L,b),$(i,q,b),e(q,E),e(E,B),m(v,B,null),e(q,I),e(q,Bn),e(Bn,ji),$(i,Us,b),$(i,He,b),e(He,Hi),e(He,Tt),e(Tt,Mi),e(He,Xi),$(i,Vs,b),$(i,Me,b),e(Me,Wn),e(Wn,Yi),e(Me,Ji),e(Me,Rn),e(Rn,Ki),$(i,Gs,b),$(i,W,b),e(W,Qi),e(W,Oo),e(Oo,Zi),e(W,ed),e(W,So),e(So,td),e(W,od),e(W,Bo),e(Bo,nd),e(W,rd),e(W,Wo),e(Wo,ad),e(W,sd),$(i,js,b),$(i,Ie,b),e(Ie,Ro),e(Ro,id),e(Ie,dd),e(Ie,Uo),e(Uo,cd),e(Ie,ld),$(i,Hs,b),$(i,me,b),e(me,Un),e(Un,hd),e(me,pd),e(me,Vn),e(Vn,md),e(me,fd),e(me,Gn),e(Gn,ud),$(i,Ms,b),$(i,D,b),e(D,Vo),e(Vo,_d),e(D,gd),e(D,Go),e(Go,kd),e(D,bd),e(D,jn),e(jn,vd),e(D,Td),e(D,Hn),e(Hn,yd),e(D,wd),e(D,Mn),e(Mn,zd),e(D,xd),e(D,Xn),e(Xn,Ed),e(D,$d),e(D,Yn),e(Yn,Pd),e(D,qd),e(D,yt),e(yt,Dd),e(D,Ld),$(i,Xs,b),$(i,Ne,b),e(Ne,Xe),e(Xe,Jn),m(wt,Jn,null),e(Ne,Fd),e(Ne,Kn),e(Kn,Id),$(i,Ys,b),$(i,g,b),m(zt,g,null),e(g,Nd),e(g,Qn),e(Qn,Ad),e(g,Cd),e(g,xt),e(xt,Od),e(xt,jo),e(jo,Sd),e(xt,Bd),e(g,Wd),e(g,Zn),e(Zn,Rd),e(g,Ud),e(g,er),e(er,Vd),e(g,Gd),e(g,tr),e(tr,jd),e(g,Hd),e(g,N),e(N,fe),e(fe,or),e(or,Md),e(fe,Xd),e(fe,nr),e(nr,Yd),e(fe,Jd),e(fe,rr),e(rr,Kd),e(fe,Qd),e(N,Zd),e(N,R),e(R,ar),e(ar,ec),e(R,tc),e(R,sr),e(sr,oc),e(R,nc),e(R,ir),e(ir,rc),e(R,ac),e(R,dr),e(dr,sc),e(R,ic),e(R,cr),e(cr,dc),e(R,cc),e(N,lc),e(N,Q),e(Q,lr),e(lr,hc),e(Q,pc),e(Q,hr),e(hr,mc),e(Q,fc),e(Q,pr),e(pr,uc),e(Q,_c),e(Q,mr),e(mr,gc),e(Q,kc),e(N,bc),e(N,U),e(U,fr),e(fr,vc),e(U,Tc),e(U,ur),e(ur,yc),e(U,wc),e(U,_r),e(_r,zc),e(U,xc),e(U,gr),e(gr,Ec),e(U,$c),e(U,Ho),e(Ho,Pc),e(U,qc),e(N,Dc),e(N,Ye),e(Ye,kr),e(kr,Lc),e(Ye,Fc),e(Ye,br),e(br,Ic),e(Ye,Nc),e(N,Ac),e(N,Z),e(Z,vr),e(vr,Cc),e(Z,Oc),e(Z,Tr),e(Tr,Sc),e(Z,Bc),e(Z,yr),e(yr,Wc),e(Z,Rc),e(Z,wr),e(wr,Uc),e(Z,Vc),e(N,Gc),e(N,ee),e(ee,zr),e(zr,jc),e(ee,Hc),e(ee,xr),e(xr,Mc),e(ee,Xc),e(ee,Er),e(Er,Yc),e(ee,Jc),e(ee,$r),e($r,Kc),e(ee,Qc),e(g,Zc),e(g,Je),m(Et,Je,null),e(Je,el),e(Je,Pr),e(Pr,tl),e(g,ol),e(g,Ke),m($t,Ke,null),e(Ke,nl),e(Ke,qr),e(qr,rl),e(g,al),e(g,ue),m(Pt,ue,null),e(ue,sl),e(ue,Dr),e(Dr,il),e(ue,dl),e(ue,qt),e(qt,cl),e(qt,Lr),e(Lr,ll),e(qt,hl),e(g,pl),e(g,_e),m(Dt,_e,null),e(_e,ml),e(_e,Fr),e(Fr,fl),e(_e,ul),e(_e,Lt),e(Lt,_l),e(Lt,Ir),e(Ir,gl),e(Lt,kl),e(g,bl),e(g,ge),m(Ft,ge,null),e(ge,vl),e(ge,It),e(It,Tl),e(It,Nr),e(Nr,yl),e(It,wl),e(ge,zl),m(Qe,ge,null),e(g,xl),e(g,Ze),m(Nt,Ze,null),e(Ze,El),e(Ze,Ar),e(Ar,$l),e(g,Pl),e(g,et),m(At,et,null),e(et,ql),e(et,Cr),e(Cr,Dl),e(g,Ll),e(g,tt),m(Ct,tt,null),e(tt,Fl),e(tt,Or),e(Or,Il),e(g,Nl),e(g,ke),m(Ot,ke,null),e(ke,Al),e(ke,Sr),e(Sr,Cl),e(ke,Ol),m(ot,ke,null),e(g,Sl),e(g,be),m(St,be,null),e(be,Bl),e(be,Br),e(Br,Wl),e(be,Rl),e(be,Ae),e(Ae,Ul),e(Ae,Wr),e(Wr,Vl),e(Ae,Gl),e(Ae,Rr),e(Rr,jl),e(Ae,Hl),e(g,Ml),e(g,ve),m(Bt,ve,null),e(ve,Xl),e(ve,Ur),e(Ur,Yl),e(ve,Jl),e(ve,Vr),e(Vr,Kl),$(i,Js,b),$(i,Ce,b),e(Ce,nt),e(nt,Gr),m(Wt,Gr,null),e(Ce,Ql),e(Ce,jr),e(jr,Zl),$(i,Ks,b),$(i,te,b),e(te,eh),e(te,Mo),e(Mo,th),e(te,oh),e(te,Rt),e(Rt,nh),e(te,rh),e(te,Xo),e(Xo,ah),e(te,sh),$(i,Qs,b),$(i,k,b),m(Ut,k,null),e(k,ih),e(k,Hr),e(Hr,dh),e(k,ch),e(k,Vt),e(Vt,lh),e(Vt,Yo),e(Yo,hh),e(Vt,ph),e(k,mh),e(k,Mr),e(Mr,fh),e(k,uh),e(k,Xr),e(Xr,_h),e(k,gh),e(k,Yr),e(Yr,kh),e(k,bh),e(k,A),e(A,Te),e(Te,Jr),e(Jr,vh),e(Te,Th),e(Te,Kr),e(Kr,yh),e(Te,wh),e(Te,Qr),e(Qr,zh),e(Te,xh),e(A,Eh),e(A,V),e(V,Zr),e(Zr,$h),e(V,Ph),e(V,ea),e(ea,qh),e(V,Dh),e(V,ta),e(ta,Lh),e(V,Fh),e(V,oa),e(oa,Ih),e(V,Nh),e(V,na),e(na,Ah),e(V,Ch),e(A,Oh),e(A,oe),e(oe,ra),e(ra,Sh),e(oe,Bh),e(oe,aa),e(aa,Wh),e(oe,Rh),e(oe,sa),e(sa,Uh),e(oe,Vh),e(oe,ia),e(ia,Gh),e(oe,jh),e(A,Hh),e(A,G),e(G,da),e(da,Mh),e(G,Xh),e(G,ca),e(ca,Yh),e(G,Jh),e(G,la),e(la,Kh),e(G,Qh),e(G,ha),e(ha,Zh),e(G,ep),e(G,Jo),e(Jo,tp),e(G,op),e(A,np),e(A,rt),e(rt,pa),e(pa,rp),e(rt,ap),e(rt,ma),e(ma,sp),e(rt,ip),e(A,dp),e(A,ne),e(ne,fa),e(fa,cp),e(ne,lp),e(ne,ua),e(ua,hp),e(ne,pp),e(ne,_a),e(_a,mp),e(ne,fp),e(ne,ga),e(ga,up),e(ne,_p),e(A,gp),e(A,re),e(re,ka),e(ka,kp),e(re,bp),e(re,ba),e(ba,vp),e(re,Tp),e(re,va),e(va,yp),e(re,wp),e(re,Ta),e(Ta,zp),e(re,xp),e(k,Ep),e(k,at),m(Gt,at,null),e(at,$p),e(at,ya),e(ya,Pp),e(k,qp),e(k,st),m(jt,st,null),e(st,Dp),e(st,wa),e(wa,Lp),e(k,Fp),e(k,ye),m(Ht,ye,null),e(ye,Ip),e(ye,za),e(za,Np),e(ye,Ap),e(ye,Mt),e(Mt,Cp),e(Mt,xa),e(xa,Op),e(Mt,Sp),e(k,Bp),e(k,we),m(Xt,we,null),e(we,Wp),e(we,Ea),e(Ea,Rp),e(we,Up),e(we,Yt),e(Yt,Vp),e(Yt,$a),e($a,Gp),e(Yt,jp),e(k,Hp),e(k,ze),m(Jt,ze,null),e(ze,Mp),e(ze,Kt),e(Kt,Xp),e(Kt,Pa),e(Pa,Yp),e(Kt,Jp),e(ze,Kp),m(it,ze,null),e(k,Qp),e(k,dt),m(Qt,dt,null),e(dt,Zp),e(dt,qa),e(qa,em),e(k,tm),e(k,ct),m(Zt,ct,null),e(ct,om),e(ct,Da),e(Da,nm),e(k,rm),e(k,lt),m(eo,lt,null),e(lt,am),e(lt,La),e(La,sm),e(k,im),e(k,xe),m(to,xe,null),e(xe,dm),e(xe,Fa),e(Fa,cm),e(xe,lm),m(ht,xe,null),e(k,hm),e(k,Ee),m(oo,Ee,null),e(Ee,pm),e(Ee,Ia),e(Ia,mm),e(Ee,fm),e(Ee,Na),e(Na,um),e(k,_m),e(k,pt),m(no,pt,null),e(pt,gm),e(pt,Aa),e(Aa,km),$(i,Zs,b),$(i,Oe,b),e(Oe,mt),e(mt,Ca),m(ro,Ca,null),e(Oe,bm),e(Oe,Oa),e(Oa,vm),$(i,ei,b),$(i,w,b),m(ao,w,null),e(w,Tm),e(w,ie),e(ie,ym),e(ie,so),e(so,Sa),e(Sa,wm),e(so,zm),e(ie,xm),e(ie,Ko),e(Ko,Em),e(ie,$m),e(ie,Qo),e(Qo,Pm),e(ie,qm),e(w,Dm),e(w,Ba),e(Ba,Lm),e(w,Fm),e(w,j),m(io,j,null),e(j,Im),e(j,Wa),e(Wa,Nm),e(j,Am),e(j,Ra),e(Ra,Cm),e(j,Om),e(j,co),e(co,Zo),e(Zo,Ua),e(Ua,Sm),e(Zo,Bm),e(co,Wm),e(co,en),e(en,Va),e(Va,Rm),e(en,Um),e(j,Vm),e(j,Ga),e(Ga,Gm),e(w,jm),e(w,H),m(lo,H,null),e(H,Hm),e(H,ja),e(ja,Mm),e(H,Xm),e(H,Ha),e(Ha,Ym),e(H,Jm),e(H,ho),e(ho,tn),e(tn,Ma),e(Ma,Km),e(tn,Qm),e(ho,Zm),e(ho,on),e(on,Xa),e(Xa,ef),e(on,tf),e(H,of),e(H,Ya),e(Ya,nf),e(w,rf),e(w,ft),m(po,ft,null),e(ft,af),e(ft,Ja),e(Ja,sf),e(w,df),e(w,$e),m(mo,$e,null),e($e,cf),e($e,Ka),e(Ka,lf),e($e,hf),e($e,Se),e(Se,nn),e(nn,Qa),e(Qa,pf),e(nn,mf),e(Se,ff),e(Se,rn),e(rn,Za),e(Za,uf),e(rn,_f),e(Se,gf),e(Se,an),e(an,es),e(es,kf),e(an,bf),e(w,vf),e(w,ut),m(fo,ut,null),e(ut,Tf),e(ut,uo),e(uo,yf),e(uo,ts),e(ts,wf),e(uo,zf),e(w,xf),e(w,O),m(_o,O,null),e(O,Ef),e(O,os),e(os,$f),e(O,Pf),e(O,go),e(go,qf),e(go,sn),e(sn,Df),e(go,Lf),e(O,Ff),e(O,ko),e(ko,dn),e(dn,ns),e(ns,If),e(dn,Nf),e(ko,Af),e(ko,cn),e(cn,rs),e(rs,Cf),e(cn,Of),e(O,Sf),e(O,as),e(as,Bf),e(O,Wf),e(O,bo),e(bo,ln),e(ln,ss),e(ss,Rf),e(ln,Uf),e(bo,Vf),e(bo,hn),e(hn,is),e(is,Gf),e(hn,jf),e(w,Hf),e(w,M),m(vo,M,null),e(M,Mf),e(M,Be),e(Be,Xf),e(Be,ds),e(ds,Yf),e(Be,Jf),e(Be,cs),e(cs,Kf),e(Be,Qf),e(M,Zf),e(M,ls),e(ls,eu),e(M,tu),e(M,To),e(To,pn),e(pn,hs),e(hs,ou),e(pn,nu),e(To,ru),e(To,mn),e(mn,ps),e(ps,au),e(mn,su),e(M,iu),e(M,ms),e(ms,du),e(w,cu),e(w,X),m(yo,X,null),e(X,lu),e(X,fs),e(fs,hu),e(X,pu),e(X,us),e(us,mu),e(X,fu),e(X,wo),e(wo,fn),e(fn,_s),e(_s,uu),e(fn,_u),e(wo,gu),e(wo,un),e(un,gs),e(gs,ku),e(un,bu),e(X,vu),e(X,ks),e(ks,Tu),e(w,yu),e(w,_t),m(zo,_t,null),e(_t,wu),e(_t,bs),e(bs,zu),e(w,xu),e(w,gt),m(xo,gt,null),e(gt,Eu),e(gt,vs),e(vs,$u),e(w,Pu),e(w,S),m(Eo,S,null),e(S,qu),e(S,Ts),e(Ts,Du),e(S,Lu),e(S,ys),e(ys,Fu),e(S,Iu),e(S,$o),e($o,ws),e(ws,Nu),e($o,Au),e($o,zs),e(zs,Cu),e(S,Ou),e(S,xs),e(xs,Su),e(S,Bu),e(S,Po),e(Po,_n),e(_n,Es),e(Es,Wu),e(_n,Ru),e(Po,Uu),e(Po,gn),e(gn,$s),e($s,Vu),e(gn,Gu),e(w,ju),e(w,F),m(qo,F,null),e(F,Hu),e(F,Ps),e(Ps,Mu),e(F,Xu),e(F,Do),e(Do,Yu),e(Do,kn),e(kn,Ju),e(Do,Ku),e(F,Qu),e(F,Lo),e(Lo,bn),e(bn,qs),e(qs,Zu),e(bn,e_),e(Lo,t_),e(Lo,vn),e(vn,Ds),e(Ds,o_),e(vn,n_),e(F,r_),e(F,Ls),e(Ls,a_),e(F,s_),e(F,Fo),e(Fo,Tn),e(Tn,Fs),e(Fs,i_),e(Tn,d_),e(Fo,c_),e(Fo,yn),e(yn,Is),e(Is,l_),e(yn,h_),e(F,p_),e(F,Ns),e(Ns,m_),e(w,f_),e(w,kt),m(Io,kt,null),e(kt,u_),e(kt,As),e(As,__),ti=!0},p(i,[b]){const No={};b&2&&(No.$$scope={dirty:b,ctx:i}),Qe.$set(No);const Cs={};b&2&&(Cs.$$scope={dirty:b,ctx:i}),ot.$set(Cs);const Os={};b&2&&(Os.$$scope={dirty:b,ctx:i}),it.$set(Os);const Ss={};b&2&&(Ss.$$scope={dirty:b,ctx:i}),ht.$set(Ss)},i(i){ti||(f(v.$$.fragment,i),f(wt.$$.fragment,i),f(zt.$$.fragment,i),f(Et.$$.fragment,i),f($t.$$.fragment,i),f(Pt.$$.fragment,i),f(Dt.$$.fragment,i),f(Ft.$$.fragment,i),f(Qe.$$.fragment,i),f(Nt.$$.fragment,i),f(At.$$.fragment,i),f(Ct.$$.fragment,i),f(Ot.$$.fragment,i),f(ot.$$.fragment,i),f(St.$$.fragment,i),f(Bt.$$.fragment,i),f(Wt.$$.fragment,i),f(Ut.$$.fragment,i),f(Gt.$$.fragment,i),f(jt.$$.fragment,i),f(Ht.$$.fragment,i),f(Xt.$$.fragment,i),f(Jt.$$.fragment,i),f(it.$$.fragment,i),f(Qt.$$.fragment,i),f(Zt.$$.fragment,i),f(eo.$$.fragment,i),f(to.$$.fragment,i),f(ht.$$.fragment,i),f(oo.$$.fragment,i),f(no.$$.fragment,i),f(ro.$$.fragment,i),f(ao.$$.fragment,i),f(io.$$.fragment,i),f(lo.$$.fragment,i),f(po.$$.fragment,i),f(mo.$$.fragment,i),f(fo.$$.fragment,i),f(_o.$$.fragment,i),f(vo.$$.fragment,i),f(yo.$$.fragment,i),f(zo.$$.fragment,i),f(xo.$$.fragment,i),f(Eo.$$.fragment,i),f(qo.$$.fragment,i),f(Io.$$.fragment,i),ti=!0)},o(i){u(v.$$.fragment,i),u(wt.$$.fragment,i),u(zt.$$.fragment,i),u(Et.$$.fragment,i),u($t.$$.fragment,i),u(Pt.$$.fragment,i),u(Dt.$$.fragment,i),u(Ft.$$.fragment,i),u(Qe.$$.fragment,i),u(Nt.$$.fragment,i),u(At.$$.fragment,i),u(Ct.$$.fragment,i),u(Ot.$$.fragment,i),u(ot.$$.fragment,i),u(St.$$.fragment,i),u(Bt.$$.fragment,i),u(Wt.$$.fragment,i),u(Ut.$$.fragment,i),u(Gt.$$.fragment,i),u(jt.$$.fragment,i),u(Ht.$$.fragment,i),u(Xt.$$.fragment,i),u(Jt.$$.fragment,i),u(it.$$.fragment,i),u(Qt.$$.fragment,i),u(Zt.$$.fragment,i),u(eo.$$.fragment,i),u(to.$$.fragment,i),u(ht.$$.fragment,i),u(oo.$$.fragment,i),u(no.$$.fragment,i),u(ro.$$.fragment,i),u(ao.$$.fragment,i),u(io.$$.fragment,i),u(lo.$$.fragment,i),u(po.$$.fragment,i),u(mo.$$.fragment,i),u(fo.$$.fragment,i),u(_o.$$.fragment,i),u(vo.$$.fragment,i),u(yo.$$.fragment,i),u(zo.$$.fragment,i),u(xo.$$.fragment,i),u(Eo.$$.fragment,i),u(qo.$$.fragment,i),u(Io.$$.fragment,i),ti=!1},d(i){t(y),i&&t(L),i&&t(q),_(v),i&&t(Us),i&&t(He),i&&t(Vs),i&&t(Me),i&&t(Gs),i&&t(W),i&&t(js),i&&t(Ie),i&&t(Hs),i&&t(me),i&&t(Ms),i&&t(D),i&&t(Xs),i&&t(Ne),_(wt),i&&t(Ys),i&&t(g),_(zt),_(Et),_($t),_(Pt),_(Dt),_(Ft),_(Qe),_(Nt),_(At),_(Ct),_(Ot),_(ot),_(St),_(Bt),i&&t(Js),i&&t(Ce),_(Wt),i&&t(Ks),i&&t(te),i&&t(Qs),i&&t(k),_(Ut),_(Gt),_(jt),_(Ht),_(Xt),_(Jt),_(it),_(Qt),_(Zt),_(eo),_(to),_(ht),_(oo),_(no),i&&t(Zs),i&&t(Oe),_(ro),i&&t(ei),i&&t(w),_(ao),_(io),_(lo),_(po),_(mo),_(fo),_(_o),_(vo),_(yo),_(zo),_(xo),_(Eo),_(qo),_(Io)}}}const bv={local:"tokenizer",sections:[{local:"transformers.PreTrainedTokenizer",title:"PreTrainedTokenizer"},{local:"transformers.PreTrainedTokenizerFast",title:"PreTrainedTokenizerFast"},{local:"transformers.BatchEncoding",title:"BatchEncoding"}],title:"Tokenizer"};function vv(pe){return mv(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class $v extends cv{constructor(y){super();lv(this,y,vv,kv,hv,{})}}export{$v as default,bv as metadata};
