class_docstr: Construct a LayoutLMv3 tokenizer. Based on [`RoBERTatokenizer`] (Byte Pair Encoding or BPE).
  [`LayoutLMv3Tokenizer`] can be used to turn words, word-level bounding boxes and optional word labels to
  token-level `input_ids`, `attention_mask`, `token_type_ids`, `bbox`, and optional `labels` (for token
  classification).
  
  This tokenizer inherits from [`PreTrainedTokenizer`] which contains most of the main methods. Users should refer to
  this superclass for more information regarding those methods.
  
  [`LayoutLMv3Tokenizer`] runs end-to-end tokenization: punctuation splitting and wordpiece. It also turns the
  word-level bounding boxes into token-level bounding boxes.
  
  Args:
      vocab_file (`str`):
          Path to the vocabulary file.
      merges_file (`str`):
          Path to the merges file.
      errors (`str`, *optional*, defaults to `"replace"`):
          Paradigm to follow when decoding bytes to UTF-8. See
          [bytes.decode](https://docs.python.org/3/library/stdtypes.html#bytes.decode) for more information.
      bos_token (`str`, *optional*, defaults to `"<s>"`):
          The beginning of sequence token that was used during pretraining. Can be used a sequence classifier token.
  
          <Tip>
  
          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 `cls_token`.
  
          </Tip>
  
      eos_token (`str`, *optional*, defaults to `"</s>"`):
          The end of sequence token.
  
          <Tip>
  
          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 `sep_token`.
  
          </Tip>
  
      sep_token (`str`, *optional*, defaults to `"</s>"`):
          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.
      cls_token (`str`, *optional*, defaults to `"<s>"`):
          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.
      unk_token (`str`, *optional*, defaults to `"<unk>"`):
          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.
      pad_token (`str`, *optional*, defaults to `"<pad>"`):
          The token used for padding, for example when batching sequences of different lengths.
      mask_token (`str`, *optional*, defaults to `"<mask>"`):
          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.
      add_prefix_space (`bool`, *optional*, defaults to `False`):
          Whether or not to add an initial space to the input. This allows to treat the leading word just as any
          other word. (RoBERTa tokenizer detect beginning of words by the preceding space).
      cls_token_box (`List[int]`, *optional*, defaults to `[0, 0, 0, 0]`):
          The bounding box to use for the special [CLS] token.
      sep_token_box (`List[int]`, *optional*, defaults to `[0, 0, 0, 0]`):
          The bounding box to use for the special [SEP] token.
      pad_token_box (`List[int]`, *optional*, defaults to `[0, 0, 0, 0]`):
          The bounding box to use for the special [PAD] token.
      pad_token_label (`int`, *optional*, defaults to -100):
          The label to use for padding tokens. Defaults to -100, which is the `ignore_index` of PyTorch's
          CrossEntropyLoss.
      only_label_first_subword (`bool`, *optional*, defaults to `True`):
          Whether or not to only label the first subword, in case word labels are provided.
class_docstr_tok: ["Construct","a","LayoutLMv3","tokenizer",".","Based","on","[","`","RoBERTatokenizer","`","]","(","Byte","Pair","Encoding","or","BPE",")",".","[","`","LayoutLMv3Tokenizer","`","]","can","be","used","to","turn","words",",","word-level","bounding","boxes","and","optional","word","labels","to","token-level","`","input_ids","`",",","`","attention_mask","`",",","`","token_type_ids","`",",","`","bbox","`",",","and","optional","`","labels","`","(","for","token","classification",")",".","This","tokenizer","inherits","from","[","`","PreTrainedTokenizer","`","]","which","contains","most","of","the","main","methods",".","Users","should","refer","to","this","superclass","for","more","information","regarding","those","methods",".","[","`","LayoutLMv3Tokenizer","`","]","runs","end-to-end","tokenization",":","punctuation","splitting","and","wordpiece",".","It","also","turns","the","word-level","bounding","boxes","into","token-level","bounding","boxes",".","Args",":","vocab_file","(","`","str","`",")",":","Path","to","the","vocabulary","file",".","merges_file","(","`","str","`",")",":","Path","to","the","merges","file",".","errors","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","replace","''","`",")",":","Paradigm","to","follow","when","decoding","bytes","to","UTF-8",".","See","[","bytes.decode","]","(","https",":","\/\/docs.python.org\/3\/library\/stdtypes.html","#","bytes.decode",")","for","more","information",".","bos_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","s",">","''","`",")",":","The","beginning","of","sequence","token","that","was","used","during","pretraining",".","Can","be","used","a","sequence","classifier","token",".","<","Tip",">","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","`","cls_token","`",".","<","\/Tip",">","eos_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","\/s",">","''","`",")",":","The","end","of","sequence","token",".","<","Tip",">","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","`","sep_token","`",".","<","\/Tip",">","sep_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","\/s",">","''","`",")",":","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",".","cls_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","s",">","''","`",")",":","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",".","unk_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","unk",">","''","`",")",":","The","unknown","token",".","A","token","that","is","not","in","the","vocabulary","can","not","be","converted","to","an","ID","and","is","set","to","be","this","token","instead",".","pad_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","pad",">","''","`",")",":","The","token","used","for","padding",",","for","example","when","batching","sequences","of","different","lengths",".","mask_token","(","`","str","`",",","*","optional","*",",","defaults","to","`","``","<","mask",">","''","`",")",":","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",".","add_prefix_space","(","`","bool","`",",","*","optional","*",",","defaults","to","`","False","`",")",":","Whether","or","not","to","add","an","initial","space","to","the","input",".","This","allows","to","treat","the","leading","word","just","as","any","other","word",".","(","RoBERTa","tokenizer","detect","beginning","of","words","by","the","preceding","space",")",".","cls_token_box","(","`","List","[","int","]","`",",","*","optional","*",",","defaults","to","`","[","0",",","0",",","0",",","0","]","`",")",":","The","bounding","box","to","use","for","the","special","[","CLS","]","token",".","sep_token_box","(","`","List","[","int","]","`",",","*","optional","*",",","defaults","to","`","[","0",",","0",",","0",",","0","]","`",")",":","The","bounding","box","to","use","for","the","special","[","SEP","]","token",".","pad_token_box","(","`","List","[","int","]","`",",","*","optional","*",",","defaults","to","`","[","0",",","0",",","0",",","0","]","`",")",":","The","bounding","box","to","use","for","the","special","[","PAD","]","token",".","pad_token_label","(","`","int","`",",","*","optional","*",",","defaults","to","-100",")",":","The","label","to","use","for","padding","tokens",".","Defaults","to","-100",",","which","is","the","`","ignore_index","`","of","PyTorch's","CrossEntropyLoss",".","only_label_first_subword","(","`","bool","`",",","*","optional","*",",","defaults","to","`","True","`",")",":","Whether","or","not","to","only","label","the","first","subword",",","in","case","word","labels","are","provided","."]
code: def encode(
      self,
      text: Union[TextInput, PreTokenizedInput],
      text_pair: Optional[PreTokenizedInput] = None,
      boxes: Optional[List[List[int]]] = None,
      word_labels: Optional[List[int]] = None,
      add_special_tokens: bool = True,
      padding: Union[bool, str, PaddingStrategy] = False,
      truncation: Union[bool, str, TruncationStrategy] = None,
      max_length: Optional[int] = None,
      stride: int = 0,
      pad_to_multiple_of: Optional[int] = None,
      return_tensors: Optional[Union[str, TensorType]] = None,
      return_token_type_ids: Optional[bool] = None,
      return_attention_mask: Optional[bool] = None,
      return_overflowing_tokens: bool = False,
      return_special_tokens_mask: bool = False,
      return_offsets_mapping: bool = False,
      return_length: bool = False,
      verbose: bool = True,
      **kwargs,
  ) -> List[int]:
      encoded_inputs = self.encode_plus(
          text=text,
          text_pair=text_pair,
          boxes=boxes,
          word_labels=word_labels,
          add_special_tokens=add_special_tokens,
          padding=padding,
          truncation=truncation,
          max_length=max_length,
          stride=stride,
          pad_to_multiple_of=pad_to_multiple_of,
          return_tensors=return_tensors,
          return_token_type_ids=return_token_type_ids,
          return_attention_mask=return_attention_mask,
          return_overflowing_tokens=return_overflowing_tokens,
          return_special_tokens_mask=return_special_tokens_mask,
          return_offsets_mapping=return_offsets_mapping,
          return_length=return_length,
          verbose=verbose,
          **kwargs,
      )
  
      return encoded_inputs["input_ids"]
  
imports: import json
  import os
  from functools import lru_cache
  from typing import Dict, List, Optional, Tuple, Union
  import regex
  from ...tokenization_utils import AddedToken, PreTrainedTokenizer
  from ...tokenization_utils_base import BatchEncoding, EncodedInput, PreTokenizedInput, TextInput, TextInputPair, TruncationStrategy
  from ...utils import PaddingStrategy, TensorType, add_end_docstrings, logging
label_desc: Use image node_id 18 for calling the LayoutLMv3Tokenizer obj's underlying member method code with example usage: obj.encode(text, text_pair, boxes, word_labels, add_special_tokens, padding, truncation, max_length, stride, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose) and returns: encoded_inputs