sreejith8100
commited on
Commit
•
336ff01
1
Parent(s):
00d16da
End of training
Browse files- README.md +79 -0
- added_tokens.json +7 -0
- preprocessor_config.json +14 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +80 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: microsoft/layoutlm-base-uncased
|
3 |
+
tags:
|
4 |
+
- generated_from_trainer
|
5 |
+
datasets:
|
6 |
+
- funsd
|
7 |
+
model-index:
|
8 |
+
- name: layoutlm-funsd
|
9 |
+
results: []
|
10 |
+
---
|
11 |
+
|
12 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
13 |
+
should probably proofread and complete it, then remove this comment. -->
|
14 |
+
|
15 |
+
# layoutlm-funsd
|
16 |
+
|
17 |
+
This model is a fine-tuned version of [microsoft/layoutlm-base-uncased](https://huggingface.co/microsoft/layoutlm-base-uncased) on the funsd dataset.
|
18 |
+
It achieves the following results on the evaluation set:
|
19 |
+
- Loss: 0.6726
|
20 |
+
- Answer: {'precision': 0.71960569550931, 'recall': 0.8121137206427689, 'f1': 0.7630662020905924, 'number': 809}
|
21 |
+
- Header: {'precision': 0.3442622950819672, 'recall': 0.35294117647058826, 'f1': 0.3485477178423237, 'number': 119}
|
22 |
+
- Question: {'precision': 0.773936170212766, 'recall': 0.819718309859155, 'f1': 0.796169630642955, 'number': 1065}
|
23 |
+
- Overall Precision: 0.7268
|
24 |
+
- Overall Recall: 0.7888
|
25 |
+
- Overall F1: 0.7565
|
26 |
+
- Overall Accuracy: 0.8038
|
27 |
+
|
28 |
+
## Model description
|
29 |
+
|
30 |
+
More information needed
|
31 |
+
|
32 |
+
## Intended uses & limitations
|
33 |
+
|
34 |
+
More information needed
|
35 |
+
|
36 |
+
## Training and evaluation data
|
37 |
+
|
38 |
+
More information needed
|
39 |
+
|
40 |
+
## Training procedure
|
41 |
+
|
42 |
+
### Training hyperparameters
|
43 |
+
|
44 |
+
The following hyperparameters were used during training:
|
45 |
+
- learning_rate: 3e-05
|
46 |
+
- train_batch_size: 16
|
47 |
+
- eval_batch_size: 8
|
48 |
+
- seed: 42
|
49 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
50 |
+
- lr_scheduler_type: linear
|
51 |
+
- num_epochs: 15
|
52 |
+
|
53 |
+
### Training results
|
54 |
+
|
55 |
+
| Training Loss | Epoch | Step | Validation Loss | Answer | Header | Question | Overall Precision | Overall Recall | Overall F1 | Overall Accuracy |
|
56 |
+
|:-------------:|:-----:|:----:|:---------------:|:-----------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------:|:-----------------:|:--------------:|:----------:|:----------------:|
|
57 |
+
| 1.7892 | 1.0 | 10 | 1.5673 | {'precision': 0.016726403823178016, 'recall': 0.0173053152039555, 'f1': 0.01701093560145808, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.2742155525238745, 'recall': 0.18873239436619718, 'f1': 0.22358175750834258, 'number': 1065} | 0.1369 | 0.1079 | 0.1207 | 0.3817 |
|
58 |
+
| 1.4288 | 2.0 | 20 | 1.2189 | {'precision': 0.21368421052631578, 'recall': 0.25092707045735474, 'f1': 0.23081296191017622, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.40669856459330145, 'recall': 0.6384976525821596, 'f1': 0.49689440993788825, 'number': 1065} | 0.3368 | 0.4431 | 0.3827 | 0.6054 |
|
59 |
+
| 1.0674 | 3.0 | 30 | 0.9170 | {'precision': 0.48810754912099275, 'recall': 0.5834363411619283, 'f1': 0.5315315315315315, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.5930232558139535, 'recall': 0.7183098591549296, 'f1': 0.6496815286624205, 'number': 1065} | 0.5447 | 0.6207 | 0.5802 | 0.7133 |
|
60 |
+
| 0.8227 | 4.0 | 40 | 0.7915 | {'precision': 0.5774518790100825, 'recall': 0.7787391841779975, 'f1': 0.6631578947368422, 'number': 809} | {'precision': 0.08695652173913043, 'recall': 0.03361344537815126, 'f1': 0.048484848484848485, 'number': 119} | {'precision': 0.6742616033755274, 'recall': 0.7502347417840376, 'f1': 0.7102222222222223, 'number': 1065} | 0.6171 | 0.7190 | 0.6642 | 0.7554 |
|
61 |
+
| 0.6799 | 5.0 | 50 | 0.7317 | {'precision': 0.6394485683987274, 'recall': 0.7453646477132262, 'f1': 0.6883561643835616, 'number': 809} | {'precision': 0.13636363636363635, 'recall': 0.07563025210084033, 'f1': 0.09729729729729729, 'number': 119} | {'precision': 0.7052810902896082, 'recall': 0.7774647887323943, 'f1': 0.7396158999553373, 'number': 1065} | 0.6596 | 0.7225 | 0.6897 | 0.7768 |
|
62 |
+
| 0.5807 | 6.0 | 60 | 0.6756 | {'precision': 0.6624338624338625, 'recall': 0.7737948084054388, 'f1': 0.7137970353477766, 'number': 809} | {'precision': 0.1744186046511628, 'recall': 0.12605042016806722, 'f1': 0.14634146341463414, 'number': 119} | {'precision': 0.7015748031496063, 'recall': 0.8366197183098592, 'f1': 0.7631691648822269, 'number': 1065} | 0.6658 | 0.7687 | 0.7136 | 0.7978 |
|
63 |
+
| 0.5033 | 7.0 | 70 | 0.6534 | {'precision': 0.6901408450704225, 'recall': 0.7873918417799752, 'f1': 0.7355658198614318, 'number': 809} | {'precision': 0.21, 'recall': 0.17647058823529413, 'f1': 0.19178082191780824, 'number': 119} | {'precision': 0.7219917012448133, 'recall': 0.8169014084507042, 'f1': 0.7665198237885463, 'number': 1065} | 0.6858 | 0.7667 | 0.7240 | 0.8036 |
|
64 |
+
| 0.4565 | 8.0 | 80 | 0.6414 | {'precision': 0.6953713670613563, 'recall': 0.7985166872682324, 'f1': 0.7433831990794016, 'number': 809} | {'precision': 0.3055555555555556, 'recall': 0.2773109243697479, 'f1': 0.2907488986784141, 'number': 119} | {'precision': 0.7297748123436196, 'recall': 0.8215962441314554, 'f1': 0.7729681978798587, 'number': 1065} | 0.6950 | 0.7797 | 0.7349 | 0.8047 |
|
65 |
+
| 0.3992 | 9.0 | 90 | 0.6539 | {'precision': 0.6824742268041237, 'recall': 0.8182941903584673, 'f1': 0.7442383361439011, 'number': 809} | {'precision': 0.25663716814159293, 'recall': 0.24369747899159663, 'f1': 0.25, 'number': 119} | {'precision': 0.7504317789291882, 'recall': 0.815962441314554, 'f1': 0.7818263607737291, 'number': 1065} | 0.6961 | 0.7827 | 0.7369 | 0.7994 |
|
66 |
+
| 0.3623 | 10.0 | 100 | 0.6492 | {'precision': 0.710239651416122, 'recall': 0.8059332509270705, 'f1': 0.755066589461494, 'number': 809} | {'precision': 0.34710743801652894, 'recall': 0.35294117647058826, 'f1': 0.35000000000000003, 'number': 119} | {'precision': 0.7538200339558574, 'recall': 0.8338028169014085, 'f1': 0.7917967008470798, 'number': 1065} | 0.7136 | 0.7938 | 0.7515 | 0.8082 |
|
67 |
+
| 0.3282 | 11.0 | 110 | 0.6552 | {'precision': 0.7079261672095548, 'recall': 0.8059332509270705, 'f1': 0.753757225433526, 'number': 809} | {'precision': 0.35537190082644626, 'recall': 0.36134453781512604, 'f1': 0.3583333333333333, 'number': 119} | {'precision': 0.7664618086040387, 'recall': 0.819718309859155, 'f1': 0.7921960072595282, 'number': 1065} | 0.7189 | 0.7868 | 0.7513 | 0.8090 |
|
68 |
+
| 0.3131 | 12.0 | 120 | 0.6544 | {'precision': 0.7166123778501629, 'recall': 0.8158220024721878, 'f1': 0.7630057803468208, 'number': 809} | {'precision': 0.35398230088495575, 'recall': 0.33613445378151263, 'f1': 0.3448275862068966, 'number': 119} | {'precision': 0.7619461337966985, 'recall': 0.8234741784037559, 'f1': 0.7915162454873647, 'number': 1065} | 0.7217 | 0.7913 | 0.7549 | 0.8091 |
|
69 |
+
| 0.2983 | 13.0 | 130 | 0.6732 | {'precision': 0.721058434399118, 'recall': 0.8084054388133498, 'f1': 0.7622377622377622, 'number': 809} | {'precision': 0.3629032258064516, 'recall': 0.37815126050420167, 'f1': 0.37037037037037035, 'number': 119} | {'precision': 0.7795698924731183, 'recall': 0.8169014084507042, 'f1': 0.797799174690509, 'number': 1065} | 0.7308 | 0.7873 | 0.7580 | 0.8035 |
|
70 |
+
| 0.2751 | 14.0 | 140 | 0.6745 | {'precision': 0.7142857142857143, 'recall': 0.8158220024721878, 'f1': 0.7616849394114252, 'number': 809} | {'precision': 0.3416666666666667, 'recall': 0.3445378151260504, 'f1': 0.34309623430962344, 'number': 119} | {'precision': 0.7723649247121346, 'recall': 0.8187793427230047, 'f1': 0.7948951686417502, 'number': 1065} | 0.7239 | 0.7893 | 0.7552 | 0.8041 |
|
71 |
+
| 0.2697 | 15.0 | 150 | 0.6726 | {'precision': 0.71960569550931, 'recall': 0.8121137206427689, 'f1': 0.7630662020905924, 'number': 809} | {'precision': 0.3442622950819672, 'recall': 0.35294117647058826, 'f1': 0.3485477178423237, 'number': 119} | {'precision': 0.773936170212766, 'recall': 0.819718309859155, 'f1': 0.796169630642955, 'number': 1065} | 0.7268 | 0.7888 | 0.7565 | 0.8038 |
|
72 |
+
|
73 |
+
|
74 |
+
### Framework versions
|
75 |
+
|
76 |
+
- Transformers 4.34.0
|
77 |
+
- Pytorch 2.0.1+cu118
|
78 |
+
- Datasets 2.14.5
|
79 |
+
- Tokenizers 0.14.1
|
added_tokens.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"[CLS]": 101,
|
3 |
+
"[MASK]": 103,
|
4 |
+
"[PAD]": 0,
|
5 |
+
"[SEP]": 102,
|
6 |
+
"[UNK]": 100
|
7 |
+
}
|
preprocessor_config.json
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"apply_ocr": true,
|
3 |
+
"do_resize": true,
|
4 |
+
"feature_extractor_type": "LayoutLMv2FeatureExtractor",
|
5 |
+
"image_processor_type": "LayoutLMv2ImageProcessor",
|
6 |
+
"ocr_lang": null,
|
7 |
+
"processor_class": "LayoutLMv2Processor",
|
8 |
+
"resample": 2,
|
9 |
+
"size": {
|
10 |
+
"height": 224,
|
11 |
+
"width": 224
|
12 |
+
},
|
13 |
+
"tesseract_config": ""
|
14 |
+
}
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"100": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"101": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"102": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"103": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"additional_special_tokens": [],
|
45 |
+
"apply_ocr": false,
|
46 |
+
"clean_up_tokenization_spaces": true,
|
47 |
+
"cls_token": "[CLS]",
|
48 |
+
"cls_token_box": [
|
49 |
+
0,
|
50 |
+
0,
|
51 |
+
0,
|
52 |
+
0
|
53 |
+
],
|
54 |
+
"do_basic_tokenize": true,
|
55 |
+
"do_lower_case": true,
|
56 |
+
"mask_token": "[MASK]",
|
57 |
+
"model_max_length": 512,
|
58 |
+
"never_split": null,
|
59 |
+
"only_label_first_subword": true,
|
60 |
+
"pad_token": "[PAD]",
|
61 |
+
"pad_token_box": [
|
62 |
+
0,
|
63 |
+
0,
|
64 |
+
0,
|
65 |
+
0
|
66 |
+
],
|
67 |
+
"pad_token_label": -100,
|
68 |
+
"processor_class": "LayoutLMv2Processor",
|
69 |
+
"sep_token": "[SEP]",
|
70 |
+
"sep_token_box": [
|
71 |
+
1000,
|
72 |
+
1000,
|
73 |
+
1000,
|
74 |
+
1000
|
75 |
+
],
|
76 |
+
"strip_accents": null,
|
77 |
+
"tokenize_chinese_chars": true,
|
78 |
+
"tokenizer_class": "LayoutLMv2Tokenizer",
|
79 |
+
"unk_token": "[UNK]"
|
80 |
+
}
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|