doc2txt commited on
Commit
a77090b
1 Parent(s): 5b53b49

End of training

Browse files
Files changed (6) hide show
  1. README.md +96 -0
  2. all_results.json +10 -0
  3. config.json +196 -0
  4. model.safetensors +3 -0
  5. test_results.json +10 -0
  6. training_args.bin +3 -0
README.md ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ base_model: microsoft/layoutlmv2-base-uncased
4
+ tags:
5
+ - generated_from_trainer
6
+ datasets:
7
+ - cord
8
+ metrics:
9
+ - precision
10
+ - recall
11
+ - f1
12
+ - accuracy
13
+ model-index:
14
+ - name: layoutlmv2-finetuned-cord
15
+ results:
16
+ - task:
17
+ name: Token Classification
18
+ type: token-classification
19
+ dataset:
20
+ name: cord
21
+ type: cord
22
+ config: cord
23
+ split: validation
24
+ args: cord
25
+ metrics:
26
+ - name: Precision
27
+ type: precision
28
+ value: 0.9652945924132365
29
+ - name: Recall
30
+ type: recall
31
+ value: 0.9676375404530745
32
+ - name: F1
33
+ type: f1
34
+ value: 0.9664646464646465
35
+ - name: Accuracy
36
+ type: accuracy
37
+ value: 0.9702653247941445
38
+ ---
39
+
40
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
41
+ should probably proofread and complete it, then remove this comment. -->
42
+
43
+ # layoutlmv2-finetuned-cord
44
+
45
+ This model is a fine-tuned version of [microsoft/layoutlmv2-base-uncased](https://huggingface.co/microsoft/layoutlmv2-base-uncased) on the cord dataset.
46
+ It achieves the following results on the evaluation set:
47
+ - Loss: 0.2819
48
+ - Precision: 0.9653
49
+ - Recall: 0.9676
50
+ - F1: 0.9665
51
+ - Accuracy: 0.9703
52
+
53
+ ## Model description
54
+
55
+ More information needed
56
+
57
+ ## Intended uses & limitations
58
+
59
+ More information needed
60
+
61
+ ## Training and evaluation data
62
+
63
+ More information needed
64
+
65
+ ## Training procedure
66
+
67
+ ### Training hyperparameters
68
+
69
+ The following hyperparameters were used during training:
70
+ - learning_rate: 5e-05
71
+ - train_batch_size: 2
72
+ - eval_batch_size: 8
73
+ - seed: 42
74
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
75
+ - lr_scheduler_type: linear
76
+ - lr_scheduler_warmup_ratio: 0.1
77
+ - num_epochs: 5
78
+ - mixed_precision_training: Native AMP
79
+
80
+ ### Training results
81
+
82
+ | Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
83
+ |:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|:--------:|
84
+ | No log | 1.0 | 400 | 1.2752 | 0.8527 | 0.8382 | 0.8454 | 0.8481 |
85
+ | 1.9583 | 2.0 | 800 | 0.6372 | 0.8799 | 0.8948 | 0.8873 | 0.9021 |
86
+ | 0.7097 | 3.0 | 1200 | 0.4255 | 0.9241 | 0.9264 | 0.9253 | 0.9414 |
87
+ | 0.3845 | 4.0 | 1600 | 0.3021 | 0.9414 | 0.9482 | 0.9448 | 0.9611 |
88
+ | 0.2699 | 5.0 | 2000 | 0.2819 | 0.9653 | 0.9676 | 0.9665 | 0.9703 |
89
+
90
+
91
+ ### Framework versions
92
+
93
+ - Transformers 4.37.2
94
+ - Pytorch 2.1.0+cu121
95
+ - Datasets 2.16.1
96
+ - Tokenizers 0.15.1
all_results.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "test_accuracy": 0.9685507862303443,
3
+ "test_f1": 0.9523088569265707,
4
+ "test_loss": 0.28069764375686646,
5
+ "test_precision": 0.953030303030303,
6
+ "test_recall": 0.9515885022692889,
7
+ "test_runtime": 3.6555,
8
+ "test_samples_per_second": 27.356,
9
+ "test_steps_per_second": 3.556
10
+ }
config.json ADDED
@@ -0,0 +1,196 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "microsoft/layoutlmv2-base-uncased",
3
+ "architectures": [
4
+ "LayoutLMv2ForTokenClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "convert_sync_batchnorm": true,
8
+ "coordinate_size": 128,
9
+ "detectron2_config_args": {
10
+ "MODEL.ANCHOR_GENERATOR.SIZES": [
11
+ [
12
+ 32
13
+ ],
14
+ [
15
+ 64
16
+ ],
17
+ [
18
+ 128
19
+ ],
20
+ [
21
+ 256
22
+ ],
23
+ [
24
+ 512
25
+ ]
26
+ ],
27
+ "MODEL.BACKBONE.NAME": "build_resnet_fpn_backbone",
28
+ "MODEL.FPN.IN_FEATURES": [
29
+ "res2",
30
+ "res3",
31
+ "res4",
32
+ "res5"
33
+ ],
34
+ "MODEL.MASK_ON": true,
35
+ "MODEL.PIXEL_STD": [
36
+ 57.375,
37
+ 57.12,
38
+ 58.395
39
+ ],
40
+ "MODEL.POST_NMS_TOPK_TEST": 1000,
41
+ "MODEL.RESNETS.ASPECT_RATIOS": [
42
+ [
43
+ 0.5,
44
+ 1.0,
45
+ 2.0
46
+ ]
47
+ ],
48
+ "MODEL.RESNETS.DEPTH": 101,
49
+ "MODEL.RESNETS.NUM_GROUPS": 32,
50
+ "MODEL.RESNETS.OUT_FEATURES": [
51
+ "res2",
52
+ "res3",
53
+ "res4",
54
+ "res5"
55
+ ],
56
+ "MODEL.RESNETS.SIZES": [
57
+ [
58
+ 32
59
+ ],
60
+ [
61
+ 64
62
+ ],
63
+ [
64
+ 128
65
+ ],
66
+ [
67
+ 256
68
+ ],
69
+ [
70
+ 512
71
+ ]
72
+ ],
73
+ "MODEL.RESNETS.STRIDE_IN_1X1": false,
74
+ "MODEL.RESNETS.WIDTH_PER_GROUP": 8,
75
+ "MODEL.ROI_BOX_HEAD.NAME": "FastRCNNConvFCHead",
76
+ "MODEL.ROI_BOX_HEAD.NUM_FC": 2,
77
+ "MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION": 14,
78
+ "MODEL.ROI_HEADS.IN_FEATURES": [
79
+ "p2",
80
+ "p3",
81
+ "p4",
82
+ "p5"
83
+ ],
84
+ "MODEL.ROI_HEADS.NAME": "StandardROIHeads",
85
+ "MODEL.ROI_HEADS.NUM_CLASSES": 5,
86
+ "MODEL.ROI_MASK_HEAD.NAME": "MaskRCNNConvUpsampleHead",
87
+ "MODEL.ROI_MASK_HEAD.NUM_CONV": 4,
88
+ "MODEL.ROI_MASK_HEAD.POOLER_RESOLUTION": 7,
89
+ "MODEL.RPN.IN_FEATURES": [
90
+ "p2",
91
+ "p3",
92
+ "p4",
93
+ "p5",
94
+ "p6"
95
+ ],
96
+ "MODEL.RPN.POST_NMS_TOPK_TRAIN": 1000,
97
+ "MODEL.RPN.PRE_NMS_TOPK_TEST": 1000,
98
+ "MODEL.RPN.PRE_NMS_TOPK_TRAIN": 2000
99
+ },
100
+ "fast_qkv": true,
101
+ "gradient_checkpointing": false,
102
+ "has_relative_attention_bias": true,
103
+ "has_spatial_attention_bias": true,
104
+ "has_visual_segment_embedding": false,
105
+ "hidden_act": "gelu",
106
+ "hidden_dropout_prob": 0.1,
107
+ "hidden_size": 768,
108
+ "id2label": {
109
+ "0": "I-menu.cnt",
110
+ "1": "I-menu.discountprice",
111
+ "2": "I-menu.etc",
112
+ "3": "I-menu.itemsubtotal",
113
+ "4": "I-menu.nm",
114
+ "5": "I-menu.num",
115
+ "6": "I-menu.price",
116
+ "7": "I-menu.sub_cnt",
117
+ "8": "I-menu.sub_etc",
118
+ "9": "I-menu.sub_nm",
119
+ "10": "I-menu.sub_price",
120
+ "11": "I-menu.sub_unitprice",
121
+ "12": "I-menu.unitprice",
122
+ "13": "I-menu.vatyn",
123
+ "14": "I-sub_total.discount_price",
124
+ "15": "I-sub_total.etc",
125
+ "16": "I-sub_total.othersvc_price",
126
+ "17": "I-sub_total.service_price",
127
+ "18": "I-sub_total.subtotal_price",
128
+ "19": "I-sub_total.tax_price",
129
+ "20": "I-total.cashprice",
130
+ "21": "I-total.changeprice",
131
+ "22": "I-total.creditcardprice",
132
+ "23": "I-total.emoneyprice",
133
+ "24": "I-total.menuqty_cnt",
134
+ "25": "I-total.menutype_cnt",
135
+ "26": "I-total.total_etc",
136
+ "27": "I-total.total_price",
137
+ "28": "I-void_menu.nm",
138
+ "29": "I-void_menu.price"
139
+ },
140
+ "image_feature_pool_shape": [
141
+ 7,
142
+ 7,
143
+ 256
144
+ ],
145
+ "initializer_range": 0.02,
146
+ "intermediate_size": 3072,
147
+ "label2id": {
148
+ "I-menu.cnt": 0,
149
+ "I-menu.discountprice": 1,
150
+ "I-menu.etc": 2,
151
+ "I-menu.itemsubtotal": 3,
152
+ "I-menu.nm": 4,
153
+ "I-menu.num": 5,
154
+ "I-menu.price": 6,
155
+ "I-menu.sub_cnt": 7,
156
+ "I-menu.sub_etc": 8,
157
+ "I-menu.sub_nm": 9,
158
+ "I-menu.sub_price": 10,
159
+ "I-menu.sub_unitprice": 11,
160
+ "I-menu.unitprice": 12,
161
+ "I-menu.vatyn": 13,
162
+ "I-sub_total.discount_price": 14,
163
+ "I-sub_total.etc": 15,
164
+ "I-sub_total.othersvc_price": 16,
165
+ "I-sub_total.service_price": 17,
166
+ "I-sub_total.subtotal_price": 18,
167
+ "I-sub_total.tax_price": 19,
168
+ "I-total.cashprice": 20,
169
+ "I-total.changeprice": 21,
170
+ "I-total.creditcardprice": 22,
171
+ "I-total.emoneyprice": 23,
172
+ "I-total.menuqty_cnt": 24,
173
+ "I-total.menutype_cnt": 25,
174
+ "I-total.total_etc": 26,
175
+ "I-total.total_price": 27,
176
+ "I-void_menu.nm": 28,
177
+ "I-void_menu.price": 29
178
+ },
179
+ "layer_norm_eps": 1e-12,
180
+ "max_2d_position_embeddings": 1024,
181
+ "max_position_embeddings": 512,
182
+ "max_rel_2d_pos": 256,
183
+ "max_rel_pos": 128,
184
+ "model_type": "layoutlmv2",
185
+ "num_attention_heads": 12,
186
+ "num_hidden_layers": 12,
187
+ "output_past": true,
188
+ "pad_token_id": 0,
189
+ "rel_2d_pos_bins": 64,
190
+ "rel_pos_bins": 32,
191
+ "shape_size": 128,
192
+ "torch_dtype": "float32",
193
+ "transformers_version": "4.37.2",
194
+ "type_vocab_size": 2,
195
+ "vocab_size": 30522
196
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:192d9cd60dd6f4f0fac9ad930c28bb2f39f65f71959cb98d724c971f3b536fa3
3
+ size 802136688
test_results.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "test_accuracy": 0.9685507862303443,
3
+ "test_f1": 0.9523088569265707,
4
+ "test_loss": 0.28069764375686646,
5
+ "test_precision": 0.953030303030303,
6
+ "test_recall": 0.9515885022692889,
7
+ "test_runtime": 3.6555,
8
+ "test_samples_per_second": 27.356,
9
+ "test_steps_per_second": 3.556
10
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4be3bcd0f05c06b3ea3aedb9cc2dbe824ad498bbe6861cc2a6e9711dc0a50a18
3
+ size 4728