File size: 9,337 Bytes
2a2d52d
 
78d1fc9
 
 
 
 
 
 
 
2a2d52d
78d1fc9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
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.0844
- Answer: {'precision': 0.3143100511073254, 'recall': 0.4561186650185414, 'f1': 0.3721633888048412, 'number': 809}
- Header: {'precision': 0.275, 'recall': 0.18487394957983194, 'f1': 0.22110552763819097, 'number': 119}
- Question: {'precision': 0.44804716285924834, 'recall': 0.5708920187793427, 'f1': 0.5020644095788603, 'number': 1065}
- Overall Precision: 0.3826
- Overall Recall: 0.5013
- Overall F1: 0.4340
- Overall Accuracy: 0.5793

## 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: 32
- eval_batch_size: 16
- 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.7974        | 1.0   | 5    | 1.6082          | {'precision': 0.015957446808510637, 'recall': 0.003708281829419036, 'f1': 0.006018054162487462, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                 | {'precision': 0.13218390804597702, 'recall': 0.0215962441314554, 'f1': 0.037126715092816794, 'number': 1065} | 0.0718            | 0.0130         | 0.0221     | 0.2950           |
| 1.6031        | 2.0   | 10   | 1.4809          | {'precision': 0.09702549575070822, 'recall': 0.16934487021013597, 'f1': 0.12336785231877535, 'number': 809}    | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                 | {'precision': 0.2448499117127722, 'recall': 0.39061032863849765, 'f1': 0.301013024602026, 'number': 1065}    | 0.1778            | 0.2775         | 0.2167     | 0.3926           |
| 1.4415        | 3.0   | 15   | 1.3965          | {'precision': 0.15503875968992248, 'recall': 0.32138442521631644, 'f1': 0.20917135961383748, 'number': 809}    | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                 | {'precision': 0.25329341317365267, 'recall': 0.3971830985915493, 'f1': 0.3093235831809872, 'number': 1065}   | 0.2041            | 0.3427         | 0.2558     | 0.4162           |
| 1.3417        | 4.0   | 20   | 1.2882          | {'precision': 0.1925233644859813, 'recall': 0.3819530284301607, 'f1': 0.25600662800331403, 'number': 809}      | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                 | {'precision': 0.2921832884097035, 'recall': 0.5089201877934272, 'f1': 0.3712328767123288, 'number': 1065}    | 0.2457            | 0.4270         | 0.3120     | 0.4305           |
| 1.2673        | 5.0   | 25   | 1.2461          | {'precision': 0.2402555910543131, 'recall': 0.4647713226205192, 'f1': 0.3167649536647009, 'number': 809}       | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119}                                                 | {'precision': 0.3362183754993342, 'recall': 0.47417840375586856, 'f1': 0.39345539540319435, 'number': 1065}  | 0.2828            | 0.4420         | 0.3449     | 0.4621           |
| 1.1953        | 6.0   | 30   | 1.1667          | {'precision': 0.2396469789545146, 'recall': 0.4363411619283066, 'f1': 0.30937773882559155, 'number': 809}      | {'precision': 0.1038961038961039, 'recall': 0.06722689075630252, 'f1': 0.08163265306122448, 'number': 119}  | {'precision': 0.34711246200607904, 'recall': 0.536150234741784, 'f1': 0.42140221402214023, 'number': 1065}   | 0.2917            | 0.4676         | 0.3593     | 0.5048           |
| 1.1257        | 7.0   | 35   | 1.1238          | {'precision': 0.271211022480058, 'recall': 0.4622991347342398, 'f1': 0.34186471663619744, 'number': 809}       | {'precision': 0.17708333333333334, 'recall': 0.14285714285714285, 'f1': 0.15813953488372096, 'number': 119} | {'precision': 0.38812154696132595, 'recall': 0.5276995305164319, 'f1': 0.4472741742936729, 'number': 1065}   | 0.3260            | 0.4782         | 0.3877     | 0.5539           |
| 1.0703        | 8.0   | 40   | 1.0882          | {'precision': 0.2758340113913751, 'recall': 0.41903584672435107, 'f1': 0.33267909715407257, 'number': 809}     | {'precision': 0.1919191919191919, 'recall': 0.15966386554621848, 'f1': 0.17431192660550457, 'number': 119}  | {'precision': 0.4045307443365696, 'recall': 0.5868544600938967, 'f1': 0.47892720306513414, 'number': 1065}   | 0.3422            | 0.4932         | 0.4040     | 0.5809           |
| 1.0172        | 9.0   | 45   | 1.0768          | {'precision': 0.277602523659306, 'recall': 0.43510506798516685, 'f1': 0.3389504092441021, 'number': 809}       | {'precision': 0.24096385542168675, 'recall': 0.16806722689075632, 'f1': 0.19801980198019803, 'number': 119} | {'precision': 0.40967092008059103, 'recall': 0.5727699530516432, 'f1': 0.4776820673453407, 'number': 1065}   | 0.3458            | 0.4927         | 0.4064     | 0.5803           |
| 0.9713        | 10.0  | 50   | 1.0884          | {'precision': 0.3041700735895339, 'recall': 0.45982694684796044, 'f1': 0.3661417322834645, 'number': 809}      | {'precision': 0.2631578947368421, 'recall': 0.16806722689075632, 'f1': 0.20512820512820512, 'number': 119}  | {'precision': 0.4506024096385542, 'recall': 0.5267605633802817, 'f1': 0.4857142857142857, 'number': 1065}    | 0.3746            | 0.4782         | 0.4201     | 0.5781           |
| 0.9434        | 11.0  | 55   | 1.1220          | {'precision': 0.29082426127527217, 'recall': 0.4622991347342398, 'f1': 0.35704057279236273, 'number': 809}     | {'precision': 0.2727272727272727, 'recall': 0.17647058823529413, 'f1': 0.21428571428571427, 'number': 119}  | {'precision': 0.4404934687953556, 'recall': 0.5699530516431925, 'f1': 0.4969300040933278, 'number': 1065}    | 0.3656            | 0.5028         | 0.4233     | 0.5669           |
| 0.9288        | 12.0  | 60   | 1.0876          | {'precision': 0.298372513562387, 'recall': 0.4079110012360939, 'f1': 0.34464751958224543, 'number': 809}       | {'precision': 0.23958333333333334, 'recall': 0.19327731092436976, 'f1': 0.21395348837209302, 'number': 119} | {'precision': 0.4299933642999336, 'recall': 0.6084507042253521, 'f1': 0.5038880248833593, 'number': 1065}    | 0.3695            | 0.5023         | 0.4258     | 0.5784           |
| 0.9043        | 13.0  | 65   | 1.1185          | {'precision': 0.31703204047217537, 'recall': 0.4647713226205192, 'f1': 0.3769423558897243, 'number': 809}      | {'precision': 0.2894736842105263, 'recall': 0.18487394957983194, 'f1': 0.22564102564102564, 'number': 119}  | {'precision': 0.4605263157894737, 'recall': 0.5258215962441315, 'f1': 0.49101271372205174, 'number': 1065}   | 0.3866            | 0.4807         | 0.4285     | 0.5679           |
| 0.8884        | 14.0  | 70   | 1.1097          | {'precision': 0.31260364842454397, 'recall': 0.46600741656365885, 'f1': 0.37419354838709684, 'number': 809}    | {'precision': 0.29333333333333333, 'recall': 0.18487394957983194, 'f1': 0.2268041237113402, 'number': 119}  | {'precision': 0.4597791798107255, 'recall': 0.5474178403755868, 'f1': 0.4997856836690956, 'number': 1065}    | 0.3852            | 0.4927         | 0.4324     | 0.5710           |
| 0.8759        | 15.0  | 75   | 1.0844          | {'precision': 0.3143100511073254, 'recall': 0.4561186650185414, 'f1': 0.3721633888048412, 'number': 809}       | {'precision': 0.275, 'recall': 0.18487394957983194, 'f1': 0.22110552763819097, 'number': 119}               | {'precision': 0.44804716285924834, 'recall': 0.5708920187793427, 'f1': 0.5020644095788603, 'number': 1065}   | 0.3826            | 0.5013         | 0.4340     | 0.5793           |


### Framework versions

- Transformers 4.33.0
- Pytorch 2.0.1+cu118
- Datasets 2.14.5
- Tokenizers 0.13.3