import{S as Ds,i as Is,s as Ss,e as a,k as d,w as k,t as n,M as Os,c as s,d as o,m as c,a as i,x as y,h as r,b as l,G as e,g as m,y as b,L as Cs,q as L,o as v,B as x,v as Us}from"../../chunks/vendor-hf-doc-builder.js";import{D as S}from"../../chunks/Docstring-hf-doc-builder.js";import{C as As}from"../../chunks/CodeBlock-hf-doc-builder.js";import{I as Bt}from"../../chunks/IconCopyLink-hf-doc-builder.js";function Rs(ga){let O,Gt,C,V,dt,ne,Mo,ct,Xo,Ht,U,B,ut,re,qo,mt,Eo,Yt,E,$o,ae,Fo,Po,se,No,Ao,Jt,Fe,Do,Zt,Pe,pt,Io,Kt,Ne,So,Qt,ie,eo,$,Oo,Ae,Co,Uo,De,Ro,jo,to,le,oo,z,Wo,Ie,Vo,Bo,Se,Go,Ho,Oe,Yo,Jo,Ce,Zo,Ko,no,G,Qo,Ue,en,tn,ro,F,on,de,nn,rn,ce,an,sn,ao,R,H,ht,ue,ln,ft,dn,so,_,me,cn,q,un,Re,mn,pn,je,hn,fn,pe,_n,gn,kn,he,yn,We,bn,Ln,vn,Y,fe,xn,_t,wn,Tn,P,_e,zn,gt,Mn,Xn,ge,Ve,qn,kt,En,$n,Be,Fn,yt,Pn,Nn,J,ke,An,ye,Dn,bt,In,Sn,On,Z,be,Cn,Lt,Un,Rn,Ge,Le,io,j,K,vt,ve,jn,xt,Wn,lo,M,xe,Vn,X,Bn,wt,Gn,Hn,He,Yn,Jn,Ye,Zn,Kn,we,Qn,er,tr,Te,or,Je,nr,rr,ar,Q,ze,sr,Tt,ir,co,W,ee,zt,Me,lr,Mt,dr,uo,T,Xe,cr,Xt,ur,mr,Ze,Ke,pr,hr,fr,f,_r,Qe,gr,kr,et,yr,br,tt,Lr,vr,qt,xr,wr,Et,Tr,zr,$t,Mr,Xr,Ft,qr,Er,Pt,$r,Fr,Nt,Pr,Nr,Ar,N,qe,Dr,p,Ir,At,Sr,Or,Ee,Dt,Cr,Ur,Rr,ot,jr,Wr,It,Vr,Br,St,Gr,Hr,$e,Ot,Yr,Jr,Zr,Ct,Kr,Qr,nt,ea,ta,Ut,oa,na,Rt,ra,aa,jt,sa,ia,Wt,la,da,ca,Vt,ua,mo;return ne=new Bt({}),re=new Bt({}),ie=new As({props:{code:`from transformers import LayoutLMv2Model

model = LayoutLMv2Model.from_pretrained("microsoft/layoutxlm-base")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LayoutLMv2Model

model = LayoutLMv2Model.from_pretrained(<span class="hljs-string">&quot;microsoft/layoutxlm-base&quot;</span>)`}}),le=new As({props:{code:`from transformers import LayoutXLMTokenizer

tokenizer = LayoutXLMTokenizer.from_pretrained("microsoft/layoutxlm-base")`,highlighted:`<span class="hljs-keyword">from</span> transformers <span class="hljs-keyword">import</span> LayoutXLMTokenizer

tokenizer = LayoutXLMTokenizer.from_pretrained(<span class="hljs-string">&quot;microsoft/layoutxlm-base&quot;</span>)`}}),ue=new Bt({}),me=new S({props:{name:"class transformers.LayoutXLMTokenizer",anchor:"transformers.LayoutXLMTokenizer",parameters:[{name:"vocab_file",val:""},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"cls_token_box",val:" = [0, 0, 0, 0]"},{name:"sep_token_box",val:" = [1000, 1000, 1000, 1000]"},{name:"pad_token_box",val:" = [0, 0, 0, 0]"},{name:"pad_token_label",val:" = -100"},{name:"only_label_first_subword",val:" = True"},{name:"sp_model_kwargs",val:": typing.Union[typing.Dict[str, typing.Any], NoneType] = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LayoutXLMTokenizer.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LayoutXLMTokenizer.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.LayoutXLMTokenizer.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.LayoutXLMTokenizer.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LayoutXLMTokenizer.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LayoutXLMTokenizer.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LayoutXLMTokenizer.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LayoutXLMTokenizer.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LayoutXLMTokenizer.cls_token_box",description:`<strong>cls_token_box</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0, 0, 0, 0]</code>) &#x2014;
The bounding box to use for the special [CLS] token.`,name:"cls_token_box"},{anchor:"transformers.LayoutXLMTokenizer.sep_token_box",description:`<strong>sep_token_box</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1000, 1000, 1000, 1000]</code>) &#x2014;
The bounding box to use for the special [SEP] token.`,name:"sep_token_box"},{anchor:"transformers.LayoutXLMTokenizer.pad_token_box",description:`<strong>pad_token_box</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0, 0, 0, 0]</code>) &#x2014;
The bounding box to use for the special [PAD] token.`,name:"pad_token_box"},{anchor:"transformers.LayoutXLMTokenizer.pad_token_label",description:`<strong>pad_token_label</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
The label to use for padding tokens. Defaults to -100, which is the <code>ignore_index</code> of PyTorch&#x2019;s
CrossEntropyLoss.`,name:"pad_token_label"},{anchor:"transformers.LayoutXLMTokenizer.only_label_first_subword",description:`<strong>only_label_first_subword</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to only label the first subword, in case word labels are provided.`,name:"only_label_first_subword"},{anchor:"transformers.LayoutXLMTokenizer.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;s&gt;NOTUSED&quot;, &quot;&lt;/s&gt;NOTUSED&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"},{anchor:"transformers.LayoutXLMTokenizer.sp_model_kwargs",description:`<strong>sp_model_kwargs</strong> (<code>dict</code>, <em>optional</em>) &#x2014;
Will be passed to the <code>SentencePieceProcessor.__init__()</code> method. The <a href="https://github.com/google/sentencepiece/tree/master/python" rel="nofollow">Python wrapper for
SentencePiece</a> can be used, among other things,
to set:</p>
<ul>
<li>
<p><code>enable_sampling</code>: Enable subword regularization.</p>
</li>
<li>
<p><code>nbest_size</code>: Sampling parameters for unigram. Invalid for BPE-Dropout.</p>
<ul>
<li><code>nbest_size = {0,1}</code>: No sampling is performed.</li>
<li><code>nbest_size &gt; 1</code>: samples from the nbest_size results.</li>
<li><code>nbest_size &lt; 0</code>: assuming that nbest_size is infinite and samples from the all hypothesis (lattice)
using forward-filtering-and-backward-sampling algorithm.</li>
</ul>
</li>
<li>
<p><code>alpha</code>: Smoothing parameter for unigram sampling, and dropout probability of merge operations for
BPE-dropout.</p>
</li>
</ul>`,name:"sp_model_kwargs"},{anchor:"transformers.LayoutXLMTokenizer.sp_model",description:`<strong>sp_model</strong> (<code>SentencePieceProcessor</code>) &#x2014;
The <em>SentencePiece</em> processor that is used for every conversion (string, tokens and IDs).`,name:"sp_model"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm.py#L47"}}),fe=new S({props:{name:"__call__",anchor:"transformers.LayoutXLMTokenizer.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]]"},{name:"text_pair",val:": typing.Union[typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"boxes",val:": typing.Union[typing.List[typing.List[int]], typing.List[typing.List[typing.List[int]]]] = None"},{name:"word_labels",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LayoutXLMTokenizer.__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, a list of strings
(words of a single example or questions of a batch of examples) or a list of list of strings (batch of
words).`,name:"text"},{anchor:"transformers.LayoutXLMTokenizer.__call__.text_pair",description:`<strong>text_pair</strong> (<code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence should be a list of strings
(pretokenized string).`,name:"text_pair"},{anchor:"transformers.LayoutXLMTokenizer.__call__.boxes",description:`<strong>boxes</strong> (<code>List[List[int]]</code>, <code>List[List[List[int]]]</code>) &#x2014;
Word-level bounding boxes. Each bounding box should be normalized to be on a 0-1000 scale.`,name:"boxes"},{anchor:"transformers.LayoutXLMTokenizer.__call__.word_labels",description:`<strong>word_labels</strong> (<code>List[int]</code>, <code>List[List[int]]</code>, <em>optional</em>) &#x2014;
Word-level integer labels (for token classification tasks such as FUNSD, CORD).`,name:"word_labels"},{anchor:"transformers.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.LayoutXLMTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/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.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_17548/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.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.LayoutXLMTokenizer.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/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.LayoutXLMTokenizer.__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. 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.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__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.LayoutXLMTokenizer.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_17548/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"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm.py#L342"}}),_e=new S({props:{name:"build_inputs_with_special_tokens",anchor:"transformers.LayoutXLMTokenizer.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.LayoutXLMTokenizer.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.LayoutXLMTokenizer.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/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm.py#L214",returnDescription:`
<p>List of <a href="../glossary#input-ids">input IDs</a> with the appropriate special tokens.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),ke=new S({props:{name:"get_special_tokens_mask",anchor:"transformers.LayoutXLMTokenizer.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.LayoutXLMTokenizer.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.LayoutXLMTokenizer.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.LayoutXLMTokenizer.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/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm.py#L240",returnDescription:`
<p>A list of integers in the range [0, 1]: 1 for a special token, 0 for a sequence token.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),be=new S({props:{name:"create_token_type_ids_from_sequences",anchor:"transformers.LayoutXLMTokenizer.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.LayoutXLMTokenizer.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.LayoutXLMTokenizer.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/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm.py#L268",returnDescription:`
<p>List of zeros.</p>
`,returnType:`
<p><code>List[int]</code></p>
`}}),Le=new S({props:{name:"save_vocabulary",anchor:"transformers.LayoutXLMTokenizer.save_vocabulary",parameters:[{name:"save_directory",val:": str"},{name:"filename_prefix",val:": typing.Optional[str] = None"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm.py#L325"}}),ve=new Bt({}),xe=new S({props:{name:"class transformers.LayoutXLMTokenizerFast",anchor:"transformers.LayoutXLMTokenizerFast",parameters:[{name:"vocab_file",val:" = None"},{name:"tokenizer_file",val:" = None"},{name:"bos_token",val:" = '<s>'"},{name:"eos_token",val:" = '</s>'"},{name:"sep_token",val:" = '</s>'"},{name:"cls_token",val:" = '<s>'"},{name:"unk_token",val:" = '<unk>'"},{name:"pad_token",val:" = '<pad>'"},{name:"mask_token",val:" = '<mask>'"},{name:"cls_token_box",val:" = [0, 0, 0, 0]"},{name:"sep_token_box",val:" = [1000, 1000, 1000, 1000]"},{name:"pad_token_box",val:" = [0, 0, 0, 0]"},{name:"pad_token_label",val:" = -100"},{name:"only_label_first_subword",val:" = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LayoutXLMTokenizerFast.vocab_file",description:`<strong>vocab_file</strong> (<code>str</code>) &#x2014;
Path to the vocabulary file.`,name:"vocab_file"},{anchor:"transformers.LayoutXLMTokenizerFast.bos_token",description:`<strong>bos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the beginning of
sequence. The token used is the <code>cls_token</code>.</p>

					</div>`,name:"bos_token"},{anchor:"transformers.LayoutXLMTokenizerFast.eos_token",description:`<strong>eos_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The end of sequence token.</p>
<div class="course-tip  bg-gradient-to-br dark:bg-gradient-to-r before:border-green-500 dark:before:border-green-800 from-green-50 dark:from-gray-900 to-white dark:to-gray-950 border border-green-50 text-green-700 dark:text-gray-400">
						
<p>When building a sequence using special tokens, this is not the token that is used for the end of sequence.
The token used is the <code>sep_token</code>.</p>

					</div>`,name:"eos_token"},{anchor:"transformers.LayoutXLMTokenizerFast.sep_token",description:`<strong>sep_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;/s&gt;&quot;</code>) &#x2014;
The separator token, which is used when building a sequence from multiple sequences, e.g. two sequences for
sequence classification or for a text and a question for question answering. It is also used as the last
token of a sequence built with special tokens.`,name:"sep_token"},{anchor:"transformers.LayoutXLMTokenizerFast.cls_token",description:`<strong>cls_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;s&gt;&quot;</code>) &#x2014;
The classifier token which is used when doing sequence classification (classification of the whole sequence
instead of per-token classification). It is the first token of the sequence when built with special tokens.`,name:"cls_token"},{anchor:"transformers.LayoutXLMTokenizerFast.unk_token",description:`<strong>unk_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;unk&gt;&quot;</code>) &#x2014;
The unknown token. A token that is not in the vocabulary cannot be converted to an ID and is set to be this
token instead.`,name:"unk_token"},{anchor:"transformers.LayoutXLMTokenizerFast.pad_token",description:`<strong>pad_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;pad&gt;&quot;</code>) &#x2014;
The token used for padding, for example when batching sequences of different lengths.`,name:"pad_token"},{anchor:"transformers.LayoutXLMTokenizerFast.mask_token",description:`<strong>mask_token</strong> (<code>str</code>, <em>optional</em>, defaults to <code>&quot;&lt;mask&gt;&quot;</code>) &#x2014;
The token used for masking values. This is the token used when training this model with masked language
modeling. This is the token which the model will try to predict.`,name:"mask_token"},{anchor:"transformers.LayoutXLMTokenizerFast.cls_token_box",description:`<strong>cls_token_box</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0, 0, 0, 0]</code>) &#x2014;
The bounding box to use for the special [CLS] token.`,name:"cls_token_box"},{anchor:"transformers.LayoutXLMTokenizerFast.sep_token_box",description:`<strong>sep_token_box</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[1000, 1000, 1000, 1000]</code>) &#x2014;
The bounding box to use for the special [SEP] token.`,name:"sep_token_box"},{anchor:"transformers.LayoutXLMTokenizerFast.pad_token_box",description:`<strong>pad_token_box</strong> (<code>List[int]</code>, <em>optional</em>, defaults to <code>[0, 0, 0, 0]</code>) &#x2014;
The bounding box to use for the special [PAD] token.`,name:"pad_token_box"},{anchor:"transformers.LayoutXLMTokenizerFast.pad_token_label",description:`<strong>pad_token_label</strong> (<code>int</code>, <em>optional</em>, defaults to -100) &#x2014;
The label to use for padding tokens. Defaults to -100, which is the <code>ignore_index</code> of PyTorch&#x2019;s
CrossEntropyLoss.`,name:"pad_token_label"},{anchor:"transformers.LayoutXLMTokenizerFast.only_label_first_subword",description:`<strong>only_label_first_subword</strong> (<code>bool</code>, <em>optional</em>, defaults to <code>True</code>) &#x2014;
Whether or not to only label the first subword, in case word labels are provided.`,name:"only_label_first_subword"},{anchor:"transformers.LayoutXLMTokenizerFast.additional_special_tokens",description:`<strong>additional_special_tokens</strong> (<code>List[str]</code>, <em>optional</em>, defaults to <code>[&quot;&lt;s&gt;NOTUSED&quot;, &quot;&lt;/s&gt;NOTUSED&quot;]</code>) &#x2014;
Additional special tokens used by the tokenizer.`,name:"additional_special_tokens"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm_fast.py#L52"}}),ze=new S({props:{name:"__call__",anchor:"transformers.LayoutXLMTokenizerFast.__call__",parameters:[{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]]"},{name:"text_pair",val:": typing.Union[typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"boxes",val:": typing.Union[typing.List[typing.List[int]], typing.List[typing.List[typing.List[int]]]] = None"},{name:"word_labels",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = None"},{name:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"return_token_type_ids",val:": typing.Optional[bool] = None"},{name:"return_attention_mask",val:": typing.Optional[bool] = None"},{name:"return_overflowing_tokens",val:": bool = False"},{name:"return_special_tokens_mask",val:": bool = False"},{name:"return_offsets_mapping",val:": bool = False"},{name:"return_length",val:": bool = False"},{name:"verbose",val:": bool = True"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LayoutXLMTokenizerFast.__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, a list of strings
(words of a single example or questions of a batch of examples) or a list of list of strings (batch of
words).`,name:"text"},{anchor:"transformers.LayoutXLMTokenizerFast.__call__.text_pair",description:`<strong>text_pair</strong> (<code>List[str]</code>, <code>List[List[str]]</code>) &#x2014;
The sequence or batch of sequences to be encoded. Each sequence should be a list of strings
(pretokenized string).`,name:"text_pair"},{anchor:"transformers.LayoutXLMTokenizerFast.__call__.boxes",description:`<strong>boxes</strong> (<code>List[List[int]]</code>, <code>List[List[List[int]]]</code>) &#x2014;
Word-level bounding boxes. Each bounding box should be normalized to be on a 0-1000 scale.`,name:"boxes"},{anchor:"transformers.LayoutXLMTokenizerFast.__call__.word_labels",description:`<strong>word_labels</strong> (<code>List[int]</code>, <code>List[List[int]]</code>, <em>optional</em>) &#x2014;
Word-level integer labels (for token classification tasks such as FUNSD, CORD).`,name:"word_labels"},{anchor:"transformers.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.LayoutXLMTokenizerFast.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/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.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_17548/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.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__call__.padding",description:`<strong>padding</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/en/internal/file_utils#transformers.utils.PaddingStrategy">PaddingStrategy</a>, <em>optional</em>, defaults to <code>False</code>) &#x2014;
Activates and controls padding. Accepts the following values:</p>
<ul>
<li><code>True</code> or <code>&apos;longest&apos;</code>: Pad to the longest sequence in the batch (or no padding if only a single
sequence if provided).</li>
<li><code>&apos;max_length&apos;</code>: Pad to a maximum length specified with the argument <code>max_length</code> or to the maximum
acceptable input length for the model if that argument is not provided.</li>
<li><code>False</code> or <code>&apos;do_not_pad&apos;</code> (default): No padding (i.e., can output a batch with sequences of different
lengths).</li>
</ul>`,name:"padding"},{anchor:"transformers.LayoutXLMTokenizerFast.__call__.truncation",description:`<strong>truncation</strong> (<code>bool</code>, <code>str</code> or <a href="/docs/transformers/pr_17548/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.LayoutXLMTokenizerFast.__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. 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.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__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.LayoutXLMTokenizerFast.__call__.return_tensors",description:`<strong>return_tensors</strong> (<code>str</code> or <a href="/docs/transformers/pr_17548/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"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/layoutxlm/tokenization_layoutxlm_fast.py#L169"}}),Me=new Bt({}),Xe=new S({props:{name:"class transformers.LayoutXLMProcessor",anchor:"transformers.LayoutXLMProcessor",parameters:[{name:"*args",val:""},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"transformers.LayoutXLMProcessor.feature_extractor",description:`<strong>feature_extractor</strong> (<code>LayoutLMv2FeatureExtractor</code>) &#x2014;
An instance of <a href="/docs/transformers/pr_17548/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor">LayoutLMv2FeatureExtractor</a>. The feature extractor is a required input.`,name:"feature_extractor"},{anchor:"transformers.LayoutXLMProcessor.tokenizer",description:`<strong>tokenizer</strong> (<code>LayoutXLMTokenizer</code> or <code>LayoutXLMTokenizerFast</code>) &#x2014;
An instance of <a href="/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizer">LayoutXLMTokenizer</a> or <a href="/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizerFast">LayoutXLMTokenizerFast</a>. The tokenizer is a required input.`,name:"tokenizer"}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/layoutxlm/processing_layoutxlm.py#L25"}}),qe=new S({props:{name:"__call__",anchor:"transformers.LayoutXLMProcessor.__call__",parameters:[{name:"images",val:""},{name:"text",val:": typing.Union[str, typing.List[str], typing.List[typing.List[str]]] = None"},{name:"text_pair",val:": typing.Union[typing.List[str], typing.List[typing.List[str]], NoneType] = None"},{name:"boxes",val:": typing.Union[typing.List[typing.List[int]], typing.List[typing.List[typing.List[int]]]] = None"},{name:"word_labels",val:": typing.Union[typing.List[int], typing.List[typing.List[int]], NoneType] = None"},{name:"add_special_tokens",val:": bool = True"},{name:"padding",val:": typing.Union[bool, str, transformers.utils.generic.PaddingStrategy] = False"},{name:"truncation",val:": typing.Union[bool, str, transformers.tokenization_utils_base.TruncationStrategy] = False"},{name:"max_length",val:": typing.Optional[int] = None"},{name:"stride",val:": int = 0"},{name:"pad_to_multiple_of",val:": typing.Optional[int] = 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:"return_tensors",val:": typing.Union[str, transformers.utils.generic.TensorType, NoneType] = None"},{name:"**kwargs",val:""}],source:"https://github.com/huggingface/transformers/blob/vr_17548/src/transformers/models/layoutxlm/processing_layoutxlm.py#L47"}}),{c(){O=a("meta"),Gt=d(),C=a("h1"),V=a("a"),dt=a("span"),k(ne.$$.fragment),Mo=d(),ct=a("span"),Xo=n("LayoutXLM"),Ht=d(),U=a("h2"),B=a("a"),ut=a("span"),k(re.$$.fragment),qo=d(),mt=a("span"),Eo=n("Overview"),Yt=d(),E=a("p"),$o=n("LayoutXLM was proposed in "),ae=a("a"),Fo=n("LayoutXLM: Multimodal Pre-training for Multilingual Visually-rich Document Understanding"),Po=n(` by Yiheng Xu, Tengchao Lv, Lei Cui, Guoxin Wang, Yijuan Lu, Dinei Florencio, Cha
Zhang, Furu Wei. It\u2019s a multilingual extension of the `),se=a("a"),No=n("LayoutLMv2 model"),Ao=n(` trained
on 53 languages.`),Jt=d(),Fe=a("p"),Do=n("The abstract from the paper is the following:"),Zt=d(),Pe=a("p"),pt=a("em"),Io=n(`Multimodal pre-training with text, layout, and image has achieved SOTA performance for visually-rich document
understanding tasks recently, which demonstrates the great potential for joint learning across different modalities. In
this paper, we present LayoutXLM, a multimodal pre-trained model for multilingual document understanding, which aims to
bridge the language barriers for visually-rich document understanding. To accurately evaluate LayoutXLM, we also
introduce a multilingual form understanding benchmark dataset named XFUN, which includes form understanding samples in
7 languages (Chinese, Japanese, Spanish, French, Italian, German, Portuguese), and key-value pairs are manually labeled
for each language. Experiment results show that the LayoutXLM model has significantly outperformed the existing SOTA
cross-lingual pre-trained models on the XFUN dataset.`),Kt=d(),Ne=a("p"),So=n("One can directly plug in the weights of LayoutXLM into a LayoutLMv2 model, like so:"),Qt=d(),k(ie.$$.fragment),eo=d(),$=a("p"),Oo=n(`Note that LayoutXLM has its own tokenizer, based on
`),Ae=a("a"),Co=n("LayoutXLMTokenizer"),Uo=n("/"),De=a("a"),Ro=n("LayoutXLMTokenizerFast"),jo=n(`. You can initialize it as
follows:`),to=d(),k(le.$$.fragment),oo=d(),z=a("p"),Wo=n("Similar to LayoutLMv2, you can use "),Ie=a("a"),Vo=n("LayoutXLMProcessor"),Bo=n(` (which internally applies
`),Se=a("a"),Go=n("LayoutLMv2FeatureExtractor"),Ho=n(` and
`),Oe=a("a"),Yo=n("LayoutXLMTokenizer"),Jo=n("/"),Ce=a("a"),Zo=n("LayoutXLMTokenizerFast"),Ko=n(` in sequence) to prepare all
data for the model.`),no=d(),G=a("p"),Qo=n("As LayoutXLM\u2019s architecture is equivalent to that of LayoutLMv2, one can refer to "),Ue=a("a"),en=n("LayoutLMv2\u2019s documentation page"),tn=n(" for all tips, code examples and notebooks."),ro=d(),F=a("p"),on=n("This model was contributed by "),de=a("a"),nn=n("nielsr"),rn=n(". The original code can be found "),ce=a("a"),an=n("here"),sn=n("."),ao=d(),R=a("h2"),H=a("a"),ht=a("span"),k(ue.$$.fragment),ln=d(),ft=a("span"),dn=n("LayoutXLMTokenizer"),so=d(),_=a("div"),k(me.$$.fragment),cn=d(),q=a("p"),un=n("Adapted from "),Re=a("a"),mn=n("RobertaTokenizer"),pn=n(" and "),je=a("a"),hn=n("XLNetTokenizer"),fn=n(`. Based on
`),pe=a("a"),_n=n("SentencePiece"),gn=n("."),kn=d(),he=a("p"),yn=n("This tokenizer inherits from "),We=a("a"),bn=n("PreTrainedTokenizer"),Ln=n(` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),vn=d(),Y=a("div"),k(fe.$$.fragment),xn=d(),_t=a("p"),wn=n(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences with word-level normalized bounding boxes and optional labels.`),Tn=d(),P=a("div"),k(_e.$$.fragment),zn=d(),gt=a("p"),Mn=n(`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM-RoBERTa sequence has the following format:`),Xn=d(),ge=a("ul"),Ve=a("li"),qn=n("single sequence: "),kt=a("code"),En=n("<s> X </s>"),$n=d(),Be=a("li"),Fn=n("pair of sequences: "),yt=a("code"),Pn=n("<s> A </s></s> B </s>"),Nn=d(),J=a("div"),k(ke.$$.fragment),An=d(),ye=a("p"),Dn=n(`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),bt=a("code"),In=n("prepare_for_model"),Sn=n(" method."),On=d(),Z=a("div"),k(be.$$.fragment),Cn=d(),Lt=a("p"),Un=n(`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLM-RoBERTa does
not make use of token type ids, therefore a list of zeros is returned.`),Rn=d(),Ge=a("div"),k(Le.$$.fragment),io=d(),j=a("h2"),K=a("a"),vt=a("span"),k(ve.$$.fragment),jn=d(),xt=a("span"),Wn=n("LayoutXLMTokenizerFast"),lo=d(),M=a("div"),k(xe.$$.fragment),Vn=d(),X=a("p"),Bn=n("Construct a \u201Cfast\u201D LayoutXLM tokenizer (backed by HuggingFace\u2019s "),wt=a("em"),Gn=n("tokenizers"),Hn=n(` library). Adapted from
`),He=a("a"),Yn=n("RobertaTokenizer"),Jn=n(" and "),Ye=a("a"),Zn=n("XLNetTokenizer"),Kn=n(`. Based on
`),we=a("a"),Qn=n("BPE"),er=n("."),tr=d(),Te=a("p"),or=n("This tokenizer inherits from "),Je=a("a"),nr=n("PreTrainedTokenizerFast"),rr=n(` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),ar=d(),Q=a("div"),k(ze.$$.fragment),sr=d(),Tt=a("p"),ir=n(`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences with word-level normalized bounding boxes and optional labels.`),co=d(),W=a("h2"),ee=a("a"),zt=a("span"),k(Me.$$.fragment),lr=d(),Mt=a("span"),dr=n("LayoutXLMProcessor"),uo=d(),T=a("div"),k(Xe.$$.fragment),cr=d(),Xt=a("p"),ur=n(`Constructs a LayoutXLM processor which combines a LayoutXLM feature extractor and a LayoutXLM tokenizer into a
single processor.`),mr=d(),Ze=a("p"),Ke=a("a"),pr=n("LayoutXLMProcessor"),hr=n(" offers all the functionalities you need to prepare data for the model."),fr=d(),f=a("p"),_r=n("It first uses "),Qe=a("a"),gr=n("LayoutLMv2FeatureExtractor"),kr=n(` to resize document images to a fixed size, and optionally applies OCR
to get words and normalized bounding boxes. These are then provided to `),et=a("a"),yr=n("LayoutXLMTokenizer"),br=n(` or
`),tt=a("a"),Lr=n("LayoutXLMTokenizerFast"),vr=n(", which turns the words and bounding boxes into token-level "),qt=a("code"),xr=n("input_ids"),wr=n(`,
`),Et=a("code"),Tr=n("attention_mask"),zr=n(", "),$t=a("code"),Mr=n("token_type_ids"),Xr=n(", "),Ft=a("code"),qr=n("bbox"),Er=n(". Optionally, one can provide integer "),Pt=a("code"),$r=n("word_labels"),Fr=n(`, which are turned
into token-level `),Nt=a("code"),Pr=n("labels"),Nr=n(" for token classification tasks (such as FUNSD, CORD)."),Ar=d(),N=a("div"),k(qe.$$.fragment),Dr=d(),p=a("p"),Ir=n("This method first forwards the "),At=a("code"),Sr=n("images"),Or=n(" argument to "),Ee=a("a"),Dt=a("strong"),Cr=n("call"),Ur=n("()"),Rr=n(`. In case
`),ot=a("a"),jr=n("LayoutLMv2FeatureExtractor"),Wr=n(" was initialized with "),It=a("code"),Vr=n("apply_ocr"),Br=n(" set to "),St=a("code"),Gr=n("True"),Hr=n(`, it passes the obtained words and
bounding boxes along with the additional arguments to `),$e=a("a"),Ot=a("strong"),Yr=n("call"),Jr=n("()"),Zr=n(` and returns the output,
together with resized `),Ct=a("code"),Kr=n("images"),Qr=n(". In case "),nt=a("a"),ea=n("LayoutLMv2FeatureExtractor"),ta=n(" was initialized with "),Ut=a("code"),oa=n("apply_ocr"),na=n(` set to
`),Rt=a("code"),ra=n("False"),aa=n(", it passes the words ("),jt=a("code"),sa=n("text"),ia=n("/"),Wt=a("code"),la=n("text_pair`) and `boxes` specified by the user along with the additional arguments to [__call__()](/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizer.__call__) and returns the output, together with resized `images"),da=n("."),ca=d(),Vt=a("p"),ua=n("Please refer to the docstring of the above two methods for more information."),this.h()},l(t){const u=Os('[data-svelte="svelte-1phssyn"]',document.head);O=s(u,"META",{name:!0,content:!0}),u.forEach(o),Gt=c(t),C=s(t,"H1",{class:!0});var po=i(C);V=s(po,"A",{id:!0,class:!0,href:!0});var ka=i(V);dt=s(ka,"SPAN",{});var ya=i(dt);y(ne.$$.fragment,ya),ya.forEach(o),ka.forEach(o),Mo=c(po),ct=s(po,"SPAN",{});var ba=i(ct);Xo=r(ba,"LayoutXLM"),ba.forEach(o),po.forEach(o),Ht=c(t),U=s(t,"H2",{class:!0});var ho=i(U);B=s(ho,"A",{id:!0,class:!0,href:!0});var La=i(B);ut=s(La,"SPAN",{});var va=i(ut);y(re.$$.fragment,va),va.forEach(o),La.forEach(o),qo=c(ho),mt=s(ho,"SPAN",{});var xa=i(mt);Eo=r(xa,"Overview"),xa.forEach(o),ho.forEach(o),Yt=c(t),E=s(t,"P",{});var rt=i(E);$o=r(rt,"LayoutXLM was proposed in "),ae=s(rt,"A",{href:!0,rel:!0});var wa=i(ae);Fo=r(wa,"LayoutXLM: Multimodal Pre-training for Multilingual Visually-rich Document Understanding"),wa.forEach(o),Po=r(rt,` by Yiheng Xu, Tengchao Lv, Lei Cui, Guoxin Wang, Yijuan Lu, Dinei Florencio, Cha
Zhang, Furu Wei. It\u2019s a multilingual extension of the `),se=s(rt,"A",{href:!0,rel:!0});var Ta=i(se);No=r(Ta,"LayoutLMv2 model"),Ta.forEach(o),Ao=r(rt,` trained
on 53 languages.`),rt.forEach(o),Jt=c(t),Fe=s(t,"P",{});var za=i(Fe);Do=r(za,"The abstract from the paper is the following:"),za.forEach(o),Zt=c(t),Pe=s(t,"P",{});var Ma=i(Pe);pt=s(Ma,"EM",{});var Xa=i(pt);Io=r(Xa,`Multimodal pre-training with text, layout, and image has achieved SOTA performance for visually-rich document
understanding tasks recently, which demonstrates the great potential for joint learning across different modalities. In
this paper, we present LayoutXLM, a multimodal pre-trained model for multilingual document understanding, which aims to
bridge the language barriers for visually-rich document understanding. To accurately evaluate LayoutXLM, we also
introduce a multilingual form understanding benchmark dataset named XFUN, which includes form understanding samples in
7 languages (Chinese, Japanese, Spanish, French, Italian, German, Portuguese), and key-value pairs are manually labeled
for each language. Experiment results show that the LayoutXLM model has significantly outperformed the existing SOTA
cross-lingual pre-trained models on the XFUN dataset.`),Xa.forEach(o),Ma.forEach(o),Kt=c(t),Ne=s(t,"P",{});var qa=i(Ne);So=r(qa,"One can directly plug in the weights of LayoutXLM into a LayoutLMv2 model, like so:"),qa.forEach(o),Qt=c(t),y(ie.$$.fragment,t),eo=c(t),$=s(t,"P",{});var at=i($);Oo=r(at,`Note that LayoutXLM has its own tokenizer, based on
`),Ae=s(at,"A",{href:!0});var Ea=i(Ae);Co=r(Ea,"LayoutXLMTokenizer"),Ea.forEach(o),Uo=r(at,"/"),De=s(at,"A",{href:!0});var $a=i(De);Ro=r($a,"LayoutXLMTokenizerFast"),$a.forEach(o),jo=r(at,`. You can initialize it as
follows:`),at.forEach(o),to=c(t),y(le.$$.fragment,t),oo=c(t),z=s(t,"P",{});var A=i(z);Wo=r(A,"Similar to LayoutLMv2, you can use "),Ie=s(A,"A",{href:!0});var Fa=i(Ie);Vo=r(Fa,"LayoutXLMProcessor"),Fa.forEach(o),Bo=r(A,` (which internally applies
`),Se=s(A,"A",{href:!0});var Pa=i(Se);Go=r(Pa,"LayoutLMv2FeatureExtractor"),Pa.forEach(o),Ho=r(A,` and
`),Oe=s(A,"A",{href:!0});var Na=i(Oe);Yo=r(Na,"LayoutXLMTokenizer"),Na.forEach(o),Jo=r(A,"/"),Ce=s(A,"A",{href:!0});var Aa=i(Ce);Zo=r(Aa,"LayoutXLMTokenizerFast"),Aa.forEach(o),Ko=r(A,` in sequence) to prepare all
data for the model.`),A.forEach(o),no=c(t),G=s(t,"P",{});var fo=i(G);Qo=r(fo,"As LayoutXLM\u2019s architecture is equivalent to that of LayoutLMv2, one can refer to "),Ue=s(fo,"A",{href:!0});var Da=i(Ue);en=r(Da,"LayoutLMv2\u2019s documentation page"),Da.forEach(o),tn=r(fo," for all tips, code examples and notebooks."),fo.forEach(o),ro=c(t),F=s(t,"P",{});var st=i(F);on=r(st,"This model was contributed by "),de=s(st,"A",{href:!0,rel:!0});var Ia=i(de);nn=r(Ia,"nielsr"),Ia.forEach(o),rn=r(st,". The original code can be found "),ce=s(st,"A",{href:!0,rel:!0});var Sa=i(ce);an=r(Sa,"here"),Sa.forEach(o),sn=r(st,"."),st.forEach(o),ao=c(t),R=s(t,"H2",{class:!0});var _o=i(R);H=s(_o,"A",{id:!0,class:!0,href:!0});var Oa=i(H);ht=s(Oa,"SPAN",{});var Ca=i(ht);y(ue.$$.fragment,Ca),Ca.forEach(o),Oa.forEach(o),ln=c(_o),ft=s(_o,"SPAN",{});var Ua=i(ft);dn=r(Ua,"LayoutXLMTokenizer"),Ua.forEach(o),_o.forEach(o),so=c(t),_=s(t,"DIV",{class:!0});var w=i(_);y(me.$$.fragment,w),cn=c(w),q=s(w,"P",{});var te=i(q);un=r(te,"Adapted from "),Re=s(te,"A",{href:!0});var Ra=i(Re);mn=r(Ra,"RobertaTokenizer"),Ra.forEach(o),pn=r(te," and "),je=s(te,"A",{href:!0});var ja=i(je);hn=r(ja,"XLNetTokenizer"),ja.forEach(o),fn=r(te,`. Based on
`),pe=s(te,"A",{href:!0,rel:!0});var Wa=i(pe);_n=r(Wa,"SentencePiece"),Wa.forEach(o),gn=r(te,"."),te.forEach(o),kn=c(w),he=s(w,"P",{});var go=i(he);yn=r(go,"This tokenizer inherits from "),We=s(go,"A",{href:!0});var Va=i(We);bn=r(Va,"PreTrainedTokenizer"),Va.forEach(o),Ln=r(go,` which contains most of the main methods. Users should refer to
this superclass for more information regarding those methods.`),go.forEach(o),vn=c(w),Y=s(w,"DIV",{class:!0});var ko=i(Y);y(fe.$$.fragment,ko),xn=c(ko),_t=s(ko,"P",{});var Ba=i(_t);wn=r(Ba,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences with word-level normalized bounding boxes and optional labels.`),Ba.forEach(o),ko.forEach(o),Tn=c(w),P=s(w,"DIV",{class:!0});var it=i(P);y(_e.$$.fragment,it),zn=c(it),gt=s(it,"P",{});var Ga=i(gt);Mn=r(Ga,`Build model inputs from a sequence or a pair of sequence for sequence classification tasks by concatenating and
adding special tokens. An XLM-RoBERTa sequence has the following format:`),Ga.forEach(o),Xn=c(it),ge=s(it,"UL",{});var yo=i(ge);Ve=s(yo,"LI",{});var ma=i(Ve);qn=r(ma,"single sequence: "),kt=s(ma,"CODE",{});var Ha=i(kt);En=r(Ha,"<s> X </s>"),Ha.forEach(o),ma.forEach(o),$n=c(yo),Be=s(yo,"LI",{});var pa=i(Be);Fn=r(pa,"pair of sequences: "),yt=s(pa,"CODE",{});var Ya=i(yt);Pn=r(Ya,"<s> A </s></s> B </s>"),Ya.forEach(o),pa.forEach(o),yo.forEach(o),it.forEach(o),Nn=c(w),J=s(w,"DIV",{class:!0});var bo=i(J);y(ke.$$.fragment,bo),An=c(bo),ye=s(bo,"P",{});var Lo=i(ye);Dn=r(Lo,`Retrieve sequence ids from a token list that has no special tokens added. This method is called when adding
special tokens using the tokenizer `),bt=s(Lo,"CODE",{});var Ja=i(bt);In=r(Ja,"prepare_for_model"),Ja.forEach(o),Sn=r(Lo," method."),Lo.forEach(o),bo.forEach(o),On=c(w),Z=s(w,"DIV",{class:!0});var vo=i(Z);y(be.$$.fragment,vo),Cn=c(vo),Lt=s(vo,"P",{});var Za=i(Lt);Un=r(Za,`Create a mask from the two sequences passed to be used in a sequence-pair classification task. XLM-RoBERTa does
not make use of token type ids, therefore a list of zeros is returned.`),Za.forEach(o),vo.forEach(o),Rn=c(w),Ge=s(w,"DIV",{class:!0});var Ka=i(Ge);y(Le.$$.fragment,Ka),Ka.forEach(o),w.forEach(o),io=c(t),j=s(t,"H2",{class:!0});var xo=i(j);K=s(xo,"A",{id:!0,class:!0,href:!0});var Qa=i(K);vt=s(Qa,"SPAN",{});var es=i(vt);y(ve.$$.fragment,es),es.forEach(o),Qa.forEach(o),jn=c(xo),xt=s(xo,"SPAN",{});var ts=i(xt);Wn=r(ts,"LayoutXLMTokenizerFast"),ts.forEach(o),xo.forEach(o),lo=c(t),M=s(t,"DIV",{class:!0});var oe=i(M);y(xe.$$.fragment,oe),Vn=c(oe),X=s(oe,"P",{});var D=i(X);Bn=r(D,"Construct a \u201Cfast\u201D LayoutXLM tokenizer (backed by HuggingFace\u2019s "),wt=s(D,"EM",{});var os=i(wt);Gn=r(os,"tokenizers"),os.forEach(o),Hn=r(D,` library). Adapted from
`),He=s(D,"A",{href:!0});var ns=i(He);Yn=r(ns,"RobertaTokenizer"),ns.forEach(o),Jn=r(D," and "),Ye=s(D,"A",{href:!0});var rs=i(Ye);Zn=r(rs,"XLNetTokenizer"),rs.forEach(o),Kn=r(D,`. Based on
`),we=s(D,"A",{href:!0,rel:!0});var as=i(we);Qn=r(as,"BPE"),as.forEach(o),er=r(D,"."),D.forEach(o),tr=c(oe),Te=s(oe,"P",{});var wo=i(Te);or=r(wo,"This tokenizer inherits from "),Je=s(wo,"A",{href:!0});var ss=i(Je);nr=r(ss,"PreTrainedTokenizerFast"),ss.forEach(o),rr=r(wo,` which contains most of the main methods. Users should
refer to this superclass for more information regarding those methods.`),wo.forEach(o),ar=c(oe),Q=s(oe,"DIV",{class:!0});var To=i(Q);y(ze.$$.fragment,To),sr=c(To),Tt=s(To,"P",{});var is=i(Tt);ir=r(is,`Main method to tokenize and prepare for the model one or several sequence(s) or one or several pair(s) of
sequences with word-level normalized bounding boxes and optional labels.`),is.forEach(o),To.forEach(o),oe.forEach(o),co=c(t),W=s(t,"H2",{class:!0});var zo=i(W);ee=s(zo,"A",{id:!0,class:!0,href:!0});var ls=i(ee);zt=s(ls,"SPAN",{});var ds=i(zt);y(Me.$$.fragment,ds),ds.forEach(o),ls.forEach(o),lr=c(zo),Mt=s(zo,"SPAN",{});var cs=i(Mt);dr=r(cs,"LayoutXLMProcessor"),cs.forEach(o),zo.forEach(o),uo=c(t),T=s(t,"DIV",{class:!0});var I=i(T);y(Xe.$$.fragment,I),cr=c(I),Xt=s(I,"P",{});var us=i(Xt);ur=r(us,`Constructs a LayoutXLM processor which combines a LayoutXLM feature extractor and a LayoutXLM tokenizer into a
single processor.`),us.forEach(o),mr=c(I),Ze=s(I,"P",{});var ha=i(Ze);Ke=s(ha,"A",{href:!0});var ms=i(Ke);pr=r(ms,"LayoutXLMProcessor"),ms.forEach(o),hr=r(ha," offers all the functionalities you need to prepare data for the model."),ha.forEach(o),fr=c(I),f=s(I,"P",{});var g=i(f);_r=r(g,"It first uses "),Qe=s(g,"A",{href:!0});var ps=i(Qe);gr=r(ps,"LayoutLMv2FeatureExtractor"),ps.forEach(o),kr=r(g,` to resize document images to a fixed size, and optionally applies OCR
to get words and normalized bounding boxes. These are then provided to `),et=s(g,"A",{href:!0});var hs=i(et);yr=r(hs,"LayoutXLMTokenizer"),hs.forEach(o),br=r(g,` or
`),tt=s(g,"A",{href:!0});var fs=i(tt);Lr=r(fs,"LayoutXLMTokenizerFast"),fs.forEach(o),vr=r(g,", which turns the words and bounding boxes into token-level "),qt=s(g,"CODE",{});var _s=i(qt);xr=r(_s,"input_ids"),_s.forEach(o),wr=r(g,`,
`),Et=s(g,"CODE",{});var gs=i(Et);Tr=r(gs,"attention_mask"),gs.forEach(o),zr=r(g,", "),$t=s(g,"CODE",{});var ks=i($t);Mr=r(ks,"token_type_ids"),ks.forEach(o),Xr=r(g,", "),Ft=s(g,"CODE",{});var ys=i(Ft);qr=r(ys,"bbox"),ys.forEach(o),Er=r(g,". Optionally, one can provide integer "),Pt=s(g,"CODE",{});var bs=i(Pt);$r=r(bs,"word_labels"),bs.forEach(o),Fr=r(g,`, which are turned
into token-level `),Nt=s(g,"CODE",{});var Ls=i(Nt);Pr=r(Ls,"labels"),Ls.forEach(o),Nr=r(g," for token classification tasks (such as FUNSD, CORD)."),g.forEach(o),Ar=c(I),N=s(I,"DIV",{class:!0});var lt=i(N);y(qe.$$.fragment,lt),Dr=c(lt),p=s(lt,"P",{});var h=i(p);Ir=r(h,"This method first forwards the "),At=s(h,"CODE",{});var vs=i(At);Sr=r(vs,"images"),vs.forEach(o),Or=r(h," argument to "),Ee=s(h,"A",{href:!0});var fa=i(Ee);Dt=s(fa,"STRONG",{});var xs=i(Dt);Cr=r(xs,"call"),xs.forEach(o),Ur=r(fa,"()"),fa.forEach(o),Rr=r(h,`. In case
`),ot=s(h,"A",{href:!0});var ws=i(ot);jr=r(ws,"LayoutLMv2FeatureExtractor"),ws.forEach(o),Wr=r(h," was initialized with "),It=s(h,"CODE",{});var Ts=i(It);Vr=r(Ts,"apply_ocr"),Ts.forEach(o),Br=r(h," set to "),St=s(h,"CODE",{});var zs=i(St);Gr=r(zs,"True"),zs.forEach(o),Hr=r(h,`, it passes the obtained words and
bounding boxes along with the additional arguments to `),$e=s(h,"A",{href:!0});var _a=i($e);Ot=s(_a,"STRONG",{});var Ms=i(Ot);Yr=r(Ms,"call"),Ms.forEach(o),Jr=r(_a,"()"),_a.forEach(o),Zr=r(h,` and returns the output,
together with resized `),Ct=s(h,"CODE",{});var Xs=i(Ct);Kr=r(Xs,"images"),Xs.forEach(o),Qr=r(h,". In case "),nt=s(h,"A",{href:!0});var qs=i(nt);ea=r(qs,"LayoutLMv2FeatureExtractor"),qs.forEach(o),ta=r(h," was initialized with "),Ut=s(h,"CODE",{});var Es=i(Ut);oa=r(Es,"apply_ocr"),Es.forEach(o),na=r(h,` set to
`),Rt=s(h,"CODE",{});var $s=i(Rt);ra=r($s,"False"),$s.forEach(o),aa=r(h,", it passes the words ("),jt=s(h,"CODE",{});var Fs=i(jt);sa=r(Fs,"text"),Fs.forEach(o),ia=r(h,"/"),Wt=s(h,"CODE",{});var Ps=i(Wt);la=r(Ps,"text_pair`) and `boxes` specified by the user along with the additional arguments to [__call__()](/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizer.__call__) and returns the output, together with resized `images"),Ps.forEach(o),da=r(h,"."),h.forEach(o),ca=c(lt),Vt=s(lt,"P",{});var Ns=i(Vt);ua=r(Ns,"Please refer to the docstring of the above two methods for more information."),Ns.forEach(o),lt.forEach(o),I.forEach(o),this.h()},h(){l(O,"name","hf:doc:metadata"),l(O,"content",JSON.stringify(js)),l(V,"id","layoutxlm"),l(V,"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(V,"href","#layoutxlm"),l(C,"class","relative group"),l(B,"id","overview"),l(B,"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(B,"href","#overview"),l(U,"class","relative group"),l(ae,"href","https://arxiv.org/abs/2104.08836"),l(ae,"rel","nofollow"),l(se,"href","https://arxiv.org/abs/2012.14740"),l(se,"rel","nofollow"),l(Ae,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizer"),l(De,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizerFast"),l(Ie,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMProcessor"),l(Se,"href","/docs/transformers/pr_17548/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor"),l(Oe,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizer"),l(Ce,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizerFast"),l(Ue,"href","layoutlmv2"),l(de,"href","https://huggingface.co/nielsr"),l(de,"rel","nofollow"),l(ce,"href","https://github.com/microsoft/unilm"),l(ce,"rel","nofollow"),l(H,"id","transformers.LayoutXLMTokenizer"),l(H,"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(H,"href","#transformers.LayoutXLMTokenizer"),l(R,"class","relative group"),l(Re,"href","/docs/transformers/pr_17548/en/model_doc/roberta#transformers.RobertaTokenizer"),l(je,"href","/docs/transformers/pr_17548/en/model_doc/xlnet#transformers.XLNetTokenizer"),l(pe,"href","https://github.com/google/sentencepiece"),l(pe,"rel","nofollow"),l(We,"href","/docs/transformers/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizer"),l(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(P,"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(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(Ge,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(K,"id","transformers.LayoutXLMTokenizerFast"),l(K,"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(K,"href","#transformers.LayoutXLMTokenizerFast"),l(j,"class","relative group"),l(He,"href","/docs/transformers/pr_17548/en/model_doc/roberta#transformers.RobertaTokenizer"),l(Ye,"href","/docs/transformers/pr_17548/en/model_doc/xlnet#transformers.XLNetTokenizer"),l(we,"href","https://huggingface.co/docs/tokenizers/python/latest/components.html?highlight=BPE#models"),l(we,"rel","nofollow"),l(Je,"href","/docs/transformers/pr_17548/en/main_classes/tokenizer#transformers.PreTrainedTokenizerFast"),l(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(M,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(ee,"id","transformers.LayoutXLMProcessor"),l(ee,"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(ee,"href","#transformers.LayoutXLMProcessor"),l(W,"class","relative group"),l(Ke,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMProcessor"),l(Qe,"href","/docs/transformers/pr_17548/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor"),l(et,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizer"),l(tt,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizerFast"),l(Ee,"href","/docs/transformers/pr_17548/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor.__call__"),l(ot,"href","/docs/transformers/pr_17548/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor"),l($e,"href","/docs/transformers/pr_17548/en/model_doc/layoutxlm#transformers.LayoutXLMTokenizer.__call__"),l(nt,"href","/docs/transformers/pr_17548/en/model_doc/layoutlmv2#transformers.LayoutLMv2FeatureExtractor"),l(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),l(T,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(t,u){e(document.head,O),m(t,Gt,u),m(t,C,u),e(C,V),e(V,dt),b(ne,dt,null),e(C,Mo),e(C,ct),e(ct,Xo),m(t,Ht,u),m(t,U,u),e(U,B),e(B,ut),b(re,ut,null),e(U,qo),e(U,mt),e(mt,Eo),m(t,Yt,u),m(t,E,u),e(E,$o),e(E,ae),e(ae,Fo),e(E,Po),e(E,se),e(se,No),e(E,Ao),m(t,Jt,u),m(t,Fe,u),e(Fe,Do),m(t,Zt,u),m(t,Pe,u),e(Pe,pt),e(pt,Io),m(t,Kt,u),m(t,Ne,u),e(Ne,So),m(t,Qt,u),b(ie,t,u),m(t,eo,u),m(t,$,u),e($,Oo),e($,Ae),e(Ae,Co),e($,Uo),e($,De),e(De,Ro),e($,jo),m(t,to,u),b(le,t,u),m(t,oo,u),m(t,z,u),e(z,Wo),e(z,Ie),e(Ie,Vo),e(z,Bo),e(z,Se),e(Se,Go),e(z,Ho),e(z,Oe),e(Oe,Yo),e(z,Jo),e(z,Ce),e(Ce,Zo),e(z,Ko),m(t,no,u),m(t,G,u),e(G,Qo),e(G,Ue),e(Ue,en),e(G,tn),m(t,ro,u),m(t,F,u),e(F,on),e(F,de),e(de,nn),e(F,rn),e(F,ce),e(ce,an),e(F,sn),m(t,ao,u),m(t,R,u),e(R,H),e(H,ht),b(ue,ht,null),e(R,ln),e(R,ft),e(ft,dn),m(t,so,u),m(t,_,u),b(me,_,null),e(_,cn),e(_,q),e(q,un),e(q,Re),e(Re,mn),e(q,pn),e(q,je),e(je,hn),e(q,fn),e(q,pe),e(pe,_n),e(q,gn),e(_,kn),e(_,he),e(he,yn),e(he,We),e(We,bn),e(he,Ln),e(_,vn),e(_,Y),b(fe,Y,null),e(Y,xn),e(Y,_t),e(_t,wn),e(_,Tn),e(_,P),b(_e,P,null),e(P,zn),e(P,gt),e(gt,Mn),e(P,Xn),e(P,ge),e(ge,Ve),e(Ve,qn),e(Ve,kt),e(kt,En),e(ge,$n),e(ge,Be),e(Be,Fn),e(Be,yt),e(yt,Pn),e(_,Nn),e(_,J),b(ke,J,null),e(J,An),e(J,ye),e(ye,Dn),e(ye,bt),e(bt,In),e(ye,Sn),e(_,On),e(_,Z),b(be,Z,null),e(Z,Cn),e(Z,Lt),e(Lt,Un),e(_,Rn),e(_,Ge),b(Le,Ge,null),m(t,io,u),m(t,j,u),e(j,K),e(K,vt),b(ve,vt,null),e(j,jn),e(j,xt),e(xt,Wn),m(t,lo,u),m(t,M,u),b(xe,M,null),e(M,Vn),e(M,X),e(X,Bn),e(X,wt),e(wt,Gn),e(X,Hn),e(X,He),e(He,Yn),e(X,Jn),e(X,Ye),e(Ye,Zn),e(X,Kn),e(X,we),e(we,Qn),e(X,er),e(M,tr),e(M,Te),e(Te,or),e(Te,Je),e(Je,nr),e(Te,rr),e(M,ar),e(M,Q),b(ze,Q,null),e(Q,sr),e(Q,Tt),e(Tt,ir),m(t,co,u),m(t,W,u),e(W,ee),e(ee,zt),b(Me,zt,null),e(W,lr),e(W,Mt),e(Mt,dr),m(t,uo,u),m(t,T,u),b(Xe,T,null),e(T,cr),e(T,Xt),e(Xt,ur),e(T,mr),e(T,Ze),e(Ze,Ke),e(Ke,pr),e(Ze,hr),e(T,fr),e(T,f),e(f,_r),e(f,Qe),e(Qe,gr),e(f,kr),e(f,et),e(et,yr),e(f,br),e(f,tt),e(tt,Lr),e(f,vr),e(f,qt),e(qt,xr),e(f,wr),e(f,Et),e(Et,Tr),e(f,zr),e(f,$t),e($t,Mr),e(f,Xr),e(f,Ft),e(Ft,qr),e(f,Er),e(f,Pt),e(Pt,$r),e(f,Fr),e(f,Nt),e(Nt,Pr),e(f,Nr),e(T,Ar),e(T,N),b(qe,N,null),e(N,Dr),e(N,p),e(p,Ir),e(p,At),e(At,Sr),e(p,Or),e(p,Ee),e(Ee,Dt),e(Dt,Cr),e(Ee,Ur),e(p,Rr),e(p,ot),e(ot,jr),e(p,Wr),e(p,It),e(It,Vr),e(p,Br),e(p,St),e(St,Gr),e(p,Hr),e(p,$e),e($e,Ot),e(Ot,Yr),e($e,Jr),e(p,Zr),e(p,Ct),e(Ct,Kr),e(p,Qr),e(p,nt),e(nt,ea),e(p,ta),e(p,Ut),e(Ut,oa),e(p,na),e(p,Rt),e(Rt,ra),e(p,aa),e(p,jt),e(jt,sa),e(p,ia),e(p,Wt),e(Wt,la),e(p,da),e(N,ca),e(N,Vt),e(Vt,ua),mo=!0},p:Cs,i(t){mo||(L(ne.$$.fragment,t),L(re.$$.fragment,t),L(ie.$$.fragment,t),L(le.$$.fragment,t),L(ue.$$.fragment,t),L(me.$$.fragment,t),L(fe.$$.fragment,t),L(_e.$$.fragment,t),L(ke.$$.fragment,t),L(be.$$.fragment,t),L(Le.$$.fragment,t),L(ve.$$.fragment,t),L(xe.$$.fragment,t),L(ze.$$.fragment,t),L(Me.$$.fragment,t),L(Xe.$$.fragment,t),L(qe.$$.fragment,t),mo=!0)},o(t){v(ne.$$.fragment,t),v(re.$$.fragment,t),v(ie.$$.fragment,t),v(le.$$.fragment,t),v(ue.$$.fragment,t),v(me.$$.fragment,t),v(fe.$$.fragment,t),v(_e.$$.fragment,t),v(ke.$$.fragment,t),v(be.$$.fragment,t),v(Le.$$.fragment,t),v(ve.$$.fragment,t),v(xe.$$.fragment,t),v(ze.$$.fragment,t),v(Me.$$.fragment,t),v(Xe.$$.fragment,t),v(qe.$$.fragment,t),mo=!1},d(t){o(O),t&&o(Gt),t&&o(C),x(ne),t&&o(Ht),t&&o(U),x(re),t&&o(Yt),t&&o(E),t&&o(Jt),t&&o(Fe),t&&o(Zt),t&&o(Pe),t&&o(Kt),t&&o(Ne),t&&o(Qt),x(ie,t),t&&o(eo),t&&o($),t&&o(to),x(le,t),t&&o(oo),t&&o(z),t&&o(no),t&&o(G),t&&o(ro),t&&o(F),t&&o(ao),t&&o(R),x(ue),t&&o(so),t&&o(_),x(me),x(fe),x(_e),x(ke),x(be),x(Le),t&&o(io),t&&o(j),x(ve),t&&o(lo),t&&o(M),x(xe),x(ze),t&&o(co),t&&o(W),x(Me),t&&o(uo),t&&o(T),x(Xe),x(qe)}}}const js={local:"layoutxlm",sections:[{local:"overview",title:"Overview"},{local:"transformers.LayoutXLMTokenizer",title:"LayoutXLMTokenizer"},{local:"transformers.LayoutXLMTokenizerFast",title:"LayoutXLMTokenizerFast"},{local:"transformers.LayoutXLMProcessor",title:"LayoutXLMProcessor"}],title:"LayoutXLM"};function Ws(ga){return Us(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ys extends Ds{constructor(O){super();Is(this,O,Ws,Rs,Ss,{})}}export{Ys as default,js as metadata};
