Instructions to use billyprodev/layoutlm-funsd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use billyprodev/layoutlm-funsd with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="billyprodev/layoutlm-funsd")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("billyprodev/layoutlm-funsd") model = AutoModelForTokenClassification.from_pretrained("billyprodev/layoutlm-funsd") - Notebooks
- Google Colab
- Kaggle
End of training
Browse files- README.md +80 -0
- model.safetensors +1 -1
- processor_config.json +14 -0
- runs/May02_20-15-42_81b4d1914131/events.out.tfevents.1777752942.81b4d1914131.4120.0 +2 -2
- tokenizer.json +0 -0
- tokenizer_config.json +37 -0
README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
library_name: transformers
|
| 3 |
+
license: mit
|
| 4 |
+
base_model: microsoft/layoutlm-base-uncased
|
| 5 |
+
tags:
|
| 6 |
+
- generated_from_trainer
|
| 7 |
+
model-index:
|
| 8 |
+
- name: layoutlm-funsd
|
| 9 |
+
results: []
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 13 |
+
should probably proofread and complete it, then remove this comment. -->
|
| 14 |
+
|
| 15 |
+
# layoutlm-funsd
|
| 16 |
+
|
| 17 |
+
This model is a fine-tuned version of [microsoft/layoutlm-base-uncased](https://huggingface.co/microsoft/layoutlm-base-uncased) on an unknown dataset.
|
| 18 |
+
It achieves the following results on the evaluation set:
|
| 19 |
+
- Loss: 0.6849
|
| 20 |
+
- Answer: {'precision': 0.7012987012987013, 'recall': 0.8009888751545118, 'f1': 0.7478361223312175, 'number': 809}
|
| 21 |
+
- Header: {'precision': 0.2949640287769784, 'recall': 0.3445378151260504, 'f1': 0.31782945736434104, 'number': 119}
|
| 22 |
+
- Question: {'precision': 0.7841918294849023, 'recall': 0.8291079812206573, 'f1': 0.8060246462802373, 'number': 1065}
|
| 23 |
+
- Overall Precision: 0.7181
|
| 24 |
+
- Overall Recall: 0.7888
|
| 25 |
+
- Overall F1: 0.7518
|
| 26 |
+
- Overall Accuracy: 0.8109
|
| 27 |
+
|
| 28 |
+
## Model description
|
| 29 |
+
|
| 30 |
+
More information needed
|
| 31 |
+
|
| 32 |
+
## Intended uses & limitations
|
| 33 |
+
|
| 34 |
+
More information needed
|
| 35 |
+
|
| 36 |
+
## Training and evaluation data
|
| 37 |
+
|
| 38 |
+
More information needed
|
| 39 |
+
|
| 40 |
+
## Training procedure
|
| 41 |
+
|
| 42 |
+
### Training hyperparameters
|
| 43 |
+
|
| 44 |
+
The following hyperparameters were used during training:
|
| 45 |
+
- learning_rate: 3e-05
|
| 46 |
+
- train_batch_size: 16
|
| 47 |
+
- eval_batch_size: 8
|
| 48 |
+
- seed: 42
|
| 49 |
+
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
|
| 50 |
+
- lr_scheduler_type: linear
|
| 51 |
+
- num_epochs: 15
|
| 52 |
+
- mixed_precision_training: Native AMP
|
| 53 |
+
|
| 54 |
+
### Training results
|
| 55 |
+
|
| 56 |
+
| Training Loss | Epoch | Step | Validation Loss | Answer | Header | Question | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
|
| 57 |
+
|:-------------:|:-----:|:----:|:---------------:|:------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------:|:-----------------:|:--------------:|:----------:|:----------------:|
|
| 58 |
+
| 1.8118 | 1.0 | 10 | 1.6165 | {'precision': 0.0053475935828877, 'recall': 0.003708281829419036, 'f1': 0.004379562043795621, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.1696969696969697, 'recall': 0.07887323943661972, 'f1': 0.10769230769230771, 'number': 1065} | 0.0824 | 0.0437 | 0.0571 | 0.3296 |
|
| 59 |
+
| 1.4873 | 2.0 | 20 | 1.2837 | {'precision': 0.2286302780638517, 'recall': 0.27441285537700866, 'f1': 0.24943820224719102, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.40404040404040403, 'recall': 0.48826291079812206, 'f1': 0.4421768707482993, 'number': 1065} | 0.3286 | 0.3723 | 0.3491 | 0.5988 |
|
| 60 |
+
| 1.1439 | 3.0 | 30 | 0.9604 | {'precision': 0.4777777777777778, 'recall': 0.5315203955500618, 'f1': 0.5032182562902282, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.5338345864661654, 'recall': 0.6666666666666666, 'f1': 0.5929018789144049, 'number': 1065} | 0.5096 | 0.5720 | 0.5390 | 0.7009 |
|
| 61 |
+
| 0.8769 | 4.0 | 40 | 0.8082 | {'precision': 0.5680473372781065, 'recall': 0.7119901112484549, 'f1': 0.6319253976961053, 'number': 809} | {'precision': 0.17142857142857143, 'recall': 0.05042016806722689, 'f1': 0.07792207792207793, 'number': 119} | {'precision': 0.634046052631579, 'recall': 0.723943661971831, 'f1': 0.676019289785182, 'number': 1065} | 0.5974 | 0.6789 | 0.6355 | 0.7460 |
|
| 62 |
+
| 0.7067 | 5.0 | 50 | 0.7335 | {'precision': 0.6294363256784968, 'recall': 0.7453646477132262, 'f1': 0.6825127334465195, 'number': 809} | {'precision': 0.1875, 'recall': 0.12605042016806722, 'f1': 0.1507537688442211, 'number': 119} | {'precision': 0.6707818930041153, 'recall': 0.7652582159624414, 'f1': 0.7149122807017545, 'number': 1065} | 0.6360 | 0.7190 | 0.6750 | 0.7739 |
|
| 63 |
+
| 0.6007 | 6.0 | 60 | 0.7113 | {'precision': 0.6472361809045226, 'recall': 0.796044499381953, 'f1': 0.7139689578713968, 'number': 809} | {'precision': 0.18604651162790697, 'recall': 0.13445378151260504, 'f1': 0.15609756097560976, 'number': 119} | {'precision': 0.7309377738825592, 'recall': 0.7830985915492957, 'f1': 0.7561196736174071, 'number': 1065} | 0.6724 | 0.7496 | 0.7089 | 0.7808 |
|
| 64 |
+
| 0.5219 | 7.0 | 70 | 0.6749 | {'precision': 0.6618257261410788, 'recall': 0.788627935723115, 'f1': 0.7196841511562324, 'number': 809} | {'precision': 0.2066115702479339, 'recall': 0.21008403361344538, 'f1': 0.20833333333333334, 'number': 119} | {'precision': 0.726649528706084, 'recall': 0.7962441314553991, 'f1': 0.7598566308243728, 'number': 1065} | 0.6710 | 0.7582 | 0.7119 | 0.7955 |
|
| 65 |
+
| 0.4628 | 8.0 | 80 | 0.6588 | {'precision': 0.6902465166130761, 'recall': 0.796044499381953, 'f1': 0.7393800229621125, 'number': 809} | {'precision': 0.2608695652173913, 'recall': 0.25210084033613445, 'f1': 0.2564102564102564, 'number': 119} | {'precision': 0.7422852376980817, 'recall': 0.8356807511737089, 'f1': 0.7862190812720848, 'number': 1065} | 0.6960 | 0.7847 | 0.7377 | 0.8061 |
|
| 66 |
+
| 0.4095 | 9.0 | 90 | 0.6676 | {'precision': 0.6787941787941788, 'recall': 0.8071693448702101, 'f1': 0.7374364765669114, 'number': 809} | {'precision': 0.29357798165137616, 'recall': 0.2689075630252101, 'f1': 0.28070175438596495, 'number': 119} | {'precision': 0.769163763066202, 'recall': 0.8291079812206573, 'f1': 0.7980117487573429, 'number': 1065} | 0.7066 | 0.7868 | 0.7445 | 0.8060 |
|
| 67 |
+
| 0.3940 | 10.0 | 100 | 0.6780 | {'precision': 0.7039473684210527, 'recall': 0.7935723114956736, 'f1': 0.7460778617083091, 'number': 809} | {'precision': 0.288135593220339, 'recall': 0.2857142857142857, 'f1': 0.2869198312236287, 'number': 119} | {'precision': 0.7744165946413137, 'recall': 0.8413145539906103, 'f1': 0.8064806480648066, 'number': 1065} | 0.7188 | 0.7888 | 0.7522 | 0.8091 |
|
| 68 |
+
| 0.3427 | 11.0 | 110 | 0.6791 | {'precision': 0.7005347593582888, 'recall': 0.8096415327564895, 'f1': 0.7511467889908257, 'number': 809} | {'precision': 0.24025974025974026, 'recall': 0.31092436974789917, 'f1': 0.2710622710622711, 'number': 119} | {'precision': 0.7715780296425457, 'recall': 0.8309859154929577, 'f1': 0.8001808318264014, 'number': 1065} | 0.7053 | 0.7913 | 0.7458 | 0.8075 |
|
| 69 |
+
| 0.3233 | 12.0 | 120 | 0.6765 | {'precision': 0.6941176470588235, 'recall': 0.8022249690976514, 'f1': 0.7442660550458714, 'number': 809} | {'precision': 0.27049180327868855, 'recall': 0.2773109243697479, 'f1': 0.27385892116182575, 'number': 119} | {'precision': 0.7831111111111111, 'recall': 0.8272300469483568, 'f1': 0.8045662100456622, 'number': 1065} | 0.7163 | 0.7842 | 0.7487 | 0.8096 |
|
| 70 |
+
| 0.3056 | 13.0 | 130 | 0.6867 | {'precision': 0.6944745395449621, 'recall': 0.792336217552534, 'f1': 0.7401847575057737, 'number': 809} | {'precision': 0.2702702702702703, 'recall': 0.33613445378151263, 'f1': 0.299625468164794, 'number': 119} | {'precision': 0.7764192139737991, 'recall': 0.8347417840375587, 'f1': 0.8045248868778281, 'number': 1065} | 0.7085 | 0.7878 | 0.7460 | 0.8108 |
|
| 71 |
+
| 0.2898 | 14.0 | 140 | 0.6837 | {'precision': 0.6989130434782609, 'recall': 0.7948084054388134, 'f1': 0.7437825332562175, 'number': 809} | {'precision': 0.2887323943661972, 'recall': 0.3445378151260504, 'f1': 0.31417624521072796, 'number': 119} | {'precision': 0.7856510186005314, 'recall': 0.8328638497652582, 'f1': 0.8085688240656335, 'number': 1065} | 0.7170 | 0.7883 | 0.7510 | 0.8110 |
|
| 72 |
+
| 0.2827 | 15.0 | 150 | 0.6849 | {'precision': 0.7012987012987013, 'recall': 0.8009888751545118, 'f1': 0.7478361223312175, 'number': 809} | {'precision': 0.2949640287769784, 'recall': 0.3445378151260504, 'f1': 0.31782945736434104, 'number': 119} | {'precision': 0.7841918294849023, 'recall': 0.8291079812206573, 'f1': 0.8060246462802373, 'number': 1065} | 0.7181 | 0.7888 | 0.7518 | 0.8109 |
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
### Framework versions
|
| 76 |
+
|
| 77 |
+
- Transformers 5.7.0
|
| 78 |
+
- Pytorch 2.10.0+cu128
|
| 79 |
+
- Datasets 4.0.0
|
| 80 |
+
- Tokenizers 0.22.2
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 450558212
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1153ebd09ab95a9cd65c68a2a87d4ac61194e258ee00aaa92803e6755e27b104
|
| 3 |
size 450558212
|
processor_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor": {
|
| 3 |
+
"apply_ocr": false,
|
| 4 |
+
"do_resize": true,
|
| 5 |
+
"image_processor_type": "LayoutLMv2ImageProcessor",
|
| 6 |
+
"resample": 2,
|
| 7 |
+
"size": {
|
| 8 |
+
"height": 224,
|
| 9 |
+
"width": 224
|
| 10 |
+
},
|
| 11 |
+
"tesseract_config": ""
|
| 12 |
+
},
|
| 13 |
+
"processor_class": "LayoutLMv2Processor"
|
| 14 |
+
}
|
runs/May02_20-15-42_81b4d1914131/events.out.tfevents.1777752942.81b4d1914131.4120.0
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e552f68045fc522695f7b9b02e94530c9d7b019ff83fce82d84c0cc4be66ae63
|
| 3 |
+
size 15651
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"apply_ocr": false,
|
| 3 |
+
"backend": "tokenizers",
|
| 4 |
+
"cls_token": "[CLS]",
|
| 5 |
+
"cls_token_box": [
|
| 6 |
+
0,
|
| 7 |
+
0,
|
| 8 |
+
0,
|
| 9 |
+
0
|
| 10 |
+
],
|
| 11 |
+
"do_lower_case": true,
|
| 12 |
+
"is_local": false,
|
| 13 |
+
"local_files_only": false,
|
| 14 |
+
"mask_token": "[MASK]",
|
| 15 |
+
"model_max_length": 512,
|
| 16 |
+
"only_label_first_subword": true,
|
| 17 |
+
"pad_token": "[PAD]",
|
| 18 |
+
"pad_token_box": [
|
| 19 |
+
0,
|
| 20 |
+
0,
|
| 21 |
+
0,
|
| 22 |
+
0
|
| 23 |
+
],
|
| 24 |
+
"pad_token_label": -100,
|
| 25 |
+
"processor_class": "LayoutLMv2Processor",
|
| 26 |
+
"sep_token": "[SEP]",
|
| 27 |
+
"sep_token_box": [
|
| 28 |
+
1000,
|
| 29 |
+
1000,
|
| 30 |
+
1000,
|
| 31 |
+
1000
|
| 32 |
+
],
|
| 33 |
+
"strip_accents": null,
|
| 34 |
+
"tokenize_chinese_chars": true,
|
| 35 |
+
"tokenizer_class": "LayoutLMv2Tokenizer",
|
| 36 |
+
"unk_token": "[UNK]"
|
| 37 |
+
}
|