File size: 9,301 Bytes
2f637a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
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: 0.6866
- Answer: {'precision': 0.7130339539978094, 'recall': 0.8046971569839307, 'f1': 0.7560975609756098, 'number': 809}
- Header: {'precision': 0.3384615384615385, 'recall': 0.3697478991596639, 'f1': 0.35341365461847385, 'number': 119}
- Question: {'precision': 0.7763975155279503, 'recall': 0.8215962441314554, 'f1': 0.7983576642335766, 'number': 1065}
- Overall Precision: 0.7235
- Overall Recall: 0.7878
- Overall F1: 0.7543
- Overall Accuracy: 0.8126

## 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

### Training results

| Training Loss | Epoch | Step | Validation Loss | Answer                                                                                                         | Header                                                                                                        | Question                                                                                                    | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
|:-------------:|:-----:|:----:|:---------------:|:--------------------------------------------------------------------------------------------------------------:|:-------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------:|:-----------------:|:--------------:|:----------:|:----------------:|
| 1.7968        | 1.0   | 10   | 1.5972          | {'precision': 0.011235955056179775, 'recall': 0.011124845488257108, 'f1': 0.011180124223602483, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                   | {'precision': 0.1959544879898862, 'recall': 0.14553990610328638, 'f1': 0.1670258620689655, 'number': 1065}  | 0.1030            | 0.0823         | 0.0915     | 0.3535           |
| 1.4694        | 2.0   | 20   | 1.2467          | {'precision': 0.2002053388090349, 'recall': 0.24103831891223734, 'f1': 0.21873247335950646, 'number': 809}     | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                   | {'precision': 0.43186895011169024, 'recall': 0.5446009389671361, 'f1': 0.48172757475083056, 'number': 1065} | 0.3345            | 0.3889         | 0.3596     | 0.6093           |
| 1.0892        | 3.0   | 30   | 0.9301          | {'precision': 0.49691991786447637, 'recall': 0.5982694684796045, 'f1': 0.5429052159282108, 'number': 809}      | {'precision': 0.08108108108108109, 'recall': 0.025210084033613446, 'f1': 0.038461538461538464, 'number': 119} | {'precision': 0.5869205298013245, 'recall': 0.6657276995305165, 'f1': 0.62384513858337, 'number': 1065}     | 0.5390            | 0.6001         | 0.5679     | 0.7041           |
| 0.8148        | 4.0   | 40   | 0.7921          | {'precision': 0.5805243445692884, 'recall': 0.7663782447466008, 'f1': 0.660628662759723, 'number': 809}        | {'precision': 0.2, 'recall': 0.12605042016806722, 'f1': 0.15463917525773196, 'number': 119}                   | {'precision': 0.6657534246575343, 'recall': 0.6845070422535211, 'f1': 0.6749999999999999, 'number': 1065}   | 0.6095            | 0.6844         | 0.6448     | 0.7498           |
| 0.6789        | 5.0   | 50   | 0.7126          | {'precision': 0.6466942148760331, 'recall': 0.7737948084054388, 'f1': 0.7045582442318515, 'number': 809}       | {'precision': 0.23809523809523808, 'recall': 0.21008403361344538, 'f1': 0.22321428571428573, 'number': 119}   | {'precision': 0.6851535836177475, 'recall': 0.7539906103286385, 'f1': 0.7179257934734019, 'number': 1065}   | 0.6477            | 0.7296         | 0.6862     | 0.7822           |
| 0.5701        | 6.0   | 60   | 0.6734          | {'precision': 0.6524390243902439, 'recall': 0.7935723114956736, 'f1': 0.7161182375906302, 'number': 809}       | {'precision': 0.25, 'recall': 0.18487394957983194, 'f1': 0.21256038647342995, 'number': 119}                  | {'precision': 0.6886564762670957, 'recall': 0.8037558685446009, 'f1': 0.7417677642980937, 'number': 1065}   | 0.6566            | 0.7627         | 0.7057     | 0.7949           |
| 0.497         | 7.0   | 70   | 0.6688          | {'precision': 0.6719745222929936, 'recall': 0.7824474660074165, 'f1': 0.7230154197601371, 'number': 809}       | {'precision': 0.2857142857142857, 'recall': 0.2689075630252101, 'f1': 0.277056277056277, 'number': 119}       | {'precision': 0.7403267411865864, 'recall': 0.8084507042253521, 'f1': 0.7728904847396768, 'number': 1065}   | 0.6883            | 0.7657         | 0.7249     | 0.7976           |
| 0.4549        | 8.0   | 80   | 0.6561          | {'precision': 0.6881028938906752, 'recall': 0.7935723114956736, 'f1': 0.7370838117106774, 'number': 809}       | {'precision': 0.25, 'recall': 0.25210084033613445, 'f1': 0.2510460251046025, 'number': 119}                   | {'precision': 0.7432784041630529, 'recall': 0.8046948356807512, 'f1': 0.7727682596934174, 'number': 1065}   | 0.6931            | 0.7672         | 0.7283     | 0.8045           |
| 0.4095        | 9.0   | 90   | 0.6514          | {'precision': 0.694206008583691, 'recall': 0.799752781211372, 'f1': 0.7432510051694429, 'number': 809}         | {'precision': 0.29411764705882354, 'recall': 0.29411764705882354, 'f1': 0.29411764705882354, 'number': 119}   | {'precision': 0.7452830188679245, 'recall': 0.815962441314554, 'f1': 0.7790228597041686, 'number': 1065}    | 0.6996            | 0.7782         | 0.7368     | 0.8027           |
| 0.3629        | 10.0  | 100  | 0.6616          | {'precision': 0.7035010940919038, 'recall': 0.7948084054388134, 'f1': 0.7463726059199072, 'number': 809}       | {'precision': 0.29927007299270075, 'recall': 0.3445378151260504, 'f1': 0.3203125, 'number': 119}              | {'precision': 0.7564216120460585, 'recall': 0.8018779342723005, 'f1': 0.7784867821330903, 'number': 1065}   | 0.7055            | 0.7717         | 0.7371     | 0.8075           |
| 0.3322        | 11.0  | 110  | 0.6668          | {'precision': 0.7112068965517241, 'recall': 0.8158220024721878, 'f1': 0.75993091537133, 'number': 809}         | {'precision': 0.336283185840708, 'recall': 0.31932773109243695, 'f1': 0.32758620689655166, 'number': 119}     | {'precision': 0.783273381294964, 'recall': 0.8178403755868544, 'f1': 0.8001837390904916, 'number': 1065}    | 0.7288            | 0.7873         | 0.7569     | 0.8120           |
| 0.3188        | 12.0  | 120  | 0.6768          | {'precision': 0.7225305216426193, 'recall': 0.8046971569839307, 'f1': 0.7614035087719299, 'number': 809}       | {'precision': 0.33076923076923076, 'recall': 0.36134453781512604, 'f1': 0.34538152610441764, 'number': 119}   | {'precision': 0.7759078830823738, 'recall': 0.8225352112676056, 'f1': 0.7985414767547857, 'number': 1065}   | 0.7269            | 0.7878         | 0.7561     | 0.8119           |
| 0.2936        | 13.0  | 130  | 0.6787          | {'precision': 0.7122692725298588, 'recall': 0.8108776266996292, 'f1': 0.7583815028901735, 'number': 809}       | {'precision': 0.35384615384615387, 'recall': 0.3865546218487395, 'f1': 0.3694779116465864, 'number': 119}     | {'precision': 0.7807486631016043, 'recall': 0.8225352112676056, 'f1': 0.8010973936899862, 'number': 1065}   | 0.7262            | 0.7918         | 0.7576     | 0.8133           |
| 0.2894        | 14.0  | 140  | 0.6863          | {'precision': 0.7113289760348583, 'recall': 0.8071693448702101, 'f1': 0.7562246670526924, 'number': 809}       | {'precision': 0.34108527131782945, 'recall': 0.3697478991596639, 'f1': 0.35483870967741943, 'number': 119}    | {'precision': 0.7852650494159928, 'recall': 0.8206572769953052, 'f1': 0.8025711662075299, 'number': 1065}   | 0.7273            | 0.7883         | 0.7566     | 0.8111           |
| 0.2813        | 15.0  | 150  | 0.6866          | {'precision': 0.7130339539978094, 'recall': 0.8046971569839307, 'f1': 0.7560975609756098, 'number': 809}       | {'precision': 0.3384615384615385, 'recall': 0.3697478991596639, 'f1': 0.35341365461847385, 'number': 119}     | {'precision': 0.7763975155279503, 'recall': 0.8215962441314554, 'f1': 0.7983576642335766, 'number': 1065}   | 0.7235            | 0.7878         | 0.7543     | 0.8126           |


### Framework versions

- Transformers 4.27.1
- Pytorch 1.12.1
- Datasets 2.6.1
- Tokenizers 0.13.2