UDOP adopts an encoder-decoder Transformer architecture based on T5 for document AI tasks like document image classification, document parsing and document visual question answering.
Intended uses & limitations
You can use the model for document image classification, document parsing and document visual question answering (DocVQA).
How to use
Here's how to use the model on a document image:
from transformers import AutoProcessor, UdopForConditionalGeneration
from datasets import load_dataset
# load model and processor# in this case, we already have performed OCR ourselves# so we initialize the processor with `apply_ocr=False`
processor = AutoProcessor.from_pretrained("microsoft/udop-large", apply_ocr=False)
model = UdopForConditionalGeneration.from_pretrained("microsoft/udop-large")
# load an example image, along with the words and coordinates# which were extracted using an OCR engine
dataset = load_dataset("nielsr/funsd-layoutlmv3", split="train")
example = dataset[0]
image = example["image"]
words = example["tokens"]
boxes = example["bboxes"]
question = "Question answering. What is the date on the form?"# prepare everything for the model
encoding = processor(image, question, words, boxes=boxes, return_tensors="pt")
# autoregressive generation
predicted_ids = model.generate(**encoding)
print(processor.batch_decode(predicted_ids, skip_special_tokens=True)[0])
9/30/92
@misc{tang2023unifying,
title={Unifying Vision, Text, and Layout for Universal Document Processing},
author={Zineng Tang and Ziyi Yang and Guoxin Wang and Yuwei Fang and Yang Liu and Chenguang Zhu and Michael Zeng and Cha Zhang and Mohit Bansal},
year={2023},
eprint={2212.02623},
archivePrefix={arXiv},
primaryClass={cs.CV}
}
Runs of microsoft udop-large on huggingface.co
68.7K
Total runs
0
24-hour runs
-3.5K
3-day runs
-6.7K
7-day runs
-18.2K
30-day runs
More Information About udop-large huggingface.co Model
udop-large huggingface.co is an AI model on huggingface.co that provides udop-large's model effect (), which can be used instantly with this microsoft udop-large model. huggingface.co supports a free trial of the udop-large model, and also provides paid use of the udop-large. Support call udop-large model through api, including Node.js, Python, http.
udop-large huggingface.co is an online trial and call api platform, which integrates udop-large's modeling effects, including api services, and provides a free online trial of udop-large, you can try udop-large online for free by clicking the link below.
microsoft udop-large online free url in huggingface.co:
udop-large is an open source model from GitHub that offers a free installation service, and any user can find udop-large on GitHub to install. At the same time, huggingface.co provides the effect of udop-large install, users can directly use udop-large installed effect in huggingface.co for debugging and trial. It also supports api for free installation.