layoutlm-funsd / README.md
marcoCasamento's picture
End of training
6e3806b verified
---
license: mit
base_model: microsoft/layoutlm-base-uncased
tags:
- generated_from_trainer
datasets:
- funsd
model-index:
- name: layoutlm-funsd
results: []
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
# layoutlm-funsd
This model is a fine-tuned version of [microsoft/layoutlm-base-uncased](https://huggingface.co/microsoft/layoutlm-base-uncased) on the funsd dataset.
It achieves the following results on the evaluation set:
- Loss: 1.0554
- Answer: {'precision': 0.4105691056910569, 'recall': 0.49938195302843014, 'f1': 0.45064138315672064, 'number': 809}
- Header: {'precision': 0.36470588235294116, 'recall': 0.2605042016806723, 'f1': 0.30392156862745096, 'number': 119}
- Question: {'precision': 0.48371104815864024, 'recall': 0.6413145539906103, 'f1': 0.551473556721841, 'number': 1065}
- Overall Precision: 0.4506
- Overall Recall: 0.5610
- Overall F1: 0.4998
- Overall Accuracy: 0.6149
## Model description
More information needed
## Intended uses & limitations
More information needed
## Training and evaluation data
More information needed
## Training procedure
### Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 3e-05
- train_batch_size: 16
- eval_batch_size: 8
- seed: 42
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: linear
- num_epochs: 15
- mixed_precision_training: Native AMP
### Training results
| Training Loss | Epoch | Step | Validation Loss | Answer | Header | Question | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:-------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------:|:-----------------:|:--------------:|:----------:|:----------------:|
| 1.7702 | 1.0 | 10 | 1.5768 | {'precision': 0.040923399790136414, 'recall': 0.048207663782447466, 'f1': 0.04426787741203178, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.38510301109350237, 'recall': 0.22816901408450704, 'f1': 0.28655660377358494, 'number': 1065} | 0.1780 | 0.1415 | 0.1577 | 0.3540 |
| 1.4963 | 2.0 | 20 | 1.4062 | {'precision': 0.1941294196130754, 'recall': 0.35970333745364647, 'f1': 0.2521663778162912, 'number': 809} | {'precision': 0.03571428571428571, 'recall': 0.01680672268907563, 'f1': 0.022857142857142857, 'number': 119} | {'precision': 0.28505291005291006, 'recall': 0.40469483568075115, 'f1': 0.33449747768723326, 'number': 1065} | 0.2361 | 0.3633 | 0.2862 | 0.4204 |
| 1.2983 | 3.0 | 30 | 1.2020 | {'precision': 0.23365122615803816, 'recall': 0.42398022249690975, 'f1': 0.3012736056214317, 'number': 809} | {'precision': 0.13846153846153847, 'recall': 0.07563025210084033, 'f1': 0.09782608695652173, 'number': 119} | {'precision': 0.3307776560788609, 'recall': 0.5671361502347417, 'f1': 0.4178484953303355, 'number': 1065} | 0.2846 | 0.4797 | 0.3572 | 0.4806 |
| 1.1603 | 4.0 | 40 | 1.1227 | {'precision': 0.2243436754176611, 'recall': 0.34857849196538937, 'f1': 0.2729912875121007, 'number': 809} | {'precision': 0.2222222222222222, 'recall': 0.18487394957983194, 'f1': 0.2018348623853211, 'number': 119} | {'precision': 0.35071846726982436, 'recall': 0.6187793427230047, 'f1': 0.4476902173913044, 'number': 1065} | 0.2977 | 0.4832 | 0.3684 | 0.5265 |
| 1.0771 | 5.0 | 50 | 1.0953 | {'precision': 0.2655198204936425, 'recall': 0.4388133498145859, 'f1': 0.33084808946877914, 'number': 809} | {'precision': 0.26666666666666666, 'recall': 0.20168067226890757, 'f1': 0.22966507177033493, 'number': 119} | {'precision': 0.3632745878339966, 'recall': 0.6, 'f1': 0.45254957507082155, 'number': 1065} | 0.3195 | 0.5108 | 0.3931 | 0.5453 |
| 1.0102 | 6.0 | 60 | 1.0388 | {'precision': 0.30492285084496695, 'recall': 0.5129789864029666, 'f1': 0.3824884792626728, 'number': 809} | {'precision': 0.3283582089552239, 'recall': 0.18487394957983194, 'f1': 0.2365591397849462, 'number': 119} | {'precision': 0.4519543973941368, 'recall': 0.5211267605633803, 'f1': 0.4840819886611426, 'number': 1065} | 0.3735 | 0.4977 | 0.4268 | 0.5839 |
| 0.9312 | 7.0 | 70 | 1.0265 | {'precision': 0.32556131260794474, 'recall': 0.46600741656365885, 'f1': 0.3833248601931876, 'number': 809} | {'precision': 0.2828282828282828, 'recall': 0.23529411764705882, 'f1': 0.25688073394495414, 'number': 119} | {'precision': 0.47326007326007324, 'recall': 0.6065727699530516, 'f1': 0.5316872427983539, 'number': 1065} | 0.4008 | 0.5273 | 0.4555 | 0.5969 |
| 0.8732 | 8.0 | 80 | 1.0508 | {'precision': 0.33681073025335323, 'recall': 0.5587144622991347, 'f1': 0.4202696420269642, 'number': 809} | {'precision': 0.3561643835616438, 'recall': 0.2184873949579832, 'f1': 0.2708333333333333, 'number': 119} | {'precision': 0.4556126192223037, 'recall': 0.5830985915492958, 'f1': 0.5115321252059308, 'number': 1065} | 0.3956 | 0.5514 | 0.4607 | 0.5947 |
| 0.808 | 9.0 | 90 | 1.0282 | {'precision': 0.36807511737089205, 'recall': 0.484548825710754, 'f1': 0.41835645677694777, 'number': 809} | {'precision': 0.3058823529411765, 'recall': 0.2184873949579832, 'f1': 0.2549019607843137, 'number': 119} | {'precision': 0.46965317919075145, 'recall': 0.6103286384976526, 'f1': 0.5308289097590853, 'number': 1065} | 0.4215 | 0.5359 | 0.4718 | 0.6085 |
| 0.7928 | 10.0 | 100 | 1.0475 | {'precision': 0.38683498647430115, 'recall': 0.5302843016069221, 'f1': 0.44734098018769547, 'number': 809} | {'precision': 0.36363636363636365, 'recall': 0.23529411764705882, 'f1': 0.2857142857142857, 'number': 119} | {'precision': 0.49149922720247297, 'recall': 0.5971830985915493, 'f1': 0.5392115303094531, 'number': 1065} | 0.4407 | 0.5484 | 0.4887 | 0.6054 |
| 0.7164 | 11.0 | 110 | 1.0310 | {'precision': 0.38894472361809046, 'recall': 0.4783683559950556, 'f1': 0.4290465631929047, 'number': 809} | {'precision': 0.38961038961038963, 'recall': 0.25210084033613445, 'f1': 0.30612244897959184, 'number': 119} | {'precision': 0.4831223628691983, 'recall': 0.6450704225352113, 'f1': 0.5524728588661038, 'number': 1065} | 0.4427 | 0.5539 | 0.4921 | 0.6149 |
| 0.707 | 12.0 | 120 | 1.0295 | {'precision': 0.40441176470588236, 'recall': 0.4758961681087763, 'f1': 0.43725156161272005, 'number': 809} | {'precision': 0.3655913978494624, 'recall': 0.2857142857142857, 'f1': 0.32075471698113206, 'number': 119} | {'precision': 0.4713031735313977, 'recall': 0.6553990610328638, 'f1': 0.5483110761979575, 'number': 1065} | 0.4422 | 0.5605 | 0.4944 | 0.6172 |
| 0.6765 | 13.0 | 130 | 1.0494 | {'precision': 0.4107485604606526, 'recall': 0.5290482076637825, 'f1': 0.46245272825499734, 'number': 809} | {'precision': 0.4305555555555556, 'recall': 0.2605042016806723, 'f1': 0.324607329842932, 'number': 119} | {'precision': 0.4879825200291333, 'recall': 0.6291079812206573, 'f1': 0.5496308449548811, 'number': 1065} | 0.4540 | 0.5665 | 0.5040 | 0.6156 |
| 0.6489 | 14.0 | 140 | 1.0557 | {'precision': 0.4165009940357853, 'recall': 0.5179233621755254, 'f1': 0.4617079889807163, 'number': 809} | {'precision': 0.4, 'recall': 0.2689075630252101, 'f1': 0.32160804020100503, 'number': 119} | {'precision': 0.4891304347826087, 'recall': 0.6338028169014085, 'f1': 0.5521472392638037, 'number': 1065} | 0.4566 | 0.5650 | 0.5050 | 0.6142 |
| 0.6397 | 15.0 | 150 | 1.0554 | {'precision': 0.4105691056910569, 'recall': 0.49938195302843014, 'f1': 0.45064138315672064, 'number': 809} | {'precision': 0.36470588235294116, 'recall': 0.2605042016806723, 'f1': 0.30392156862745096, 'number': 119} | {'precision': 0.48371104815864024, 'recall': 0.6413145539906103, 'f1': 0.551473556721841, 'number': 1065} | 0.4506 | 0.5610 | 0.4998 | 0.6149 |
### Framework versions
- Transformers 4.38.2
- Pytorch 2.2.1+cu121
- Datasets 2.18.0
- Tokenizers 0.15.2