

Usage: LayoutLMv2Processor
The easiest way to prepare data for the model is to use [LayoutLMv2Processor], which internally
combines a image processor ([LayoutLMv2ImageProcessor]) and a tokenizer
([LayoutLMv2Tokenizer] or [LayoutLMv2TokenizerFast]). The image processor
handles the image modality, while the tokenizer handles the text modality. A processor combines both, which is ideal
for a multi-modal model like LayoutLMv2. Note that you can still use both separately, if you only want to handle one
modality.
thon
from transformers import LayoutLMv2ImageProcessor, LayoutLMv2TokenizerFast, LayoutLMv2Processor
image_processor = LayoutLMv2ImageProcessor()  # apply_ocr is set to True by default
tokenizer = LayoutLMv2TokenizerFast.from_pretrained("microsoft/layoutlmv2-base-uncased")
processor = LayoutLMv2Processor(image_processor, tokenizer)