import{s as Wt,o as Bt,n as Tt}from"../chunks/scheduler.18a86fab.js";import{S as Ot,i as St,g as o,s as n,r as _,A as Qt,h as i,f as a,c as s,j as z,u as k,x as m,k as L,y as t,a as c,v as b,d as v,t as T,w}from"../chunks/index.98837b22.js";import{T as Yt}from"../chunks/Tip.77304350.js";import{D as j}from"../chunks/Docstring.6758ea23.js";import{C as wt}from"../chunks/CodeBlock.8d0c2e8a.js";import{E as Ft}from"../chunks/ExampleCodeBlock.0c42463f.js";import{H as Ce}from"../chunks/Heading.7e7e0c5b.js";import{E as Kt}from"../chunks/index.499f366c.js";function en(E){let p,$=`Herbert implementation is the same as <code>BERT</code> except for the tokenization method. Refer to <a href="bert">BERT documentation</a>
for API reference and examples.`;return{c(){p=o("p"),p.innerHTML=$},l(u){p=i(u,"P",{"data-svelte-h":!0}),m(p)!=="svelte-71d2k4"&&(p.innerHTML=$)},m(u,f){c(u,p,f)},p:Tt,d(u){u&&a(p)}}}function tn(E){let p,$="pair mask has the following format:",u,f,y;return f=new wt({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`,wrap:!1}}),{c(){p=o("p"),p.textContent=$,u=n(),_(f.$$.fragment)},l(l){p=i(l,"P",{"data-svelte-h":!0}),m(p)!=="svelte-qjgeij"&&(p.textContent=$),u=s(l),k(f.$$.fragment,l)},m(l,M){c(l,p,M),c(l,u,M),b(f,l,M),y=!0},p:Tt,i(l){y||(v(f.$$.fragment,l),y=!0)},o(l){T(f.$$.fragment,l),y=!1},d(l){l&&(a(p),a(u)),w(f,l)}}}function nn(E){let p,$="BERT sequence pair mask has the following format:",u,f,y;return f=new wt({props:{code:"MCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAwJTIwMCUyMDAlMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMjAxJTIwMSUyMDElMEElN0MlMjBmaXJzdCUyMHNlcXVlbmNlJTIwJTIwJTIwJTIwJTdDJTIwc2Vjb25kJTIwc2VxdWVuY2UlMjAlN0M=",highlighted:`0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 0 </span>0<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1<span class="hljs-number"> 1 </span>1 1
| first sequence    | second sequence |`,wrap:!1}}),{c(){p=o("p"),p.textContent=$,u=n(),_(f.$$.fragment)},l(l){p=i(l,"P",{"data-svelte-h":!0}),m(p)!=="svelte-thc81r"&&(p.textContent=$),u=s(l),k(f.$$.fragment,l)},m(l,M){c(l,p,M),c(l,u,M),b(f,l,M),y=!0},p:Tt,i(l){y||(v(f.$$.fragment,l),y=!0)},o(l){T(f.$$.fragment,l),y=!1},d(l){l&&(a(p),a(u)),w(f,l)}}}function sn(E){let p,$,u,f,y,l,M,yt=`<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-DE3412?style=flat&amp;logo=pytorch&amp;logoColor=white"/> <img alt="TensorFlow" src="https://img.shields.io/badge/TensorFlow-FF6F00?style=flat&amp;logo=tensorflow&amp;logoColor=white"/> <img alt="Flax" src="https://img.shields.io/badge/Flax-29a79b.svg?style=flat&amp;logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAtCAMAAAANx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Mbm3ZJAOn1rUKpYIt/lDhW/5RHHteeWFN60qo98YJuoq1nK3uW5AabyspC1BcIEpOhft+SZAShYoLSvnmSfnYADUERP5jJn2h5XtsgCRuhYQqAvwTwn33+YWEKUI72HX5AtfSAZDe8F2DtPPm77afhl0EkthzuCQU0BWApgQIH9+KB0JhopMM7bJrdTRoleM2JAVNMyPF+wdoaz+XJpGoVAQ7WXUkcV7gT3oUZyi/ISIJAVKhgNp+4b4veCFhYVJw4locdSjZCp9cPUhLF9EZ3KKzURepMEtCDPP3VcWFx4UIiZIklIpFNfHpdEafIF2aRmOcrUmjohbT2WUllbmRvgfbythbQO3222fpDJoufaQPncYYuqoGtUEsCJZL6/3PR5b4syeSjZMQG/T2maGANlXT2v8S4AULWaUkCxfLyW8iW4kdka+nEMjxpL2NCwsYNBp+Q61PF43zyDg9Bm9+3NNySn78jMZUUkumqE4Gp7JmFOdP1vc8PpRrzj9+wPinCy8K1PiJ4aYbnTYpCCbDkBSbzhu2QJ1Gd82t8jI8TH51+OzvXoWbnXUOBkNW+0mWFwGcGOUVpU81/n3TOHb5oMt2FgYGjzau0Nif0Ss7Q3XB33hjjQHjHA5E5aOyIQc8CBrLdQSs3j92VG+3nNEjbkbdbBr9zm04ruvw37vh0QKOdeGIkckc80fX3KH/h7PT4BOjgCty8VZ5ux1MoO5Cf5naca2LAsEgehI+drX8o/0Nu+W0m6K/I9gGPd/dfx/EN/wN62AhsBWuAAAAAElFTkSuQmCC
"/>`,Ae,G,He,R,Mt=`The HerBERT model was proposed in <a href="https://www.aclweb.org/anthology/2020.acl-main.111.pdf" rel="nofollow">KLEJ: Comprehensive Benchmark for Polish Language Understanding</a> by Piotr Rybak, Robert Mroczkowski, Janusz Tracz, and
Ireneusz Gawlik. It is a BERT-based Language Model trained on Polish Corpora using only MLM objective with dynamic
masking of whole words.`,Ie,X,xt="The abstract from the paper is the following:",je,F,$t=`<em>In recent years, a series of Transformer-based models unlocked major improvements in general natural language
understanding (NLU) tasks. Such a fast pace of research would not be possible without general NLU benchmarks, which
allow for a fair comparison of the proposed methods. However, such benchmarks are available only for a handful of
languages. To alleviate this issue, we introduce a comprehensive multi-task benchmark for the Polish language
understanding, accompanied by an online leaderboard. It consists of a diverse set of tasks, adopted from existing
datasets for named entity recognition, question-answering, textual entailment, and others. We also introduce a new
sentiment analysis task for the e-commerce domain, named Allegro Reviews (AR). To ensure a common evaluation scheme and
promote models that generalize to different NLU tasks, the benchmark includes datasets from varying domains and
applications. Additionally, we release HerBERT, a Transformer-based model trained specifically for the Polish language,
which has the best average performance and obtains the best results for three out of nine tasks. Finally, we provide an
extensive evaluation, including several standard baselines and recently proposed, multilingual Transformer-based
models.</em>`,Ee,W,Jt=`This model was contributed by <a href="https://huggingface.co/rmroczkowski" rel="nofollow">rmroczkowski</a>. The original code can be found
<a href="https://github.com/allegro/HerBERT" rel="nofollow">here</a>.`,qe,B,Ue,O,De,q,Ve,S,Pe,d,Q,Be,pe,Lt="Construct a BPE tokenizer for HerBERT.",Oe,ce,zt="Peculiarities:",Se,me,Ct=`<li><p>uses BERT’s pre-tokenizer: BaseTokenizer splits tokens on spaces, and also on punctuation. Each occurrence of a
punctuation character will be treated separately.</p></li> <li><p>Such pretokenized input is BPE subtokenized</p></li>`,Qe,de,At=`This tokenizer inherits from <a href="/docs/transformers/main/en/model_doc/xlm#transformers.XLMTokenizer">XLMTokenizer</a> which contains most of the methods. Users should refer to the
superclass for more information regarding methods.`,Ye,C,Y,Ke,fe,Ht=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM sequence has the following format:`,et,ue,It="<li>single sequence: <code>&lt;s&gt; X &lt;/s&gt;</code></li> <li>pair of sequences: <code>&lt;s&gt; A &lt;/s&gt; B &lt;/s&gt;</code></li>",tt,U,K,nt,ge,jt="Converts a sequence of tokens (string) in a single string.",st,J,ee,rt,he,Et="Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence",at,D,ot,_e,qt="If <code>token_ids_1</code> is <code>None</code>, this method only returns the first portion of the mask (0s).",it,V,te,lt,ke,Ut=`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer <code>prepare_for_model</code> method.`,Ze,ne,Ne,g,se,pt,be,Dt="Construct a “Fast” BPE tokenizer for HerBERT (backed by HuggingFace’s <em>tokenizers</em> library).",ct,ve,Vt="Peculiarities:",mt,Te,Pt=`<li>uses BERT’s pre-tokenizer: BertPreTokenizer splits tokens on spaces, and also on punctuation. Each occurrence of
a punctuation character will be treated separately.</li>`,dt,we,Zt=`This tokenizer inherits from <a href="/docs/transformers/main/en/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> which contains most of the methods. Users should refer to the
superclass for more information regarding methods.`,ft,A,re,ut,ye,Nt=`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An HerBERT, like BERT sequence has the following format:`,gt,Me,Gt="<li>single sequence: <code>&lt;s&gt; X &lt;/s&gt;</code></li> <li>pair of sequences: <code>&lt;s&gt; A &lt;/s&gt; B &lt;/s&gt;</code></li>",ht,H,ae,_t,xe,Rt="Create a mask from the two sequences passed to be used in a sequence-pair classification task. HerBERT, like",kt,P,bt,Z,oe,vt,$e,Xt=`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer <code>prepare_for_model</code> method.`,Ge,ie,Re,ze,Xe;return y=new Ce({props:{title:"HerBERT",local:"herbert",headingTag:"h1"}}),G=new Ce({props:{title:"Overview",local:"overview",headingTag:"h2"}}),B=new Ce({props:{title:"Usage example",local:"usage-example",headingTag:"h2"}}),O=new wt({props:{code:"ZnJvbSUyMHRyYW5zZm9ybWVycyUyMGltcG9ydCUyMEhlcmJlcnRUb2tlbml6ZXIlMkMlMjBSb2JlcnRhTW9kZWwlMEElMEF0b2tlbml6ZXIlMjAlM0QlMjBIZXJiZXJ0VG9rZW5pemVyLmZyb21fcHJldHJhaW5lZCglMjJhbGxlZ3JvJTJGaGVyYmVydC1rbGVqLWNhc2VkLXRva2VuaXplci12MSUyMiklMEFtb2RlbCUyMCUzRCUyMFJvYmVydGFNb2RlbC5mcm9tX3ByZXRyYWluZWQoJTIyYWxsZWdybyUyRmhlcmJlcnQta2xlai1jYXNlZC12MSUyMiklMEElMEFlbmNvZGVkX2lucHV0JTIwJTNEJTIwdG9rZW5pemVyLmVuY29kZSglMjJLdG8lMjBtYSUyMGxlcHN6JUM0JTg1JTIwc3p0dWslQzQlOTklMkMlMjBtYSUyMGxlcHN6eSUyMHJ6JUM0JTg1ZCUyMCVFMiU4MCU5MyUyMHRvJTIwamFzbmUuJTIyJTJDJTIwcmV0dXJuX3RlbnNvcnMlM0QlMjJwdCUyMiklMEFvdXRwdXRzJTIwJTNEJTIwbW9kZWwoZW5jb2RlZF9pbnB1dCklMEElMEElMjMlMjBIZXJCRVJUJTIwY2FuJTIwYWxzbyUyMGJlJTIwbG9hZGVkJTIwdXNpbmclMjBBdXRvVG9rZW5pemVyJTIwYW5kJTIwQXV0b01vZGVsJTNBJTBBaW1wb3J0JTIwdG9yY2glMEFmcm9tJTIwdHJhbnNmb3JtZXJzJTIwaW1wb3J0JTIwQXV0b01vZGVsJTJDJTIwQXV0b1Rva2VuaXplciUwQSUwQXRva2VuaXplciUyMCUzRCUyMEF1dG9Ub2tlbml6ZXIuZnJvbV9wcmV0cmFpbmVkKCUyMmFsbGVncm8lMkZoZXJiZXJ0LWtsZWotY2FzZWQtdG9rZW5pemVyLXYxJTIyKSUwQW1vZGVsJTIwJTNEJTIwQXV0b01vZGVsLmZyb21fcHJldHJhaW5lZCglMjJhbGxlZ3JvJTJGaGVyYmVydC1rbGVqLWNhc2VkLXYxJTIyKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> HerbertTokenizer, RobertaModel

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = HerbertTokenizer.from_pretrained(<span class="hljs-string">&quot;allegro/herbert-klej-cased-tokenizer-v1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = RobertaModel.from_pretrained(<span class="hljs-string">&quot;allegro/herbert-klej-cased-v1&quot;</span>)

<span class="hljs-meta">&gt;&gt;&gt; </span>encoded_input = tokenizer.encode(<span class="hljs-string">&quot;Kto ma lepszą sztukę, ma lepszy rząd – to jasne.&quot;</span>, return_tensors=<span class="hljs-string">&quot;pt&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>outputs = model(encoded_input)

<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-comment"># HerBERT can also be loaded using AutoTokenizer and AutoModel:</span>
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> torch
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> AutoModel, AutoTokenizer

<span class="hljs-meta">&gt;&gt;&gt; </span>tokenizer = AutoTokenizer.from_pretrained(<span class="hljs-string">&quot;allegro/herbert-klej-cased-tokenizer-v1&quot;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>model = AutoModel.from_pretrained(<span class="hljs-string">&quot;allegro/herbert-klej-cased-v1&quot;</span>)`,wrap:!1}}),q=new Yt({props:{$$slots:{default:[en]},$$scope:{ctx:E}}}),S=new Ce({props:{title:"HerbertTokenizer",local:"transformers.HerbertTokenizer",headingTag:"h2"}}),Q=new j({props:{name:"class transformers.HerbertTokenizer",anchor:"transformers.HerbertTokenizer",parameters:[{name:"vocab_file",val:""},{name:"merges_file",val:""},{name:"tokenizer_file",val:" = None"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"sep_token",val:" = '</s>'"},{name:"bos_token",val:" = '<s>'"},{name:"do_lowercase_and_remove_accent",val:" = False"},{name:"additional_special_tokens",val:" = ['<special0>', '<special1>', '<special2>', '<special3>', '<special4>', '<special5>', '<special6>', '<special7>', '<special8>', '<special9>']"},{name:"lang2id",val:" = None"},{name:"id2lang",val:" = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert.py#L277"}}),Y=new j({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.HerbertTokenizer.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.HerbertTokenizer.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.HerbertTokenizer.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert.py#L511",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),K=new j({props:{name:"convert_tokens_to_string",anchor:"transformers.HerbertTokenizer.convert_tokens_to_string",parameters:[{name:"tokens",val:""}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert.py#L505"}}),ee=new j({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.HerbertTokenizer.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.HerbertTokenizer.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.HerbertTokenizer.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert.py#L568",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),D=new Ft({props:{anchor:"transformers.HerbertTokenizer.create_token_type_ids_from_sequences.example",$$slots:{default:[tn]},$$scope:{ctx:E}}}),te=new j({props:{name:"get_special_tokens_mask",anchor:"transformers.HerbertTokenizer.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HerbertTokenizer.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.HerbertTokenizer.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.HerbertTokenizer.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert.py#L539",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),ne=new Ce({props:{title:"HerbertTokenizerFast",local:"transformers.HerbertTokenizerFast",headingTag:"h2"}}),se=new j({props:{name:"class transformers.HerbertTokenizerFast",anchor:"transformers.HerbertTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"merges_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"sep_token",val:" = '</s>'"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.HerbertTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.HerbertTokenizerFast.merges_file",description:`<strong>merges_file</strong> (<code>str</code>) &#x2014;
Path to the merges file.`,name:"merges_file"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert_fast.py#L28"}}),re=new j({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.HerbertTokenizerFast.build_inputs_with_special_tokens",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.HerbertTokenizerFast.build_inputs_with_special_tokens.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs to which the special tokens will be added.`,name:"token_ids_0"},{anchor:"transformers.HerbertTokenizerFast.build_inputs_with_special_tokens.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert_fast.py#L74",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),ae=new j({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.HerbertTokenizerFast.create_token_type_ids_from_sequences",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"}],parametersDescription:[{anchor:"transformers.HerbertTokenizerFast.create_token_type_ids_from_sequences.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.HerbertTokenizerFast.create_token_type_ids_from_sequences.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert_fast.py#L128",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>List of <a href="../glossary#token-type-ids">token type IDs</a> according to the given sequence(s).</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),P=new Ft({props:{anchor:"transformers.HerbertTokenizerFast.create_token_type_ids_from_sequences.example",$$slots:{default:[nn]},$$scope:{ctx:E}}}),oe=new j({props:{name:"get_special_tokens_mask",anchor:"transformers.HerbertTokenizerFast.get_special_tokens_mask",parameters:[{name:"token_ids_0",val:": typing.List[int]"},{name:"token_ids_1",val:": typing.Optional[typing.List[int]] = None"},{name:"already_has_special_tokens",val:": bool = False"}],parametersDescription:[{anchor:"transformers.HerbertTokenizerFast.get_special_tokens_mask.token_ids_0",description:`<strong>token_ids_0</strong> (<code>List[int]</code>) &#x2014;
List of IDs.`,name:"token_ids_0"},{anchor:"transformers.HerbertTokenizerFast.get_special_tokens_mask.token_ids_1",description:`<strong>token_ids_1</strong> (<code>List[int]</code>, <em>optional</em>) &#x2014;
Optional second list of IDs for sequence pairs.`,name:"token_ids_1"},{anchor:"transformers.HerbertTokenizerFast.get_special_tokens_mask.already_has_special_tokens",description:`<strong>already_has_special_tokens</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Whether or not the token list is already formatted with special tokens for the model.`,name:"already_has_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/models/herbert/tokenization_herbert_fast.py#L101",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>List[int]</code></p>
`}}),ie=new Kt({props:{source:"https://github.com/huggingface/transformers/blob/main/docs/source/en/model_doc/herbert.md"}}),{c(){p=o("meta"),$=n(),u=o("p"),f=n(),_(y.$$.fragment),l=n(),M=o("div"),M.innerHTML=yt,Ae=n(),_(G.$$.fragment),He=n(),R=o("p"),R.innerHTML=Mt,Ie=n(),X=o("p"),X.textContent=xt,je=n(),F=o("p"),F.innerHTML=$t,Ee=n(),W=o("p"),W.innerHTML=Jt,qe=n(),_(B.$$.fragment),Ue=n(),_(O.$$.fragment),De=n(),_(q.$$.fragment),Ve=n(),_(S.$$.fragment),Pe=n(),d=o("div"),_(Q.$$.fragment),Be=n(),pe=o("p"),pe.textContent=Lt,Oe=n(),ce=o("p"),ce.textContent=zt,Se=n(),me=o("ul"),me.innerHTML=Ct,Qe=n(),de=o("p"),de.innerHTML=At,Ye=n(),C=o("div"),_(Y.$$.fragment),Ke=n(),fe=o("p"),fe.textContent=Ht,et=n(),ue=o("ul"),ue.innerHTML=It,tt=n(),U=o("div"),_(K.$$.fragment),nt=n(),ge=o("p"),ge.textContent=jt,st=n(),J=o("div"),_(ee.$$.fragment),rt=n(),he=o("p"),he.textContent=Et,at=n(),_(D.$$.fragment),ot=n(),_e=o("p"),_e.innerHTML=qt,it=n(),V=o("div"),_(te.$$.fragment),lt=n(),ke=o("p"),ke.innerHTML=Ut,Ze=n(),_(ne.$$.fragment),Ne=n(),g=o("div"),_(se.$$.fragment),pt=n(),be=o("p"),be.innerHTML=Dt,ct=n(),ve=o("p"),ve.textContent=Vt,mt=n(),Te=o("ul"),Te.innerHTML=Pt,dt=n(),we=o("p"),we.innerHTML=Zt,ft=n(),A=o("div"),_(re.$$.fragment),ut=n(),ye=o("p"),ye.textContent=Nt,gt=n(),Me=o("ul"),Me.innerHTML=Gt,ht=n(),H=o("div"),_(ae.$$.fragment),_t=n(),xe=o("p"),xe.textContent=Rt,kt=n(),_(P.$$.fragment),bt=n(),Z=o("div"),_(oe.$$.fragment),vt=n(),$e=o("p"),$e.innerHTML=Xt,Ge=n(),_(ie.$$.fragment),Re=n(),ze=o("p"),this.h()},l(e){const r=Qt("svelte-u9bgzb",document.head);p=i(r,"META",{name:!0,content:!0}),r.forEach(a),$=s(e),u=i(e,"P",{}),z(u).forEach(a),f=s(e),k(y.$$.fragment,e),l=s(e),M=i(e,"DIV",{class:!0,"data-svelte-h":!0}),m(M)!=="svelte-1px1zvi"&&(M.innerHTML=yt),Ae=s(e),k(G.$$.fragment,e),He=s(e),R=i(e,"P",{"data-svelte-h":!0}),m(R)!=="svelte-innugr"&&(R.innerHTML=Mt),Ie=s(e),X=i(e,"P",{"data-svelte-h":!0}),m(X)!=="svelte-vfdo9a"&&(X.textContent=xt),je=s(e),F=i(e,"P",{"data-svelte-h":!0}),m(F)!=="svelte-1frp4qn"&&(F.innerHTML=$t),Ee=s(e),W=i(e,"P",{"data-svelte-h":!0}),m(W)!=="svelte-1jq061t"&&(W.innerHTML=Jt),qe=s(e),k(B.$$.fragment,e),Ue=s(e),k(O.$$.fragment,e),De=s(e),k(q.$$.fragment,e),Ve=s(e),k(S.$$.fragment,e),Pe=s(e),d=i(e,"DIV",{class:!0});var h=z(d);k(Q.$$.fragment,h),Be=s(h),pe=i(h,"P",{"data-svelte-h":!0}),m(pe)!=="svelte-irtuqb"&&(pe.textContent=Lt),Oe=s(h),ce=i(h,"P",{"data-svelte-h":!0}),m(ce)!=="svelte-r7777v"&&(ce.textContent=zt),Se=s(h),me=i(h,"UL",{"data-svelte-h":!0}),m(me)!=="svelte-15v80xk"&&(me.innerHTML=Ct),Qe=s(h),de=i(h,"P",{"data-svelte-h":!0}),m(de)!=="svelte-1xpuuz9"&&(de.innerHTML=At),Ye=s(h),C=i(h,"DIV",{class:!0});var I=z(C);k(Y.$$.fragment,I),Ke=s(I),fe=i(I,"P",{"data-svelte-h":!0}),m(fe)!=="svelte-1xo6smc"&&(fe.textContent=Ht),et=s(I),ue=i(I,"UL",{"data-svelte-h":!0}),m(ue)!=="svelte-1w73b42"&&(ue.innerHTML=It),I.forEach(a),tt=s(h),U=i(h,"DIV",{class:!0});var le=z(U);k(K.$$.fragment,le),nt=s(le),ge=i(le,"P",{"data-svelte-h":!0}),m(ge)!=="svelte-b3k2yi"&&(ge.textContent=jt),le.forEach(a),st=s(h),J=i(h,"DIV",{class:!0});var N=z(J);k(ee.$$.fragment,N),rt=s(N),he=i(N,"P",{"data-svelte-h":!0}),m(he)!=="svelte-17m549d"&&(he.textContent=Et),at=s(N),k(D.$$.fragment,N),ot=s(N),_e=i(N,"P",{"data-svelte-h":!0}),m(_e)!=="svelte-owoxgn"&&(_e.innerHTML=qt),N.forEach(a),it=s(h),V=i(h,"DIV",{class:!0});var Fe=z(V);k(te.$$.fragment,Fe),lt=s(Fe),ke=i(Fe,"P",{"data-svelte-h":!0}),m(ke)!=="svelte-1f4f5kp"&&(ke.innerHTML=Ut),Fe.forEach(a),h.forEach(a),Ze=s(e),k(ne.$$.fragment,e),Ne=s(e),g=i(e,"DIV",{class:!0});var x=z(g);k(se.$$.fragment,x),pt=s(x),be=i(x,"P",{"data-svelte-h":!0}),m(be)!=="svelte-1n4shqg"&&(be.innerHTML=Dt),ct=s(x),ve=i(x,"P",{"data-svelte-h":!0}),m(ve)!=="svelte-r7777v"&&(ve.textContent=Vt),mt=s(x),Te=i(x,"UL",{"data-svelte-h":!0}),m(Te)!=="svelte-lbio7x"&&(Te.innerHTML=Pt),dt=s(x),we=i(x,"P",{"data-svelte-h":!0}),m(we)!=="svelte-jf96o3"&&(we.innerHTML=Zt),ft=s(x),A=i(x,"DIV",{class:!0});var Je=z(A);k(re.$$.fragment,Je),ut=s(Je),ye=i(Je,"P",{"data-svelte-h":!0}),m(ye)!=="svelte-11s9gqx"&&(ye.textContent=Nt),gt=s(Je),Me=i(Je,"UL",{"data-svelte-h":!0}),m(Me)!=="svelte-1w73b42"&&(Me.innerHTML=Gt),Je.forEach(a),ht=s(x),H=i(x,"DIV",{class:!0});var Le=z(H);k(ae.$$.fragment,Le),_t=s(Le),xe=i(Le,"P",{"data-svelte-h":!0}),m(xe)!=="svelte-xgjhc7"&&(xe.textContent=Rt),kt=s(Le),k(P.$$.fragment,Le),Le.forEach(a),bt=s(x),Z=i(x,"DIV",{class:!0});var We=z(Z);k(oe.$$.fragment,We),vt=s(We),$e=i(We,"P",{"data-svelte-h":!0}),m($e)!=="svelte-1f4f5kp"&&($e.innerHTML=Xt),We.forEach(a),x.forEach(a),Ge=s(e),k(ie.$$.fragment,e),Re=s(e),ze=i(e,"P",{}),z(ze).forEach(a),this.h()},h(){L(p,"name","hf:doc:metadata"),L(p,"content",rn),L(M,"class","flex flex-wrap space-x-1"),L(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(J,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(d,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(H,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),L(g,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,r){t(document.head,p),c(e,$,r),c(e,u,r),c(e,f,r),b(y,e,r),c(e,l,r),c(e,M,r),c(e,Ae,r),b(G,e,r),c(e,He,r),c(e,R,r),c(e,Ie,r),c(e,X,r),c(e,je,r),c(e,F,r),c(e,Ee,r),c(e,W,r),c(e,qe,r),b(B,e,r),c(e,Ue,r),b(O,e,r),c(e,De,r),b(q,e,r),c(e,Ve,r),b(S,e,r),c(e,Pe,r),c(e,d,r),b(Q,d,null),t(d,Be),t(d,pe),t(d,Oe),t(d,ce),t(d,Se),t(d,me),t(d,Qe),t(d,de),t(d,Ye),t(d,C),b(Y,C,null),t(C,Ke),t(C,fe),t(C,et),t(C,ue),t(d,tt),t(d,U),b(K,U,null),t(U,nt),t(U,ge),t(d,st),t(d,J),b(ee,J,null),t(J,rt),t(J,he),t(J,at),b(D,J,null),t(J,ot),t(J,_e),t(d,it),t(d,V),b(te,V,null),t(V,lt),t(V,ke),c(e,Ze,r),b(ne,e,r),c(e,Ne,r),c(e,g,r),b(se,g,null),t(g,pt),t(g,be),t(g,ct),t(g,ve),t(g,mt),t(g,Te),t(g,dt),t(g,we),t(g,ft),t(g,A),b(re,A,null),t(A,ut),t(A,ye),t(A,gt),t(A,Me),t(g,ht),t(g,H),b(ae,H,null),t(H,_t),t(H,xe),t(H,kt),b(P,H,null),t(g,bt),t(g,Z),b(oe,Z,null),t(Z,vt),t(Z,$e),c(e,Ge,r),b(ie,e,r),c(e,Re,r),c(e,ze,r),Xe=!0},p(e,[r]){const h={};r&2&&(h.$$scope={dirty:r,ctx:e}),q.$set(h);const I={};r&2&&(I.$$scope={dirty:r,ctx:e}),D.$set(I);const le={};r&2&&(le.$$scope={dirty:r,ctx:e}),P.$set(le)},i(e){Xe||(v(y.$$.fragment,e),v(G.$$.fragment,e),v(B.$$.fragment,e),v(O.$$.fragment,e),v(q.$$.fragment,e),v(S.$$.fragment,e),v(Q.$$.fragment,e),v(Y.$$.fragment,e),v(K.$$.fragment,e),v(ee.$$.fragment,e),v(D.$$.fragment,e),v(te.$$.fragment,e),v(ne.$$.fragment,e),v(se.$$.fragment,e),v(re.$$.fragment,e),v(ae.$$.fragment,e),v(P.$$.fragment,e),v(oe.$$.fragment,e),v(ie.$$.fragment,e),Xe=!0)},o(e){T(y.$$.fragment,e),T(G.$$.fragment,e),T(B.$$.fragment,e),T(O.$$.fragment,e),T(q.$$.fragment,e),T(S.$$.fragment,e),T(Q.$$.fragment,e),T(Y.$$.fragment,e),T(K.$$.fragment,e),T(ee.$$.fragment,e),T(D.$$.fragment,e),T(te.$$.fragment,e),T(ne.$$.fragment,e),T(se.$$.fragment,e),T(re.$$.fragment,e),T(ae.$$.fragment,e),T(P.$$.fragment,e),T(oe.$$.fragment,e),T(ie.$$.fragment,e),Xe=!1},d(e){e&&(a($),a(u),a(f),a(l),a(M),a(Ae),a(He),a(R),a(Ie),a(X),a(je),a(F),a(Ee),a(W),a(qe),a(Ue),a(De),a(Ve),a(Pe),a(d),a(Ze),a(Ne),a(g),a(Ge),a(Re),a(ze)),a(p),w(y,e),w(G,e),w(B,e),w(O,e),w(q,e),w(S,e),w(Q),w(Y),w(K),w(ee),w(D),w(te),w(ne,e),w(se),w(re),w(ae),w(P),w(oe),w(ie,e)}}}const rn='{"title":"HerBERT","local":"herbert","sections":[{"title":"Overview","local":"overview","sections":[],"depth":2},{"title":"Usage example","local":"usage-example","sections":[],"depth":2},{"title":"HerbertTokenizer","local":"transformers.HerbertTokenizer","sections":[],"depth":2},{"title":"HerbertTokenizerFast","local":"transformers.HerbertTokenizerFast","sections":[],"depth":2}],"depth":1}';function an(E){return Bt(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class gn extends Ot{constructor(p){super(),St(this,p,an,sn,Wt,{})}}export{gn as component};
