File size: 9,362 Bytes
75e07b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aafd146
 
 
 
 
 
 
 
75e07b5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aafd146
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
75e07b5
 
 
 
 
 
 
 
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
---
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.6865
- Answer: {'precision': 0.6990185387131952, 'recall': 0.792336217552534, 'f1': 0.7427578215527232, 'number': 809}
- Header: {'precision': 0.3416666666666667, 'recall': 0.3445378151260504, 'f1': 0.34309623430962344, 'number': 119}
- Question: {'precision': 0.7904085257548845, 'recall': 0.8356807511737089, 'f1': 0.8124144226380648, 'number': 1065}
- Overall Precision: 0.7268
- Overall Recall: 0.7888
- Overall F1: 0.7565
- Overall Accuracy: 0.8047

## 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.7784        | 1.0   | 10   | 1.6271          | {'precision': 0.01841620626151013, 'recall': 0.012360939431396786, 'f1': 0.014792899408284023, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                   | {'precision': 0.11462450592885376, 'recall': 0.054460093896713614, 'f1': 0.07383831954169319, 'number': 1065} | 0.0648            | 0.0341         | 0.0447     | 0.3258           |
| 1.4893        | 2.0   | 20   | 1.2865          | {'precision': 0.18452935694315004, 'recall': 0.24474660074165636, 'f1': 0.21041445270988307, 'number': 809}   | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                   | {'precision': 0.4293563579277865, 'recall': 0.5136150234741784, 'f1': 0.4677212483967507, 'number': 1065}     | 0.3174            | 0.3738         | 0.3433     | 0.5703           |
| 1.1173        | 3.0   | 30   | 0.9566          | {'precision': 0.4382845188284519, 'recall': 0.5179233621755254, 'f1': 0.4747875354107649, 'number': 809}      | {'precision': 0.045454545454545456, 'recall': 0.01680672268907563, 'f1': 0.024539877300613498, 'number': 119} | {'precision': 0.5686113393590797, 'recall': 0.6497652582159624, 'f1': 0.6064855390008765, 'number': 1065}     | 0.5020            | 0.5585         | 0.5287     | 0.6883           |
| 0.8579        | 4.0   | 40   | 0.8042          | {'precision': 0.5834932821497121, 'recall': 0.7515451174289246, 'f1': 0.6569421934089681, 'number': 809}      | {'precision': 0.18055555555555555, 'recall': 0.1092436974789916, 'f1': 0.13612565445026178, 'number': 119}    | {'precision': 0.6401480111008325, 'recall': 0.6497652582159624, 'f1': 0.6449207828518173, 'number': 1065}     | 0.5982            | 0.6588         | 0.6270     | 0.7438           |
| 0.711         | 5.0   | 50   | 0.7251          | {'precision': 0.6355140186915887, 'recall': 0.7564894932014833, 'f1': 0.6907449209932279, 'number': 809}      | {'precision': 0.25252525252525254, 'recall': 0.21008403361344538, 'f1': 0.22935779816513763, 'number': 119}   | {'precision': 0.6740237691001698, 'recall': 0.7455399061032864, 'f1': 0.7079803834150691, 'number': 1065}     | 0.6388            | 0.7180         | 0.6761     | 0.7764           |
| 0.5916        | 6.0   | 60   | 0.6914          | {'precision': 0.6471204188481675, 'recall': 0.7639060568603214, 'f1': 0.7006802721088435, 'number': 809}      | {'precision': 0.325, 'recall': 0.2184873949579832, 'f1': 0.26130653266331655, 'number': 119}                  | {'precision': 0.6792452830188679, 'recall': 0.8112676056338028, 'f1': 0.7394094993581515, 'number': 1065}     | 0.6537            | 0.7566         | 0.7014     | 0.7820           |
| 0.5253        | 7.0   | 70   | 0.6778          | {'precision': 0.6542056074766355, 'recall': 0.7787391841779975, 'f1': 0.711060948081264, 'number': 809}       | {'precision': 0.3047619047619048, 'recall': 0.2689075630252101, 'f1': 0.28571428571428575, 'number': 119}     | {'precision': 0.739247311827957, 'recall': 0.7746478873239436, 'f1': 0.7565337001375517, 'number': 1065}      | 0.6809            | 0.7461         | 0.7120     | 0.7896           |
| 0.4705        | 8.0   | 80   | 0.6586          | {'precision': 0.6659751037344398, 'recall': 0.7935723114956736, 'f1': 0.7241962774957698, 'number': 809}      | {'precision': 0.30392156862745096, 'recall': 0.2605042016806723, 'f1': 0.28054298642533937, 'number': 119}    | {'precision': 0.7257093723129837, 'recall': 0.7924882629107981, 'f1': 0.7576301615798923, 'number': 1065}     | 0.6806            | 0.7612         | 0.7186     | 0.7966           |
| 0.4214        | 9.0   | 90   | 0.6588          | {'precision': 0.6852846401718582, 'recall': 0.788627935723115, 'f1': 0.7333333333333334, 'number': 809}       | {'precision': 0.2755905511811024, 'recall': 0.29411764705882354, 'f1': 0.2845528455284553, 'number': 119}     | {'precision': 0.7396907216494846, 'recall': 0.8084507042253521, 'f1': 0.7725437415881561, 'number': 1065}     | 0.6904            | 0.7697         | 0.7279     | 0.7992           |
| 0.3765        | 10.0  | 100  | 0.6598          | {'precision': 0.6825053995680346, 'recall': 0.7812113720642769, 'f1': 0.7285302593659942, 'number': 809}      | {'precision': 0.32142857142857145, 'recall': 0.3025210084033613, 'f1': 0.3116883116883117, 'number': 119}     | {'precision': 0.7658833768494343, 'recall': 0.8262910798122066, 'f1': 0.7949412827461607, 'number': 1065}     | 0.7078            | 0.7767         | 0.7407     | 0.8013           |
| 0.3331        | 11.0  | 110  | 0.6659          | {'precision': 0.6778947368421052, 'recall': 0.796044499381953, 'f1': 0.7322342239909039, 'number': 809}       | {'precision': 0.3157894736842105, 'recall': 0.3025210084033613, 'f1': 0.30901287553648066, 'number': 119}     | {'precision': 0.772566371681416, 'recall': 0.819718309859155, 'f1': 0.7954441913439636, 'number': 1065}       | 0.7078            | 0.7792         | 0.7418     | 0.8033           |
| 0.3192        | 12.0  | 120  | 0.6782          | {'precision': 0.6885069817400644, 'recall': 0.792336217552534, 'f1': 0.7367816091954023, 'number': 809}       | {'precision': 0.3170731707317073, 'recall': 0.3277310924369748, 'f1': 0.32231404958677684, 'number': 119}     | {'precision': 0.7828418230563002, 'recall': 0.8225352112676056, 'f1': 0.8021978021978022, 'number': 1065}     | 0.7161            | 0.7807         | 0.7470     | 0.8015           |
| 0.3012        | 13.0  | 130  | 0.6835          | {'precision': 0.6929637526652452, 'recall': 0.8034610630407911, 'f1': 0.7441327990841443, 'number': 809}      | {'precision': 0.3252032520325203, 'recall': 0.33613445378151263, 'f1': 0.3305785123966942, 'number': 119}     | {'precision': 0.7847652790079717, 'recall': 0.831924882629108, 'f1': 0.8076572470373746, 'number': 1065}      | 0.7196            | 0.7908         | 0.7535     | 0.8025           |
| 0.2867        | 14.0  | 140  | 0.6851          | {'precision': 0.7003257328990228, 'recall': 0.7972805933250927, 'f1': 0.7456647398843931, 'number': 809}      | {'precision': 0.3445378151260504, 'recall': 0.3445378151260504, 'f1': 0.3445378151260504, 'number': 119}      | {'precision': 0.7884444444444444, 'recall': 0.8328638497652582, 'f1': 0.8100456621004566, 'number': 1065}     | 0.7266            | 0.7893         | 0.7566     | 0.8029           |
| 0.2827        | 15.0  | 150  | 0.6865          | {'precision': 0.6990185387131952, 'recall': 0.792336217552534, 'f1': 0.7427578215527232, 'number': 809}       | {'precision': 0.3416666666666667, 'recall': 0.3445378151260504, 'f1': 0.34309623430962344, 'number': 119}     | {'precision': 0.7904085257548845, 'recall': 0.8356807511737089, 'f1': 0.8124144226380648, 'number': 1065}     | 0.7268            | 0.7888         | 0.7565     | 0.8047           |


### Framework versions

- Transformers 4.27.4
- Pytorch 2.0.0+cu118
- Datasets 2.11.0
- Tokenizers 0.13.3