import{s as Ra,o as Xa,n as Ka}from"../chunks/scheduler.9991993c.js";import{S as Ga,i as Ja,g as l,s as a,r as m,A as Qa,h as s,f as r,c as o,j as v,u as c,x as d,k as _,y as t,a as i,v as p,d as g,t as f,w as u}from"../chunks/index.7fc9a5e7.js";import{T as Ua}from"../chunks/Tip.9de92fc6.js";import{D as C}from"../chunks/Docstring.8180f571.js";import{H}from"../chunks/Heading.e3de321f.js";function Ya(ye){let h,L=`For best performance, this data collator should be used with a dataset having items that are dictionaries or
BatchEncoding, with the <code>&quot;special_tokens_mask&quot;</code> key, as returned by a <a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> or a
<a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a> with the argument <code>return_special_tokens_mask=True</code>.`;return{c(){h=l("p"),h.innerHTML=L},l($){h=s($,"P",{"data-svelte-h":!0}),d(h)!=="svelte-1gijru4"&&(h.innerHTML=L)},m($,V){i($,h,V)},p:Ka,d($){$&&r(h)}}}function Za(ye){let h,L=`This collator relies on details of the implementation of subword tokenization by <code>BertTokenizer</code>, specifically
that subword tokens are prefixed with <em>##</em>. For tokenizers that do not adhere to this scheme, this collator will
produce an output that is roughly equivalent to <code>.DataCollatorForLanguageModeling</code>.`;return{c(){h=l("p"),h.innerHTML=L},l($){h=s($,"P",{"data-svelte-h":!0}),d(h)!=="svelte-3v0y1u"&&(h.innerHTML=L)},m($,V){i($,h,V)},p:Ka,d($){$&&r(h)}}}function eo(ye){let h,L,$,V,X,tt,G,ua="Data collators是一个对象，通过使用数据集元素列表作为输入来形成一个批次。这些元素与 <code>train_dataset</code> 或 <code>eval_dataset</code> 的元素类型相同。",at,J,ha='为了能够构建批次，Data collators可能会应用一些预处理（比如填充）。其中一些（比如<a href="/docs/transformers/main/zh/main_classes/data_collator#transformers.DataCollatorForLanguageModeling">DataCollatorForLanguageModeling</a>）还会在形成的批次上应用一些随机数据增强（比如随机掩码）。',ot,Q,_a='在<a href="../examples">示例脚本</a>或<a href="../notebooks">示例notebooks</a>中可以找到使用的示例。',rt,Y,nt,y,Z,Lt,we,ba=`Very simple data collator that simply collates batches of dict-like objects and performs special handling for
potential keys named:`,qt,Pe,va="<li><code>label</code>: handles a single value (int or float) per object</li> <li><code>label_ids</code>: handles a list of values per object</li>",Mt,ze,$a=`Does not do any additional preprocessing: property names of the input object will be used as corresponding inputs
to the model. See glue and ner for example of how it’s useful.`,lt,ee,st,T,te,St,Fe,ka=`Very simple data collator that simply collates batches of dict-like objects and performs special handling for
potential keys named:`,It,Le,xa="<li><code>label</code>: handles a single value (int or float) per object</li> <li><code>label_ids</code>: handles a list of values per object</li>",Wt,qe,Ca=`Does not do any additional preprocessing: property names of the input object will be used as corresponding inputs
to the model. See glue and ner for example of how it’s useful.`,At,Me,Ta=`This is an object (like other data collators) rather than a pure function like default_data_collator. This can be
helpful if you need to set a return_tensors value at initialization.`,it,ae,dt,I,oe,Ht,Se,Da="Data collator that will dynamically pad the inputs received.",mt,re,ct,W,ne,Vt,Ie,ya="Data collator that will dynamically pad the inputs received, as well as the labels.",pt,le,gt,A,se,Et,We,wa="Data collator that will dynamically pad the inputs received, as well as the labels.",ft,ie,ut,k,de,jt,Ae,Pa=`Data collator used for language modeling. Inputs are dynamically padded to the maximum length of a batch if they
are not all of the same length.`,Nt,E,Ot,j,me,Bt,He,za="Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original.",Ut,N,ce,Kt,Ve,Fa="Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original.",Rt,O,pe,Xt,Ee,La="Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original.",ht,ge,_t,b,fe,Gt,je,qa="Data collator used for language modeling that masks entire words.",Jt,Ne,Ma="<li>collates batches of tensors, honoring their tokenizer’s pad_token</li> <li>preprocesses batches for masked language modeling</li>",Qt,B,Yt,U,ue,Zt,Oe,Sa=`Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original. Set
‘mask_labels’ means we use whole word mask (wwm), we directly mask idxs according to it’s ref.`,ea,K,he,ta,Be,Ia=`Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original. Set
‘mask_labels’ means we use whole word mask (wwm), we directly mask idxs according to it’s ref.`,aa,R,_e,oa,Ue,Wa=`Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original. Set
‘mask_labels’ means we use whole word mask (wwm), we directly mask idxs according to it’s ref.`,bt,be,vt,x,ve,ra,Ke,Aa="Data collator used for permutation language modeling.",na,Re,Ha="<li>collates batches of tensors, honoring their tokenizer’s pad_token</li> <li>preprocesses batches for permutation language modeling with procedures specific to XLNet</li>",la,q,$e,sa,Xe,Va="The masked tokens to be predicted for a particular sequence are determined by the following algorithm:",ia,ke,Ea=`<li>Start from the beginning of the sequence by setting <code>cur_len = 0</code> (number of tokens processed so far).</li> <li>Sample a <code>span_length</code> from the interval <code>[1, max_span_length]</code> (length of span of tokens to be masked)</li> <li>Reserve a context of length <code>context_length = span_length / plm_probability</code> to surround span to be
masked</li> <li>Sample a starting point <code>start_index</code> from the interval <code>[cur_len, cur_len + context_length - span_length]</code> and mask tokens <code>start_index:start_index + span_length</code></li> <li>Set <code>cur_len = cur_len + context_length</code>. If <code>cur_len &lt; max_len</code> (i.e. there are tokens remaining in the
sequence to be processed), repeat from Step 1.</li>`,da,M,xe,ma,Ge,ja="The masked tokens to be predicted for a particular sequence are determined by the following algorithm:",ca,Ce,Na=`<li>Start from the beginning of the sequence by setting <code>cur_len = 0</code> (number of tokens processed so far).</li> <li>Sample a <code>span_length</code> from the interval <code>[1, max_span_length]</code> (length of span of tokens to be masked)</li> <li>Reserve a context of length <code>context_length = span_length / plm_probability</code> to surround span to be
masked</li> <li>Sample a starting point <code>start_index</code> from the interval <code>[cur_len, cur_len + context_length - span_length]</code> and mask tokens <code>start_index:start_index + span_length</code></li> <li>Set <code>cur_len = cur_len + context_length</code>. If <code>cur_len &lt; max_len</code> (i.e. there are tokens remaining in the
sequence to be processed), repeat from Step 1.</li>`,pa,S,Te,ga,Je,Oa="The masked tokens to be predicted for a particular sequence are determined by the following algorithm:",fa,De,Ba=`<li>Start from the beginning of the sequence by setting <code>cur_len = 0</code> (number of tokens processed so far).</li> <li>Sample a <code>span_length</code> from the interval <code>[1, max_span_length]</code> (length of span of tokens to be masked)</li> <li>Reserve a context of length <code>context_length = span_length / plm_probability</code> to surround span to be
masked</li> <li>Sample a starting point <code>start_index</code> from the interval <code>[cur_len, cur_len + context_length - span_length]</code> and mask tokens <code>start_index:start_index + span_length</code></li> <li>Set <code>cur_len = cur_len + context_length</code>. If <code>cur_len &lt; max_len</code> (i.e. there are tokens remaining in the
sequence to be processed), repeat from Step 1.</li>`,$t,et,kt;return X=new H({props:{title:"Data Collator",local:"data-collator",headingTag:"h1"}}),Y=new H({props:{title:"Default data collator",local:"transformers.default_data_collator",headingTag:"h2"}}),Z=new C({props:{name:"transformers.default_data_collator",anchor:"transformers.default_data_collator",parameters:[{name:"features",val:": List"},{name:"return_tensors",val:" = 'pt'"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L74"}}),ee=new H({props:{title:"DefaultDataCollator",local:"transformers.DefaultDataCollator",headingTag:"h2"}}),te=new C({props:{name:"class transformers.DefaultDataCollator",anchor:"transformers.DefaultDataCollator",parameters:[{name:"return_tensors",val:": str = 'pt'"}],parametersDescription:[{anchor:"transformers.DefaultDataCollator.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
The type of Tensor to return. Allowable values are &#x201C;np&#x201D;, &#x201C;pt&#x201D; and &#x201C;tf&#x201D;.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L99"}}),ae=new H({props:{title:"DataCollatorWithPadding",local:"transformers.DataCollatorWithPadding",headingTag:"h2"}}),oe=new C({props:{name:"class transformers.DataCollatorWithPadding",anchor:"transformers.DataCollatorWithPadding",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"padding",val:": Union = True"},{name:"max_length",val:": Optional = None"},{name:"pad_to_multiple_of",val:": Optional = None"},{name:"return_tensors",val:": str = 'pt'"}],parametersDescription:[{anchor:"transformers.DataCollatorWithPadding.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> or <a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>) &#x2014;
The tokenizer used for encoding the data.`,name:"tokenizer"},{anchor:"transformers.DataCollatorWithPadding.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding index)
among:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code> (default): Pad to the longest sequence in the batch (or no padding if only a single
sequence is 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>: No padding (i.e., can output a batch with sequences of different lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.DataCollatorWithPadding.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.DataCollatorWithPadding.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.</p>
<p>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.DataCollatorWithPadding.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
The type of Tensor to return. Allowable values are &#x201C;np&#x201D;, &#x201C;pt&#x201D; and &#x201C;tf&#x201D;.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L236"}}),re=new H({props:{title:"DataCollatorForTokenClassification",local:"transformers.DataCollatorForTokenClassification",headingTag:"h2"}}),ne=new C({props:{name:"class transformers.DataCollatorForTokenClassification",anchor:"transformers.DataCollatorForTokenClassification",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"padding",val:": Union = True"},{name:"max_length",val:": Optional = None"},{name:"pad_to_multiple_of",val:": Optional = None"},{name:"label_pad_token_id",val:": int = -100"},{name:"return_tensors",val:": str = 'pt'"}],parametersDescription:[{anchor:"transformers.DataCollatorForTokenClassification.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> or <a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>) &#x2014;
The tokenizer used for encoding the data.`,name:"tokenizer"},{anchor:"transformers.DataCollatorForTokenClassification.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding index)
among:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code> (default): Pad to the longest sequence in the batch (or no padding if only a single
sequence is 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>: No padding (i.e., can output a batch with sequences of different lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.DataCollatorForTokenClassification.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.DataCollatorForTokenClassification.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.</p>
<p>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.DataCollatorForTokenClassification.label_pad_token_id",description:`<strong>label_pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
The id to use when padding the labels (-100 will be automatically ignore by PyTorch loss functions).`,name:"label_pad_token_id"},{anchor:"transformers.DataCollatorForTokenClassification.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
The type of Tensor to return. Allowable values are &#x201C;np&#x201D;, &#x201C;pt&#x201D; and &#x201C;tf&#x201D;.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L288"}}),le=new H({props:{title:"DataCollatorForSeq2Seq",local:"transformers.DataCollatorForSeq2Seq",headingTag:"h2"}}),se=new C({props:{name:"class transformers.DataCollatorForSeq2Seq",anchor:"transformers.DataCollatorForSeq2Seq",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"model",val:": Optional = None"},{name:"padding",val:": Union = True"},{name:"max_length",val:": Optional = None"},{name:"pad_to_multiple_of",val:": Optional = None"},{name:"label_pad_token_id",val:": int = -100"},{name:"return_tensors",val:": str = 'pt'"}],parametersDescription:[{anchor:"transformers.DataCollatorForSeq2Seq.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> or <a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>) &#x2014;
The tokenizer used for encoding the data.`,name:"tokenizer"},{anchor:"transformers.DataCollatorForSeq2Seq.model",description:`<strong>model</strong> (<a href="/docs/transformers/main/zh/main_classes/model#transformers.PreTrainedModel">PreTrainedModel</a>, <em>optional</em>) &#x2014;
The model that is being trained. If set and has the <em>prepare_decoder_input_ids_from_labels</em>, use it to
prepare the <em>decoder_input_ids</em></p>
<p>This is useful when using <em>label_smoothing</em> to avoid calculating loss twice.`,name:"model"},{anchor:"transformers.DataCollatorForSeq2Seq.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/main/zh/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Select a strategy to pad the returned sequences (according to the model&#x2019;s padding side and padding index)
among:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code> (default): Pad to the longest sequence in the batch (or no padding if only a single
sequence is 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>: No padding (i.e., can output a batch with sequences of different lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.DataCollatorForSeq2Seq.max_length",description:`<strong>max_length</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Maximum length of the returned list and optionally padding length (see above).`,name:"max_length"},{anchor:"transformers.DataCollatorForSeq2Seq.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.</p>
<p>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.DataCollatorForSeq2Seq.label_pad_token_id",description:`<strong>label_pad_token_id</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
The id to use when padding the labels (-100 will be automatically ignored by PyTorch loss functions).`,name:"label_pad_token_id"},{anchor:"transformers.DataCollatorForSeq2Seq.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;pt&quot;</code>) &#x2014;
The type of Tensor to return. Allowable values are &#x201C;np&#x201D;, &#x201C;pt&#x201D; and &#x201C;tf&#x201D;.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L542"}}),ie=new H({props:{title:"DataCollatorForLanguageModeling",local:"transformers.DataCollatorForLanguageModeling",headingTag:"h2"}}),de=new C({props:{name:"class transformers.DataCollatorForLanguageModeling",anchor:"transformers.DataCollatorForLanguageModeling",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"mlm",val:": bool = True"},{name:"mlm_probability",val:": float = 0.15"},{name:"pad_to_multiple_of",val:": Optional = None"},{name:"tf_experimental_compile",val:": bool = False"},{name:"return_tensors",val:": str = 'pt'"}],parametersDescription:[{anchor:"transformers.DataCollatorForLanguageModeling.tokenizer",description:`<strong>tokenizer</strong> (<a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizer">PreTrainedTokenizer</a> or <a href="/docs/transformers/main/zh/main_classes/tokenizer#transformers.PreTrainedTokenizerFast">PreTrainedTokenizerFast</a>) &#x2014;
The tokenizer used for encoding the data.`,name:"tokenizer"},{anchor:"transformers.DataCollatorForLanguageModeling.mlm",description:`<strong>mlm</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to use masked language modeling. If set to <code>False</code>, the labels are the same as the inputs
with the padding tokens ignored (by setting them to -100). Otherwise, the labels are -100 for non-masked
tokens and the value to predict for the masked token.`,name:"mlm"},{anchor:"transformers.DataCollatorForLanguageModeling.mlm_probability",description:`<strong>mlm_probability</strong> (<code>float</code>, <em>optional</em>, defaults to 0.15) &#x2014;
The probability with which to (randomly) mask tokens in the input, when <code>mlm</code> is set to <code>True</code>.`,name:"mlm_probability"},{anchor:"transformers.DataCollatorForLanguageModeling.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.`,name:"pad_to_multiple_of"},{anchor:"transformers.DataCollatorForLanguageModeling.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code>) &#x2014;
The type of Tensor to return. Allowable values are &#x201C;np&#x201D;, &#x201C;pt&#x201D; and &#x201C;tf&#x201D;.`,name:"return_tensors"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L633"}}),E=new Ua({props:{$$slots:{default:[Ya]},$$scope:{ctx:ye}}}),me=new C({props:{name:"numpy_mask_tokens",anchor:"transformers.DataCollatorForLanguageModeling.numpy_mask_tokens",parameters:[{name:"inputs",val:": Any"},{name:"special_tokens_mask",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L839"}}),ce=new C({props:{name:"tf_mask_tokens",anchor:"transformers.DataCollatorForLanguageModeling.tf_mask_tokens",parameters:[{name:"inputs",val:": Any"},{name:"vocab_size",val:""},{name:"mask_token_id",val:""},{name:"special_tokens_mask",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L686"}}),pe=new C({props:{name:"torch_mask_tokens",anchor:"transformers.DataCollatorForLanguageModeling.torch_mask_tokens",parameters:[{name:"inputs",val:": Any"},{name:"special_tokens_mask",val:": Optional = None"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L782"}}),ge=new H({props:{title:"DataCollatorForWholeWordMask",local:"transformers.DataCollatorForWholeWordMask",headingTag:"h2"}}),fe=new C({props:{name:"class transformers.DataCollatorForWholeWordMask",anchor:"transformers.DataCollatorForWholeWordMask",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"mlm",val:": bool = True"},{name:"mlm_probability",val:": float = 0.15"},{name:"pad_to_multiple_of",val:": Optional = None"},{name:"tf_experimental_compile",val:": bool = False"},{name:"return_tensors",val:": str = 'pt'"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L877"}}),B=new Ua({props:{$$slots:{default:[Za]},$$scope:{ctx:ye}}}),ue=new C({props:{name:"numpy_mask_tokens",anchor:"transformers.DataCollatorForWholeWordMask.numpy_mask_tokens",parameters:[{name:"inputs",val:": Any"},{name:"mask_labels",val:": Any"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L1108"}}),he=new C({props:{name:"tf_mask_tokens",anchor:"transformers.DataCollatorForWholeWordMask.tf_mask_tokens",parameters:[{name:"inputs",val:": Any"},{name:"mask_labels",val:": Any"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L1066"}}),_e=new C({props:{name:"torch_mask_tokens",anchor:"transformers.DataCollatorForWholeWordMask.torch_mask_tokens",parameters:[{name:"inputs",val:": Any"},{name:"mask_labels",val:": Any"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L1026"}}),be=new H({props:{title:"DataCollatorForPermutationLanguageModeling",local:"transformers.DataCollatorForPermutationLanguageModeling",headingTag:"h2"}}),ve=new C({props:{name:"class transformers.DataCollatorForPermutationLanguageModeling",anchor:"transformers.DataCollatorForPermutationLanguageModeling",parameters:[{name:"tokenizer",val:": PreTrainedTokenizerBase"},{name:"plm_probability",val:": float = 0.16666666666666666"},{name:"max_span_length",val:": int = 5"},{name:"return_tensors",val:": str = 'pt'"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L1232"}}),$e=new C({props:{name:"numpy_mask_tokens",anchor:"transformers.DataCollatorForPermutationLanguageModeling.numpy_mask_tokens",parameters:[{name:"inputs",val:": Any"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L1473"}}),xe=new C({props:{name:"tf_mask_tokens",anchor:"transformers.DataCollatorForPermutationLanguageModeling.tf_mask_tokens",parameters:[{name:"inputs",val:": Any"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L1366"}}),Te=new C({props:{name:"torch_mask_tokens",anchor:"transformers.DataCollatorForPermutationLanguageModeling.torch_mask_tokens",parameters:[{name:"inputs",val:": Any"}],source:"https://github.com/huggingface/transformers/blob/main/src/transformers/data/data_collator.py#L1267"}}),{c(){h=l("meta"),L=a(),$=l("p"),V=a(),m(X.$$.fragment),tt=a(),G=l("p"),G.innerHTML=ua,at=a(),J=l("p"),J.innerHTML=ha,ot=a(),Q=l("p"),Q.innerHTML=_a,rt=a(),m(Y.$$.fragment),nt=a(),y=l("div"),m(Z.$$.fragment),Lt=a(),we=l("p"),we.textContent=ba,qt=a(),Pe=l("ul"),Pe.innerHTML=va,Mt=a(),ze=l("p"),ze.textContent=$a,lt=a(),m(ee.$$.fragment),st=a(),T=l("div"),m(te.$$.fragment),St=a(),Fe=l("p"),Fe.textContent=ka,It=a(),Le=l("ul"),Le.innerHTML=xa,Wt=a(),qe=l("p"),qe.textContent=Ca,At=a(),Me=l("p"),Me.textContent=Ta,it=a(),m(ae.$$.fragment),dt=a(),I=l("div"),m(oe.$$.fragment),Ht=a(),Se=l("p"),Se.textContent=Da,mt=a(),m(re.$$.fragment),ct=a(),W=l("div"),m(ne.$$.fragment),Vt=a(),Ie=l("p"),Ie.textContent=ya,pt=a(),m(le.$$.fragment),gt=a(),A=l("div"),m(se.$$.fragment),Et=a(),We=l("p"),We.textContent=wa,ft=a(),m(ie.$$.fragment),ut=a(),k=l("div"),m(de.$$.fragment),jt=a(),Ae=l("p"),Ae.textContent=Pa,Nt=a(),m(E.$$.fragment),Ot=a(),j=l("div"),m(me.$$.fragment),Bt=a(),He=l("p"),He.textContent=za,Ut=a(),N=l("div"),m(ce.$$.fragment),Kt=a(),Ve=l("p"),Ve.textContent=Fa,Rt=a(),O=l("div"),m(pe.$$.fragment),Xt=a(),Ee=l("p"),Ee.textContent=La,ht=a(),m(ge.$$.fragment),_t=a(),b=l("div"),m(fe.$$.fragment),Gt=a(),je=l("p"),je.textContent=qa,Jt=a(),Ne=l("ul"),Ne.innerHTML=Ma,Qt=a(),m(B.$$.fragment),Yt=a(),U=l("div"),m(ue.$$.fragment),Zt=a(),Oe=l("p"),Oe.textContent=Sa,ea=a(),K=l("div"),m(he.$$.fragment),ta=a(),Be=l("p"),Be.textContent=Ia,aa=a(),R=l("div"),m(_e.$$.fragment),oa=a(),Ue=l("p"),Ue.textContent=Wa,bt=a(),m(be.$$.fragment),vt=a(),x=l("div"),m(ve.$$.fragment),ra=a(),Ke=l("p"),Ke.textContent=Aa,na=a(),Re=l("ul"),Re.innerHTML=Ha,la=a(),q=l("div"),m($e.$$.fragment),sa=a(),Xe=l("p"),Xe.textContent=Va,ia=a(),ke=l("ol"),ke.innerHTML=Ea,da=a(),M=l("div"),m(xe.$$.fragment),ma=a(),Ge=l("p"),Ge.textContent=ja,ca=a(),Ce=l("ol"),Ce.innerHTML=Na,pa=a(),S=l("div"),m(Te.$$.fragment),ga=a(),Je=l("p"),Je.textContent=Oa,fa=a(),De=l("ol"),De.innerHTML=Ba,$t=a(),et=l("p"),this.h()},l(e){const n=Qa("svelte-u9bgzb",document.head);h=s(n,"META",{name:!0,content:!0}),n.forEach(r),L=o(e),$=s(e,"P",{}),v($).forEach(r),V=o(e),c(X.$$.fragment,e),tt=o(e),G=s(e,"P",{"data-svelte-h":!0}),d(G)!=="svelte-1t1zoyx"&&(G.innerHTML=ua),at=o(e),J=s(e,"P",{"data-svelte-h":!0}),d(J)!=="svelte-aec1vj"&&(J.innerHTML=ha),ot=o(e),Q=s(e,"P",{"data-svelte-h":!0}),d(Q)!=="svelte-54nsx2"&&(Q.innerHTML=_a),rt=o(e),c(Y.$$.fragment,e),nt=o(e),y=s(e,"DIV",{class:!0});var F=v(y);c(Z.$$.fragment,F),Lt=o(F),we=s(F,"P",{"data-svelte-h":!0}),d(we)!=="svelte-1hmsgsg"&&(we.textContent=ba),qt=o(F),Pe=s(F,"UL",{"data-svelte-h":!0}),d(Pe)!=="svelte-1pq8qks"&&(Pe.innerHTML=va),Mt=o(F),ze=s(F,"P",{"data-svelte-h":!0}),d(ze)!=="svelte-1vi1gug"&&(ze.textContent=$a),F.forEach(r),lt=o(e),c(ee.$$.fragment,e),st=o(e),T=s(e,"DIV",{class:!0});var w=v(T);c(te.$$.fragment,w),St=o(w),Fe=s(w,"P",{"data-svelte-h":!0}),d(Fe)!=="svelte-1hmsgsg"&&(Fe.textContent=ka),It=o(w),Le=s(w,"UL",{"data-svelte-h":!0}),d(Le)!=="svelte-1pq8qks"&&(Le.innerHTML=xa),Wt=o(w),qe=s(w,"P",{"data-svelte-h":!0}),d(qe)!=="svelte-1vi1gug"&&(qe.textContent=Ca),At=o(w),Me=s(w,"P",{"data-svelte-h":!0}),d(Me)!=="svelte-vfvbwr"&&(Me.textContent=Ta),w.forEach(r),it=o(e),c(ae.$$.fragment,e),dt=o(e),I=s(e,"DIV",{class:!0});var xt=v(I);c(oe.$$.fragment,xt),Ht=o(xt),Se=s(xt,"P",{"data-svelte-h":!0}),d(Se)!=="svelte-1iebpai"&&(Se.textContent=Da),xt.forEach(r),mt=o(e),c(re.$$.fragment,e),ct=o(e),W=s(e,"DIV",{class:!0});var Ct=v(W);c(ne.$$.fragment,Ct),Vt=o(Ct),Ie=s(Ct,"P",{"data-svelte-h":!0}),d(Ie)!=="svelte-4uvw1w"&&(Ie.textContent=ya),Ct.forEach(r),pt=o(e),c(le.$$.fragment,e),gt=o(e),A=s(e,"DIV",{class:!0});var Tt=v(A);c(se.$$.fragment,Tt),Et=o(Tt),We=s(Tt,"P",{"data-svelte-h":!0}),d(We)!=="svelte-4uvw1w"&&(We.textContent=wa),Tt.forEach(r),ft=o(e),c(ie.$$.fragment,e),ut=o(e),k=s(e,"DIV",{class:!0});var P=v(k);c(de.$$.fragment,P),jt=o(P),Ae=s(P,"P",{"data-svelte-h":!0}),d(Ae)!=="svelte-10km8jk"&&(Ae.textContent=Pa),Nt=o(P),c(E.$$.fragment,P),Ot=o(P),j=s(P,"DIV",{class:!0});var Dt=v(j);c(me.$$.fragment,Dt),Bt=o(Dt),He=s(Dt,"P",{"data-svelte-h":!0}),d(He)!=="svelte-iv4xqf"&&(He.textContent=za),Dt.forEach(r),Ut=o(P),N=s(P,"DIV",{class:!0});var yt=v(N);c(ce.$$.fragment,yt),Kt=o(yt),Ve=s(yt,"P",{"data-svelte-h":!0}),d(Ve)!=="svelte-iv4xqf"&&(Ve.textContent=Fa),yt.forEach(r),Rt=o(P),O=s(P,"DIV",{class:!0});var wt=v(O);c(pe.$$.fragment,wt),Xt=o(wt),Ee=s(wt,"P",{"data-svelte-h":!0}),d(Ee)!=="svelte-iv4xqf"&&(Ee.textContent=La),wt.forEach(r),P.forEach(r),ht=o(e),c(ge.$$.fragment,e),_t=o(e),b=s(e,"DIV",{class:!0});var D=v(b);c(fe.$$.fragment,D),Gt=o(D),je=s(D,"P",{"data-svelte-h":!0}),d(je)!=="svelte-sjqk55"&&(je.textContent=qa),Jt=o(D),Ne=s(D,"UL",{"data-svelte-h":!0}),d(Ne)!=="svelte-d2ozxj"&&(Ne.innerHTML=Ma),Qt=o(D),c(B.$$.fragment,D),Yt=o(D),U=s(D,"DIV",{class:!0});var Pt=v(U);c(ue.$$.fragment,Pt),Zt=o(Pt),Oe=s(Pt,"P",{"data-svelte-h":!0}),d(Oe)!=="svelte-10msjh1"&&(Oe.textContent=Sa),Pt.forEach(r),ea=o(D),K=s(D,"DIV",{class:!0});var zt=v(K);c(he.$$.fragment,zt),ta=o(zt),Be=s(zt,"P",{"data-svelte-h":!0}),d(Be)!=="svelte-10msjh1"&&(Be.textContent=Ia),zt.forEach(r),aa=o(D),R=s(D,"DIV",{class:!0});var Ft=v(R);c(_e.$$.fragment,Ft),oa=o(Ft),Ue=s(Ft,"P",{"data-svelte-h":!0}),d(Ue)!=="svelte-10msjh1"&&(Ue.textContent=Wa),Ft.forEach(r),D.forEach(r),bt=o(e),c(be.$$.fragment,e),vt=o(e),x=s(e,"DIV",{class:!0});var z=v(x);c(ve.$$.fragment,z),ra=o(z),Ke=s(z,"P",{"data-svelte-h":!0}),d(Ke)!=="svelte-12inif1"&&(Ke.textContent=Aa),na=o(z),Re=s(z,"UL",{"data-svelte-h":!0}),d(Re)!=="svelte-1t4qh7k"&&(Re.innerHTML=Ha),la=o(z),q=s(z,"DIV",{class:!0});var Qe=v(q);c($e.$$.fragment,Qe),sa=o(Qe),Xe=s(Qe,"P",{"data-svelte-h":!0}),d(Xe)!=="svelte-1u70phx"&&(Xe.textContent=Va),ia=o(Qe),ke=s(Qe,"OL",{start:!0,"data-svelte-h":!0}),d(ke)!=="svelte-1r6jrbi"&&(ke.innerHTML=Ea),Qe.forEach(r),da=o(z),M=s(z,"DIV",{class:!0});var Ye=v(M);c(xe.$$.fragment,Ye),ma=o(Ye),Ge=s(Ye,"P",{"data-svelte-h":!0}),d(Ge)!=="svelte-1u70phx"&&(Ge.textContent=ja),ca=o(Ye),Ce=s(Ye,"OL",{start:!0,"data-svelte-h":!0}),d(Ce)!=="svelte-1r6jrbi"&&(Ce.innerHTML=Na),Ye.forEach(r),pa=o(z),S=s(z,"DIV",{class:!0});var Ze=v(S);c(Te.$$.fragment,Ze),ga=o(Ze),Je=s(Ze,"P",{"data-svelte-h":!0}),d(Je)!=="svelte-1u70phx"&&(Je.textContent=Oa),fa=o(Ze),De=s(Ze,"OL",{start:!0,"data-svelte-h":!0}),d(De)!=="svelte-1r6jrbi"&&(De.innerHTML=Ba),Ze.forEach(r),z.forEach(r),$t=o(e),et=s(e,"P",{}),v(et).forEach(r),this.h()},h(){_(h,"name","hf:doc:metadata"),_(h,"content",to),_(y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(I,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(k,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ke,"start","0"),_(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Ce,"start","0"),_(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(De,"start","0"),_(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(x,"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,n){t(document.head,h),i(e,L,n),i(e,$,n),i(e,V,n),p(X,e,n),i(e,tt,n),i(e,G,n),i(e,at,n),i(e,J,n),i(e,ot,n),i(e,Q,n),i(e,rt,n),p(Y,e,n),i(e,nt,n),i(e,y,n),p(Z,y,null),t(y,Lt),t(y,we),t(y,qt),t(y,Pe),t(y,Mt),t(y,ze),i(e,lt,n),p(ee,e,n),i(e,st,n),i(e,T,n),p(te,T,null),t(T,St),t(T,Fe),t(T,It),t(T,Le),t(T,Wt),t(T,qe),t(T,At),t(T,Me),i(e,it,n),p(ae,e,n),i(e,dt,n),i(e,I,n),p(oe,I,null),t(I,Ht),t(I,Se),i(e,mt,n),p(re,e,n),i(e,ct,n),i(e,W,n),p(ne,W,null),t(W,Vt),t(W,Ie),i(e,pt,n),p(le,e,n),i(e,gt,n),i(e,A,n),p(se,A,null),t(A,Et),t(A,We),i(e,ft,n),p(ie,e,n),i(e,ut,n),i(e,k,n),p(de,k,null),t(k,jt),t(k,Ae),t(k,Nt),p(E,k,null),t(k,Ot),t(k,j),p(me,j,null),t(j,Bt),t(j,He),t(k,Ut),t(k,N),p(ce,N,null),t(N,Kt),t(N,Ve),t(k,Rt),t(k,O),p(pe,O,null),t(O,Xt),t(O,Ee),i(e,ht,n),p(ge,e,n),i(e,_t,n),i(e,b,n),p(fe,b,null),t(b,Gt),t(b,je),t(b,Jt),t(b,Ne),t(b,Qt),p(B,b,null),t(b,Yt),t(b,U),p(ue,U,null),t(U,Zt),t(U,Oe),t(b,ea),t(b,K),p(he,K,null),t(K,ta),t(K,Be),t(b,aa),t(b,R),p(_e,R,null),t(R,oa),t(R,Ue),i(e,bt,n),p(be,e,n),i(e,vt,n),i(e,x,n),p(ve,x,null),t(x,ra),t(x,Ke),t(x,na),t(x,Re),t(x,la),t(x,q),p($e,q,null),t(q,sa),t(q,Xe),t(q,ia),t(q,ke),t(x,da),t(x,M),p(xe,M,null),t(M,ma),t(M,Ge),t(M,ca),t(M,Ce),t(x,pa),t(x,S),p(Te,S,null),t(S,ga),t(S,Je),t(S,fa),t(S,De),i(e,$t,n),i(e,et,n),kt=!0},p(e,[n]){const F={};n&2&&(F.$$scope={dirty:n,ctx:e}),E.$set(F);const w={};n&2&&(w.$$scope={dirty:n,ctx:e}),B.$set(w)},i(e){kt||(g(X.$$.fragment,e),g(Y.$$.fragment,e),g(Z.$$.fragment,e),g(ee.$$.fragment,e),g(te.$$.fragment,e),g(ae.$$.fragment,e),g(oe.$$.fragment,e),g(re.$$.fragment,e),g(ne.$$.fragment,e),g(le.$$.fragment,e),g(se.$$.fragment,e),g(ie.$$.fragment,e),g(de.$$.fragment,e),g(E.$$.fragment,e),g(me.$$.fragment,e),g(ce.$$.fragment,e),g(pe.$$.fragment,e),g(ge.$$.fragment,e),g(fe.$$.fragment,e),g(B.$$.fragment,e),g(ue.$$.fragment,e),g(he.$$.fragment,e),g(_e.$$.fragment,e),g(be.$$.fragment,e),g(ve.$$.fragment,e),g($e.$$.fragment,e),g(xe.$$.fragment,e),g(Te.$$.fragment,e),kt=!0)},o(e){f(X.$$.fragment,e),f(Y.$$.fragment,e),f(Z.$$.fragment,e),f(ee.$$.fragment,e),f(te.$$.fragment,e),f(ae.$$.fragment,e),f(oe.$$.fragment,e),f(re.$$.fragment,e),f(ne.$$.fragment,e),f(le.$$.fragment,e),f(se.$$.fragment,e),f(ie.$$.fragment,e),f(de.$$.fragment,e),f(E.$$.fragment,e),f(me.$$.fragment,e),f(ce.$$.fragment,e),f(pe.$$.fragment,e),f(ge.$$.fragment,e),f(fe.$$.fragment,e),f(B.$$.fragment,e),f(ue.$$.fragment,e),f(he.$$.fragment,e),f(_e.$$.fragment,e),f(be.$$.fragment,e),f(ve.$$.fragment,e),f($e.$$.fragment,e),f(xe.$$.fragment,e),f(Te.$$.fragment,e),kt=!1},d(e){e&&(r(L),r($),r(V),r(tt),r(G),r(at),r(J),r(ot),r(Q),r(rt),r(nt),r(y),r(lt),r(st),r(T),r(it),r(dt),r(I),r(mt),r(ct),r(W),r(pt),r(gt),r(A),r(ft),r(ut),r(k),r(ht),r(_t),r(b),r(bt),r(vt),r(x),r($t),r(et)),r(h),u(X,e),u(Y,e),u(Z),u(ee,e),u(te),u(ae,e),u(oe),u(re,e),u(ne),u(le,e),u(se),u(ie,e),u(de),u(E),u(me),u(ce),u(pe),u(ge,e),u(fe),u(B),u(ue),u(he),u(_e),u(be,e),u(ve),u($e),u(xe),u(Te)}}}const to='{"title":"Data Collator","local":"data-collator","sections":[{"title":"Default data collator","local":"transformers.default_data_collator","sections":[],"depth":2},{"title":"DefaultDataCollator","local":"transformers.DefaultDataCollator","sections":[],"depth":2},{"title":"DataCollatorWithPadding","local":"transformers.DataCollatorWithPadding","sections":[],"depth":2},{"title":"DataCollatorForTokenClassification","local":"transformers.DataCollatorForTokenClassification","sections":[],"depth":2},{"title":"DataCollatorForSeq2Seq","local":"transformers.DataCollatorForSeq2Seq","sections":[],"depth":2},{"title":"DataCollatorForLanguageModeling","local":"transformers.DataCollatorForLanguageModeling","sections":[],"depth":2},{"title":"DataCollatorForWholeWordMask","local":"transformers.DataCollatorForWholeWordMask","sections":[],"depth":2},{"title":"DataCollatorForPermutationLanguageModeling","local":"transformers.DataCollatorForPermutationLanguageModeling","sections":[],"depth":2}],"depth":1}';function ao(ye){return Xa(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class io extends Ga{constructor(h){super(),Ja(this,h,ao,eo,Ra,{})}}export{io as component};
