ahlem-phantom
commited on
Commit
·
60783bc
1
Parent(s):
f7eca3b
End of training
Browse files- README.md +109 -0
- added_tokens.json +7 -0
- config.json +112 -0
- merges.txt +0 -0
- preprocessor_config.json +27 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +9 -0
- tokenizer.json +0 -0
- tokenizer_config.json +80 -0
- training_args.bin +3 -0
- vocab.json +0 -0
README.md
ADDED
@@ -0,0 +1,109 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: cc-by-nc-sa-4.0
|
3 |
+
base_model: microsoft/layoutlmv3-base
|
4 |
+
tags:
|
5 |
+
- generated_from_trainer
|
6 |
+
datasets:
|
7 |
+
- ls-generated4
|
8 |
+
metrics:
|
9 |
+
- precision
|
10 |
+
- recall
|
11 |
+
- f1
|
12 |
+
- accuracy
|
13 |
+
model-index:
|
14 |
+
- name: layoutlmv3-invoice-model
|
15 |
+
results:
|
16 |
+
- task:
|
17 |
+
name: Token Classification
|
18 |
+
type: token-classification
|
19 |
+
dataset:
|
20 |
+
name: ls-generated4
|
21 |
+
type: ls-generated4
|
22 |
+
config: invoice
|
23 |
+
split: test
|
24 |
+
args: invoice
|
25 |
+
metrics:
|
26 |
+
- name: Precision
|
27 |
+
type: precision
|
28 |
+
value: 0.9185733512786003
|
29 |
+
- name: Recall
|
30 |
+
type: recall
|
31 |
+
value: 0.9375
|
32 |
+
- name: F1
|
33 |
+
type: f1
|
34 |
+
value: 0.9279401767505099
|
35 |
+
- name: Accuracy
|
36 |
+
type: accuracy
|
37 |
+
value: 0.9536870503597122
|
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 |
+
# layoutlmv3-invoice-model
|
44 |
+
|
45 |
+
This model is a fine-tuned version of [microsoft/layoutlmv3-base](https://huggingface.co/microsoft/layoutlmv3-base) on the ls-generated4 dataset.
|
46 |
+
It achieves the following results on the evaluation set:
|
47 |
+
- Loss: 0.3694
|
48 |
+
- Precision: 0.9186
|
49 |
+
- Recall: 0.9375
|
50 |
+
- F1: 0.9279
|
51 |
+
- Accuracy: 0.9537
|
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: 2
|
73 |
+
- seed: 42
|
74 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
75 |
+
- lr_scheduler_type: linear
|
76 |
+
- training_steps: 2000
|
77 |
+
|
78 |
+
### Training results
|
79 |
+
|
80 |
+
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
|
81 |
+
|:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|:--------:|
|
82 |
+
| No log | 0.85 | 100 | 0.7836 | 0.5238 | 0.5982 | 0.5585 | 0.7680 |
|
83 |
+
| No log | 1.69 | 200 | 0.4954 | 0.6888 | 0.7479 | 0.7172 | 0.8422 |
|
84 |
+
| No log | 2.54 | 300 | 0.3483 | 0.7807 | 0.8462 | 0.8121 | 0.9040 |
|
85 |
+
| No log | 3.39 | 400 | 0.3200 | 0.8113 | 0.8654 | 0.8375 | 0.9125 |
|
86 |
+
| 0.5923 | 4.24 | 500 | 0.2775 | 0.8593 | 0.8853 | 0.8721 | 0.9319 |
|
87 |
+
| 0.5923 | 5.08 | 600 | 0.2674 | 0.8700 | 0.9052 | 0.8872 | 0.9377 |
|
88 |
+
| 0.5923 | 5.93 | 700 | 0.2766 | 0.8739 | 0.9135 | 0.8932 | 0.9386 |
|
89 |
+
| 0.5923 | 6.78 | 800 | 0.2641 | 0.8879 | 0.9190 | 0.9031 | 0.9472 |
|
90 |
+
| 0.5923 | 7.63 | 900 | 0.2893 | 0.9094 | 0.9238 | 0.9165 | 0.9447 |
|
91 |
+
| 0.0802 | 8.47 | 1000 | 0.3369 | 0.9145 | 0.9258 | 0.9201 | 0.9465 |
|
92 |
+
| 0.0802 | 9.32 | 1100 | 0.3037 | 0.9043 | 0.9341 | 0.9189 | 0.9505 |
|
93 |
+
| 0.0802 | 10.17 | 1200 | 0.3510 | 0.9032 | 0.9231 | 0.9130 | 0.9472 |
|
94 |
+
| 0.0802 | 11.02 | 1300 | 0.3224 | 0.9138 | 0.9251 | 0.9195 | 0.9501 |
|
95 |
+
| 0.0802 | 11.86 | 1400 | 0.3873 | 0.9133 | 0.9265 | 0.9199 | 0.9456 |
|
96 |
+
| 0.0198 | 12.71 | 1500 | 0.3786 | 0.9120 | 0.9327 | 0.9222 | 0.9492 |
|
97 |
+
| 0.0198 | 13.56 | 1600 | 0.3807 | 0.9050 | 0.9293 | 0.9170 | 0.9469 |
|
98 |
+
| 0.0198 | 14.41 | 1700 | 0.3664 | 0.9088 | 0.9313 | 0.9199 | 0.9510 |
|
99 |
+
| 0.0198 | 15.25 | 1800 | 0.3582 | 0.9152 | 0.9341 | 0.9245 | 0.9521 |
|
100 |
+
| 0.0198 | 16.1 | 1900 | 0.3736 | 0.9198 | 0.9368 | 0.9282 | 0.9528 |
|
101 |
+
| 0.007 | 16.95 | 2000 | 0.3694 | 0.9186 | 0.9375 | 0.9279 | 0.9537 |
|
102 |
+
|
103 |
+
|
104 |
+
### Framework versions
|
105 |
+
|
106 |
+
- Transformers 4.35.0.dev0
|
107 |
+
- Pytorch 2.0.1+cu118
|
108 |
+
- Datasets 2.14.5
|
109 |
+
- Tokenizers 0.14.1
|
added_tokens.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"</s>": 2,
|
3 |
+
"<mask>": 50264,
|
4 |
+
"<pad>": 1,
|
5 |
+
"<s>": 0,
|
6 |
+
"<unk>": 3
|
7 |
+
}
|
config.json
ADDED
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
"has_relative_attention_bias": true,
|
12 |
+
"has_spatial_attention_bias": true,
|
13 |
+
"hidden_act": "gelu",
|
14 |
+
"hidden_dropout_prob": 0.1,
|
15 |
+
"hidden_size": 768,
|
16 |
+
"id2label": {
|
17 |
+
"0": "B-INVOICENUMBER",
|
18 |
+
"1": "B-INVOICEDATE",
|
19 |
+
"2": "I-INVOICEDATE",
|
20 |
+
"3": "B-DUEDATE",
|
21 |
+
"4": "I-DUEDATE",
|
22 |
+
"5": "B-VENDORNAME",
|
23 |
+
"6": "I-VENDORNAME",
|
24 |
+
"7": "B-VENDORADDRESS",
|
25 |
+
"8": "I-VENDORADDRESS",
|
26 |
+
"9": "B-VENDORPHONE",
|
27 |
+
"10": "I-VENDORPHONE",
|
28 |
+
"11": "B-VENDOREMAIL",
|
29 |
+
"12": "B-CUSTOMERNAME",
|
30 |
+
"13": "I-CUSTOMERNAME",
|
31 |
+
"14": "B-CUSTOMERADDRESS",
|
32 |
+
"15": "I-CUSTOMERADDRESS",
|
33 |
+
"16": "B-CUSTOMERPHONE",
|
34 |
+
"17": "I-CUSTOMERPHONE",
|
35 |
+
"18": "B-CUSTOMEREMAIL",
|
36 |
+
"19": "B-PRODUCTNAME",
|
37 |
+
"20": "I-PRODUCTNAME",
|
38 |
+
"21": "B-PRODUCTPRICE",
|
39 |
+
"22": "I-PRODUCTPRICE",
|
40 |
+
"23": "B-PRODUCTAMOUNT",
|
41 |
+
"24": "I-PRODUCTAMOUNT",
|
42 |
+
"25": "B-PRODUCTQTY",
|
43 |
+
"26": "B-SUBTOTAL",
|
44 |
+
"27": "I-SUBTOTAL",
|
45 |
+
"28": "B-TAX",
|
46 |
+
"29": "I-TAX",
|
47 |
+
"30": "B-TOTAL",
|
48 |
+
"31": "I-TOTAL",
|
49 |
+
"32": "B-DISCOUNT",
|
50 |
+
"33": "O"
|
51 |
+
},
|
52 |
+
"initializer_range": 0.02,
|
53 |
+
"input_size": 224,
|
54 |
+
"intermediate_size": 3072,
|
55 |
+
"label2id": {
|
56 |
+
"B-CUSTOMERADDRESS": 14,
|
57 |
+
"B-CUSTOMEREMAIL": 18,
|
58 |
+
"B-CUSTOMERNAME": 12,
|
59 |
+
"B-CUSTOMERPHONE": 16,
|
60 |
+
"B-DISCOUNT": 32,
|
61 |
+
"B-DUEDATE": 3,
|
62 |
+
"B-INVOICEDATE": 1,
|
63 |
+
"B-INVOICENUMBER": 0,
|
64 |
+
"B-PRODUCTAMOUNT": 23,
|
65 |
+
"B-PRODUCTNAME": 19,
|
66 |
+
"B-PRODUCTPRICE": 21,
|
67 |
+
"B-PRODUCTQTY": 25,
|
68 |
+
"B-SUBTOTAL": 26,
|
69 |
+
"B-TAX": 28,
|
70 |
+
"B-TOTAL": 30,
|
71 |
+
"B-VENDORADDRESS": 7,
|
72 |
+
"B-VENDOREMAIL": 11,
|
73 |
+
"B-VENDORNAME": 5,
|
74 |
+
"B-VENDORPHONE": 9,
|
75 |
+
"I-CUSTOMERADDRESS": 15,
|
76 |
+
"I-CUSTOMERNAME": 13,
|
77 |
+
"I-CUSTOMERPHONE": 17,
|
78 |
+
"I-DUEDATE": 4,
|
79 |
+
"I-INVOICEDATE": 2,
|
80 |
+
"I-PRODUCTAMOUNT": 24,
|
81 |
+
"I-PRODUCTNAME": 20,
|
82 |
+
"I-PRODUCTPRICE": 22,
|
83 |
+
"I-SUBTOTAL": 27,
|
84 |
+
"I-TAX": 29,
|
85 |
+
"I-TOTAL": 31,
|
86 |
+
"I-VENDORADDRESS": 8,
|
87 |
+
"I-VENDORNAME": 6,
|
88 |
+
"I-VENDORPHONE": 10,
|
89 |
+
"O": 33
|
90 |
+
},
|
91 |
+
"layer_norm_eps": 1e-05,
|
92 |
+
"max_2d_position_embeddings": 1024,
|
93 |
+
"max_position_embeddings": 514,
|
94 |
+
"max_rel_2d_pos": 256,
|
95 |
+
"max_rel_pos": 128,
|
96 |
+
"model_type": "layoutlmv3",
|
97 |
+
"num_attention_heads": 12,
|
98 |
+
"num_channels": 3,
|
99 |
+
"num_hidden_layers": 12,
|
100 |
+
"pad_token_id": 1,
|
101 |
+
"patch_size": 16,
|
102 |
+
"rel_2d_pos_bins": 64,
|
103 |
+
"rel_pos_bins": 32,
|
104 |
+
"second_input_size": 112,
|
105 |
+
"shape_size": 128,
|
106 |
+
"text_embed": true,
|
107 |
+
"torch_dtype": "float32",
|
108 |
+
"transformers_version": "4.35.0.dev0",
|
109 |
+
"type_vocab_size": 1,
|
110 |
+
"visual_embed": true,
|
111 |
+
"vocab_size": 50265
|
112 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
preprocessor_config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"apply_ocr": false,
|
3 |
+
"do_normalize": true,
|
4 |
+
"do_rescale": true,
|
5 |
+
"do_resize": true,
|
6 |
+
"feature_extractor_type": "LayoutLMv3FeatureExtractor",
|
7 |
+
"image_mean": [
|
8 |
+
0.5,
|
9 |
+
0.5,
|
10 |
+
0.5
|
11 |
+
],
|
12 |
+
"image_processor_type": "LayoutLMv3ImageProcessor",
|
13 |
+
"image_std": [
|
14 |
+
0.5,
|
15 |
+
0.5,
|
16 |
+
0.5
|
17 |
+
],
|
18 |
+
"ocr_lang": null,
|
19 |
+
"processor_class": "LayoutLMv3Processor",
|
20 |
+
"resample": 2,
|
21 |
+
"rescale_factor": 0.00392156862745098,
|
22 |
+
"size": {
|
23 |
+
"height": 224,
|
24 |
+
"width": 224
|
25 |
+
},
|
26 |
+
"tesseract_config": ""
|
27 |
+
}
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:ddd01aef5b6c15e649dad0e216ae75eed3bec657173272bd2f03140a97413bd6
|
3 |
+
size 503849389
|
special_tokens_map.json
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": "<s>",
|
3 |
+
"cls_token": "<s>",
|
4 |
+
"eos_token": "</s>",
|
5 |
+
"mask_token": "<mask>",
|
6 |
+
"pad_token": "<pad>",
|
7 |
+
"sep_token": "</s>",
|
8 |
+
"unk_token": "<unk>"
|
9 |
+
}
|
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 |
+
"add_prefix_space": true,
|
3 |
+
"added_tokens_decoder": {
|
4 |
+
"0": {
|
5 |
+
"content": "<s>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false,
|
10 |
+
"special": true
|
11 |
+
},
|
12 |
+
"1": {
|
13 |
+
"content": "<pad>",
|
14 |
+
"lstrip": false,
|
15 |
+
"normalized": true,
|
16 |
+
"rstrip": false,
|
17 |
+
"single_word": false,
|
18 |
+
"special": true
|
19 |
+
},
|
20 |
+
"2": {
|
21 |
+
"content": "</s>",
|
22 |
+
"lstrip": false,
|
23 |
+
"normalized": true,
|
24 |
+
"rstrip": false,
|
25 |
+
"single_word": false,
|
26 |
+
"special": true
|
27 |
+
},
|
28 |
+
"3": {
|
29 |
+
"content": "<unk>",
|
30 |
+
"lstrip": false,
|
31 |
+
"normalized": true,
|
32 |
+
"rstrip": false,
|
33 |
+
"single_word": false,
|
34 |
+
"special": true
|
35 |
+
},
|
36 |
+
"50264": {
|
37 |
+
"content": "<mask>",
|
38 |
+
"lstrip": true,
|
39 |
+
"normalized": true,
|
40 |
+
"rstrip": false,
|
41 |
+
"single_word": false,
|
42 |
+
"special": true
|
43 |
+
}
|
44 |
+
},
|
45 |
+
"additional_special_tokens": [],
|
46 |
+
"apply_ocr": false,
|
47 |
+
"bos_token": "<s>",
|
48 |
+
"clean_up_tokenization_spaces": true,
|
49 |
+
"cls_token": "<s>",
|
50 |
+
"cls_token_box": [
|
51 |
+
0,
|
52 |
+
0,
|
53 |
+
0,
|
54 |
+
0
|
55 |
+
],
|
56 |
+
"eos_token": "</s>",
|
57 |
+
"errors": "replace",
|
58 |
+
"mask_token": "<mask>",
|
59 |
+
"model_max_length": 512,
|
60 |
+
"only_label_first_subword": true,
|
61 |
+
"pad_token": "<pad>",
|
62 |
+
"pad_token_box": [
|
63 |
+
0,
|
64 |
+
0,
|
65 |
+
0,
|
66 |
+
0
|
67 |
+
],
|
68 |
+
"pad_token_label": -100,
|
69 |
+
"processor_class": "LayoutLMv3Processor",
|
70 |
+
"sep_token": "</s>",
|
71 |
+
"sep_token_box": [
|
72 |
+
0,
|
73 |
+
0,
|
74 |
+
0,
|
75 |
+
0
|
76 |
+
],
|
77 |
+
"tokenizer_class": "LayoutLMv3Tokenizer",
|
78 |
+
"trim_offsets": true,
|
79 |
+
"unk_token": "<unk>"
|
80 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9c97334c502f7a0b3fa1c843761f2445f13bdc15fbd529f06264cd0866cc5950
|
3 |
+
size 4027
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|