class_docstr: Constructs a LayoutLMv2 processor which combines a LayoutLMv2 image processor and a LayoutLMv2 tokenizer into a
  single processor.
  
  [`LayoutLMv2Processor`] offers all the functionalities you need to prepare data for the model.
  
  It first uses [`LayoutLMv2ImageProcessor`] to resize document images to a fixed size, and optionally applies OCR to
  get words and normalized bounding boxes. These are then provided to [`LayoutLMv2Tokenizer`] or
  [`LayoutLMv2TokenizerFast`], which turns the words and bounding boxes into token-level `input_ids`,
  `attention_mask`, `token_type_ids`, `bbox`. Optionally, one can provide integer `word_labels`, which are turned
  into token-level `labels` for token classification tasks (such as FUNSD, CORD).
  
  Args:
      image_processor (`LayoutLMv2ImageProcessor`, *optional*):
          An instance of [`LayoutLMv2ImageProcessor`]. The image processor is a required input.
      tokenizer (`LayoutLMv2Tokenizer` or `LayoutLMv2TokenizerFast`, *optional*):
          An instance of [`LayoutLMv2Tokenizer`] or [`LayoutLMv2TokenizerFast`]. The tokenizer is a required input.
class_docstr_tok: ["Constructs","a","LayoutLMv2","processor","which","combines","a","LayoutLMv2","image","processor","and","a","LayoutLMv2","tokenizer","into","a","single","processor",".","[","`","LayoutLMv2Processor","`","]","offers","all","the","functionalities","you","need","to","prepare","data","for","the","model",".","It","first","uses","[","`","LayoutLMv2ImageProcessor","`","]","to","resize","document","images","to","a","fixed","size",",","and","optionally","applies","OCR","to","get","words","and","normalized","bounding","boxes",".","These","are","then","provided","to","[","`","LayoutLMv2Tokenizer","`","]","or","[","`","LayoutLMv2TokenizerFast","`","]",",","which","turns","the","words","and","bounding","boxes","into","token-level","`","input_ids","`",",","`","attention_mask","`",",","`","token_type_ids","`",",","`","bbox","`",".","Optionally",",","one","can","provide","integer","`","word_labels","`",",","which","are","turned","into","token-level","`","labels","`","for","token","classification","tasks","(","such","as","FUNSD",",","CORD",")",".","Args",":","image_processor","(","`","LayoutLMv2ImageProcessor","`",",","*","optional","*",")",":","An","instance","of","[","`","LayoutLMv2ImageProcessor","`","]",".","The","image","processor","is","a","required","input",".","tokenizer","(","`","LayoutLMv2Tokenizer","`","or","`","LayoutLMv2TokenizerFast","`",",","*","optional","*",")",":","An","instance","of","[","`","LayoutLMv2Tokenizer","`","]","or","[","`","LayoutLMv2TokenizerFast","`","]",".","The","tokenizer","is","a","required","input","."]
code: def __init__(self, image_processor=None, tokenizer=None, **kwargs):
      feature_extractor = None
      if "feature_extractor" in kwargs:
          warnings.warn(
              "The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`"
              " instead.",
              FutureWarning,
          )
          feature_extractor = kwargs.pop("feature_extractor")
  
      image_processor = (
          image_processor
          if image_processor is not None
          else feature_extractor
      )
      if image_processor is None:
          raise ValueError("You need to specify an `image_processor`.")
      if tokenizer is None:
          raise ValueError("You need to specify a `tokenizer`.")
  
      super().__init__(image_processor, tokenizer)
  
file_path: transformers/src/transformers/models/layoutlmv2/processing_layoutlmv2.py
imports: import warnings
  from typing import List, Optional, Union
  from ...processing_utils import ProcessorMixin
  from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, PreTokenizedInput, TextInput, TruncationStrategy
  from ...utils import TensorType
label_desc: Use image node_id 1 to create a new LayoutLMv2Processor object from inherited base classes: ProcessorMixin with example: obj = LayoutLMv2Processor(image_processor, tokenizer)