LayoutLMv3 table word labeling

microsoft/layoutlmv3-base fine tuned to label each word on a PDF page as O, TABLE_HEADER or TABLE_CELL. Built for the Voice Enabled RAG Pipeline (spec 0004), where rows and columns are rebuilt from the labeled words.

License: CC BY-NC-SA 4.0, inherited from LayoutLMv3 (non commercial).

Data

PubTables-1M full page words with labels from PubTables-1M-PDF_Annotations: a word whose centre lies in a column header cell is TABLE_HEADER, inside a table box otherwise TABLE_CELL, else O. Pages holding a table marked exclude_for_detection are left out. The sample is seeded (seed 42, smallest seeded hash of the page id): 5000 training pages, 1000 validation pages, 500 test pages from the official train, val and test splits. Page images are shrunk to 224 by 224.

Settings

Learning rate 5e-05, 5 epochs, batch size 8, fp16, AdamW with linear decay, cross entropy weighted by inverse label frequency on the training sample, windows of 512 tokens with stride 128, labels on each word's first subword only. The checkpoint with the best validation macro F1 is kept.

Validation by epoch: [{"epoch": 1, "train_loss": 0.112, "val_macro_f1": 0.9497}, {"epoch": 2, "train_loss": 0.0563, "val_macro_f1": 0.9671}, {"epoch": 3, "train_loss": 0.0316, "val_macro_f1": 0.9736}, {"epoch": 4, "train_loss": 0.0218, "val_macro_f1": 0.9812}, {"epoch": 5, "train_loss": 0.0117, "val_macro_f1": 0.9812}]

Test scores (per word, 500 pages)

Label Precision Recall F1 Words
O 0.9988 0.9993 0.999 241701
TABLE_HEADER 0.9516 0.9799 0.9656 7180
TABLE_CELL 0.9955 0.9897 0.9926 58919

Macro F1: 0.9857

Downloads last month
19
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

Model tree for Prashant-Mahto/layoutlmv3-pubtables-table-words

Finetuned
(313)
this model

Dataset used to train Prashant-Mahto/layoutlmv3-pubtables-table-words