class_docstr: Construct a MarkupLM tokenizer. Based on byte-level Byte-Pair-Encoding (BPE).
  
  [`MarkupLMTokenizerFast`] can be used to turn HTML strings into to token-level `input_ids`, `attention_mask`,
  `token_type_ids`, `xpath_tags_seq` and `xpath_tags_seq`. This tokenizer inherits from [`PreTrainedTokenizer`] which
  contains most of the main methods.
  
  Users should refer to this superclass for more information regarding those methods.
  
  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).
code: def __init__(
      self,
      vocab_file,
      merges_file,
      tags_dict,
      tokenizer_file=None,
      errors="replace",
      bos_token="<s>",
      eos_token="</s>",
      sep_token="</s>",
      cls_token="<s>",
      unk_token="<unk>",
      pad_token="<pad>",
      mask_token="<mask>",
      add_prefix_space=False,
      max_depth=50,
      max_width=1000,
      pad_width=1001,
      pad_token_label=-100,
      only_label_first_subword=True,
      trim_offsets=False,
      **kwargs,
  ):
      bos_token = (
          AddedToken(bos_token, lstrip=False, rstrip=False)
          if isinstance(bos_token, str)
          else bos_token
      )
      eos_token = (
          AddedToken(eos_token, lstrip=False, rstrip=False)
          if isinstance(eos_token, str)
          else eos_token
      )
      sep_token = (
          AddedToken(sep_token, lstrip=False, rstrip=False)
          if isinstance(sep_token, str)
          else sep_token
      )
      cls_token = (
          AddedToken(cls_token, lstrip=False, rstrip=False)
          if isinstance(cls_token, str)
          else cls_token
      )
      unk_token = (
          AddedToken(unk_token, lstrip=False, rstrip=False)
          if isinstance(unk_token, str)
          else unk_token
      )
      pad_token = (
          AddedToken(pad_token, lstrip=False, rstrip=False)
          if isinstance(pad_token, str)
          else pad_token
      )
  
      # Mask token behave like a normal word, i.e. include the space before it
      mask_token = (
          AddedToken(mask_token, lstrip=True, rstrip=False)
          if isinstance(mask_token, str)
          else mask_token
      )
  
      super().__init__(
          vocab_file=vocab_file,
          merges_file=merges_file,
          tags_dict=tags_dict,
          tokenizer_file=tokenizer_file,
          errors=errors,
          bos_token=bos_token,
          eos_token=eos_token,
          unk_token=unk_token,
          sep_token=sep_token,
          cls_token=cls_token,
          pad_token=pad_token,
          mask_token=mask_token,
          add_prefix_space=add_prefix_space,
          trim_offsets=trim_offsets,
          max_depth=max_depth,
          max_width=max_width,
          pad_width=pad_width,
          pad_token_label=pad_token_label,
          only_label_first_subword=only_label_first_subword,
          **kwargs,
      )
      if trim_offsets:
          # Not implemented yet, because we need to chain two post processors which is not possible yet
          # We need to wait for https://github.com/huggingface/tokenizers/pull/1005
          # With `trim_offsets=False` we don't need to do add `processors.ByteLevel(trim_offsets=False)`
          # because it's not doing anything
          raise NotImplementedError(
              "`trim_offsets=True` is not implemented for MarkupLMTokenizerFast. Please set it to False."
          )
  
      self.tags_dict = tags_dict
  
      pre_tok_state = json.loads(
          self.backend_tokenizer.pre_tokenizer.__getstate__()
      )
      if (
          pre_tok_state.get("add_prefix_space", add_prefix_space)
          != add_prefix_space
      ):
          pre_tok_class = getattr(
              pre_tokenizers, pre_tok_state.pop("type")
          )
          pre_tok_state["add_prefix_space"] = add_prefix_space
          self.backend_tokenizer.pre_tokenizer = pre_tok_class(
              **pre_tok_state
          )
  
      self.add_prefix_space = add_prefix_space
  
      tokenizer_component = "post_processor"
      tokenizer_component_instance = getattr(
          self.backend_tokenizer, tokenizer_component, None
      )
      if tokenizer_component_instance:
          state = json.loads(
              tokenizer_component_instance.__getstate__()
          )
  
          # The lists 'sep' and 'cls' must be cased in tuples for the object `post_processor_class`
          if "sep" in state:
              state["sep"] = tuple(state["sep"])
          if "cls" in state:
              state["cls"] = tuple(state["cls"])
  
          changes_to_apply = False
  
          if (
              state.get("add_prefix_space", add_prefix_space)
              != add_prefix_space
          ):
              state["add_prefix_space"] = add_prefix_space
              changes_to_apply = True
  
          if changes_to_apply:
              component_class = getattr(processors, state.pop("type"))
              new_value = component_class(**state)
              setattr(
                  self.backend_tokenizer, tokenizer_component, new_value
              )
  
      # additional properties
      self.max_depth = max_depth
      self.max_width = max_width
      self.pad_width = pad_width
      self.unk_tag_id = len(self.tags_dict)
      self.pad_tag_id = self.unk_tag_id + 1
      self.pad_xpath_tags_seq = [self.pad_tag_id] * self.max_depth
      self.pad_xpath_subs_seq = [self.pad_width] * self.max_depth
      self.pad_token_label = pad_token_label
      self.only_label_first_subword = only_label_first_subword
  
imports: import json
  from functools import lru_cache
  from typing import Dict, List, Optional, Tuple, Union
  from tokenizers import pre_tokenizers, processors
  from ...file_utils import PaddingStrategy, TensorType, add_end_docstrings
  from ...tokenization_utils_base import ENCODE_KWARGS_DOCSTRING, AddedToken, BatchEncoding, EncodedInput, PreTokenizedInput, TextInput, TextInputPair, TruncationStrategy
  from ...tokenization_utils_fast import PreTrainedTokenizerFast
  from ...utils import logging
  from .tokenization_markuplm import MARKUPLM_ENCODE_PLUS_ADDITIONAL_KWARGS_DOCSTRING, MarkupLMTokenizer
label_desc: Use image node_id 1 to create a new MarkupLMTokenizerFast object from inherited base classes: PreTrainedTokenizerFast with example: obj = MarkupLMTokenizerFast(vocab_file, merges_file, tags_dict, tokenizer_file, errors, bos_token, eos_token, sep_token, cls_token, unk_token, pad_token, mask_token, add_prefix_space, max_depth, max_width, pad_width, pad_token_label, only_label_first_subword, trim_offsets)