File size: 9,419 Bytes
90076d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e89b1b
 
 
 
 
 
 
 
90076d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3e89b1b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90076d7
 
 
 
 
 
 
 
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
80
81
82
---
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: 0.6788
- Answer: {'precision': 0.7050592034445641, 'recall': 0.8096415327564895, 'f1': 0.7537399309551209, 'number': 809}
- Header: {'precision': 0.3014705882352941, 'recall': 0.3445378151260504, 'f1': 0.3215686274509804, 'number': 119}
- Question: {'precision': 0.7795414462081128, 'recall': 0.8300469483568075, 'f1': 0.8040018190086403, 'number': 1065}
- Overall Precision: 0.7185
- Overall Recall: 0.7928
- Overall F1: 0.7538
- Overall Accuracy: 0.8119

## 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.8004        | 1.0   | 10   | 1.6077          | {'precision': 0.013595166163141994, 'recall': 0.011124845488257108, 'f1': 0.012236573759347382, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                    | {'precision': 0.24475524475524477, 'recall': 0.13145539906103287, 'f1': 0.1710445937690898, 'number': 1065} | 0.1207            | 0.0748         | 0.0923     | 0.3510           |
| 1.4746        | 2.0   | 20   | 1.2888          | {'precision': 0.1705521472392638, 'recall': 0.17181705809641531, 'f1': 0.1711822660098522, 'number': 809}      | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                    | {'precision': 0.4061776061776062, 'recall': 0.49389671361502346, 'f1': 0.4457627118644068, 'number': 1065}  | 0.3152            | 0.3337         | 0.3242     | 0.5672           |
| 1.1291        | 3.0   | 30   | 0.9811          | {'precision': 0.5127931769722814, 'recall': 0.5945611866501854, 'f1': 0.5506582713222669, 'number': 809}       | {'precision': 0.027777777777777776, 'recall': 0.008403361344537815, 'f1': 0.012903225806451613, 'number': 119} | {'precision': 0.5457317073170732, 'recall': 0.672300469483568, 'f1': 0.6024400504838031, 'number': 1065}    | 0.5241            | 0.6011         | 0.5599     | 0.7097           |
| 0.86          | 4.0   | 40   | 0.8044          | {'precision': 0.5934489402697495, 'recall': 0.761433868974042, 'f1': 0.6670276123443422, 'number': 809}        | {'precision': 0.18333333333333332, 'recall': 0.09243697478991597, 'f1': 0.12290502793296088, 'number': 119}    | {'precision': 0.6554694229112834, 'recall': 0.7145539906103286, 'f1': 0.683737646001797, 'number': 1065}    | 0.6144            | 0.6964         | 0.6529     | 0.7534           |
| 0.6873        | 5.0   | 50   | 0.7263          | {'precision': 0.6666666666666666, 'recall': 0.7416563658838071, 'f1': 0.7021650087770627, 'number': 809}       | {'precision': 0.2777777777777778, 'recall': 0.21008403361344538, 'f1': 0.23923444976076552, 'number': 119}     | {'precision': 0.6648648648648648, 'recall': 0.8084507042253521, 'f1': 0.7296610169491525, 'number': 1065}   | 0.6503            | 0.7456         | 0.6947     | 0.7838           |
| 0.5806        | 6.0   | 60   | 0.6815          | {'precision': 0.6598569969356486, 'recall': 0.7985166872682324, 'f1': 0.7225950782997763, 'number': 809}       | {'precision': 0.25806451612903225, 'recall': 0.20168067226890757, 'f1': 0.22641509433962265, 'number': 119}    | {'precision': 0.7074829931972789, 'recall': 0.7812206572769953, 'f1': 0.7425256581883088, 'number': 1065}   | 0.6681            | 0.7536         | 0.7083     | 0.7901           |
| 0.5036        | 7.0   | 70   | 0.6550          | {'precision': 0.6694473409801877, 'recall': 0.7935723114956736, 'f1': 0.7262443438914026, 'number': 809}       | {'precision': 0.23076923076923078, 'recall': 0.226890756302521, 'f1': 0.22881355932203387, 'number': 119}      | {'precision': 0.7226962457337884, 'recall': 0.7953051643192488, 'f1': 0.7572641931157801, 'number': 1065}   | 0.6744            | 0.7607         | 0.7149     | 0.7975           |
| 0.4447        | 8.0   | 80   | 0.6628          | {'precision': 0.67570385818561, 'recall': 0.8009888751545118, 'f1': 0.7330316742081447, 'number': 809}         | {'precision': 0.24390243902439024, 'recall': 0.25210084033613445, 'f1': 0.24793388429752067, 'number': 119}    | {'precision': 0.7413494809688581, 'recall': 0.8046948356807512, 'f1': 0.7717244484466456, 'number': 1065}   | 0.6859            | 0.7702         | 0.7256     | 0.7973           |
| 0.392         | 9.0   | 90   | 0.6465          | {'precision': 0.6974248927038627, 'recall': 0.8034610630407911, 'f1': 0.7466973004020677, 'number': 809}       | {'precision': 0.31451612903225806, 'recall': 0.3277310924369748, 'f1': 0.32098765432098764, 'number': 119}     | {'precision': 0.7433476394849785, 'recall': 0.8131455399061033, 'f1': 0.7766816143497759, 'number': 1065}   | 0.7001            | 0.7802         | 0.7380     | 0.8060           |
| 0.3844        | 10.0  | 100  | 0.6466          | {'precision': 0.6900212314225053, 'recall': 0.8034610630407911, 'f1': 0.7424328954882924, 'number': 809}       | {'precision': 0.28440366972477066, 'recall': 0.2605042016806723, 'f1': 0.2719298245614035, 'number': 119}      | {'precision': 0.7697022767075307, 'recall': 0.8253521126760563, 'f1': 0.7965564114182148, 'number': 1065}   | 0.7114            | 0.7827         | 0.7453     | 0.8170           |
| 0.323         | 11.0  | 110  | 0.6688          | {'precision': 0.7047930283224401, 'recall': 0.799752781211372, 'f1': 0.7492762015055008, 'number': 809}        | {'precision': 0.2808219178082192, 'recall': 0.3445378151260504, 'f1': 0.309433962264151, 'number': 119}        | {'precision': 0.7660869565217391, 'recall': 0.8272300469483568, 'f1': 0.7954853273137698, 'number': 1065}   | 0.7087            | 0.7873         | 0.7459     | 0.8081           |
| 0.3034        | 12.0  | 120  | 0.6660          | {'precision': 0.7082429501084598, 'recall': 0.8071693448702101, 'f1': 0.754477180820335, 'number': 809}        | {'precision': 0.3559322033898305, 'recall': 0.35294117647058826, 'f1': 0.35443037974683544, 'number': 119}     | {'precision': 0.7871956717763751, 'recall': 0.819718309859155, 'f1': 0.8031278748850045, 'number': 1065}    | 0.7296            | 0.7868         | 0.7571     | 0.8138           |
| 0.2884        | 13.0  | 130  | 0.6788          | {'precision': 0.7159956474428727, 'recall': 0.8133498145859085, 'f1': 0.7615740740740741, 'number': 809}       | {'precision': 0.328125, 'recall': 0.35294117647058826, 'f1': 0.340080971659919, 'number': 119}                 | {'precision': 0.7803365810451727, 'recall': 0.8272300469483568, 'f1': 0.8030993618960802, 'number': 1065}   | 0.7266            | 0.7933         | 0.7585     | 0.8110           |
| 0.2674        | 14.0  | 140  | 0.6781          | {'precision': 0.7114967462039046, 'recall': 0.8108776266996292, 'f1': 0.7579433853264009, 'number': 809}       | {'precision': 0.30597014925373134, 'recall': 0.3445378151260504, 'f1': 0.3241106719367589, 'number': 119}      | {'precision': 0.7848888888888889, 'recall': 0.8291079812206573, 'f1': 0.8063926940639269, 'number': 1065}   | 0.7244            | 0.7928         | 0.7571     | 0.8133           |
| 0.271         | 15.0  | 150  | 0.6788          | {'precision': 0.7050592034445641, 'recall': 0.8096415327564895, 'f1': 0.7537399309551209, 'number': 809}       | {'precision': 0.3014705882352941, 'recall': 0.3445378151260504, 'f1': 0.3215686274509804, 'number': 119}       | {'precision': 0.7795414462081128, 'recall': 0.8300469483568075, 'f1': 0.8040018190086403, 'number': 1065}   | 0.7185            | 0.7928         | 0.7538     | 0.8119           |


### Framework versions

- Transformers 4.41.1
- Pytorch 2.3.0+cu121
- Datasets 2.19.1
- Tokenizers 0.19.1