LayoutLMv3: Pre-training for Document AI with Unified Text and Image Masking
Paper
•
2204.08387
•
Published
•
8
pixel_values
listlengths 3
3
| input_ids
listlengths 512
512
| attention_mask
listlengths 512
512
| bbox
listlengths 512
512
| labels
listlengths 512
512
|
|---|---|---|---|---|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,843,34890,16218,10566,9,696,35,158,73,996,73,14517,44795,35,33536,35,12717,6,41(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-100,-1(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,231,1558,4419,33657,10566,9,696,35,12087,73,4124,73,14517,33536,35,44795,35,140(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-1(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,3191,21070,34295,10566,9,696,35,13470,73,4124,73,16310,44795,35,33536,35,2505,2(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-100,-1(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,974,28167,32972,10566,9,696,35,158,73,3546,73,14517,44795,35,33536,35,1604,2291(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-100,0,(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,13955,1922,38080,10566,9,696,35,12087,73,2481,73,24837,33536,35,44795,35,7816,2(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-100,0,(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,231,3367,3506,35414,10566,9,696,35,15140,73,1092,73,3789,33536,35,44795,35,9978(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-1(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,40766,1922,29023,10566,9,696,35,9465,73,2517,73,9029,44795,35,33536,35,2826,6,7(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-100,-1(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,6705,5067,3272,3170,10566,9,696,35,15007,73,1570,73,3789,44795,35,33536,35,1445(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-1(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,3620,1096,3083,6468,10566,9,696,35,13470,73,541,73,16310,44795,35,33536,35,221,(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-1(...TRUNCATED)
|
[[[1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1.0,1(...TRUNCATED)
| [0,9318,41689,117,35,971,4156,3387,3103,10566,9,696,35,12087,73,2518,73,9029,33536,35,44795,35,735,8(...TRUNCATED)
| [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1(...TRUNCATED)
| [[0,0,0,0],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20],[0,0,100,20(...TRUNCATED)
| [-100,1,-100,-100,-100,-100,-100,-100,-100,0,-100,-100,-100,3,-100,-100,-100,-100,0,-100,0,-100,0,-1(...TRUNCATED)
|
This dataset is processed and ready for training LayoutLMv3 models for invoice information extraction.
This dataset contains invoice documents with OCR-extracted text, bounding boxes, and entity labels for training document understanding models.
input_ids: Tokenized text inputattention_mask: Attention mask for the inputbbox: Bounding box coordinates for each tokenlabels: BIO-tagged entity labelspixel_values: Image tensors (if available)The dataset includes 45 entity types:
OB-INVOICE_NOI-INVOICE_NOB-INVOICE_DATEI-INVOICE_DATEB-SELLERI-SELLERB-CLIENTI-CLIENTB-SELLER_TAX_IDI-SELLER_TAX_IDB-CLIENT_TAX_IDI-CLIENT_TAX_IDB-IBANI-IBANB-ITEM_DESCI-ITEM_DESCB-ITEM_QTYI-ITEM_QTYB-ITEM_NET_PRICEI-ITEM_NET_PRICEB-ITEM_NET_WORTHI-ITEM_NET_WORTHB-ITEM_VATI-ITEM_VATB-ITEM_GROSS_WORTHI-ITEM_GROSS_WORTHB-TOTAL_NET_WORTHI-TOTAL_NET_WORTHB-TOTAL_VATI-TOTAL_VATB-TOTAL_GROSS_WORTHI-TOTAL_GROSS_WORTHB-DUE_DATEI-DUE_DATEB-PAYMENT_TERMSI-PAYMENT_TERMSB-CURRENCYI-CURRENCYB-SUBTOTALI-SUBTOTALB-DISCOUNTI-DISCOUNTB-SHIPPINGI-SHIPPINGfrom datasets import load_dataset
# Load the dataset
dataset = load_dataset("your-username/layoutlmv3-invoice-dataset")
# Load label information
import json
with open("label_info.json", "r") as f:
label_info = json.load(f)
id2label = label_info["id2label"]
label2id = label_info["label2id"]
This dataset is compatible with HuggingFace Transformers and can be used directly with LayoutLMv3 models.
If you use this dataset, please cite the original LayoutLMv3 paper:
@misc{huang2022layoutlmv3,
title={LayoutLMv3: A Unified Transformer for Document AI},
author={Yupan Huang and Tengchao Lv and Lei Cui and Yutong Lu and Furu Wei},
year={2022},
eprint={2204.08387},
archivePrefix={arXiv},
primaryClass={cs.CL}
}