Circle6173 commited on
Commit
08e094e
1 Parent(s): e22a2df

Circle6173/check_ocr

Browse files
README.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-sa-4.0
3
+ base_model: microsoft/layoutlmv3-base
4
+ tags:
5
+ - generated_from_trainer
6
+ datasets:
7
+ - data_loader
8
+ metrics:
9
+ - precision
10
+ - recall
11
+ - f1
12
+ - accuracy
13
+ model-index:
14
+ - name: models
15
+ results:
16
+ - task:
17
+ name: Token Classification
18
+ type: token-classification
19
+ dataset:
20
+ name: data_loader
21
+ type: data_loader
22
+ config: default
23
+ split: test
24
+ args: default
25
+ metrics:
26
+ - name: Precision
27
+ type: precision
28
+ value: 0.8940149625935162
29
+ - name: Recall
30
+ type: recall
31
+ value: 0.9168797953964194
32
+ - name: F1
33
+ type: f1
34
+ value: 0.9053030303030304
35
+ - name: Accuracy
36
+ type: accuracy
37
+ value: 0.9743718592964824
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
+ # models
44
+
45
+ This model is a fine-tuned version of [microsoft/layoutlmv3-base](https://huggingface.co/microsoft/layoutlmv3-base) on the data_loader dataset.
46
+ It achieves the following results on the evaluation set:
47
+ - Loss: 0.1595
48
+ - Precision: 0.8940
49
+ - Recall: 0.9169
50
+ - F1: 0.9053
51
+ - Accuracy: 0.9744
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: 1e-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: 1000
77
+
78
+ ### Training results
79
+
80
+ | Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 | Accuracy |
81
+ |:-------------:|:-----:|:----:|:---------------:|:---------:|:------:|:------:|:--------:|
82
+ | No log | 2.5 | 100 | 0.1926 | 0.7730 | 0.8274 | 0.7993 | 0.9452 |
83
+ | No log | 5.0 | 200 | 0.1342 | 0.8285 | 0.8708 | 0.8491 | 0.9583 |
84
+ | No log | 7.5 | 300 | 0.1217 | 0.8758 | 0.9015 | 0.8885 | 0.9693 |
85
+ | No log | 10.0 | 400 | 0.1157 | 0.9082 | 0.9233 | 0.9157 | 0.9769 |
86
+ | 0.15 | 12.5 | 500 | 0.1310 | 0.9011 | 0.9092 | 0.9052 | 0.9744 |
87
+ | 0.15 | 15.0 | 600 | 0.1583 | 0.8682 | 0.9015 | 0.8846 | 0.9693 |
88
+ | 0.15 | 17.5 | 700 | 0.1628 | 0.8867 | 0.9105 | 0.8984 | 0.9724 |
89
+ | 0.15 | 20.0 | 800 | 0.1594 | 0.8945 | 0.9220 | 0.9081 | 0.9749 |
90
+ | 0.15 | 22.5 | 900 | 0.1579 | 0.8940 | 0.9169 | 0.9053 | 0.9744 |
91
+ | 0.0047 | 25.0 | 1000 | 0.1595 | 0.8940 | 0.9169 | 0.9053 | 0.9744 |
92
+
93
+
94
+ ### Framework versions
95
+
96
+ - Transformers 4.40.0.dev0
97
+ - Pytorch 2.2.1+cu121
98
+ - Datasets 2.18.0
99
+ - Tokenizers 0.15.2
config.json ADDED
@@ -0,0 +1,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "Check Number",
18
+ "1": "Check Number Title",
19
+ "2": "Invoice Number",
20
+ "3": "Invoice Number Title",
21
+ "4": "Line Amount",
22
+ "5": "Total Amount",
23
+ "6": "Check Date Title",
24
+ "7": "Check Date",
25
+ "8": "Ignore"
26
+ },
27
+ "initializer_range": 0.02,
28
+ "input_size": 224,
29
+ "intermediate_size": 3072,
30
+ "label2id": {
31
+ "Check Date": 7,
32
+ "Check Date Title": 6,
33
+ "Check Number": 0,
34
+ "Check Number Title": 1,
35
+ "Ignore": 8,
36
+ "Invoice Number": 2,
37
+ "Invoice Number Title": 3,
38
+ "Line Amount": 4,
39
+ "Total Amount": 5
40
+ },
41
+ "layer_norm_eps": 1e-05,
42
+ "max_2d_position_embeddings": 1024,
43
+ "max_position_embeddings": 514,
44
+ "max_rel_2d_pos": 256,
45
+ "max_rel_pos": 128,
46
+ "model_type": "layoutlmv3",
47
+ "num_attention_heads": 12,
48
+ "num_channels": 3,
49
+ "num_hidden_layers": 12,
50
+ "pad_token_id": 1,
51
+ "patch_size": 16,
52
+ "rel_2d_pos_bins": 64,
53
+ "rel_pos_bins": 32,
54
+ "second_input_size": 112,
55
+ "shape_size": 128,
56
+ "text_embed": true,
57
+ "torch_dtype": "float32",
58
+ "transformers_version": "4.40.0.dev0",
59
+ "type_vocab_size": 1,
60
+ "visual_embed": true,
61
+ "vocab_size": 50265
62
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40e6e9a46725aa8a0b8dd9621e9f028e0e5e3e5ea67e3b9e0f3b9f9b58552d7e
3
+ size 501361684
preprocessor_config.json ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_valid_processor_keys": [
3
+ "images",
4
+ "do_resize",
5
+ "size",
6
+ "resample",
7
+ "do_rescale",
8
+ "rescale_factor",
9
+ "do_normalize",
10
+ "image_mean",
11
+ "image_std",
12
+ "apply_ocr",
13
+ "ocr_lang",
14
+ "tesseract_config",
15
+ "return_tensors",
16
+ "data_format",
17
+ "input_data_format"
18
+ ],
19
+ "apply_ocr": false,
20
+ "do_normalize": true,
21
+ "do_rescale": true,
22
+ "do_resize": true,
23
+ "image_mean": [
24
+ 0.5,
25
+ 0.5,
26
+ 0.5
27
+ ],
28
+ "image_processor_type": "LayoutLMv3ImageProcessor",
29
+ "image_std": [
30
+ 0.5,
31
+ 0.5,
32
+ 0.5
33
+ ],
34
+ "ocr_lang": null,
35
+ "processor_class": "LayoutLMv3Processor",
36
+ "resample": 2,
37
+ "rescale_factor": 0.00392156862745098,
38
+ "size": {
39
+ "height": 224,
40
+ "width": 224
41
+ },
42
+ "tesseract_config": ""
43
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": true,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
26
+ "normalized": true,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "<pad>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "</s>",
39
+ "lstrip": false,
40
+ "normalized": true,
41
+ "rstrip": false,
42
+ "single_word": false
43
+ },
44
+ "unk_token": {
45
+ "content": "<unk>",
46
+ "lstrip": false,
47
+ "normalized": true,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "apply_ocr": false,
46
+ "bos_token": "<s>",
47
+ "clean_up_tokenization_spaces": true,
48
+ "cls_token": "<s>",
49
+ "cls_token_box": [
50
+ 0,
51
+ 0,
52
+ 0,
53
+ 0
54
+ ],
55
+ "eos_token": "</s>",
56
+ "errors": "replace",
57
+ "mask_token": "<mask>",
58
+ "model_max_length": 512,
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": "LayoutLMv3Processor",
69
+ "sep_token": "</s>",
70
+ "sep_token_box": [
71
+ 0,
72
+ 0,
73
+ 0,
74
+ 0
75
+ ],
76
+ "tokenizer_class": "LayoutLMv3Tokenizer",
77
+ "trim_offsets": true,
78
+ "unk_token": "<unk>"
79
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3ec9674ff1a12dd5c8bb77c57991f7f11def008c903672dbbf3c9acc5fad285b
3
+ size 4856
vocab.json ADDED
The diff for this file is too large to render. See raw diff