LayoutReader-base

Detect the reading order of a layout-rich document (e.g. receipts, forms, papers) by encoding the word-level bounding boxes in a seq2seq transformer.

Refer to the official Github Repo: https://github.com/microsoft/unilm/tree/master/layoutreader

Model details

Trained on ReadingBank.

Architecture LayoutlmForSequenceToSequence (LayoutLM backbone)
Layers / hidden / heads 12 / 768 / 12
Parameters ~113M (207 tensors, fp32)
Vocab size 30522
Max position embeddings 1024
Max 2D position embeddings 1024
Max source length 513

Files

  • model.safetensors / pytorch_model.bin โ€” the same checkpoint in both formats
  • config.json

No tokenizer files are included in this repo โ€” load one separately.

Note on revisions

The original upload of this repo was saved through a plain BertModel, which silently dropped every LayoutReader-specific tensor: the 2D layout position embeddings (x/y/h/w_position_embeddings) and the cls.predictions head. Its config.json also recorded architectures: ["BertModel"].

main now holds the complete original checkpoint, verified against the source pytorch_model.bin.

The previous incomplete version is still available at the v1-old tag:

from transformers import AutoModel
AutoModel.from_pretrained("zilongwang/layoutreader-base", revision="v1-old")
Downloads last month
38
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support