import{S as db,i as cb,s as lb,e as r,k as d,w as h,t as n,M as hb,c as a,d as t,m as c,a as s,x as p,h as o,b as l,F as e,g as x,y as m,q as f,o as u,B as _}from"../../chunks/vendor-4833417e.js";import{T as sb}from"../../chunks/Tip-fffd6df1.js";import{D as v}from"../../chunks/Docstring-4f315ed9.js";import{C as ib}from"../../chunks/CodeBlock-6a3d1b46.js";import{I as Ri}from"../../chunks/IconCopyLink-4b81c553.js";import"../../chunks/CopyButton-dacfbfaf.js";function pb(_t){let E,A;return{c(){E=r("p"),A=n(`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($){E=a($,"P",{});var P=s(E);A=o(P,`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.`),P.forEach(t)},m($,P){x($,E,P),e(E,A)},d($){$&&t(E)}}}function mb(_t){let E,A;return{c(){E=r("p"),A=n(`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($){E=a($,"P",{});var P=s(E);A=o(P,`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.`),P.forEach(t)},m($,P){x($,E,P),e(E,A)},d($){$&&t(E)}}}function fb(_t){let E,A,$,P,Co,gt,Ui,Ao,ji,Ss,Ue,Vi,kt,Hi,Mi,Ws,je,No,Gi,Xi,Oo,Yi,Rs,N,Ji,Cn,Ki,Qi,An,Zi,ed,Nn,td,nd,On,od,rd,Us,Pe,Sn,ad,sd,Wn,id,dd,js,le,So,cd,ld,Wo,hd,pd,Ro,md,Vs,q,Rn,fd,ud,Un,_d,gd,Uo,kd,vd,jo,bd,yd,Vo,Td,wd,Ho,zd,xd,Mo,Ed,$d,vt,Pd,qd,Hs,qe,Ve,Go,bt,Dd,Xo,Id,Ms,g,yt,Ld,Yo,Bd,Fd,Tt,Cd,jn,Ad,Nd,Od,Jo,Sd,Wd,Ko,Rd,Ud,Qo,jd,Vd,I,he,Zo,Hd,Md,er,Gd,Xd,tr,Yd,Jd,Kd,O,nr,Qd,Zd,or,ec,tc,rr,nc,oc,ar,rc,ac,sr,sc,ic,dc,Y,ir,cc,lc,dr,hc,pc,cr,mc,fc,lr,uc,_c,gc,S,hr,kc,vc,pr,bc,yc,mr,Tc,wc,fr,zc,xc,Vn,Ec,$c,Pc,He,ur,qc,Dc,_r,Ic,Lc,Bc,J,gr,Fc,Cc,kr,Ac,Nc,vr,Oc,Sc,br,Wc,Rc,Uc,K,yr,jc,Vc,Tr,Hc,Mc,wr,Gc,Xc,zr,Yc,Jc,Kc,Me,wt,Qc,xr,Zc,el,Ge,zt,tl,Er,nl,ol,pe,xt,rl,$r,al,sl,Et,il,Pr,dl,cl,ll,me,$t,hl,qr,pl,ml,Pt,fl,Dr,ul,_l,gl,Q,qt,kl,Dt,vl,Ir,bl,yl,Tl,Lr,wl,zl,It,xl,Xe,Lt,El,Br,$l,Pl,Ye,Bt,ql,Fr,Dl,Il,Je,Ft,Ll,Cr,Bl,Fl,fe,Ct,Cl,Ar,Al,Nl,Ke,Ol,ue,At,Sl,Nr,Wl,Rl,De,Ul,Or,jl,Vl,Sr,Hl,Ml,Gl,_e,Nt,Xl,Wr,Yl,Jl,Rr,Kl,Gs,Ie,Qe,Ur,Ot,Ql,jr,Zl,Xs,Z,eh,Hn,th,nh,St,oh,rh,Mn,ah,sh,Ys,k,Wt,ih,Vr,dh,ch,Rt,lh,Gn,hh,ph,mh,Hr,fh,uh,Mr,_h,gh,Gr,kh,vh,L,ge,Xr,bh,yh,Yr,Th,wh,Jr,zh,xh,Eh,W,Kr,$h,Ph,Qr,qh,Dh,Zr,Ih,Lh,ea,Bh,Fh,ta,Ch,Ah,Nh,ee,na,Oh,Sh,oa,Wh,Rh,ra,Uh,jh,aa,Vh,Hh,Mh,R,sa,Gh,Xh,ia,Yh,Jh,da,Kh,Qh,ca,Zh,ep,Xn,tp,np,op,Ze,la,rp,ap,ha,sp,ip,dp,te,pa,cp,lp,ma,hp,pp,fa,mp,fp,ua,up,_p,gp,ne,_a,kp,vp,ga,bp,yp,ka,Tp,wp,va,zp,xp,Ep,et,Ut,$p,ba,Pp,qp,tt,jt,Dp,ya,Ip,Lp,ke,Vt,Bp,Ta,Fp,Cp,Ht,Ap,wa,Np,Op,Sp,ve,Mt,Wp,za,Rp,Up,Gt,jp,xa,Vp,Hp,Mp,oe,Xt,Gp,Yt,Xp,Ea,Yp,Jp,Kp,$a,Qp,Zp,Jt,em,nt,Kt,tm,Pa,nm,om,ot,Qt,rm,qa,am,sm,rt,Zt,im,Da,dm,cm,be,en,lm,Ia,hm,pm,at,mm,ye,tn,fm,La,um,_m,Ba,gm,km,st,nn,vm,Fa,bm,Js,Le,it,Ca,on,ym,Aa,Tm,Ks,b,rn,wm,Be,zm,Yn,xm,Em,Na,$m,Pm,qm,Oa,Dm,Im,U,an,Lm,Sa,Bm,Fm,Wa,Cm,Am,sn,Jn,Ra,Nm,Om,Sm,Kn,Ua,Wm,Rm,Um,ja,jm,Vm,j,dn,Hm,Va,Mm,Gm,Ha,Xm,Ym,cn,Qn,Ma,Jm,Km,Qm,Zn,Ga,Zm,ef,tf,Xa,nf,of,dt,ln,rf,Ya,af,sf,Te,hn,df,Ja,cf,lf,Fe,eo,Ka,hf,pf,mf,to,Qa,ff,uf,_f,no,Za,gf,kf,vf,ct,pn,bf,mn,yf,es,Tf,wf,zf,F,fn,xf,ts,Ef,$f,un,Pf,oo,qf,Df,If,_n,ro,ns,Lf,Bf,Ff,ao,os,Cf,Af,Nf,rs,Of,Sf,gn,so,as,Wf,Rf,Uf,io,ss,jf,Vf,Hf,V,kn,Mf,Ce,Gf,is,Xf,Yf,ds,Jf,Kf,Qf,cs,Zf,eu,vn,co,ls,tu,nu,ou,lo,hs,ru,au,su,ps,iu,du,H,bn,cu,ms,lu,hu,fs,pu,mu,yn,ho,us,fu,uu,_u,po,_s,gu,ku,vu,gs,bu,yu,lt,Tn,Tu,ks,wu,zu,ht,wn,xu,vs,Eu,$u,C,zn,Pu,bs,qu,Du,ys,Iu,Lu,xn,Ts,Bu,Fu,ws,Cu,Au,zs,Nu,Ou,En,mo,xs,Su,Wu,Ru,fo,Es,Uu,ju,Vu,D,$n,Hu,$s,Mu,Gu,Pn,Xu,uo,Yu,Ju,Ku,qn,_o,Ps,Qu,Zu,e_,go,qs,t_,n_,o_,Ds,r_,a_,Dn,ko,Is,s_,i_,d_,vo,Ls,c_,l_,h_,Bs,p_,m_,pt,In,f_,Fs,u_,Qs;return gt=new Ri({}),bt=new Ri({}),yt=new v({props:{name:"class transformers.PreTrainedTokenizer",anchor:"transformers.PreTrainedTokenizer",parameters:[{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils.py#L333",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/pr_15839/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"}]}}),wt=new v({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizerBase.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]]"},{name:"text_pair",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.file_utils.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = False"},{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.file_utils.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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L2379",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#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.PreTrainedTokenizerBase.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/en/internal/file_utils#transformers.file_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.PreTrainedTokenizerBase.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability &gt;= 7.5 (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_15839/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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/pr_15839/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),zt=new v({props:{name:"batch_decode",anchor:"transformers.PreTrainedTokenizerBase.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 = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L3250",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.batch_decode.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 to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerBase.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"}],returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),xt=new v({props:{name:"decode",anchor:"transformers.PreTrainedTokenizerBase.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 = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L3283",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.decode.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 to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerBase.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"}],returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),$t=new v({props:{name:"encode",anchor:"transformers.PreTrainedTokenizerBase.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.file_utils.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"return_tensors",val:": typing.Union[str, transformers.file_utils.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L2189",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/en/internal/file_utils#transformers.file_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.PreTrainedTokenizerBase.encode.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability &gt;= 7.5 (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_15839/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"}],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>
`}}),qt=new v({props:{name:"push_to_hub",anchor:"transformers.file_utils.PushToHubMixin.push_to_hub",parameters:[{name:"repo_path_or_name",val:": typing.Optional[str] = None"},{name:"repo_url",val:": typing.Optional[str] = None"},{name:"use_temp_dir",val:": bool = False"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"organization",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"use_auth_token",val:": typing.Union[bool, str, NoneType] = None"},{name:"**model_card_kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/file_utils.py#L2842",parametersDescription:[{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.repo_path_or_name",description:`<strong>repo_path_or_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Can either be a repository name for your tokenizer in the Hub or a path to a local folder (in which case
the repository will have the name of that local folder). If not specified, will default to the name
given by <code>repo_url</code> and a local directory with that name will be created.`,name:"repo_path_or_name"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.repo_url",description:`<strong>repo_url</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Specify this in case you want to push to an existing repository in the hub. If unspecified, a new
repository will be created in your namespace (unless you specify an <code>organization</code>) with <code>repo_name</code>.`,name:"repo_url"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clone the distant repo in a temporary directory or in <code>repo_path_or_name</code> inside the
current working directory. This will slow things down if you are making changes in an existing repo
since you will need to clone the repo before every push.`,name:"use_temp_dir"},{anchor:"transformers.file_utils.PushToHubMixin.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;add tokenizer&quot;</code>.`,name:"commit_message"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.organization",description:`<strong>organization</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Organization in which you want to push your tokenizer (you must be a member of this organization).`,name:"organization"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private (requires a paying subscription).`,name:"private"},{anchor:"transformers.file_utils.PushToHubMixin.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>transformers-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"}],returnDescription:`
<p>The url of the commit of your tokenizer in the given repository.</p>
`,returnType:`
<p><code>str</code></p>
`}}),It=new ib({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" and have a local clone in the
# *my-finetuned-bert* folder.
tokenizer.push_to_hub("my-finetuned-bert")

# Push the tokenizer to your namespace with the name "my-finetuned-bert" with no local clone.
tokenizer.push_to_hub("my-finetuned-bert", use_temp_dir=True)

# Push the tokenizer to an organization with the name "my-finetuned-bert" and have a local clone in the
# *my-finetuned-bert* folder.
tokenizer.push_to_hub("my-finetuned-bert", organization="huggingface")

# Make a change to an existing repo that has been cloned locally in *my-finetuned-bert*.
tokenizer.push_to_hub("my-finetuned-bert", repo_url="https://huggingface.co/sgugger/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; and have a local clone in the</span>
<span class="hljs-comment"># *my-finetuned-bert* folder.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

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

<span class="hljs-comment"># Push the tokenizer to an organization with the name &quot;my-finetuned-bert&quot; and have a local clone in the</span>
<span class="hljs-comment"># *my-finetuned-bert* folder.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>, organization=<span class="hljs-string">&quot;huggingface&quot;</span>)

<span class="hljs-comment"># Make a change to an existing repo that has been cloned locally in *my-finetuned-bert*.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>, repo_url=<span class="hljs-string">&quot;https://huggingface.co/sgugger/my-finetuned-bert&quot;</span>)`}}),Lt=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils.py#L881",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"}],returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),Bt=new v({props:{name:"convert_tokens_to_ids",anchor:"transformers.PreTrainedTokenizer.convert_tokens_to_ids",parameters:[{name:"tokens",val:": typing.Union[str, typing.List[str]]"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils.py#L560",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"}],returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),Ft=new v({props:{name:"get_added_vocab",anchor:"transformers.PreTrainedTokenizer.get_added_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils.py#L369",returnDescription:`
<p>The added tokens.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),Ct=new v({props:{name:"num_special_tokens_to_add",anchor:"transformers.PreTrainedTokenizer.num_special_tokens_to_add",parameters:[{name:"pair",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils.py#L458",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"}],returnDescription:`
<p>Number of special tokens added to sequences.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Ke=new sb({props:{$$slots:{default:[pb]},$$scope:{ctx:_t}}}),At=new v({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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils.py#L819",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"}],returnDescription:`
<p>The prepared text and the unused kwargs.</p>
`,returnType:`
<p><code>Tuple[str, Dict[str, Any]]</code></p>
`}}),Nt=new v({props:{name:"tokenize",anchor:"transformers.PreTrainedTokenizer.tokenize",parameters:[{name:"text",val:": str"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils.py#L481",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"}],returnDescription:`
<p>The list of tokens.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Ot=new Ri({}),Wt=new v({props:{name:"class transformers.PreTrainedTokenizerFast",anchor:"transformers.PreTrainedTokenizerFast",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_fast.py#L77",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/pr_15839/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.tokenizer_object",description:`<strong>tokenizer_object</strong> (<code>tokenizers.Tokenizer</code>) &#x2014;
A <code>tokenizers.Tokenizer</code> 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 <code>tokenizers.Tokenizer</code> object from &#x1F917;
tokenizers.`,name:"tokenizer_file"}]}}),Ut=new v({props:{name:"__call__",anchor:"transformers.PreTrainedTokenizerBase.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]]"},{name:"text_pair",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.file_utils.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = False"},{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.file_utils.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:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L2379",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.__call__.text",description:`<strong>text</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#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.PreTrainedTokenizerBase.__call__.text_pair",description:`<strong>text_pair</strong> (<code>str</code>, <code>List[str]</code>, <code>List[List[str]]</code>) &#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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/en/internal/file_utils#transformers.file_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.PreTrainedTokenizerBase.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability &gt;= 7.5 (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_15839/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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/pr_15839/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.PreTrainedTokenizerBase.__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.PreTrainedTokenizerBase.__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"}],returnDescription:`
<p>A <a
  href="/docs/transformers/pr_15839/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/pr_15839/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),jt=new v({props:{name:"batch_decode",anchor:"transformers.PreTrainedTokenizerBase.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 = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L3250",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.batch_decode.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 to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerBase.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"}],returnDescription:`
<p>The list of decoded sentences.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),Vt=new v({props:{name:"decode",anchor:"transformers.PreTrainedTokenizerBase.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 = True"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L3283",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.decode.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 to clean up the tokenization spaces.`,name:"clean_up_tokenization_spaces"},{anchor:"transformers.PreTrainedTokenizerBase.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"}],returnDescription:`
<p>The decoded sentence.</p>
`,returnType:`
<p><code>str</code></p>
`}}),Mt=new v({props:{name:"encode",anchor:"transformers.PreTrainedTokenizerBase.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.file_utils.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"return_tensors",val:": typing.Union[str, transformers.file_utils.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L2189",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.encode.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/en/internal/file_utils#transformers.file_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.PreTrainedTokenizerBase.encode.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_15839/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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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.PreTrainedTokenizerBase.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. This is especially useful to enable
the use of Tensor Cores on NVIDIA hardware with compute capability &gt;= 7.5 (Volta).`,name:"pad_to_multiple_of"},{anchor:"transformers.PreTrainedTokenizerBase.encode.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_15839/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"}],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>
`}}),Xt=new v({props:{name:"push_to_hub",anchor:"transformers.file_utils.PushToHubMixin.push_to_hub",parameters:[{name:"repo_path_or_name",val:": typing.Optional[str] = None"},{name:"repo_url",val:": typing.Optional[str] = None"},{name:"use_temp_dir",val:": bool = False"},{name:"commit_message",val:": typing.Optional[str] = None"},{name:"organization",val:": typing.Optional[str] = None"},{name:"private",val:": typing.Optional[bool] = None"},{name:"use_auth_token",val:": typing.Union[bool, str, NoneType] = None"},{name:"**model_card_kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/file_utils.py#L2842",parametersDescription:[{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.repo_path_or_name",description:`<strong>repo_path_or_name</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Can either be a repository name for your tokenizer in the Hub or a path to a local folder (in which case
the repository will have the name of that local folder). If not specified, will default to the name
given by <code>repo_url</code> and a local directory with that name will be created.`,name:"repo_path_or_name"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.repo_url",description:`<strong>repo_url</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Specify this in case you want to push to an existing repository in the hub. If unspecified, a new
repository will be created in your namespace (unless you specify an <code>organization</code>) with <code>repo_name</code>.`,name:"repo_url"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.use_temp_dir",description:`<strong>use_temp_dir</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not to clone the distant repo in a temporary directory or in <code>repo_path_or_name</code> inside the
current working directory. This will slow things down if you are making changes in an existing repo
since you will need to clone the repo before every push.`,name:"use_temp_dir"},{anchor:"transformers.file_utils.PushToHubMixin.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;add tokenizer&quot;</code>.`,name:"commit_message"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.organization",description:`<strong>organization</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Organization in which you want to push your tokenizer (you must be a member of this organization).`,name:"organization"},{anchor:"transformers.file_utils.PushToHubMixin.push_to_hub.private",description:`<strong>private</strong> (<code>bool</code>, <em>optional</em>) &#x2014;
Whether or not the repository created should be private (requires a paying subscription).`,name:"private"},{anchor:"transformers.file_utils.PushToHubMixin.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>transformers-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"}],returnDescription:`
<p>The url of the commit of your tokenizer in the given repository.</p>
`,returnType:`
<p><code>str</code></p>
`}}),Jt=new ib({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" and have a local clone in the
# *my-finetuned-bert* folder.
tokenizer.push_to_hub("my-finetuned-bert")

# Push the tokenizer to your namespace with the name "my-finetuned-bert" with no local clone.
tokenizer.push_to_hub("my-finetuned-bert", use_temp_dir=True)

# Push the tokenizer to an organization with the name "my-finetuned-bert" and have a local clone in the
# *my-finetuned-bert* folder.
tokenizer.push_to_hub("my-finetuned-bert", organization="huggingface")

# Make a change to an existing repo that has been cloned locally in *my-finetuned-bert*.
tokenizer.push_to_hub("my-finetuned-bert", repo_url="https://huggingface.co/sgugger/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; and have a local clone in the</span>
<span class="hljs-comment"># *my-finetuned-bert* folder.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>)

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

<span class="hljs-comment"># Push the tokenizer to an organization with the name &quot;my-finetuned-bert&quot; and have a local clone in the</span>
<span class="hljs-comment"># *my-finetuned-bert* folder.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>, organization=<span class="hljs-string">&quot;huggingface&quot;</span>)

<span class="hljs-comment"># Make a change to an existing repo that has been cloned locally in *my-finetuned-bert*.</span>
tokenizer.push_to_hub(<span class="hljs-string">&quot;my-finetuned-bert&quot;</span>, repo_url=<span class="hljs-string">&quot;https://huggingface.co/sgugger/my-finetuned-bert&quot;</span>)`}}),Kt=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_fast.py#L292",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"}],returnDescription:`
<p>The decoded token(s).</p>
`,returnType:`
<p><code>str</code> or <code>List[str]</code></p>
`}}),Qt=new v({props:{name:"convert_tokens_to_ids",anchor:"transformers.PreTrainedTokenizerFast.convert_tokens_to_ids",parameters:[{name:"tokens",val:": typing.Union[str, typing.List[str]]"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_fast.py#L234",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"}],returnDescription:`
<p>The token id or list of token ids.</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),Zt=new v({props:{name:"get_added_vocab",anchor:"transformers.PreTrainedTokenizerFast.get_added_vocab",parameters:[],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_fast.py#L155",returnDescription:`
<p>The added tokens.</p>
`,returnType:`
<p><code>Dict[str, int]</code></p>
`}}),en=new v({props:{name:"num_special_tokens_to_add",anchor:"transformers.PreTrainedTokenizerFast.num_special_tokens_to_add",parameters:[{name:"pair",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_fast.py#L271",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"}],returnDescription:`
<p>Number of special tokens added to sequences.</p>
`,returnType:`
<p><code>int</code></p>
`}}),at=new sb({props:{$$slots:{default:[mb]},$$scope:{ctx:_t}}}),tn=new v({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]"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_fast.py#L321",parametersDescription:[{anchor:"transformers.PreTrainedTokenizerFast.set_truncation_and_padding.padding_strategy",description:`<strong>padding_strategy</strong> (<a href="/docs/transformers/pr_15839/en/internal/file_utils#transformers.file_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/pr_15839/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 &gt;= 7.5 (Volta).`,name:"pad_to_multiple_of"}]}}),nn=new v({props:{name:"train_new_from_iterator",anchor:"transformers.PreTrainedTokenizerFast.train_new_from_iterator",parameters:[{name:"text_iterator",val:""},{name:"vocab_size",val:""},{name:"new_special_tokens",val:" = None"},{name:"special_tokens_map",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_fast.py#L604",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.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"}],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/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"
>PreTrainedTokenizerFast</a></p>
`}}),on=new Ri({}),rn=new v({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.file_utils.TensorType] = None"},{name:"prepend_batch_axis",val:": bool = False"},{name:"n_sequences",val:": typing.Optional[int] = None"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L167",parametersDescription:[{anchor:"transformers.BatchEncoding.data",description:`<strong>data</strong> (<code>dict</code>) &#x2014;
Dictionary of lists/arrays/tensors returned by the encode/batch_encode 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"}]}}),an=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L523",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"}],returnDescription:`
<p>Index of the token.</p>
`,returnType:`
<p><code>int</code></p>
`}}),dn=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L609",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"}],returnDescription:`
<p>Index or indices of the associated encoded token(s).</p>
`,returnType:`
<p><code>int</code> or <code>List[int]</code></p>
`}}),ln=new v({props:{name:"convert_to_tensors",anchor:"transformers.BatchEncoding.convert_to_tensors",parameters:[{name:"tensor_type",val:": typing.Union[str, transformers.file_utils.TensorType, NoneType] = None"},{name:"prepend_batch_axis",val:": bool = False"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L648",parametersDescription:[{anchor:"transformers.BatchEncoding.convert_to_tensors.tensor_type",description:`<strong>tensor_type</strong> (<code>str</code> or <a href="/docs/transformers/pr_15839/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/pr_15839/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"}]}}),hn=new v({props:{name:"sequence_ids",anchor:"transformers.BatchEncoding.sequence_ids",parameters:[{name:"batch_index",val:": int = 0"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L301",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"}],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>
`}}),pn=new v({props:{name:"to",anchor:"transformers.BatchEncoding.to",parameters:[{name:"device",val:": typing.Union[str, ForwardRef('torch.device')]"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L731",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"}],returnDescription:`
<p>The same instance after modification.</p>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.BatchEncoding"
>BatchEncoding</a></p>
`}}),fn=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L487",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"}],returnDescription:`
<p>Span of characters in the original string.</p>
`,returnType:`
<p><a
  href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.CharSpan"
>CharSpan</a></p>
`}}),kn=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L359",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"}],returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),bn=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L398",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"}],returnDescription:`
<p>Index of the word in the input sequence.</p>
`,returnType:`
<p><code>int</code></p>
`}}),Tn=new v({props:{name:"tokens",anchor:"transformers.BatchEncoding.tokens",parameters:[{name:"batch_index",val:": int = 0"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L286",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"}],returnDescription:`
<p>The list of tokens at that index.</p>
`,returnType:`
<p><code>List[str]</code></p>
`}}),wn=new v({props:{name:"word_ids",anchor:"transformers.BatchEncoding.word_ids",parameters:[{name:"batch_index",val:": int = 0"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L343",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"}],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>
`}}),zn=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L564",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"}],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>
`}}),$n=new v({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"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L436",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"}],returnDescription:`
<p>Optional <a
  href="/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.TokenSpan"
>TokenSpan</a> Span of tokens in the encoded sequence. Returns <code>None</code> if
no tokens correspond to the word.</p>
`}}),In=new v({props:{name:"words",anchor:"transformers.BatchEncoding.words",parameters:[{name:"batch_index",val:": int = 0"}],source:"https://github.com/huggingface/transformers/blob/pr_15839/src/transformers/tokenization_utils_base.py#L322",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"}],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(){E=r("meta"),A=d(),$=r("h1"),P=r("a"),Co=r("span"),h(gt.$$.fragment),Ui=d(),Ao=r("span"),ji=n("Tokenizer"),Ss=d(),Ue=r("p"),Vi=n(`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 `),kt=r("a"),Hi=n("\u{1F917} Tokenizers"),Mi=n(". The \u201CFast\u201D implementations allows:"),Ws=d(),je=r("ol"),No=r("li"),Gi=n("a significant speed-up in particular when doing batched tokenization and"),Xi=d(),Oo=r("li"),Yi=n(`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). Currently
no \u201CFast\u201D implementation is available for the SentencePiece-based tokenizers (for T5, ALBERT, CamemBERT, XLM-RoBERTa
and XLNet models).`),Rs=d(),N=r("p"),Ji=n("The base classes "),Cn=r("a"),Ki=n("PreTrainedTokenizer"),Qi=n(" and "),An=r("a"),Zi=n("PreTrainedTokenizerFast"),ed=n(`
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
`),Nn=r("a"),td=n("PreTrainedTokenizerBase"),nd=n(` that contains the common methods, and
`),On=r("a"),od=n("SpecialTokensMixin"),rd=n("."),Us=d(),Pe=r("p"),Sn=r("a"),ad=n("PreTrainedTokenizer"),sd=n(" and "),Wn=r("a"),id=n("PreTrainedTokenizerFast"),dd=n(` thus implement the main
methods for using all the tokenizers:`),js=d(),le=r("ul"),So=r("li"),cd=n(`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).`),ld=d(),Wo=r("li"),hd=n("Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),pd=d(),Ro=r("li"),md=n(`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.`),Vs=d(),q=r("p"),Rn=r("a"),fd=n("BatchEncoding"),ud=n(` holds the output of the
`),Un=r("a"),_d=n("PreTrainedTokenizerBase"),gd=n("\u2019s encoding methods ("),Uo=r("code"),kd=n("__call__"),vd=n(`,
`),jo=r("code"),bd=n("encode_plus"),yd=n(" and "),Vo=r("code"),Td=n("batch_encode_plus"),wd=n(`) 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 (`),Ho=r("code"),zd=n("input_ids"),xd=n(", "),Mo=r("code"),Ed=n("attention_mask"),$d=n(`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),vt=r("a"),Pd=n("tokenizers library"),qd=n(`), 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).`),Hs=d(),qe=r("h2"),Ve=r("a"),Go=r("span"),h(bt.$$.fragment),Dd=d(),Xo=r("span"),Id=n("PreTrainedTokenizer"),Ms=d(),g=r("div"),h(yt.$$.fragment),Ld=d(),Yo=r("p"),Bd=n("Base class for all slow tokenizers."),Fd=d(),Tt=r("p"),Cd=n("Inherits from "),jn=r("a"),Ad=n("PreTrainedTokenizerBase"),Nd=n("."),Od=d(),Jo=r("p"),Sd=n(`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.`),Wd=d(),Ko=r("p"),Rd=n(`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).`),Ud=d(),Qo=r("p"),jd=n("Class attributes (overridden by derived classes)"),Vd=d(),I=r("ul"),he=r("li"),Zo=r("strong"),Hd=n("vocab_files_names"),Md=n(" ("),er=r("code"),Gd=n("Dict[str, str]"),Xd=n(") \u2014 A dictionary with, as keys, the "),tr=r("code"),Yd=n("__init__"),Jd=n(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Kd=d(),O=r("li"),nr=r("strong"),Qd=n("pretrained_vocab_files_map"),Zd=n(" ("),or=r("code"),ec=n("Dict[str, Dict[str, str]]"),tc=n(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),rr=r("code"),nc=n("__init__"),oc=n(` keyword name of each vocabulary file required by the model, the
low-level being the `),ar=r("code"),rc=n("short-cut-names"),ac=n(" of the pretrained models with, as associated values, the "),sr=r("code"),sc=n("url"),ic=n(` to the
associated pretrained vocabulary file.`),dc=d(),Y=r("li"),ir=r("strong"),cc=n("max_model_input_sizes"),lc=n(" ("),dr=r("code"),hc=n("Dict[str, Optional[int]]"),pc=n(") \u2014 A dictionary with, as keys, the "),cr=r("code"),mc=n("short-cut-names"),fc=n(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),lr=r("code"),uc=n("None"),_c=n(" if the model has no maximum input size."),gc=d(),S=r("li"),hr=r("strong"),kc=n("pretrained_init_configuration"),vc=n(" ("),pr=r("code"),bc=n("Dict[str, Dict[str, Any]]"),yc=n(`) \u2014 A dictionary with, as keys, the
`),mr=r("code"),Tc=n("short-cut-names"),wc=n(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),fr=r("code"),zc=n("__init__"),xc=n(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Vn=r("a"),Ec=n("from_pretrained()"),$c=n(" method."),Pc=d(),He=r("li"),ur=r("strong"),qc=n("model_input_names"),Dc=n(" ("),_r=r("code"),Ic=n("List[str]"),Lc=n(") \u2014 A list of inputs expected in the forward pass of the model."),Bc=d(),J=r("li"),gr=r("strong"),Fc=n("padding_side"),Cc=n(" ("),kr=r("code"),Ac=n("str"),Nc=n(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),vr=r("code"),Oc=n("'right'"),Sc=n(" or "),br=r("code"),Wc=n("'left'"),Rc=n("."),Uc=d(),K=r("li"),yr=r("strong"),jc=n("truncation_side"),Vc=n(" ("),Tr=r("code"),Hc=n("str"),Mc=n(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),wr=r("code"),Gc=n("'right'"),Xc=n(" or "),zr=r("code"),Yc=n("'left'"),Jc=n("."),Kc=d(),Me=r("div"),h(wt.$$.fragment),Qc=d(),xr=r("p"),Zc=n(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),el=d(),Ge=r("div"),h(zt.$$.fragment),tl=d(),Er=r("p"),nl=n("Convert a list of lists of token ids into a list of strings by calling decode."),ol=d(),pe=r("div"),h(xt.$$.fragment),rl=d(),$r=r("p"),al=n(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),sl=d(),Et=r("p"),il=n("Similar to doing "),Pr=r("code"),dl=n("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),cl=n("."),ll=d(),me=r("div"),h($t.$$.fragment),hl=d(),qr=r("p"),pl=n("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),ml=d(),Pt=r("p"),fl=n("Same as doing "),Dr=r("code"),ul=n("self.convert_tokens_to_ids(self.tokenize(text))"),_l=n("."),gl=d(),Q=r("div"),h(qt.$$.fragment),kl=d(),Dt=r("p"),vl=n(`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Ir=r("code"),bl=n("repo_path_or_name"),yl=n("."),Tl=d(),Lr=r("p"),wl=n("Examples:"),zl=d(),h(It.$$.fragment),xl=d(),Xe=r("div"),h(Lt.$$.fragment),El=d(),Br=r("p"),$l=n(`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(),Ye=r("div"),h(Bt.$$.fragment),ql=d(),Fr=r("p"),Dl=n(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Il=d(),Je=r("div"),h(Ft.$$.fragment),Ll=d(),Cr=r("p"),Bl=n("Returns the added tokens in the vocabulary as a dictionary of token to index."),Fl=d(),fe=r("div"),h(Ct.$$.fragment),Cl=d(),Ar=r("p"),Al=n("Returns the number of added tokens when encoding a sequence with special tokens."),Nl=d(),h(Ke.$$.fragment),Ol=d(),ue=r("div"),h(At.$$.fragment),Sl=d(),Nr=r("p"),Wl=n("Performs any necessary transformations before tokenization."),Rl=d(),De=r("p"),Ul=n("This method should pop the arguments from kwargs and return the remaining "),Or=r("code"),jl=n("kwargs"),Vl=n(` as well. We test the
`),Sr=r("code"),Hl=n("kwargs"),Ml=n(" at the end of the encoding process to be sure all the arguments have been used."),Gl=d(),_e=r("div"),h(Nt.$$.fragment),Xl=d(),Wr=r("p"),Yl=n("Converts a string in a sequence of tokens, using the tokenizer."),Jl=d(),Rr=r("p"),Kl=n(`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),Gs=d(),Ie=r("h2"),Qe=r("a"),Ur=r("span"),h(Ot.$$.fragment),Ql=d(),jr=r("span"),Zl=n("PreTrainedTokenizerFast"),Xs=d(),Z=r("p"),eh=n("The "),Hn=r("a"),th=n("PreTrainedTokenizerFast"),nh=n(" depend on the "),St=r("a"),oh=n("tokenizers"),rh=n(` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),Mn=r("a"),ah=n("Using tokenizers from \u{1F917} tokenizers"),sh=n(" page to understand how this is done."),Ys=d(),k=r("div"),h(Wt.$$.fragment),ih=d(),Vr=r("p"),dh=n("Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),ch=d(),Rt=r("p"),lh=n("Inherits from "),Gn=r("a"),hh=n("PreTrainedTokenizerBase"),ph=n("."),mh=d(),Hr=r("p"),fh=n(`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(),Mr=r("p"),_h=n(`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(),Gr=r("p"),kh=n("Class attributes (overridden by derived classes)"),vh=d(),L=r("ul"),ge=r("li"),Xr=r("strong"),bh=n("vocab_files_names"),yh=n(" ("),Yr=r("code"),Th=n("Dict[str, str]"),wh=n(") \u2014 A dictionary with, as keys, the "),Jr=r("code"),zh=n("__init__"),xh=n(` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Eh=d(),W=r("li"),Kr=r("strong"),$h=n("pretrained_vocab_files_map"),Ph=n(" ("),Qr=r("code"),qh=n("Dict[str, Dict[str, str]]"),Dh=n(`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Zr=r("code"),Ih=n("__init__"),Lh=n(` keyword name of each vocabulary file required by the model, the
low-level being the `),ea=r("code"),Bh=n("short-cut-names"),Fh=n(" of the pretrained models with, as associated values, the "),ta=r("code"),Ch=n("url"),Ah=n(` to the
associated pretrained vocabulary file.`),Nh=d(),ee=r("li"),na=r("strong"),Oh=n("max_model_input_sizes"),Sh=n(" ("),oa=r("code"),Wh=n("Dict[str, Optional[int]]"),Rh=n(") \u2014 A dictionary with, as keys, the "),ra=r("code"),Uh=n("short-cut-names"),jh=n(`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),aa=r("code"),Vh=n("None"),Hh=n(" if the model has no maximum input size."),Mh=d(),R=r("li"),sa=r("strong"),Gh=n("pretrained_init_configuration"),Xh=n(" ("),ia=r("code"),Yh=n("Dict[str, Dict[str, Any]]"),Jh=n(`) \u2014 A dictionary with, as keys, the
`),da=r("code"),Kh=n("short-cut-names"),Qh=n(` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ca=r("code"),Zh=n("__init__"),ep=n(` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Xn=r("a"),tp=n("from_pretrained()"),np=n(" method."),op=d(),Ze=r("li"),la=r("strong"),rp=n("model_input_names"),ap=n(" ("),ha=r("code"),sp=n("List[str]"),ip=n(") \u2014 A list of inputs expected in the forward pass of the model."),dp=d(),te=r("li"),pa=r("strong"),cp=n("padding_side"),lp=n(" ("),ma=r("code"),hp=n("str"),pp=n(`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),fa=r("code"),mp=n("'right'"),fp=n(" or "),ua=r("code"),up=n("'left'"),_p=n("."),gp=d(),ne=r("li"),_a=r("strong"),kp=n("truncation_side"),vp=n(" ("),ga=r("code"),bp=n("str"),yp=n(`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),ka=r("code"),Tp=n("'right'"),wp=n(" or "),va=r("code"),zp=n("'left'"),xp=n("."),Ep=d(),et=r("div"),h(Ut.$$.fragment),$p=d(),ba=r("p"),Pp=n(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),qp=d(),tt=r("div"),h(jt.$$.fragment),Dp=d(),ya=r("p"),Ip=n("Convert a list of lists of token ids into a list of strings by calling decode."),Lp=d(),ke=r("div"),h(Vt.$$.fragment),Bp=d(),Ta=r("p"),Fp=n(`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),Cp=d(),Ht=r("p"),Ap=n("Similar to doing "),wa=r("code"),Np=n("self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Op=n("."),Sp=d(),ve=r("div"),h(Mt.$$.fragment),Wp=d(),za=r("p"),Rp=n("Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Up=d(),Gt=r("p"),jp=n("Same as doing "),xa=r("code"),Vp=n("self.convert_tokens_to_ids(self.tokenize(text))"),Hp=n("."),Mp=d(),oe=r("div"),h(Xt.$$.fragment),Gp=d(),Yt=r("p"),Xp=n(`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Ea=r("code"),Yp=n("repo_path_or_name"),Jp=n("."),Kp=d(),$a=r("p"),Qp=n("Examples:"),Zp=d(),h(Jt.$$.fragment),em=d(),nt=r("div"),h(Kt.$$.fragment),tm=d(),Pa=r("p"),nm=n(`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),om=d(),ot=r("div"),h(Qt.$$.fragment),rm=d(),qa=r("p"),am=n(`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),sm=d(),rt=r("div"),h(Zt.$$.fragment),im=d(),Da=r("p"),dm=n("Returns the added tokens in the vocabulary as a dictionary of token to index."),cm=d(),be=r("div"),h(en.$$.fragment),lm=d(),Ia=r("p"),hm=n("Returns the number of added tokens when encoding a sequence with special tokens."),pm=d(),h(at.$$.fragment),mm=d(),ye=r("div"),h(tn.$$.fragment),fm=d(),La=r("p"),um=n(`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),_m=d(),Ba=r("p"),gm=n(`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.`),km=d(),st=r("div"),h(nn.$$.fragment),vm=d(),Fa=r("p"),bm=n(`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),Js=d(),Le=r("h2"),it=r("a"),Ca=r("span"),h(on.$$.fragment),ym=d(),Aa=r("span"),Tm=n("BatchEncoding"),Ks=d(),b=r("div"),h(rn.$$.fragment),wm=d(),Be=r("p"),zm=n("Holds the output of the "),Yn=r("a"),xm=n("encode_plus()"),Em=n(` and
`),Na=r("code"),$m=n("batch_encode"),Pm=n(" methods (tokens, attention_masks, etc)."),qm=d(),Oa=r("p"),Dm=n(`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.`),Im=d(),U=r("div"),h(an.$$.fragment),Lm=d(),Sa=r("p"),Bm=n(`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),Fm=d(),Wa=r("p"),Cm=n("Can be called as:"),Am=d(),sn=r("ul"),Jn=r("li"),Ra=r("code"),Nm=n("self.char_to_token(char_index)"),Om=n(" if batch size is 1"),Sm=d(),Kn=r("li"),Ua=r("code"),Wm=n("self.char_to_token(batch_index, char_index)"),Rm=n(" if batch size is greater or equal to 1"),Um=d(),ja=r("p"),jm=n(`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.`),Vm=d(),j=r("div"),h(dn.$$.fragment),Hm=d(),Va=r("p"),Mm=n(`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),Gm=d(),Ha=r("p"),Xm=n("Can be called as:"),Ym=d(),cn=r("ul"),Qn=r("li"),Ma=r("code"),Jm=n("self.char_to_word(char_index)"),Km=n(" if batch size is 1"),Qm=d(),Zn=r("li"),Ga=r("code"),Zm=n("self.char_to_word(batch_index, char_index)"),ef=n(" if batch size is greater than 1"),tf=d(),Xa=r("p"),nf=n(`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.`),of=d(),dt=r("div"),h(ln.$$.fragment),rf=d(),Ya=r("p"),af=n("Convert the inner content to tensors."),sf=d(),Te=r("div"),h(hn.$$.fragment),df=d(),Ja=r("p"),cf=n("Return a list mapping the tokens to the id of their original sentences:"),lf=d(),Fe=r("ul"),eo=r("li"),Ka=r("code"),hf=n("None"),pf=n(" for special tokens added around or between sequences,"),mf=d(),to=r("li"),Qa=r("code"),ff=n("0"),uf=n(" for tokens corresponding to words in the first sequence,"),_f=d(),no=r("li"),Za=r("code"),gf=n("1"),kf=n(` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),vf=d(),ct=r("div"),h(pn.$$.fragment),bf=d(),mn=r("p"),yf=n("Send all values to device by calling "),es=r("code"),Tf=n("v.to(device)"),wf=n(" (PyTorch only)."),zf=d(),F=r("div"),h(fn.$$.fragment),xf=d(),ts=r("p"),Ef=n("Get the character span corresponding to an encoded token in a sequence of the batch."),$f=d(),un=r("p"),Pf=n("Character spans are returned as a "),oo=r("a"),qf=n("CharSpan"),Df=n(" with:"),If=d(),_n=r("ul"),ro=r("li"),ns=r("strong"),Lf=n("start"),Bf=n(" \u2014 Index of the first character in the original string associated to the token."),Ff=d(),ao=r("li"),os=r("strong"),Cf=n("end"),Af=n(` \u2014 Index of the character following the last character in the original string associated to the
token.`),Nf=d(),rs=r("p"),Of=n("Can be called as:"),Sf=d(),gn=r("ul"),so=r("li"),as=r("code"),Wf=n("self.token_to_chars(token_index)"),Rf=n(" if batch size is 1"),Uf=d(),io=r("li"),ss=r("code"),jf=n("self.token_to_chars(batch_index, token_index)"),Vf=n(" if batch size is greater or equal to 1"),Hf=d(),V=r("div"),h(kn.$$.fragment),Mf=d(),Ce=r("p"),Gf=n("Get the index of the sequence represented by the given token. In the general use case, this method returns "),is=r("code"),Xf=n("0"),Yf=n(`
for a single sequence or the first sequence of a pair, and `),ds=r("code"),Jf=n("1"),Kf=n(" for the second sequence of a pair"),Qf=d(),cs=r("p"),Zf=n("Can be called as:"),eu=d(),vn=r("ul"),co=r("li"),ls=r("code"),tu=n("self.token_to_sequence(token_index)"),nu=n(" if batch size is 1"),ou=d(),lo=r("li"),hs=r("code"),ru=n("self.token_to_sequence(batch_index, token_index)"),au=n(" if batch size is greater than 1"),su=d(),ps=r("p"),iu=n(`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.`),du=d(),H=r("div"),h(bn.$$.fragment),cu=d(),ms=r("p"),lu=n("Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),hu=d(),fs=r("p"),pu=n("Can be called as:"),mu=d(),yn=r("ul"),ho=r("li"),us=r("code"),fu=n("self.token_to_word(token_index)"),uu=n(" if batch size is 1"),_u=d(),po=r("li"),_s=r("code"),gu=n("self.token_to_word(batch_index, token_index)"),ku=n(" if batch size is greater than 1"),vu=d(),gs=r("p"),bu=n(`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(),lt=r("div"),h(Tn.$$.fragment),Tu=d(),ks=r("p"),wu=n(`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).`),zu=d(),ht=r("div"),h(wn.$$.fragment),xu=d(),vs=r("p"),Eu=n("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),$u=d(),C=r("div"),h(zn.$$.fragment),Pu=d(),bs=r("p"),qu=n("Get the character span in the original string corresponding to given word in a sequence of the batch."),Du=d(),ys=r("p"),Iu=n("Character spans are returned as a CharSpan NamedTuple with:"),Lu=d(),xn=r("ul"),Ts=r("li"),Bu=n("start: index of the first character in the original string"),Fu=d(),ws=r("li"),Cu=n("end: index of the character following the last character in the original string"),Au=d(),zs=r("p"),Nu=n("Can be called as:"),Ou=d(),En=r("ul"),mo=r("li"),xs=r("code"),Su=n("self.word_to_chars(word_index)"),Wu=n(" if batch size is 1"),Ru=d(),fo=r("li"),Es=r("code"),Uu=n("self.word_to_chars(batch_index, word_index)"),ju=n(" if batch size is greater or equal to 1"),Vu=d(),D=r("div"),h($n.$$.fragment),Hu=d(),$s=r("p"),Mu=n("Get the encoded token span corresponding to a word in a sequence of the batch."),Gu=d(),Pn=r("p"),Xu=n("Token spans are returned as a "),uo=r("a"),Yu=n("TokenSpan"),Ju=n(" with:"),Ku=d(),qn=r("ul"),_o=r("li"),Ps=r("strong"),Qu=n("start"),Zu=n(" \u2014 Index of the first token."),e_=d(),go=r("li"),qs=r("strong"),t_=n("end"),n_=n(" \u2014 Index of the token following the last token."),o_=d(),Ds=r("p"),r_=n("Can be called as:"),a_=d(),Dn=r("ul"),ko=r("li"),Is=r("code"),s_=n("self.word_to_tokens(word_index, sequence_index: int = 0)"),i_=n(" if batch size is 1"),d_=d(),vo=r("li"),Ls=r("code"),c_=n("self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),l_=n(` if batch size is greater or equal to
1`),h_=d(),Bs=r("p"),p_=n(`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.`),m_=d(),pt=r("div"),h(In.$$.fragment),f_=d(),Fs=r("p"),u_=n("Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),this.h()},l(i){const y=hb('[data-svelte="svelte-1phssyn"]',document.head);E=a(y,"META",{name:!0,content:!0}),y.forEach(t),A=c(i),$=a(i,"H1",{class:!0});var Ln=s($);P=a(Ln,"A",{id:!0,class:!0,href:!0});var Cs=s(P);Co=a(Cs,"SPAN",{});var N_=s(Co);p(gt.$$.fragment,N_),N_.forEach(t),Cs.forEach(t),Ui=c(Ln),Ao=a(Ln,"SPAN",{});var O_=s(Ao);ji=o(O_,"Tokenizer"),O_.forEach(t),Ln.forEach(t),Ss=c(i),Ue=a(i,"P",{});var Zs=s(Ue);Vi=o(Zs,`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 `),kt=a(Zs,"A",{href:!0,rel:!0});var S_=s(kt);Hi=o(S_,"\u{1F917} Tokenizers"),S_.forEach(t),Mi=o(Zs,". The \u201CFast\u201D implementations allows:"),Zs.forEach(t),Ws=c(i),je=a(i,"OL",{});var ei=s(je);No=a(ei,"LI",{});var W_=s(No);Gi=o(W_,"a significant speed-up in particular when doing batched tokenization and"),W_.forEach(t),Xi=c(ei),Oo=a(ei,"LI",{});var R_=s(Oo);Yi=o(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). Currently
no \u201CFast\u201D implementation is available for the SentencePiece-based tokenizers (for T5, ALBERT, CamemBERT, XLM-RoBERTa
and XLNet models).`),R_.forEach(t),ei.forEach(t),Rs=c(i),N=a(i,"P",{});var we=s(N);Ji=o(we,"The base classes "),Cn=a(we,"A",{href:!0});var U_=s(Cn);Ki=o(U_,"PreTrainedTokenizer"),U_.forEach(t),Qi=o(we," and "),An=a(we,"A",{href:!0});var j_=s(An);Zi=o(j_,"PreTrainedTokenizerFast"),j_.forEach(t),ed=o(we,`
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
`),Nn=a(we,"A",{href:!0});var V_=s(Nn);td=o(V_,"PreTrainedTokenizerBase"),V_.forEach(t),nd=o(we,` that contains the common methods, and
`),On=a(we,"A",{href:!0});var H_=s(On);od=o(H_,"SpecialTokensMixin"),H_.forEach(t),rd=o(we,"."),we.forEach(t),Us=c(i),Pe=a(i,"P",{});var As=s(Pe);Sn=a(As,"A",{href:!0});var M_=s(Sn);ad=o(M_,"PreTrainedTokenizer"),M_.forEach(t),sd=o(As," and "),Wn=a(As,"A",{href:!0});var G_=s(Wn);id=o(G_,"PreTrainedTokenizerFast"),G_.forEach(t),dd=o(As,` thus implement the main
methods for using all the tokenizers:`),As.forEach(t),js=c(i),le=a(i,"UL",{});var bo=s(le);So=a(bo,"LI",{});var X_=s(So);cd=o(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),ld=c(bo),Wo=a(bo,"LI",{});var Y_=s(Wo);hd=o(Y_,"Adding new tokens to the vocabulary in a way that is independent of the underlying structure (BPE, SentencePiece\u2026)."),Y_.forEach(t),pd=c(bo),Ro=a(bo,"LI",{});var J_=s(Ro);md=o(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),bo.forEach(t),Vs=c(i),q=a(i,"P",{});var B=s(q);Rn=a(B,"A",{href:!0});var K_=s(Rn);fd=o(K_,"BatchEncoding"),K_.forEach(t),ud=o(B,` holds the output of the
`),Un=a(B,"A",{href:!0});var Q_=s(Un);_d=o(Q_,"PreTrainedTokenizerBase"),Q_.forEach(t),gd=o(B,"\u2019s encoding methods ("),Uo=a(B,"CODE",{});var Z_=s(Uo);kd=o(Z_,"__call__"),Z_.forEach(t),vd=o(B,`,
`),jo=a(B,"CODE",{});var eg=s(jo);bd=o(eg,"encode_plus"),eg.forEach(t),yd=o(B," and "),Vo=a(B,"CODE",{});var tg=s(Vo);Td=o(tg,"batch_encode_plus"),tg.forEach(t),wd=o(B,`) 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 (`),Ho=a(B,"CODE",{});var ng=s(Ho);zd=o(ng,"input_ids"),ng.forEach(t),xd=o(B,", "),Mo=a(B,"CODE",{});var og=s(Mo);Ed=o(og,"attention_mask"),og.forEach(t),$d=o(B,`\u2026). When the tokenizer is a \u201CFast\u201D tokenizer (i.e., backed by
HuggingFace `),vt=a(B,"A",{href:!0,rel:!0});var rg=s(vt);Pd=o(rg,"tokenizers library"),rg.forEach(t),qd=o(B,`), 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).`),B.forEach(t),Hs=c(i),qe=a(i,"H2",{class:!0});var ti=s(qe);Ve=a(ti,"A",{id:!0,class:!0,href:!0});var ag=s(Ve);Go=a(ag,"SPAN",{});var sg=s(Go);p(bt.$$.fragment,sg),sg.forEach(t),ag.forEach(t),Dd=c(ti),Xo=a(ti,"SPAN",{});var ig=s(Xo);Id=o(ig,"PreTrainedTokenizer"),ig.forEach(t),ti.forEach(t),Ms=c(i),g=a(i,"DIV",{class:!0});var T=s(g);p(yt.$$.fragment,T),Ld=c(T),Yo=a(T,"P",{});var dg=s(Yo);Bd=o(dg,"Base class for all slow tokenizers."),dg.forEach(t),Fd=c(T),Tt=a(T,"P",{});var ni=s(Tt);Cd=o(ni,"Inherits from "),jn=a(ni,"A",{href:!0});var cg=s(jn);Ad=o(cg,"PreTrainedTokenizerBase"),cg.forEach(t),Nd=o(ni,"."),ni.forEach(t),Od=c(T),Jo=a(T,"P",{});var lg=s(Jo);Sd=o(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),Wd=c(T),Ko=a(T,"P",{});var hg=s(Ko);Rd=o(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),Ud=c(T),Qo=a(T,"P",{});var pg=s(Qo);jd=o(pg,"Class attributes (overridden by derived classes)"),pg.forEach(t),Vd=c(T),I=a(T,"UL",{});var M=s(I);he=a(M,"LI",{});var Bn=s(he);Zo=a(Bn,"STRONG",{});var mg=s(Zo);Hd=o(mg,"vocab_files_names"),mg.forEach(t),Md=o(Bn," ("),er=a(Bn,"CODE",{});var fg=s(er);Gd=o(fg,"Dict[str, str]"),fg.forEach(t),Xd=o(Bn,") \u2014 A dictionary with, as keys, the "),tr=a(Bn,"CODE",{});var ug=s(tr);Yd=o(ug,"__init__"),ug.forEach(t),Jd=o(Bn,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Bn.forEach(t),Kd=c(M),O=a(M,"LI",{});var se=s(O);nr=a(se,"STRONG",{});var _g=s(nr);Qd=o(_g,"pretrained_vocab_files_map"),_g.forEach(t),Zd=o(se," ("),or=a(se,"CODE",{});var gg=s(or);ec=o(gg,"Dict[str, Dict[str, str]]"),gg.forEach(t),tc=o(se,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),rr=a(se,"CODE",{});var kg=s(rr);nc=o(kg,"__init__"),kg.forEach(t),oc=o(se,` keyword name of each vocabulary file required by the model, the
low-level being the `),ar=a(se,"CODE",{});var vg=s(ar);rc=o(vg,"short-cut-names"),vg.forEach(t),ac=o(se," of the pretrained models with, as associated values, the "),sr=a(se,"CODE",{});var bg=s(sr);sc=o(bg,"url"),bg.forEach(t),ic=o(se,` to the
associated pretrained vocabulary file.`),se.forEach(t),dc=c(M),Y=a(M,"LI",{});var Ae=s(Y);ir=a(Ae,"STRONG",{});var yg=s(ir);cc=o(yg,"max_model_input_sizes"),yg.forEach(t),lc=o(Ae," ("),dr=a(Ae,"CODE",{});var Tg=s(dr);hc=o(Tg,"Dict[str, Optional[int]]"),Tg.forEach(t),pc=o(Ae,") \u2014 A dictionary with, as keys, the "),cr=a(Ae,"CODE",{});var wg=s(cr);mc=o(wg,"short-cut-names"),wg.forEach(t),fc=o(Ae,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),lr=a(Ae,"CODE",{});var zg=s(lr);uc=o(zg,"None"),zg.forEach(t),_c=o(Ae," if the model has no maximum input size."),Ae.forEach(t),gc=c(M),S=a(M,"LI",{});var ie=s(S);hr=a(ie,"STRONG",{});var xg=s(hr);kc=o(xg,"pretrained_init_configuration"),xg.forEach(t),vc=o(ie," ("),pr=a(ie,"CODE",{});var Eg=s(pr);bc=o(Eg,"Dict[str, Dict[str, Any]]"),Eg.forEach(t),yc=o(ie,`) \u2014 A dictionary with, as keys, the
`),mr=a(ie,"CODE",{});var $g=s(mr);Tc=o($g,"short-cut-names"),$g.forEach(t),wc=o(ie,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),fr=a(ie,"CODE",{});var Pg=s(fr);zc=o(Pg,"__init__"),Pg.forEach(t),xc=o(ie,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Vn=a(ie,"A",{href:!0});var qg=s(Vn);Ec=o(qg,"from_pretrained()"),qg.forEach(t),$c=o(ie," method."),ie.forEach(t),Pc=c(M),He=a(M,"LI",{});var Ns=s(He);ur=a(Ns,"STRONG",{});var Dg=s(ur);qc=o(Dg,"model_input_names"),Dg.forEach(t),Dc=o(Ns," ("),_r=a(Ns,"CODE",{});var Ig=s(_r);Ic=o(Ig,"List[str]"),Ig.forEach(t),Lc=o(Ns,") \u2014 A list of inputs expected in the forward pass of the model."),Ns.forEach(t),Bc=c(M),J=a(M,"LI",{});var Ne=s(J);gr=a(Ne,"STRONG",{});var Lg=s(gr);Fc=o(Lg,"padding_side"),Lg.forEach(t),Cc=o(Ne," ("),kr=a(Ne,"CODE",{});var Bg=s(kr);Ac=o(Bg,"str"),Bg.forEach(t),Nc=o(Ne,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),vr=a(Ne,"CODE",{});var Fg=s(vr);Oc=o(Fg,"'right'"),Fg.forEach(t),Sc=o(Ne," or "),br=a(Ne,"CODE",{});var Cg=s(br);Wc=o(Cg,"'left'"),Cg.forEach(t),Rc=o(Ne,"."),Ne.forEach(t),Uc=c(M),K=a(M,"LI",{});var Oe=s(K);yr=a(Oe,"STRONG",{});var Ag=s(yr);jc=o(Ag,"truncation_side"),Ag.forEach(t),Vc=o(Oe," ("),Tr=a(Oe,"CODE",{});var Ng=s(Tr);Hc=o(Ng,"str"),Ng.forEach(t),Mc=o(Oe,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),wr=a(Oe,"CODE",{});var Og=s(wr);Gc=o(Og,"'right'"),Og.forEach(t),Xc=o(Oe," or "),zr=a(Oe,"CODE",{});var Sg=s(zr);Yc=o(Sg,"'left'"),Sg.forEach(t),Jc=o(Oe,"."),Oe.forEach(t),M.forEach(t),Kc=c(T),Me=a(T,"DIV",{class:!0});var oi=s(Me);p(wt.$$.fragment,oi),Qc=c(oi),xr=a(oi,"P",{});var Wg=s(xr);Zc=o(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),oi.forEach(t),el=c(T),Ge=a(T,"DIV",{class:!0});var ri=s(Ge);p(zt.$$.fragment,ri),tl=c(ri),Er=a(ri,"P",{});var Rg=s(Er);nl=o(Rg,"Convert a list of lists of token ids into a list of strings by calling decode."),Rg.forEach(t),ri.forEach(t),ol=c(T),pe=a(T,"DIV",{class:!0});var yo=s(pe);p(xt.$$.fragment,yo),rl=c(yo),$r=a(yo,"P",{});var Ug=s($r);al=o(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),sl=c(yo),Et=a(yo,"P",{});var ai=s(Et);il=o(ai,"Similar to doing "),Pr=a(ai,"CODE",{});var jg=s(Pr);dl=o(jg,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),jg.forEach(t),cl=o(ai,"."),ai.forEach(t),yo.forEach(t),ll=c(T),me=a(T,"DIV",{class:!0});var To=s(me);p($t.$$.fragment,To),hl=c(To),qr=a(To,"P",{});var Vg=s(qr);pl=o(Vg,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Vg.forEach(t),ml=c(To),Pt=a(To,"P",{});var si=s(Pt);fl=o(si,"Same as doing "),Dr=a(si,"CODE",{});var Hg=s(Dr);ul=o(Hg,"self.convert_tokens_to_ids(self.tokenize(text))"),Hg.forEach(t),_l=o(si,"."),si.forEach(t),To.forEach(t),gl=c(T),Q=a(T,"DIV",{class:!0});var mt=s(Q);p(qt.$$.fragment,mt),kl=c(mt),Dt=a(mt,"P",{});var ii=s(Dt);vl=o(ii,`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Ir=a(ii,"CODE",{});var Mg=s(Ir);bl=o(Mg,"repo_path_or_name"),Mg.forEach(t),yl=o(ii,"."),ii.forEach(t),Tl=c(mt),Lr=a(mt,"P",{});var Gg=s(Lr);wl=o(Gg,"Examples:"),Gg.forEach(t),zl=c(mt),p(It.$$.fragment,mt),mt.forEach(t),xl=c(T),Xe=a(T,"DIV",{class:!0});var di=s(Xe);p(Lt.$$.fragment,di),El=c(di),Br=a(di,"P",{});var Xg=s(Br);$l=o(Xg,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Xg.forEach(t),di.forEach(t),Pl=c(T),Ye=a(T,"DIV",{class:!0});var ci=s(Ye);p(Bt.$$.fragment,ci),ql=c(ci),Fr=a(ci,"P",{});var Yg=s(Fr);Dl=o(Yg,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Yg.forEach(t),ci.forEach(t),Il=c(T),Je=a(T,"DIV",{class:!0});var li=s(Je);p(Ft.$$.fragment,li),Ll=c(li),Cr=a(li,"P",{});var Jg=s(Cr);Bl=o(Jg,"Returns the added tokens in the vocabulary as a dictionary of token to index."),Jg.forEach(t),li.forEach(t),Fl=c(T),fe=a(T,"DIV",{class:!0});var wo=s(fe);p(Ct.$$.fragment,wo),Cl=c(wo),Ar=a(wo,"P",{});var Kg=s(Ar);Al=o(Kg,"Returns the number of added tokens when encoding a sequence with special tokens."),Kg.forEach(t),Nl=c(wo),p(Ke.$$.fragment,wo),wo.forEach(t),Ol=c(T),ue=a(T,"DIV",{class:!0});var zo=s(ue);p(At.$$.fragment,zo),Sl=c(zo),Nr=a(zo,"P",{});var Qg=s(Nr);Wl=o(Qg,"Performs any necessary transformations before tokenization."),Qg.forEach(t),Rl=c(zo),De=a(zo,"P",{});var xo=s(De);Ul=o(xo,"This method should pop the arguments from kwargs and return the remaining "),Or=a(xo,"CODE",{});var Zg=s(Or);jl=o(Zg,"kwargs"),Zg.forEach(t),Vl=o(xo,` as well. We test the
`),Sr=a(xo,"CODE",{});var ek=s(Sr);Hl=o(ek,"kwargs"),ek.forEach(t),Ml=o(xo," at the end of the encoding process to be sure all the arguments have been used."),xo.forEach(t),zo.forEach(t),Gl=c(T),_e=a(T,"DIV",{class:!0});var Eo=s(_e);p(Nt.$$.fragment,Eo),Xl=c(Eo),Wr=a(Eo,"P",{});var tk=s(Wr);Yl=o(tk,"Converts a string in a sequence of tokens, using the tokenizer."),tk.forEach(t),Jl=c(Eo),Rr=a(Eo,"P",{});var nk=s(Rr);Kl=o(nk,`Split in words for word-based vocabulary or sub-words for sub-word-based vocabularies
(BPE/SentencePieces/WordPieces). Takes care of added tokens.`),nk.forEach(t),Eo.forEach(t),T.forEach(t),Gs=c(i),Ie=a(i,"H2",{class:!0});var hi=s(Ie);Qe=a(hi,"A",{id:!0,class:!0,href:!0});var ok=s(Qe);Ur=a(ok,"SPAN",{});var rk=s(Ur);p(Ot.$$.fragment,rk),rk.forEach(t),ok.forEach(t),Ql=c(hi),jr=a(hi,"SPAN",{});var ak=s(jr);Zl=o(ak,"PreTrainedTokenizerFast"),ak.forEach(t),hi.forEach(t),Xs=c(i),Z=a(i,"P",{});var ft=s(Z);eh=o(ft,"The "),Hn=a(ft,"A",{href:!0});var sk=s(Hn);th=o(sk,"PreTrainedTokenizerFast"),sk.forEach(t),nh=o(ft," depend on the "),St=a(ft,"A",{href:!0,rel:!0});var ik=s(St);oh=o(ik,"tokenizers"),ik.forEach(t),rh=o(ft,` library. The tokenizers obtained from the \u{1F917} tokenizers library can be
loaded very simply into \u{1F917} transformers. Take a look at the `),Mn=a(ft,"A",{href:!0});var dk=s(Mn);ah=o(dk,"Using tokenizers from \u{1F917} tokenizers"),dk.forEach(t),sh=o(ft," page to understand how this is done."),ft.forEach(t),Ys=c(i),k=a(i,"DIV",{class:!0});var w=s(k);p(Wt.$$.fragment,w),ih=c(w),Vr=a(w,"P",{});var ck=s(Vr);dh=o(ck,"Base class for all fast tokenizers (wrapping HuggingFace tokenizers library)."),ck.forEach(t),ch=c(w),Rt=a(w,"P",{});var pi=s(Rt);lh=o(pi,"Inherits from "),Gn=a(pi,"A",{href:!0});var lk=s(Gn);hh=o(lk,"PreTrainedTokenizerBase"),lk.forEach(t),ph=o(pi,"."),pi.forEach(t),mh=c(w),Hr=a(w,"P",{});var hk=s(Hr);fh=o(hk,`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.`),hk.forEach(t),uh=c(w),Mr=a(w,"P",{});var pk=s(Mr);_h=o(pk,`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).`),pk.forEach(t),gh=c(w),Gr=a(w,"P",{});var mk=s(Gr);kh=o(mk,"Class attributes (overridden by derived classes)"),mk.forEach(t),vh=c(w),L=a(w,"UL",{});var G=s(L);ge=a(G,"LI",{});var Fn=s(ge);Xr=a(Fn,"STRONG",{});var fk=s(Xr);bh=o(fk,"vocab_files_names"),fk.forEach(t),yh=o(Fn," ("),Yr=a(Fn,"CODE",{});var uk=s(Yr);Th=o(uk,"Dict[str, str]"),uk.forEach(t),wh=o(Fn,") \u2014 A dictionary with, as keys, the "),Jr=a(Fn,"CODE",{});var _k=s(Jr);zh=o(_k,"__init__"),_k.forEach(t),xh=o(Fn,` keyword name of each
vocabulary file required by the model, and as associated values, the filename for saving the associated file
(string).`),Fn.forEach(t),Eh=c(G),W=a(G,"LI",{});var de=s(W);Kr=a(de,"STRONG",{});var gk=s(Kr);$h=o(gk,"pretrained_vocab_files_map"),gk.forEach(t),Ph=o(de," ("),Qr=a(de,"CODE",{});var kk=s(Qr);qh=o(kk,"Dict[str, Dict[str, str]]"),kk.forEach(t),Dh=o(de,`) \u2014 A dictionary of dictionaries, with the
high-level keys being the `),Zr=a(de,"CODE",{});var vk=s(Zr);Ih=o(vk,"__init__"),vk.forEach(t),Lh=o(de,` keyword name of each vocabulary file required by the model, the
low-level being the `),ea=a(de,"CODE",{});var bk=s(ea);Bh=o(bk,"short-cut-names"),bk.forEach(t),Fh=o(de," of the pretrained models with, as associated values, the "),ta=a(de,"CODE",{});var yk=s(ta);Ch=o(yk,"url"),yk.forEach(t),Ah=o(de,` to the
associated pretrained vocabulary file.`),de.forEach(t),Nh=c(G),ee=a(G,"LI",{});var Se=s(ee);na=a(Se,"STRONG",{});var Tk=s(na);Oh=o(Tk,"max_model_input_sizes"),Tk.forEach(t),Sh=o(Se," ("),oa=a(Se,"CODE",{});var wk=s(oa);Wh=o(wk,"Dict[str, Optional[int]]"),wk.forEach(t),Rh=o(Se,") \u2014 A dictionary with, as keys, the "),ra=a(Se,"CODE",{});var zk=s(ra);Uh=o(zk,"short-cut-names"),zk.forEach(t),jh=o(Se,`
of the pretrained models, and as associated values, the maximum length of the sequence inputs of this model,
or `),aa=a(Se,"CODE",{});var xk=s(aa);Vh=o(xk,"None"),xk.forEach(t),Hh=o(Se," if the model has no maximum input size."),Se.forEach(t),Mh=c(G),R=a(G,"LI",{});var ce=s(R);sa=a(ce,"STRONG",{});var Ek=s(sa);Gh=o(Ek,"pretrained_init_configuration"),Ek.forEach(t),Xh=o(ce," ("),ia=a(ce,"CODE",{});var $k=s(ia);Yh=o($k,"Dict[str, Dict[str, Any]]"),$k.forEach(t),Jh=o(ce,`) \u2014 A dictionary with, as keys, the
`),da=a(ce,"CODE",{});var Pk=s(da);Kh=o(Pk,"short-cut-names"),Pk.forEach(t),Qh=o(ce,` of the pretrained models, and as associated values, a dictionary of specific arguments to
pass to the `),ca=a(ce,"CODE",{});var qk=s(ca);Zh=o(qk,"__init__"),qk.forEach(t),ep=o(ce,` method of the tokenizer class for this pretrained model when loading the tokenizer
with the `),Xn=a(ce,"A",{href:!0});var Dk=s(Xn);tp=o(Dk,"from_pretrained()"),Dk.forEach(t),np=o(ce," method."),ce.forEach(t),op=c(G),Ze=a(G,"LI",{});var Os=s(Ze);la=a(Os,"STRONG",{});var Ik=s(la);rp=o(Ik,"model_input_names"),Ik.forEach(t),ap=o(Os," ("),ha=a(Os,"CODE",{});var Lk=s(ha);sp=o(Lk,"List[str]"),Lk.forEach(t),ip=o(Os,") \u2014 A list of inputs expected in the forward pass of the model."),Os.forEach(t),dp=c(G),te=a(G,"LI",{});var We=s(te);pa=a(We,"STRONG",{});var Bk=s(pa);cp=o(Bk,"padding_side"),Bk.forEach(t),lp=o(We," ("),ma=a(We,"CODE",{});var Fk=s(ma);hp=o(Fk,"str"),Fk.forEach(t),pp=o(We,`) \u2014 The default value for the side on which the model should have padding applied.
Should be `),fa=a(We,"CODE",{});var Ck=s(fa);mp=o(Ck,"'right'"),Ck.forEach(t),fp=o(We," or "),ua=a(We,"CODE",{});var Ak=s(ua);up=o(Ak,"'left'"),Ak.forEach(t),_p=o(We,"."),We.forEach(t),gp=c(G),ne=a(G,"LI",{});var Re=s(ne);_a=a(Re,"STRONG",{});var Nk=s(_a);kp=o(Nk,"truncation_side"),Nk.forEach(t),vp=o(Re," ("),ga=a(Re,"CODE",{});var Ok=s(ga);bp=o(Ok,"str"),Ok.forEach(t),yp=o(Re,`) \u2014 The default value for the side on which the model should have truncation
applied. Should be `),ka=a(Re,"CODE",{});var Sk=s(ka);Tp=o(Sk,"'right'"),Sk.forEach(t),wp=o(Re," or "),va=a(Re,"CODE",{});var Wk=s(va);zp=o(Wk,"'left'"),Wk.forEach(t),xp=o(Re,"."),Re.forEach(t),G.forEach(t),Ep=c(w),et=a(w,"DIV",{class:!0});var mi=s(et);p(Ut.$$.fragment,mi),$p=c(mi),ba=a(mi,"P",{});var Rk=s(ba);Pp=o(Rk,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences.`),Rk.forEach(t),mi.forEach(t),qp=c(w),tt=a(w,"DIV",{class:!0});var fi=s(tt);p(jt.$$.fragment,fi),Dp=c(fi),ya=a(fi,"P",{});var Uk=s(ya);Ip=o(Uk,"Convert a list of lists of token ids into a list of strings by calling decode."),Uk.forEach(t),fi.forEach(t),Lp=c(w),ke=a(w,"DIV",{class:!0});var $o=s(ke);p(Vt.$$.fragment,$o),Bp=c($o),Ta=a($o,"P",{});var jk=s(Ta);Fp=o(jk,`Converts a sequence of ids in a string, using the tokenizer and vocabulary with options to remove special
tokens and clean up tokenization spaces.`),jk.forEach(t),Cp=c($o),Ht=a($o,"P",{});var ui=s(Ht);Ap=o(ui,"Similar to doing "),wa=a(ui,"CODE",{});var Vk=s(wa);Np=o(Vk,"self.convert_tokens_to_string(self.convert_ids_to_tokens(token_ids))"),Vk.forEach(t),Op=o(ui,"."),ui.forEach(t),$o.forEach(t),Sp=c(w),ve=a(w,"DIV",{class:!0});var Po=s(ve);p(Mt.$$.fragment,Po),Wp=c(Po),za=a(Po,"P",{});var Hk=s(za);Rp=o(Hk,"Converts a string to a sequence of ids (integer), using the tokenizer and vocabulary."),Hk.forEach(t),Up=c(Po),Gt=a(Po,"P",{});var _i=s(Gt);jp=o(_i,"Same as doing "),xa=a(_i,"CODE",{});var Mk=s(xa);Vp=o(Mk,"self.convert_tokens_to_ids(self.tokenize(text))"),Mk.forEach(t),Hp=o(_i,"."),_i.forEach(t),Po.forEach(t),Mp=c(w),oe=a(w,"DIV",{class:!0});var ut=s(oe);p(Xt.$$.fragment,ut),Gp=c(ut),Yt=a(ut,"P",{});var gi=s(Yt);Xp=o(gi,`Upload the tokenizer files to the \u{1F917} Model Hub while synchronizing a local clone of the repo in
`),Ea=a(gi,"CODE",{});var Gk=s(Ea);Yp=o(Gk,"repo_path_or_name"),Gk.forEach(t),Jp=o(gi,"."),gi.forEach(t),Kp=c(ut),$a=a(ut,"P",{});var Xk=s($a);Qp=o(Xk,"Examples:"),Xk.forEach(t),Zp=c(ut),p(Jt.$$.fragment,ut),ut.forEach(t),em=c(w),nt=a(w,"DIV",{class:!0});var ki=s(nt);p(Kt.$$.fragment,ki),tm=c(ki),Pa=a(ki,"P",{});var Yk=s(Pa);nm=o(Yk,`Converts a single index or a sequence of indices in a token or a sequence of tokens, using the vocabulary and
added tokens.`),Yk.forEach(t),ki.forEach(t),om=c(w),ot=a(w,"DIV",{class:!0});var vi=s(ot);p(Qt.$$.fragment,vi),rm=c(vi),qa=a(vi,"P",{});var Jk=s(qa);am=o(Jk,`Converts a token string (or a sequence of tokens) in a single integer id (or a sequence of ids), using the
vocabulary.`),Jk.forEach(t),vi.forEach(t),sm=c(w),rt=a(w,"DIV",{class:!0});var bi=s(rt);p(Zt.$$.fragment,bi),im=c(bi),Da=a(bi,"P",{});var Kk=s(Da);dm=o(Kk,"Returns the added tokens in the vocabulary as a dictionary of token to index."),Kk.forEach(t),bi.forEach(t),cm=c(w),be=a(w,"DIV",{class:!0});var qo=s(be);p(en.$$.fragment,qo),lm=c(qo),Ia=a(qo,"P",{});var Qk=s(Ia);hm=o(Qk,"Returns the number of added tokens when encoding a sequence with special tokens."),Qk.forEach(t),pm=c(qo),p(at.$$.fragment,qo),qo.forEach(t),mm=c(w),ye=a(w,"DIV",{class:!0});var Do=s(ye);p(tn.$$.fragment,Do),fm=c(Do),La=a(Do,"P",{});var Zk=s(La);um=o(Zk,`Define the truncation and the padding strategies for fast tokenizers (provided by HuggingFace tokenizers
library) and restore the tokenizer settings afterwards.`),Zk.forEach(t),_m=c(Do),Ba=a(Do,"P",{});var ev=s(Ba);gm=o(ev,`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.`),ev.forEach(t),Do.forEach(t),km=c(w),st=a(w,"DIV",{class:!0});var yi=s(st);p(nn.$$.fragment,yi),vm=c(yi),Fa=a(yi,"P",{});var tv=s(Fa);bm=o(tv,`Trains a tokenizer on a new corpus with the same defaults (in terms of special tokens or tokenization pipeline)
as the current one.`),tv.forEach(t),yi.forEach(t),w.forEach(t),Js=c(i),Le=a(i,"H2",{class:!0});var Ti=s(Le);it=a(Ti,"A",{id:!0,class:!0,href:!0});var nv=s(it);Ca=a(nv,"SPAN",{});var ov=s(Ca);p(on.$$.fragment,ov),ov.forEach(t),nv.forEach(t),ym=c(Ti),Aa=a(Ti,"SPAN",{});var rv=s(Aa);Tm=o(rv,"BatchEncoding"),rv.forEach(t),Ti.forEach(t),Ks=c(i),b=a(i,"DIV",{class:!0});var z=s(b);p(rn.$$.fragment,z),wm=c(z),Be=a(z,"P",{});var Io=s(Be);zm=o(Io,"Holds the output of the "),Yn=a(Io,"A",{href:!0});var av=s(Yn);xm=o(av,"encode_plus()"),av.forEach(t),Em=o(Io,` and
`),Na=a(Io,"CODE",{});var sv=s(Na);$m=o(sv,"batch_encode"),sv.forEach(t),Pm=o(Io," methods (tokens, attention_masks, etc)."),Io.forEach(t),qm=c(z),Oa=a(z,"P",{});var iv=s(Oa);Dm=o(iv,`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.`),iv.forEach(t),Im=c(z),U=a(z,"DIV",{class:!0});var ze=s(U);p(an.$$.fragment,ze),Lm=c(ze),Sa=a(ze,"P",{});var dv=s(Sa);Bm=o(dv,`Get the index of the token in the encoded output comprising a character in the original string for a sequence
of the batch.`),dv.forEach(t),Fm=c(ze),Wa=a(ze,"P",{});var cv=s(Wa);Cm=o(cv,"Can be called as:"),cv.forEach(t),Am=c(ze),sn=a(ze,"UL",{});var wi=s(sn);Jn=a(wi,"LI",{});var __=s(Jn);Ra=a(__,"CODE",{});var lv=s(Ra);Nm=o(lv,"self.char_to_token(char_index)"),lv.forEach(t),Om=o(__," if batch size is 1"),__.forEach(t),Sm=c(wi),Kn=a(wi,"LI",{});var g_=s(Kn);Ua=a(g_,"CODE",{});var hv=s(Ua);Wm=o(hv,"self.char_to_token(batch_index, char_index)"),hv.forEach(t),Rm=o(g_," if batch size is greater or equal to 1"),g_.forEach(t),wi.forEach(t),Um=c(ze),ja=a(ze,"P",{});var pv=s(ja);jm=o(pv,`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.`),pv.forEach(t),ze.forEach(t),Vm=c(z),j=a(z,"DIV",{class:!0});var xe=s(j);p(dn.$$.fragment,xe),Hm=c(xe),Va=a(xe,"P",{});var mv=s(Va);Mm=o(mv,`Get the word in the original string corresponding to a character in the original string of a sequence of the
batch.`),mv.forEach(t),Gm=c(xe),Ha=a(xe,"P",{});var fv=s(Ha);Xm=o(fv,"Can be called as:"),fv.forEach(t),Ym=c(xe),cn=a(xe,"UL",{});var zi=s(cn);Qn=a(zi,"LI",{});var k_=s(Qn);Ma=a(k_,"CODE",{});var uv=s(Ma);Jm=o(uv,"self.char_to_word(char_index)"),uv.forEach(t),Km=o(k_," if batch size is 1"),k_.forEach(t),Qm=c(zi),Zn=a(zi,"LI",{});var v_=s(Zn);Ga=a(v_,"CODE",{});var _v=s(Ga);Zm=o(_v,"self.char_to_word(batch_index, char_index)"),_v.forEach(t),ef=o(v_," if batch size is greater than 1"),v_.forEach(t),zi.forEach(t),tf=c(xe),Xa=a(xe,"P",{});var gv=s(Xa);nf=o(gv,`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.`),gv.forEach(t),xe.forEach(t),of=c(z),dt=a(z,"DIV",{class:!0});var xi=s(dt);p(ln.$$.fragment,xi),rf=c(xi),Ya=a(xi,"P",{});var kv=s(Ya);af=o(kv,"Convert the inner content to tensors."),kv.forEach(t),xi.forEach(t),sf=c(z),Te=a(z,"DIV",{class:!0});var Lo=s(Te);p(hn.$$.fragment,Lo),df=c(Lo),Ja=a(Lo,"P",{});var vv=s(Ja);cf=o(vv,"Return a list mapping the tokens to the id of their original sentences:"),vv.forEach(t),lf=c(Lo),Fe=a(Lo,"UL",{});var Bo=s(Fe);eo=a(Bo,"LI",{});var b_=s(eo);Ka=a(b_,"CODE",{});var bv=s(Ka);hf=o(bv,"None"),bv.forEach(t),pf=o(b_," for special tokens added around or between sequences,"),b_.forEach(t),mf=c(Bo),to=a(Bo,"LI",{});var y_=s(to);Qa=a(y_,"CODE",{});var yv=s(Qa);ff=o(yv,"0"),yv.forEach(t),uf=o(y_," for tokens corresponding to words in the first sequence,"),y_.forEach(t),_f=c(Bo),no=a(Bo,"LI",{});var T_=s(no);Za=a(T_,"CODE",{});var Tv=s(Za);gf=o(Tv,"1"),Tv.forEach(t),kf=o(T_,` for tokens corresponding to words in the second sequence when a pair of sequences was jointly
encoded.`),T_.forEach(t),Bo.forEach(t),Lo.forEach(t),vf=c(z),ct=a(z,"DIV",{class:!0});var Ei=s(ct);p(pn.$$.fragment,Ei),bf=c(Ei),mn=a(Ei,"P",{});var $i=s(mn);yf=o($i,"Send all values to device by calling "),es=a($i,"CODE",{});var wv=s(es);Tf=o(wv,"v.to(device)"),wv.forEach(t),wf=o($i," (PyTorch only)."),$i.forEach(t),Ei.forEach(t),zf=c(z),F=a(z,"DIV",{class:!0});var re=s(F);p(fn.$$.fragment,re),xf=c(re),ts=a(re,"P",{});var zv=s(ts);Ef=o(zv,"Get the character span corresponding to an encoded token in a sequence of the batch."),zv.forEach(t),$f=c(re),un=a(re,"P",{});var Pi=s(un);Pf=o(Pi,"Character spans are returned as a "),oo=a(Pi,"A",{href:!0});var xv=s(oo);qf=o(xv,"CharSpan"),xv.forEach(t),Df=o(Pi," with:"),Pi.forEach(t),If=c(re),_n=a(re,"UL",{});var qi=s(_n);ro=a(qi,"LI",{});var w_=s(ro);ns=a(w_,"STRONG",{});var Ev=s(ns);Lf=o(Ev,"start"),Ev.forEach(t),Bf=o(w_," \u2014 Index of the first character in the original string associated to the token."),w_.forEach(t),Ff=c(qi),ao=a(qi,"LI",{});var z_=s(ao);os=a(z_,"STRONG",{});var $v=s(os);Cf=o($v,"end"),$v.forEach(t),Af=o(z_,` \u2014 Index of the character following the last character in the original string associated to the
token.`),z_.forEach(t),qi.forEach(t),Nf=c(re),rs=a(re,"P",{});var Pv=s(rs);Of=o(Pv,"Can be called as:"),Pv.forEach(t),Sf=c(re),gn=a(re,"UL",{});var Di=s(gn);so=a(Di,"LI",{});var x_=s(so);as=a(x_,"CODE",{});var qv=s(as);Wf=o(qv,"self.token_to_chars(token_index)"),qv.forEach(t),Rf=o(x_," if batch size is 1"),x_.forEach(t),Uf=c(Di),io=a(Di,"LI",{});var E_=s(io);ss=a(E_,"CODE",{});var Dv=s(ss);jf=o(Dv,"self.token_to_chars(batch_index, token_index)"),Dv.forEach(t),Vf=o(E_," if batch size is greater or equal to 1"),E_.forEach(t),Di.forEach(t),re.forEach(t),Hf=c(z),V=a(z,"DIV",{class:!0});var Ee=s(V);p(kn.$$.fragment,Ee),Mf=c(Ee),Ce=a(Ee,"P",{});var Fo=s(Ce);Gf=o(Fo,"Get the index of the sequence represented by the given token. In the general use case, this method returns "),is=a(Fo,"CODE",{});var Iv=s(is);Xf=o(Iv,"0"),Iv.forEach(t),Yf=o(Fo,`
for a single sequence or the first sequence of a pair, and `),ds=a(Fo,"CODE",{});var Lv=s(ds);Jf=o(Lv,"1"),Lv.forEach(t),Kf=o(Fo," for the second sequence of a pair"),Fo.forEach(t),Qf=c(Ee),cs=a(Ee,"P",{});var Bv=s(cs);Zf=o(Bv,"Can be called as:"),Bv.forEach(t),eu=c(Ee),vn=a(Ee,"UL",{});var Ii=s(vn);co=a(Ii,"LI",{});var $_=s(co);ls=a($_,"CODE",{});var Fv=s(ls);tu=o(Fv,"self.token_to_sequence(token_index)"),Fv.forEach(t),nu=o($_," if batch size is 1"),$_.forEach(t),ou=c(Ii),lo=a(Ii,"LI",{});var P_=s(lo);hs=a(P_,"CODE",{});var Cv=s(hs);ru=o(Cv,"self.token_to_sequence(batch_index, token_index)"),Cv.forEach(t),au=o(P_," if batch size is greater than 1"),P_.forEach(t),Ii.forEach(t),su=c(Ee),ps=a(Ee,"P",{});var Av=s(ps);iu=o(Av,`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.`),Av.forEach(t),Ee.forEach(t),du=c(z),H=a(z,"DIV",{class:!0});var $e=s(H);p(bn.$$.fragment,$e),cu=c($e),ms=a($e,"P",{});var Nv=s(ms);lu=o(Nv,"Get the index of the word corresponding (i.e. comprising) to an encoded token in a sequence of the batch."),Nv.forEach(t),hu=c($e),fs=a($e,"P",{});var Ov=s(fs);pu=o(Ov,"Can be called as:"),Ov.forEach(t),mu=c($e),yn=a($e,"UL",{});var Li=s(yn);ho=a(Li,"LI",{});var q_=s(ho);us=a(q_,"CODE",{});var Sv=s(us);fu=o(Sv,"self.token_to_word(token_index)"),Sv.forEach(t),uu=o(q_," if batch size is 1"),q_.forEach(t),_u=c(Li),po=a(Li,"LI",{});var D_=s(po);_s=a(D_,"CODE",{});var Wv=s(_s);gu=o(Wv,"self.token_to_word(batch_index, token_index)"),Wv.forEach(t),ku=o(D_," if batch size is greater than 1"),D_.forEach(t),Li.forEach(t),vu=c($e),gs=a($e,"P",{});var Rv=s(gs);bu=o(Rv,`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.`),Rv.forEach(t),$e.forEach(t),yu=c(z),lt=a(z,"DIV",{class:!0});var Bi=s(lt);p(Tn.$$.fragment,Bi),Tu=c(Bi),ks=a(Bi,"P",{});var Uv=s(ks);wu=o(Uv,`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).`),Uv.forEach(t),Bi.forEach(t),zu=c(z),ht=a(z,"DIV",{class:!0});var Fi=s(ht);p(wn.$$.fragment,Fi),xu=c(Fi),vs=a(Fi,"P",{});var jv=s(vs);Eu=o(jv,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),jv.forEach(t),Fi.forEach(t),$u=c(z),C=a(z,"DIV",{class:!0});var ae=s(C);p(zn.$$.fragment,ae),Pu=c(ae),bs=a(ae,"P",{});var Vv=s(bs);qu=o(Vv,"Get the character span in the original string corresponding to given word in a sequence of the batch."),Vv.forEach(t),Du=c(ae),ys=a(ae,"P",{});var Hv=s(ys);Iu=o(Hv,"Character spans are returned as a CharSpan NamedTuple with:"),Hv.forEach(t),Lu=c(ae),xn=a(ae,"UL",{});var Ci=s(xn);Ts=a(Ci,"LI",{});var Mv=s(Ts);Bu=o(Mv,"start: index of the first character in the original string"),Mv.forEach(t),Fu=c(Ci),ws=a(Ci,"LI",{});var Gv=s(ws);Cu=o(Gv,"end: index of the character following the last character in the original string"),Gv.forEach(t),Ci.forEach(t),Au=c(ae),zs=a(ae,"P",{});var Xv=s(zs);Nu=o(Xv,"Can be called as:"),Xv.forEach(t),Ou=c(ae),En=a(ae,"UL",{});var Ai=s(En);mo=a(Ai,"LI",{});var I_=s(mo);xs=a(I_,"CODE",{});var Yv=s(xs);Su=o(Yv,"self.word_to_chars(word_index)"),Yv.forEach(t),Wu=o(I_," if batch size is 1"),I_.forEach(t),Ru=c(Ai),fo=a(Ai,"LI",{});var L_=s(fo);Es=a(L_,"CODE",{});var Jv=s(Es);Uu=o(Jv,"self.word_to_chars(batch_index, word_index)"),Jv.forEach(t),ju=o(L_," if batch size is greater or equal to 1"),L_.forEach(t),Ai.forEach(t),ae.forEach(t),Vu=c(z),D=a(z,"DIV",{class:!0});var X=s(D);p($n.$$.fragment,X),Hu=c(X),$s=a(X,"P",{});var Kv=s($s);Mu=o(Kv,"Get the encoded token span corresponding to a word in a sequence of the batch."),Kv.forEach(t),Gu=c(X),Pn=a(X,"P",{});var Ni=s(Pn);Xu=o(Ni,"Token spans are returned as a "),uo=a(Ni,"A",{href:!0});var Qv=s(uo);Yu=o(Qv,"TokenSpan"),Qv.forEach(t),Ju=o(Ni," with:"),Ni.forEach(t),Ku=c(X),qn=a(X,"UL",{});var Oi=s(qn);_o=a(Oi,"LI",{});var B_=s(_o);Ps=a(B_,"STRONG",{});var Zv=s(Ps);Qu=o(Zv,"start"),Zv.forEach(t),Zu=o(B_," \u2014 Index of the first token."),B_.forEach(t),e_=c(Oi),go=a(Oi,"LI",{});var F_=s(go);qs=a(F_,"STRONG",{});var eb=s(qs);t_=o(eb,"end"),eb.forEach(t),n_=o(F_," \u2014 Index of the token following the last token."),F_.forEach(t),Oi.forEach(t),o_=c(X),Ds=a(X,"P",{});var tb=s(Ds);r_=o(tb,"Can be called as:"),tb.forEach(t),a_=c(X),Dn=a(X,"UL",{});var Si=s(Dn);ko=a(Si,"LI",{});var C_=s(ko);Is=a(C_,"CODE",{});var nb=s(Is);s_=o(nb,"self.word_to_tokens(word_index, sequence_index: int = 0)"),nb.forEach(t),i_=o(C_," if batch size is 1"),C_.forEach(t),d_=c(Si),vo=a(Si,"LI",{});var A_=s(vo);Ls=a(A_,"CODE",{});var ob=s(Ls);c_=o(ob,"self.word_to_tokens(batch_index, word_index, sequence_index: int = 0)"),ob.forEach(t),l_=o(A_,` if batch size is greater or equal to
1`),A_.forEach(t),Si.forEach(t),h_=c(X),Bs=a(X,"P",{});var rb=s(Bs);p_=o(rb,`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.`),rb.forEach(t),X.forEach(t),m_=c(z),pt=a(z,"DIV",{class:!0});var Wi=s(pt);p(In.$$.fragment,Wi),f_=c(Wi),Fs=a(Wi,"P",{});var ab=s(Fs);u_=o(ab,"Return a list mapping the tokens to their actual word in the initial sentence for a fast tokenizer."),ab.forEach(t),Wi.forEach(t),z.forEach(t),this.h()},h(){l(E,"name","hf:doc:metadata"),l(E,"content",JSON.stringify(ub)),l(P,"id","tokenizer"),l(P,"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(P,"href","#tokenizer"),l($,"class","relative group"),l(kt,"href","https://github.com/huggingface/tokenizers"),l(kt,"rel","nofollow"),l(Cn,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(An,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Nn,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(On,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.SpecialTokensMixin"),l(Sn,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Wn,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Rn,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.BatchEncoding"),l(Un,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(vt,"href","https://github.com/huggingface/tokenizers"),l(vt,"rel","nofollow"),l(Ve,"id","transformers.PreTrainedTokenizer"),l(Ve,"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(Ve,"href","#transformers.PreTrainedTokenizer"),l(qe,"class","relative group"),l(jn,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Vn,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),l(Me,"class","docstring"),l(Ge,"class","docstring"),l(pe,"class","docstring"),l(me,"class","docstring"),l(Q,"class","docstring"),l(Xe,"class","docstring"),l(Ye,"class","docstring"),l(Je,"class","docstring"),l(fe,"class","docstring"),l(ue,"class","docstring"),l(_e,"class","docstring"),l(g,"class","docstring"),l(Qe,"id","transformers.PreTrainedTokenizerFast"),l(Qe,"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(Qe,"href","#transformers.PreTrainedTokenizerFast"),l(Ie,"class","relative group"),l(Hn,"href","/docs/transformers/pr_15839/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(St,"href","https://huggingface.co/docs/tokenizers"),l(St,"rel","nofollow"),l(Mn,"href","../fast_tokenizers"),l(Gn,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase"),l(Xn,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.from_pretrained"),l(et,"class","docstring"),l(tt,"class","docstring"),l(ke,"class","docstring"),l(ve,"class","docstring"),l(oe,"class","docstring"),l(nt,"class","docstring"),l(ot,"class","docstring"),l(rt,"class","docstring"),l(be,"class","docstring"),l(ye,"class","docstring"),l(st,"class","docstring"),l(k,"class","docstring"),l(it,"id","transformers.BatchEncoding"),l(it,"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(it,"href","#transformers.BatchEncoding"),l(Le,"class","relative group"),l(Yn,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.PreTrainedTokenizerBase.encode_plus"),l(U,"class","docstring"),l(j,"class","docstring"),l(dt,"class","docstring"),l(Te,"class","docstring"),l(ct,"class","docstring"),l(oo,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.CharSpan"),l(F,"class","docstring"),l(V,"class","docstring"),l(H,"class","docstring"),l(lt,"class","docstring"),l(ht,"class","docstring"),l(C,"class","docstring"),l(uo,"href","/docs/transformers/pr_15839/en/internal/tokenization_utils#transformers.TokenSpan"),l(D,"class","docstring"),l(pt,"class","docstring"),l(b,"class","docstring")},m(i,y){e(document.head,E),x(i,A,y),x(i,$,y),e($,P),e(P,Co),m(gt,Co,null),e($,Ui),e($,Ao),e(Ao,ji),x(i,Ss,y),x(i,Ue,y),e(Ue,Vi),e(Ue,kt),e(kt,Hi),e(Ue,Mi),x(i,Ws,y),x(i,je,y),e(je,No),e(No,Gi),e(je,Xi),e(je,Oo),e(Oo,Yi),x(i,Rs,y),x(i,N,y),e(N,Ji),e(N,Cn),e(Cn,Ki),e(N,Qi),e(N,An),e(An,Zi),e(N,ed),e(N,Nn),e(Nn,td),e(N,nd),e(N,On),e(On,od),e(N,rd),x(i,Us,y),x(i,Pe,y),e(Pe,Sn),e(Sn,ad),e(Pe,sd),e(Pe,Wn),e(Wn,id),e(Pe,dd),x(i,js,y),x(i,le,y),e(le,So),e(So,cd),e(le,ld),e(le,Wo),e(Wo,hd),e(le,pd),e(le,Ro),e(Ro,md),x(i,Vs,y),x(i,q,y),e(q,Rn),e(Rn,fd),e(q,ud),e(q,Un),e(Un,_d),e(q,gd),e(q,Uo),e(Uo,kd),e(q,vd),e(q,jo),e(jo,bd),e(q,yd),e(q,Vo),e(Vo,Td),e(q,wd),e(q,Ho),e(Ho,zd),e(q,xd),e(q,Mo),e(Mo,Ed),e(q,$d),e(q,vt),e(vt,Pd),e(q,qd),x(i,Hs,y),x(i,qe,y),e(qe,Ve),e(Ve,Go),m(bt,Go,null),e(qe,Dd),e(qe,Xo),e(Xo,Id),x(i,Ms,y),x(i,g,y),m(yt,g,null),e(g,Ld),e(g,Yo),e(Yo,Bd),e(g,Fd),e(g,Tt),e(Tt,Cd),e(Tt,jn),e(jn,Ad),e(Tt,Nd),e(g,Od),e(g,Jo),e(Jo,Sd),e(g,Wd),e(g,Ko),e(Ko,Rd),e(g,Ud),e(g,Qo),e(Qo,jd),e(g,Vd),e(g,I),e(I,he),e(he,Zo),e(Zo,Hd),e(he,Md),e(he,er),e(er,Gd),e(he,Xd),e(he,tr),e(tr,Yd),e(he,Jd),e(I,Kd),e(I,O),e(O,nr),e(nr,Qd),e(O,Zd),e(O,or),e(or,ec),e(O,tc),e(O,rr),e(rr,nc),e(O,oc),e(O,ar),e(ar,rc),e(O,ac),e(O,sr),e(sr,sc),e(O,ic),e(I,dc),e(I,Y),e(Y,ir),e(ir,cc),e(Y,lc),e(Y,dr),e(dr,hc),e(Y,pc),e(Y,cr),e(cr,mc),e(Y,fc),e(Y,lr),e(lr,uc),e(Y,_c),e(I,gc),e(I,S),e(S,hr),e(hr,kc),e(S,vc),e(S,pr),e(pr,bc),e(S,yc),e(S,mr),e(mr,Tc),e(S,wc),e(S,fr),e(fr,zc),e(S,xc),e(S,Vn),e(Vn,Ec),e(S,$c),e(I,Pc),e(I,He),e(He,ur),e(ur,qc),e(He,Dc),e(He,_r),e(_r,Ic),e(He,Lc),e(I,Bc),e(I,J),e(J,gr),e(gr,Fc),e(J,Cc),e(J,kr),e(kr,Ac),e(J,Nc),e(J,vr),e(vr,Oc),e(J,Sc),e(J,br),e(br,Wc),e(J,Rc),e(I,Uc),e(I,K),e(K,yr),e(yr,jc),e(K,Vc),e(K,Tr),e(Tr,Hc),e(K,Mc),e(K,wr),e(wr,Gc),e(K,Xc),e(K,zr),e(zr,Yc),e(K,Jc),e(g,Kc),e(g,Me),m(wt,Me,null),e(Me,Qc),e(Me,xr),e(xr,Zc),e(g,el),e(g,Ge),m(zt,Ge,null),e(Ge,tl),e(Ge,Er),e(Er,nl),e(g,ol),e(g,pe),m(xt,pe,null),e(pe,rl),e(pe,$r),e($r,al),e(pe,sl),e(pe,Et),e(Et,il),e(Et,Pr),e(Pr,dl),e(Et,cl),e(g,ll),e(g,me),m($t,me,null),e(me,hl),e(me,qr),e(qr,pl),e(me,ml),e(me,Pt),e(Pt,fl),e(Pt,Dr),e(Dr,ul),e(Pt,_l),e(g,gl),e(g,Q),m(qt,Q,null),e(Q,kl),e(Q,Dt),e(Dt,vl),e(Dt,Ir),e(Ir,bl),e(Dt,yl),e(Q,Tl),e(Q,Lr),e(Lr,wl),e(Q,zl),m(It,Q,null),e(g,xl),e(g,Xe),m(Lt,Xe,null),e(Xe,El),e(Xe,Br),e(Br,$l),e(g,Pl),e(g,Ye),m(Bt,Ye,null),e(Ye,ql),e(Ye,Fr),e(Fr,Dl),e(g,Il),e(g,Je),m(Ft,Je,null),e(Je,Ll),e(Je,Cr),e(Cr,Bl),e(g,Fl),e(g,fe),m(Ct,fe,null),e(fe,Cl),e(fe,Ar),e(Ar,Al),e(fe,Nl),m(Ke,fe,null),e(g,Ol),e(g,ue),m(At,ue,null),e(ue,Sl),e(ue,Nr),e(Nr,Wl),e(ue,Rl),e(ue,De),e(De,Ul),e(De,Or),e(Or,jl),e(De,Vl),e(De,Sr),e(Sr,Hl),e(De,Ml),e(g,Gl),e(g,_e),m(Nt,_e,null),e(_e,Xl),e(_e,Wr),e(Wr,Yl),e(_e,Jl),e(_e,Rr),e(Rr,Kl),x(i,Gs,y),x(i,Ie,y),e(Ie,Qe),e(Qe,Ur),m(Ot,Ur,null),e(Ie,Ql),e(Ie,jr),e(jr,Zl),x(i,Xs,y),x(i,Z,y),e(Z,eh),e(Z,Hn),e(Hn,th),e(Z,nh),e(Z,St),e(St,oh),e(Z,rh),e(Z,Mn),e(Mn,ah),e(Z,sh),x(i,Ys,y),x(i,k,y),m(Wt,k,null),e(k,ih),e(k,Vr),e(Vr,dh),e(k,ch),e(k,Rt),e(Rt,lh),e(Rt,Gn),e(Gn,hh),e(Rt,ph),e(k,mh),e(k,Hr),e(Hr,fh),e(k,uh),e(k,Mr),e(Mr,_h),e(k,gh),e(k,Gr),e(Gr,kh),e(k,vh),e(k,L),e(L,ge),e(ge,Xr),e(Xr,bh),e(ge,yh),e(ge,Yr),e(Yr,Th),e(ge,wh),e(ge,Jr),e(Jr,zh),e(ge,xh),e(L,Eh),e(L,W),e(W,Kr),e(Kr,$h),e(W,Ph),e(W,Qr),e(Qr,qh),e(W,Dh),e(W,Zr),e(Zr,Ih),e(W,Lh),e(W,ea),e(ea,Bh),e(W,Fh),e(W,ta),e(ta,Ch),e(W,Ah),e(L,Nh),e(L,ee),e(ee,na),e(na,Oh),e(ee,Sh),e(ee,oa),e(oa,Wh),e(ee,Rh),e(ee,ra),e(ra,Uh),e(ee,jh),e(ee,aa),e(aa,Vh),e(ee,Hh),e(L,Mh),e(L,R),e(R,sa),e(sa,Gh),e(R,Xh),e(R,ia),e(ia,Yh),e(R,Jh),e(R,da),e(da,Kh),e(R,Qh),e(R,ca),e(ca,Zh),e(R,ep),e(R,Xn),e(Xn,tp),e(R,np),e(L,op),e(L,Ze),e(Ze,la),e(la,rp),e(Ze,ap),e(Ze,ha),e(ha,sp),e(Ze,ip),e(L,dp),e(L,te),e(te,pa),e(pa,cp),e(te,lp),e(te,ma),e(ma,hp),e(te,pp),e(te,fa),e(fa,mp),e(te,fp),e(te,ua),e(ua,up),e(te,_p),e(L,gp),e(L,ne),e(ne,_a),e(_a,kp),e(ne,vp),e(ne,ga),e(ga,bp),e(ne,yp),e(ne,ka),e(ka,Tp),e(ne,wp),e(ne,va),e(va,zp),e(ne,xp),e(k,Ep),e(k,et),m(Ut,et,null),e(et,$p),e(et,ba),e(ba,Pp),e(k,qp),e(k,tt),m(jt,tt,null),e(tt,Dp),e(tt,ya),e(ya,Ip),e(k,Lp),e(k,ke),m(Vt,ke,null),e(ke,Bp),e(ke,Ta),e(Ta,Fp),e(ke,Cp),e(ke,Ht),e(Ht,Ap),e(Ht,wa),e(wa,Np),e(Ht,Op),e(k,Sp),e(k,ve),m(Mt,ve,null),e(ve,Wp),e(ve,za),e(za,Rp),e(ve,Up),e(ve,Gt),e(Gt,jp),e(Gt,xa),e(xa,Vp),e(Gt,Hp),e(k,Mp),e(k,oe),m(Xt,oe,null),e(oe,Gp),e(oe,Yt),e(Yt,Xp),e(Yt,Ea),e(Ea,Yp),e(Yt,Jp),e(oe,Kp),e(oe,$a),e($a,Qp),e(oe,Zp),m(Jt,oe,null),e(k,em),e(k,nt),m(Kt,nt,null),e(nt,tm),e(nt,Pa),e(Pa,nm),e(k,om),e(k,ot),m(Qt,ot,null),e(ot,rm),e(ot,qa),e(qa,am),e(k,sm),e(k,rt),m(Zt,rt,null),e(rt,im),e(rt,Da),e(Da,dm),e(k,cm),e(k,be),m(en,be,null),e(be,lm),e(be,Ia),e(Ia,hm),e(be,pm),m(at,be,null),e(k,mm),e(k,ye),m(tn,ye,null),e(ye,fm),e(ye,La),e(La,um),e(ye,_m),e(ye,Ba),e(Ba,gm),e(k,km),e(k,st),m(nn,st,null),e(st,vm),e(st,Fa),e(Fa,bm),x(i,Js,y),x(i,Le,y),e(Le,it),e(it,Ca),m(on,Ca,null),e(Le,ym),e(Le,Aa),e(Aa,Tm),x(i,Ks,y),x(i,b,y),m(rn,b,null),e(b,wm),e(b,Be),e(Be,zm),e(Be,Yn),e(Yn,xm),e(Be,Em),e(Be,Na),e(Na,$m),e(Be,Pm),e(b,qm),e(b,Oa),e(Oa,Dm),e(b,Im),e(b,U),m(an,U,null),e(U,Lm),e(U,Sa),e(Sa,Bm),e(U,Fm),e(U,Wa),e(Wa,Cm),e(U,Am),e(U,sn),e(sn,Jn),e(Jn,Ra),e(Ra,Nm),e(Jn,Om),e(sn,Sm),e(sn,Kn),e(Kn,Ua),e(Ua,Wm),e(Kn,Rm),e(U,Um),e(U,ja),e(ja,jm),e(b,Vm),e(b,j),m(dn,j,null),e(j,Hm),e(j,Va),e(Va,Mm),e(j,Gm),e(j,Ha),e(Ha,Xm),e(j,Ym),e(j,cn),e(cn,Qn),e(Qn,Ma),e(Ma,Jm),e(Qn,Km),e(cn,Qm),e(cn,Zn),e(Zn,Ga),e(Ga,Zm),e(Zn,ef),e(j,tf),e(j,Xa),e(Xa,nf),e(b,of),e(b,dt),m(ln,dt,null),e(dt,rf),e(dt,Ya),e(Ya,af),e(b,sf),e(b,Te),m(hn,Te,null),e(Te,df),e(Te,Ja),e(Ja,cf),e(Te,lf),e(Te,Fe),e(Fe,eo),e(eo,Ka),e(Ka,hf),e(eo,pf),e(Fe,mf),e(Fe,to),e(to,Qa),e(Qa,ff),e(to,uf),e(Fe,_f),e(Fe,no),e(no,Za),e(Za,gf),e(no,kf),e(b,vf),e(b,ct),m(pn,ct,null),e(ct,bf),e(ct,mn),e(mn,yf),e(mn,es),e(es,Tf),e(mn,wf),e(b,zf),e(b,F),m(fn,F,null),e(F,xf),e(F,ts),e(ts,Ef),e(F,$f),e(F,un),e(un,Pf),e(un,oo),e(oo,qf),e(un,Df),e(F,If),e(F,_n),e(_n,ro),e(ro,ns),e(ns,Lf),e(ro,Bf),e(_n,Ff),e(_n,ao),e(ao,os),e(os,Cf),e(ao,Af),e(F,Nf),e(F,rs),e(rs,Of),e(F,Sf),e(F,gn),e(gn,so),e(so,as),e(as,Wf),e(so,Rf),e(gn,Uf),e(gn,io),e(io,ss),e(ss,jf),e(io,Vf),e(b,Hf),e(b,V),m(kn,V,null),e(V,Mf),e(V,Ce),e(Ce,Gf),e(Ce,is),e(is,Xf),e(Ce,Yf),e(Ce,ds),e(ds,Jf),e(Ce,Kf),e(V,Qf),e(V,cs),e(cs,Zf),e(V,eu),e(V,vn),e(vn,co),e(co,ls),e(ls,tu),e(co,nu),e(vn,ou),e(vn,lo),e(lo,hs),e(hs,ru),e(lo,au),e(V,su),e(V,ps),e(ps,iu),e(b,du),e(b,H),m(bn,H,null),e(H,cu),e(H,ms),e(ms,lu),e(H,hu),e(H,fs),e(fs,pu),e(H,mu),e(H,yn),e(yn,ho),e(ho,us),e(us,fu),e(ho,uu),e(yn,_u),e(yn,po),e(po,_s),e(_s,gu),e(po,ku),e(H,vu),e(H,gs),e(gs,bu),e(b,yu),e(b,lt),m(Tn,lt,null),e(lt,Tu),e(lt,ks),e(ks,wu),e(b,zu),e(b,ht),m(wn,ht,null),e(ht,xu),e(ht,vs),e(vs,Eu),e(b,$u),e(b,C),m(zn,C,null),e(C,Pu),e(C,bs),e(bs,qu),e(C,Du),e(C,ys),e(ys,Iu),e(C,Lu),e(C,xn),e(xn,Ts),e(Ts,Bu),e(xn,Fu),e(xn,ws),e(ws,Cu),e(C,Au),e(C,zs),e(zs,Nu),e(C,Ou),e(C,En),e(En,mo),e(mo,xs),e(xs,Su),e(mo,Wu),e(En,Ru),e(En,fo),e(fo,Es),e(Es,Uu),e(fo,ju),e(b,Vu),e(b,D),m($n,D,null),e(D,Hu),e(D,$s),e($s,Mu),e(D,Gu),e(D,Pn),e(Pn,Xu),e(Pn,uo),e(uo,Yu),e(Pn,Ju),e(D,Ku),e(D,qn),e(qn,_o),e(_o,Ps),e(Ps,Qu),e(_o,Zu),e(qn,e_),e(qn,go),e(go,qs),e(qs,t_),e(go,n_),e(D,o_),e(D,Ds),e(Ds,r_),e(D,a_),e(D,Dn),e(Dn,ko),e(ko,Is),e(Is,s_),e(ko,i_),e(Dn,d_),e(Dn,vo),e(vo,Ls),e(Ls,c_),e(vo,l_),e(D,h_),e(D,Bs),e(Bs,p_),e(b,m_),e(b,pt),m(In,pt,null),e(pt,f_),e(pt,Fs),e(Fs,u_),Qs=!0},p(i,[y]){const Ln={};y&2&&(Ln.$$scope={dirty:y,ctx:i}),Ke.$set(Ln);const Cs={};y&2&&(Cs.$$scope={dirty:y,ctx:i}),at.$set(Cs)},i(i){Qs||(f(gt.$$.fragment,i),f(bt.$$.fragment,i),f(yt.$$.fragment,i),f(wt.$$.fragment,i),f(zt.$$.fragment,i),f(xt.$$.fragment,i),f($t.$$.fragment,i),f(qt.$$.fragment,i),f(It.$$.fragment,i),f(Lt.$$.fragment,i),f(Bt.$$.fragment,i),f(Ft.$$.fragment,i),f(Ct.$$.fragment,i),f(Ke.$$.fragment,i),f(At.$$.fragment,i),f(Nt.$$.fragment,i),f(Ot.$$.fragment,i),f(Wt.$$.fragment,i),f(Ut.$$.fragment,i),f(jt.$$.fragment,i),f(Vt.$$.fragment,i),f(Mt.$$.fragment,i),f(Xt.$$.fragment,i),f(Jt.$$.fragment,i),f(Kt.$$.fragment,i),f(Qt.$$.fragment,i),f(Zt.$$.fragment,i),f(en.$$.fragment,i),f(at.$$.fragment,i),f(tn.$$.fragment,i),f(nn.$$.fragment,i),f(on.$$.fragment,i),f(rn.$$.fragment,i),f(an.$$.fragment,i),f(dn.$$.fragment,i),f(ln.$$.fragment,i),f(hn.$$.fragment,i),f(pn.$$.fragment,i),f(fn.$$.fragment,i),f(kn.$$.fragment,i),f(bn.$$.fragment,i),f(Tn.$$.fragment,i),f(wn.$$.fragment,i),f(zn.$$.fragment,i),f($n.$$.fragment,i),f(In.$$.fragment,i),Qs=!0)},o(i){u(gt.$$.fragment,i),u(bt.$$.fragment,i),u(yt.$$.fragment,i),u(wt.$$.fragment,i),u(zt.$$.fragment,i),u(xt.$$.fragment,i),u($t.$$.fragment,i),u(qt.$$.fragment,i),u(It.$$.fragment,i),u(Lt.$$.fragment,i),u(Bt.$$.fragment,i),u(Ft.$$.fragment,i),u(Ct.$$.fragment,i),u(Ke.$$.fragment,i),u(At.$$.fragment,i),u(Nt.$$.fragment,i),u(Ot.$$.fragment,i),u(Wt.$$.fragment,i),u(Ut.$$.fragment,i),u(jt.$$.fragment,i),u(Vt.$$.fragment,i),u(Mt.$$.fragment,i),u(Xt.$$.fragment,i),u(Jt.$$.fragment,i),u(Kt.$$.fragment,i),u(Qt.$$.fragment,i),u(Zt.$$.fragment,i),u(en.$$.fragment,i),u(at.$$.fragment,i),u(tn.$$.fragment,i),u(nn.$$.fragment,i),u(on.$$.fragment,i),u(rn.$$.fragment,i),u(an.$$.fragment,i),u(dn.$$.fragment,i),u(ln.$$.fragment,i),u(hn.$$.fragment,i),u(pn.$$.fragment,i),u(fn.$$.fragment,i),u(kn.$$.fragment,i),u(bn.$$.fragment,i),u(Tn.$$.fragment,i),u(wn.$$.fragment,i),u(zn.$$.fragment,i),u($n.$$.fragment,i),u(In.$$.fragment,i),Qs=!1},d(i){t(E),i&&t(A),i&&t($),_(gt),i&&t(Ss),i&&t(Ue),i&&t(Ws),i&&t(je),i&&t(Rs),i&&t(N),i&&t(Us),i&&t(Pe),i&&t(js),i&&t(le),i&&t(Vs),i&&t(q),i&&t(Hs),i&&t(qe),_(bt),i&&t(Ms),i&&t(g),_(yt),_(wt),_(zt),_(xt),_($t),_(qt),_(It),_(Lt),_(Bt),_(Ft),_(Ct),_(Ke),_(At),_(Nt),i&&t(Gs),i&&t(Ie),_(Ot),i&&t(Xs),i&&t(Z),i&&t(Ys),i&&t(k),_(Wt),_(Ut),_(jt),_(Vt),_(Mt),_(Xt),_(Jt),_(Kt),_(Qt),_(Zt),_(en),_(at),_(tn),_(nn),i&&t(Js),i&&t(Le),_(on),i&&t(Ks),i&&t(b),_(rn),_(an),_(dn),_(ln),_(hn),_(pn),_(fn),_(kn),_(bn),_(Tn),_(wn),_(zn),_($n),_(In)}}}const ub={local:"tokenizer",sections:[{local:"transformers.PreTrainedTokenizer",title:"PreTrainedTokenizer"},{local:"transformers.PreTrainedTokenizerFast",title:"PreTrainedTokenizerFast"},{local:"transformers.BatchEncoding",title:"BatchEncoding"}],title:"Tokenizer"};function _b(_t,E,A){let{fw:$}=E;return _t.$$set=P=>{"fw"in P&&A(0,$=P.fw)},[$]}class wb extends db{constructor(E){super();cb(this,E,_b,fb,lb,{fw:0})}}export{wb as default,ub as metadata};
