Update README: model details, file list, v1-old revision note
Browse files
README.md
CHANGED
|
@@ -1,9 +1,51 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
|
| 5 |
# LayoutReader-base
|
| 6 |
|
| 7 |
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.
|
| 8 |
|
| 9 |
-
Refer to the official Github Repo: https://github.com/microsoft/unilm/tree/master/layoutreader
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
tags:
|
| 4 |
+
- layoutlm
|
| 5 |
+
- reading-order
|
| 6 |
+
- document-ai
|
| 7 |
---
|
| 8 |
|
| 9 |
# LayoutReader-base
|
| 10 |
|
| 11 |
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.
|
| 12 |
|
| 13 |
+
Refer to the official Github Repo: https://github.com/microsoft/unilm/tree/master/layoutreader
|
| 14 |
+
|
| 15 |
+
## Model details
|
| 16 |
+
|
| 17 |
+
Trained on [ReadingBank](https://github.com/microsoft/unilm/tree/master/layoutreader#readingbank).
|
| 18 |
+
|
| 19 |
+
| | |
|
| 20 |
+
|---|---|
|
| 21 |
+
| Architecture | `LayoutlmForSequenceToSequence` (LayoutLM backbone) |
|
| 22 |
+
| Layers / hidden / heads | 12 / 768 / 12 |
|
| 23 |
+
| Parameters | ~113M (207 tensors, fp32) |
|
| 24 |
+
| Vocab size | 30522 |
|
| 25 |
+
| Max position embeddings | 1024 |
|
| 26 |
+
| Max 2D position embeddings | 1024 |
|
| 27 |
+
| Max source length | 513 |
|
| 28 |
+
|
| 29 |
+
## Files
|
| 30 |
+
|
| 31 |
+
- `model.safetensors` / `pytorch_model.bin` — the same checkpoint in both formats
|
| 32 |
+
- `config.json`
|
| 33 |
+
|
| 34 |
+
No tokenizer files are included in this repo — load one separately.
|
| 35 |
+
|
| 36 |
+
## Note on revisions
|
| 37 |
+
|
| 38 |
+
The original upload of this repo was saved through a plain `BertModel`, which
|
| 39 |
+
silently dropped every LayoutReader-specific tensor: the 2D layout position
|
| 40 |
+
embeddings (`x`/`y`/`h`/`w_position_embeddings`) and the `cls.predictions`
|
| 41 |
+
head. Its `config.json` also recorded `architectures: ["BertModel"]`.
|
| 42 |
+
|
| 43 |
+
`main` now holds the complete original checkpoint, verified against the source
|
| 44 |
+
`pytorch_model.bin`.
|
| 45 |
+
|
| 46 |
+
The previous incomplete version is still available at the `v1-old` tag:
|
| 47 |
+
|
| 48 |
+
```python
|
| 49 |
+
from transformers import AutoModel
|
| 50 |
+
AutoModel.from_pretrained("zilongwang/layoutreader-base", revision="v1-old")
|
| 51 |
+
```
|