Narsil HF staff nielsr HF staff commited on
Commit
ad0403e
0 Parent(s):

Duplicate from nielsr/layoutlmv3-finetuned-funsd

Browse files

Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>

.gitattributes ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ftz filter=lfs diff=lfs merge=lfs -text
6
+ *.gz filter=lfs diff=lfs merge=lfs -text
7
+ *.h5 filter=lfs diff=lfs merge=lfs -text
8
+ *.joblib filter=lfs diff=lfs merge=lfs -text
9
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
10
+ *.model filter=lfs diff=lfs merge=lfs -text
11
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
12
+ *.onnx filter=lfs diff=lfs merge=lfs -text
13
+ *.ot filter=lfs diff=lfs merge=lfs -text
14
+ *.parquet filter=lfs diff=lfs merge=lfs -text
15
+ *.pb filter=lfs diff=lfs merge=lfs -text
16
+ *.pt filter=lfs diff=lfs merge=lfs -text
17
+ *.pth filter=lfs diff=lfs merge=lfs -text
18
+ *.rar filter=lfs diff=lfs merge=lfs -text
19
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
20
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
21
+ *.tflite filter=lfs diff=lfs merge=lfs -text
22
+ *.tgz filter=lfs diff=lfs merge=lfs -text
23
+ *.wasm filter=lfs diff=lfs merge=lfs -text
24
+ *.xz filter=lfs diff=lfs merge=lfs -text
25
+ *.zip filter=lfs diff=lfs merge=lfs -text
26
+ *.zstandard filter=lfs diff=lfs merge=lfs -text
27
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ checkpoint-*/
README.md ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - generated_from_trainer
4
+ datasets:
5
+ - nielsr/funsd-layoutlmv3
6
+ metrics:
7
+ - precision
8
+ - recall
9
+ - f1
10
+ - accuracy
11
+ model-index:
12
+ - name: layoutlmv3-finetuned-funsd
13
+ results:
14
+ - task:
15
+ name: Token Classification
16
+ type: token-classification
17
+ dataset:
18
+ name: nielsr/funsd-layoutlmv3
19
+ type: nielsr/funsd-layoutlmv3
20
+ args: funsd
21
+ metrics:
22
+ - name: Precision
23
+ type: precision
24
+ value: 0.9026198714780029
25
+ - name: Recall
26
+ type: recall
27
+ value: 0.913
28
+ - name: F1
29
+ type: f1
30
+ value: 0.9077802634849614
31
+ - name: Accuracy
32
+ type: accuracy
33
+ value: 0.8330271015158475
34
+ duplicated_from: nielsr/layoutlmv3-finetuned-funsd
35
+ ---
36
+
37
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
38
+ should probably proofread and complete it, then remove this comment. -->
39
+
40
+ # layoutlmv3-finetuned-funsd
41
+
42
+ This model is a fine-tuned version of [microsoft/layoutlmv3-base](https://huggingface.co/microsoft/layoutlmv3-base) on the nielsr/funsd-layoutlmv3 dataset.
43
+ It achieves the following results on the evaluation set:
44
+ - Loss: 1.1164
45
+ - Precision: 0.9026
46
+ - Recall: 0.913
47
+ - F1: 0.9078
48
+ - Accuracy: 0.8330
49
+
50
+ The script for training can be found here: https://github.com/huggingface/transformers/tree/main/examples/research_projects/layoutlmv3
51
+
52
+ ## Model description
53
+
54
+ More information needed
55
+
56
+ ## Intended uses & limitations
57
+
58
+ More information needed
59
+
60
+ ## Training and evaluation data
61
+
62
+ More information needed
63
+
64
+ ## Training procedure
65
+
66
+ ### Training hyperparameters
67
+
68
+ The following hyperparameters were used during training:
69
+ - learning_rate: 1e-05
70
+ - train_batch_size: 16
71
+ - eval_batch_size: 16
72
+ - seed: 42
73
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
74
+ - lr_scheduler_type: linear
75
+ - training_steps: 1000
76
+
77
+ ### Training results
78
+
79
+ | Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
80
+ |:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|:--------:|
81
+ | No log | 10.0 | 100 | 0.5238 | 0.8366 | 0.886 | 0.8606 | 0.8410 |
82
+ | No log | 20.0 | 200 | 0.6930 | 0.8751 | 0.8965 | 0.8857 | 0.8322 |
83
+ | No log | 30.0 | 300 | 0.7784 | 0.8902 | 0.908 | 0.8990 | 0.8414 |
84
+ | No log | 40.0 | 400 | 0.9056 | 0.8916 | 0.905 | 0.8983 | 0.8364 |
85
+ | 0.2429 | 50.0 | 500 | 1.0016 | 0.8954 | 0.9075 | 0.9014 | 0.8298 |
86
+ | 0.2429 | 60.0 | 600 | 1.0097 | 0.8899 | 0.897 | 0.8934 | 0.8294 |
87
+ | 0.2429 | 70.0 | 700 | 1.0722 | 0.9035 | 0.9085 | 0.9060 | 0.8315 |
88
+ | 0.2429 | 80.0 | 800 | 1.0884 | 0.8905 | 0.9105 | 0.9004 | 0.8269 |
89
+ | 0.2429 | 90.0 | 900 | 1.1292 | 0.8938 | 0.909 | 0.9013 | 0.8279 |
90
+ | 0.0098 | 100.0 | 1000 | 1.1164 | 0.9026 | 0.913 | 0.9078 | 0.8330 |
91
+
92
+
93
+ ### Framework versions
94
+
95
+ - Transformers 4.19.0.dev0
96
+ - Pytorch 1.11.0+cu113
97
+ - Datasets 2.0.0
98
+ - Tokenizers 0.11.6
all_results.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 100.0,
3
+ "eval_accuracy": 0.8330271015158475,
4
+ "eval_f1": 0.9077802634849614,
5
+ "eval_loss": 1.1164220571517944,
6
+ "eval_precision": 0.9026198714780029,
7
+ "eval_recall": 0.913,
8
+ "eval_runtime": 4.5243,
9
+ "eval_samples": 54,
10
+ "eval_samples_per_second": 11.936,
11
+ "eval_steps_per_second": 0.884,
12
+ "train_loss": 0.12633917331695557,
13
+ "train_runtime": 1653.606,
14
+ "train_samples": 150,
15
+ "train_samples_per_second": 9.676,
16
+ "train_steps_per_second": 0.605
17
+ }
config.json ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/layoutlmv3-base",
3
+ "architectures": [
4
+ "LayoutLMv3ForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "bos_token_id": 0,
8
+ "classifier_dropout": null,
9
+ "coordinate_size": 128,
10
+ "eos_token_id": 2,
11
+ "finetuning_task": "ner",
12
+ "has_relative_attention_bias": true,
13
+ "has_spatial_attention_bias": true,
14
+ "hidden_act": "gelu",
15
+ "hidden_dropout_prob": 0.1,
16
+ "hidden_size": 768,
17
+ "id2label": {
18
+ "0": "O",
19
+ "1": "B-HEADER",
20
+ "2": "I-HEADER",
21
+ "3": "B-QUESTION",
22
+ "4": "I-QUESTION",
23
+ "5": "B-ANSWER",
24
+ "6": "I-ANSWER"
25
+ },
26
+ "initializer_range": 0.02,
27
+ "input_size": 224,
28
+ "intermediate_size": 3072,
29
+ "label2id": {
30
+ "B-ANSWER": 5,
31
+ "B-HEADER": 1,
32
+ "B-QUESTION": 3,
33
+ "I-ANSWER": 6,
34
+ "I-HEADER": 2,
35
+ "I-QUESTION": 4,
36
+ "O": 0
37
+ },
38
+ "layer_norm_eps": 1e-05,
39
+ "max_2d_position_embeddings": 1024,
40
+ "max_position_embeddings": 514,
41
+ "max_rel_2d_pos": 256,
42
+ "max_rel_pos": 128,
43
+ "model_type": "layoutlmv3",
44
+ "num_attention_heads": 12,
45
+ "num_hidden_layers": 12,
46
+ "pad_token_id": 1,
47
+ "patch_size": 16,
48
+ "rel_2d_pos_bins": 64,
49
+ "rel_pos_bins": 32,
50
+ "second_input_size": 112,
51
+ "shape_size": 128,
52
+ "torch_dtype": "float32",
53
+ "transformers_version": "4.19.0.dev0",
54
+ "type_vocab_size": 1,
55
+ "visual_embed": true,
56
+ "vocab_size": 50265
57
+ }
emissions.csv ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ timestamp,experiment_id,project_name,duration,emissions,energy_consumed,country_name,country_iso_code,region,on_cloud,cloud_provider,cloud_region
2
+ 2022-05-02T16:54:11,8eebd56a-eb8f-4892-9c80-7ac739a77655,codecarbon,1653.8408570289612,0.028152538025484036,0.1337565669441834,United States,USA,new york,N,,
eval_results.json ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 100.0,
3
+ "eval_accuracy": 0.8330271015158475,
4
+ "eval_f1": 0.9077802634849614,
5
+ "eval_loss": 1.1164220571517944,
6
+ "eval_precision": 0.9026198714780029,
7
+ "eval_recall": 0.913,
8
+ "eval_runtime": 4.5243,
9
+ "eval_samples": 54,
10
+ "eval_samples_per_second": 11.936,
11
+ "eval_steps_per_second": 0.884
12
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "apply_ocr": true,
3
+ "do_normalize": true,
4
+ "do_resize": true,
5
+ "feature_extractor_type": "LayoutLMv3FeatureExtractor",
6
+ "image_mean": [
7
+ 0.5,
8
+ 0.5,
9
+ 0.5
10
+ ],
11
+ "image_std": [
12
+ 0.5,
13
+ 0.5,
14
+ 0.5
15
+ ],
16
+ "ocr_lang": null,
17
+ "resample": 2,
18
+ "size": 224
19
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fab7ab7a858117bc58a9431474bb8010396a330136730dd1eed4c1ceed68e44e
3
+ size 501405907
runs/May02_16-26-18_brutasse/1651508794.4462817/events.out.tfevents.1651508794.brutasse.9557.1 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7494fd0a658cd16ee6cee37961f02e3e761b1db027032e26cc2e82d2ef1a46c1
3
+ size 5031
runs/May02_16-26-18_brutasse/events.out.tfevents.1651508794.brutasse.9557.0 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f01c4f3993c8a55cd4b3b333bdb55a66209afd9c260cceebd171b182c0c6b3d8
3
+ size 9489
runs/May02_16-26-18_brutasse/events.out.tfevents.1651510649.brutasse.9557.2 ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb2ed9c23e5973706e0aaa2a59ef0f1cfcfedaa1baa2552e05455bc0bebe9eaf
3
+ size 512
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"bos_token": "<s>", "eos_token": "</s>", "unk_token": "<unk>", "sep_token": "</s>", "pad_token": "<pad>", "cls_token": "<s>", "mask_token": {"content": "<mask>", "single_word": false, "lstrip": true, "rstrip": false, "normalized": false}}
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"errors": "replace", "bos_token": "<s>", "eos_token": "</s>", "sep_token": "</s>", "cls_token": "<s>", "unk_token": "<unk>", "pad_token": "<pad>", "mask_token": "<mask>", "add_prefix_space": true, "trim_offsets": true, "model_max_length": 512, "special_tokens_map_file": null, "name_or_path": "roberta-base", "tokenizer_class": "RobertaTokenizer"}
train_results.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "epoch": 100.0,
3
+ "train_loss": 0.12633917331695557,
4
+ "train_runtime": 1653.606,
5
+ "train_samples": 150,
6
+ "train_samples_per_second": 9.676,
7
+ "train_steps_per_second": 0.605
8
+ }
trainer_state.json ADDED
@@ -0,0 +1,157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": 0.9077802634849614,
3
+ "best_model_checkpoint": "layoutlmv3-test/checkpoint-1000",
4
+ "epoch": 100.0,
5
+ "global_step": 1000,
6
+ "is_hyper_param_search": false,
7
+ "is_local_process_zero": true,
8
+ "is_world_process_zero": true,
9
+ "log_history": [
10
+ {
11
+ "epoch": 10.0,
12
+ "eval_accuracy": 0.8409508497932935,
13
+ "eval_f1": 0.8606119475473532,
14
+ "eval_loss": 0.5238379240036011,
15
+ "eval_precision": 0.8366383380547686,
16
+ "eval_recall": 0.886,
17
+ "eval_runtime": 4.4875,
18
+ "eval_samples_per_second": 12.033,
19
+ "eval_steps_per_second": 0.891,
20
+ "step": 100
21
+ },
22
+ {
23
+ "epoch": 20.0,
24
+ "eval_accuracy": 0.8322232429949472,
25
+ "eval_f1": 0.8856507779698691,
26
+ "eval_loss": 0.6930040717124939,
27
+ "eval_precision": 0.8750610053684724,
28
+ "eval_recall": 0.8965,
29
+ "eval_runtime": 4.6295,
30
+ "eval_samples_per_second": 11.664,
31
+ "eval_steps_per_second": 0.864,
32
+ "step": 200
33
+ },
34
+ {
35
+ "epoch": 30.0,
36
+ "eval_accuracy": 0.8414101975195223,
37
+ "eval_f1": 0.899009900990099,
38
+ "eval_loss": 0.7784350514411926,
39
+ "eval_precision": 0.8901960784313725,
40
+ "eval_recall": 0.908,
41
+ "eval_runtime": 4.5256,
42
+ "eval_samples_per_second": 11.932,
43
+ "eval_steps_per_second": 0.884,
44
+ "step": 300
45
+ },
46
+ {
47
+ "epoch": 40.0,
48
+ "eval_accuracy": 0.836357372531006,
49
+ "eval_f1": 0.8982630272952853,
50
+ "eval_loss": 0.9056066870689392,
51
+ "eval_precision": 0.8916256157635468,
52
+ "eval_recall": 0.905,
53
+ "eval_runtime": 4.5498,
54
+ "eval_samples_per_second": 11.869,
55
+ "eval_steps_per_second": 0.879,
56
+ "step": 400
57
+ },
58
+ {
59
+ "epoch": 50.0,
60
+ "learning_rate": 5e-06,
61
+ "loss": 0.2429,
62
+ "step": 500
63
+ },
64
+ {
65
+ "epoch": 50.0,
66
+ "eval_accuracy": 0.8298116674322462,
67
+ "eval_f1": 0.9014154457412467,
68
+ "eval_loss": 1.001568078994751,
69
+ "eval_precision": 0.895411938825851,
70
+ "eval_recall": 0.9075,
71
+ "eval_runtime": 4.6434,
72
+ "eval_samples_per_second": 11.629,
73
+ "eval_steps_per_second": 0.861,
74
+ "step": 500
75
+ },
76
+ {
77
+ "epoch": 60.0,
78
+ "eval_accuracy": 0.8293523197060174,
79
+ "eval_f1": 0.8934262948207171,
80
+ "eval_loss": 1.009719967842102,
81
+ "eval_precision": 0.8898809523809523,
82
+ "eval_recall": 0.897,
83
+ "eval_runtime": 4.6541,
84
+ "eval_samples_per_second": 11.603,
85
+ "eval_steps_per_second": 0.859,
86
+ "step": 600
87
+ },
88
+ {
89
+ "epoch": 70.0,
90
+ "eval_accuracy": 0.8315342214056041,
91
+ "eval_f1": 0.906008476689105,
92
+ "eval_loss": 1.072226643562317,
93
+ "eval_precision": 0.9035305818000995,
94
+ "eval_recall": 0.9085,
95
+ "eval_runtime": 4.5145,
96
+ "eval_samples_per_second": 11.961,
97
+ "eval_steps_per_second": 0.886,
98
+ "step": 700
99
+ },
100
+ {
101
+ "epoch": 80.0,
102
+ "eval_accuracy": 0.8269407441433165,
103
+ "eval_f1": 0.9003708281829418,
104
+ "eval_loss": 1.088362693786621,
105
+ "eval_precision": 0.8904645476772616,
106
+ "eval_recall": 0.9105,
107
+ "eval_runtime": 4.4141,
108
+ "eval_samples_per_second": 12.233,
109
+ "eval_steps_per_second": 0.906,
110
+ "step": 800
111
+ },
112
+ {
113
+ "epoch": 90.0,
114
+ "eval_accuracy": 0.827859439595774,
115
+ "eval_f1": 0.9013386217154189,
116
+ "eval_loss": 1.129175066947937,
117
+ "eval_precision": 0.8938053097345132,
118
+ "eval_recall": 0.909,
119
+ "eval_runtime": 4.4449,
120
+ "eval_samples_per_second": 12.149,
121
+ "eval_steps_per_second": 0.9,
122
+ "step": 900
123
+ },
124
+ {
125
+ "epoch": 100.0,
126
+ "learning_rate": 0.0,
127
+ "loss": 0.0098,
128
+ "step": 1000
129
+ },
130
+ {
131
+ "epoch": 100.0,
132
+ "eval_accuracy": 0.8330271015158475,
133
+ "eval_f1": 0.9077802634849614,
134
+ "eval_loss": 1.1164220571517944,
135
+ "eval_precision": 0.9026198714780029,
136
+ "eval_recall": 0.913,
137
+ "eval_runtime": 4.533,
138
+ "eval_samples_per_second": 11.913,
139
+ "eval_steps_per_second": 0.882,
140
+ "step": 1000
141
+ },
142
+ {
143
+ "epoch": 100.0,
144
+ "step": 1000,
145
+ "total_flos": 3954080148480000.0,
146
+ "train_loss": 0.12633917331695557,
147
+ "train_runtime": 1653.606,
148
+ "train_samples_per_second": 9.676,
149
+ "train_steps_per_second": 0.605
150
+ }
151
+ ],
152
+ "max_steps": 1000,
153
+ "num_train_epochs": 100,
154
+ "total_flos": 3954080148480000.0,
155
+ "trial_name": null,
156
+ "trial_params": null
157
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a236fc2f8ad0eb53ff60dc4aa91eec43e0143120b817b147b606f73d53579abe
3
+ size 3183
vocab.json ADDED
The diff for this file is too large to render. See raw diff