Commit
•
0b1122d
1
Parent(s):
26c96d5
End of training
Browse files- README.md +79 -0
- added_tokens.json +7 -0
- preprocessor_config.json +14 -0
- pytorch_model.bin +1 -1
- 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.6771
|
20 |
+
- Answer: {'precision': 0.7053571428571429, 'recall': 0.7812113720642769, 'f1': 0.7413489736070381, 'number': 809}
|
21 |
+
- Header: {'precision': 0.29770992366412213, 'recall': 0.3277310924369748, 'f1': 0.312, 'number': 119}
|
22 |
+
- Question: {'precision': 0.763716814159292, 'recall': 0.8103286384976526, 'f1': 0.7863325740318907, 'number': 1065}
|
23 |
+
- Overall Precision: 0.7112
|
24 |
+
- Overall Recall: 0.7697
|
25 |
+
- Overall F1: 0.7393
|
26 |
+
- Overall Accuracy: 0.8036
|
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.7668 | 1.0 | 10 | 1.5655 | {'precision': 0.01564945226917058, 'recall': 0.012360939431396786, 'f1': 0.013812154696132598, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.31925675675675674, 'recall': 0.17746478873239438, 'f1': 0.22812311406155703, 'number': 1065} | 0.1617 | 0.0998 | 0.1234 | 0.3599 |
|
58 |
+
| 1.4335 | 2.0 | 20 | 1.2504 | {'precision': 0.22972972972972974, 'recall': 0.2521631644004944, 'f1': 0.24042427813789036, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.391304347826087, 'recall': 0.5492957746478874, 'f1': 0.45703125, 'number': 1065} | 0.3311 | 0.3959 | 0.3606 | 0.5926 |
|
59 |
+
| 1.1215 | 3.0 | 30 | 0.9771 | {'precision': 0.4570273003033367, 'recall': 0.5587144622991347, 'f1': 0.5027808676307008, 'number': 809} | {'precision': 0.0, 'recall': 0.0, 'f1': 0.0, 'number': 119} | {'precision': 0.5460829493087558, 'recall': 0.6676056338028169, 'f1': 0.6007604562737643, 'number': 1065} | 0.5022 | 0.5835 | 0.5398 | 0.6802 |
|
60 |
+
| 0.8632 | 4.0 | 40 | 0.7960 | {'precision': 0.5714285714285714, 'recall': 0.7317676143386898, 'f1': 0.6417344173441735, 'number': 809} | {'precision': 0.0379746835443038, 'recall': 0.025210084033613446, 'f1': 0.030303030303030304, 'number': 119} | {'precision': 0.633201581027668, 'recall': 0.752112676056338, 'f1': 0.6875536480686696, 'number': 1065} | 0.5866 | 0.7005 | 0.6385 | 0.7572 |
|
61 |
+
| 0.6913 | 5.0 | 50 | 0.7202 | {'precision': 0.6335797254487856, 'recall': 0.7416563658838071, 'f1': 0.683371298405467, 'number': 809} | {'precision': 0.10752688172043011, 'recall': 0.08403361344537816, 'f1': 0.09433962264150944, 'number': 119} | {'precision': 0.6907216494845361, 'recall': 0.7549295774647887, 'f1': 0.721399730820996, 'number': 1065} | 0.6416 | 0.7095 | 0.6738 | 0.7808 |
|
62 |
+
| 0.5758 | 6.0 | 60 | 0.6812 | {'precision': 0.6677248677248677, 'recall': 0.7799752781211372, 'f1': 0.7194982896237172, 'number': 809} | {'precision': 0.17857142857142858, 'recall': 0.16806722689075632, 'f1': 0.17316017316017318, 'number': 119} | {'precision': 0.6919315403422983, 'recall': 0.7971830985915493, 'f1': 0.7408376963350787, 'number': 1065} | 0.6567 | 0.7526 | 0.7014 | 0.7947 |
|
63 |
+
| 0.4993 | 7.0 | 70 | 0.6593 | {'precision': 0.6597938144329897, 'recall': 0.7911001236093943, 'f1': 0.7195053400786959, 'number': 809} | {'precision': 0.21875, 'recall': 0.17647058823529413, 'f1': 0.19534883720930232, 'number': 119} | {'precision': 0.7158703071672355, 'recall': 0.787793427230047, 'f1': 0.7501117568171659, 'number': 1065} | 0.6702 | 0.7526 | 0.7091 | 0.7951 |
|
64 |
+
| 0.4397 | 8.0 | 80 | 0.6633 | {'precision': 0.6749192680301399, 'recall': 0.7750309023485785, 'f1': 0.721518987341772, 'number': 809} | {'precision': 0.23943661971830985, 'recall': 0.2857142857142857, 'f1': 0.26053639846743293, 'number': 119} | {'precision': 0.7274290627687017, 'recall': 0.7943661971830986, 'f1': 0.7594254937163376, 'number': 1065} | 0.6746 | 0.7561 | 0.7130 | 0.7987 |
|
65 |
+
| 0.396 | 9.0 | 90 | 0.6605 | {'precision': 0.6875699888017918, 'recall': 0.7589616810877626, 'f1': 0.7215041128084607, 'number': 809} | {'precision': 0.25203252032520324, 'recall': 0.2605042016806723, 'f1': 0.25619834710743805, 'number': 119} | {'precision': 0.7344013490725126, 'recall': 0.8178403755868544, 'f1': 0.7738782763216348, 'number': 1065} | 0.6885 | 0.7607 | 0.7228 | 0.8026 |
|
66 |
+
| 0.3578 | 10.0 | 100 | 0.6624 | {'precision': 0.6842105263157895, 'recall': 0.7873918417799752, 'f1': 0.7321839080459769, 'number': 809} | {'precision': 0.2773109243697479, 'recall': 0.2773109243697479, 'f1': 0.2773109243697479, 'number': 119} | {'precision': 0.7476231633535004, 'recall': 0.812206572769953, 'f1': 0.7785778577857785, 'number': 1065} | 0.6955 | 0.7702 | 0.7310 | 0.8022 |
|
67 |
+
| 0.3249 | 11.0 | 110 | 0.6678 | {'precision': 0.6865671641791045, 'recall': 0.796044499381953, 'f1': 0.7372638809387521, 'number': 809} | {'precision': 0.273972602739726, 'recall': 0.33613445378151263, 'f1': 0.3018867924528302, 'number': 119} | {'precision': 0.7584973166368515, 'recall': 0.7962441314553991, 'f1': 0.7769125057260651, 'number': 1065} | 0.6957 | 0.7687 | 0.7304 | 0.8010 |
|
68 |
+
| 0.3021 | 12.0 | 120 | 0.6681 | {'precision': 0.7120535714285714, 'recall': 0.788627935723115, 'f1': 0.7483870967741936, 'number': 809} | {'precision': 0.2923076923076923, 'recall': 0.31932773109243695, 'f1': 0.3052208835341365, 'number': 119} | {'precision': 0.7547826086956522, 'recall': 0.8150234741784037, 'f1': 0.7837471783295711, 'number': 1065} | 0.7096 | 0.7747 | 0.7407 | 0.8045 |
|
69 |
+
| 0.2895 | 13.0 | 130 | 0.6755 | {'precision': 0.7122060470324748, 'recall': 0.7861557478368356, 'f1': 0.7473560517038778, 'number': 809} | {'precision': 0.2887323943661972, 'recall': 0.3445378151260504, 'f1': 0.31417624521072796, 'number': 119} | {'precision': 0.7595048629531388, 'recall': 0.8065727699530516, 'f1': 0.7823315118397085, 'number': 1065} | 0.7091 | 0.7707 | 0.7386 | 0.8026 |
|
70 |
+
| 0.2734 | 14.0 | 140 | 0.6768 | {'precision': 0.7093541202672605, 'recall': 0.7873918417799752, 'f1': 0.7463386057410661, 'number': 809} | {'precision': 0.28368794326241137, 'recall': 0.33613445378151263, 'f1': 0.3076923076923077, 'number': 119} | {'precision': 0.7570175438596491, 'recall': 0.8103286384976526, 'f1': 0.7827664399092971, 'number': 1065} | 0.7067 | 0.7727 | 0.7383 | 0.8026 |
|
71 |
+
| 0.2804 | 15.0 | 150 | 0.6771 | {'precision': 0.7053571428571429, 'recall': 0.7812113720642769, 'f1': 0.7413489736070381, 'number': 809} | {'precision': 0.29770992366412213, 'recall': 0.3277310924369748, 'f1': 0.312, 'number': 119} | {'precision': 0.763716814159292, 'recall': 0.8103286384976526, 'f1': 0.7863325740318907, 'number': 1065} | 0.7112 | 0.7697 | 0.7393 | 0.8036 |
|
72 |
+
|
73 |
+
|
74 |
+
### Framework versions
|
75 |
+
|
76 |
+
- Transformers 4.34.0
|
77 |
+
- Pytorch 2.1.0+cpu
|
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 |
+
}
|
pytorch_model.bin
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 450601534
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6ceab5f17a937345f1d04ed7676fa7973865ff63726d14255b7890a6a292173b
|
3 |
size 450601534
|
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
|
|