sejalv/Fine_Tuned_LP_TROCR
Browse files- README.md +92 -0
- config.json +177 -0
- generation_config.json +13 -0
- model.safetensors +3 -0
- preprocessor_config.json +27 -0
- runs/Jul19_08-25-04_c7563290c136/events.out.tfevents.1721377505.c7563290c136.2155.4 +3 -0
- training_args.bin +3 -0
README.md
ADDED
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
base_model: microsoft/trocr-small-printed
|
3 |
+
tags:
|
4 |
+
- generated_from_trainer
|
5 |
+
model-index:
|
6 |
+
- name: seq2seq_model_printed
|
7 |
+
results: []
|
8 |
+
---
|
9 |
+
|
10 |
+
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
11 |
+
should probably proofread and complete it, then remove this comment. -->
|
12 |
+
|
13 |
+
# seq2seq_model_printed
|
14 |
+
|
15 |
+
This model is a fine-tuned version of [microsoft/trocr-small-printed](https://huggingface.co/microsoft/trocr-small-printed) on an unknown dataset.
|
16 |
+
It achieves the following results on the evaluation set:
|
17 |
+
- Loss: 1.5578
|
18 |
+
- Cer: 0.2138
|
19 |
+
|
20 |
+
## Model description
|
21 |
+
|
22 |
+
More information needed
|
23 |
+
|
24 |
+
## Intended uses & limitations
|
25 |
+
|
26 |
+
More information needed
|
27 |
+
|
28 |
+
## Training and evaluation data
|
29 |
+
|
30 |
+
More information needed
|
31 |
+
|
32 |
+
## Training procedure
|
33 |
+
|
34 |
+
### Training hyperparameters
|
35 |
+
|
36 |
+
The following hyperparameters were used during training:
|
37 |
+
- learning_rate: 5e-05
|
38 |
+
- train_batch_size: 2
|
39 |
+
- eval_batch_size: 2
|
40 |
+
- seed: 42
|
41 |
+
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
42 |
+
- lr_scheduler_type: linear
|
43 |
+
- num_epochs: 35
|
44 |
+
- mixed_precision_training: Native AMP
|
45 |
+
|
46 |
+
### Training results
|
47 |
+
|
48 |
+
| Training Loss | Epoch | Step | Validation Loss | Cer |
|
49 |
+
|:-------------:|:-----:|:----:|:---------------:|:------:|
|
50 |
+
| 4.6751 | 1.0 | 244 | 3.5585 | 1.0652 |
|
51 |
+
| 3.3624 | 2.0 | 488 | 2.7206 | 0.7373 |
|
52 |
+
| 2.9125 | 3.0 | 732 | 1.9523 | 0.5418 |
|
53 |
+
| 2.5734 | 4.0 | 976 | 2.0470 | 0.7149 |
|
54 |
+
| 2.4143 | 5.0 | 1220 | 1.4577 | 0.3585 |
|
55 |
+
| 2.2459 | 6.0 | 1464 | 1.5741 | 0.4501 |
|
56 |
+
| 2.1514 | 7.0 | 1708 | 1.2625 | 0.3218 |
|
57 |
+
| 2.0268 | 8.0 | 1952 | 1.4816 | 0.3625 |
|
58 |
+
| 1.9513 | 9.0 | 2196 | 1.6085 | 0.3259 |
|
59 |
+
| 1.7768 | 10.0 | 2440 | 1.4458 | 0.4033 |
|
60 |
+
| 1.7156 | 11.0 | 2684 | 1.4845 | 0.3055 |
|
61 |
+
| 1.5976 | 12.0 | 2928 | 1.6491 | 0.3503 |
|
62 |
+
| 1.4664 | 13.0 | 3172 | 1.3220 | 0.3381 |
|
63 |
+
| 1.3276 | 14.0 | 3416 | 1.4486 | 0.3503 |
|
64 |
+
| 1.2354 | 15.0 | 3660 | 1.6394 | 0.3177 |
|
65 |
+
| 1.1072 | 16.0 | 3904 | 1.5189 | 0.3035 |
|
66 |
+
| 0.9209 | 17.0 | 4148 | 1.3820 | 0.2485 |
|
67 |
+
| 0.7356 | 18.0 | 4392 | 1.4799 | 0.2607 |
|
68 |
+
| 0.6336 | 19.0 | 4636 | 1.5075 | 0.2220 |
|
69 |
+
| 0.5035 | 20.0 | 4880 | 1.5413 | 0.2179 |
|
70 |
+
| 0.406 | 21.0 | 5124 | 1.5602 | 0.2464 |
|
71 |
+
| 0.3294 | 22.0 | 5368 | 1.4495 | 0.2159 |
|
72 |
+
| 0.2515 | 23.0 | 5612 | 1.5809 | 0.2240 |
|
73 |
+
| 0.2207 | 24.0 | 5856 | 1.5188 | 0.2281 |
|
74 |
+
| 0.1689 | 25.0 | 6100 | 1.5153 | 0.2118 |
|
75 |
+
| 0.1426 | 26.0 | 6344 | 1.5616 | 0.2118 |
|
76 |
+
| 0.1142 | 27.0 | 6588 | 1.7044 | 0.2179 |
|
77 |
+
| 0.0785 | 28.0 | 6832 | 1.6267 | 0.2281 |
|
78 |
+
| 0.0751 | 29.0 | 7076 | 1.6769 | 0.2159 |
|
79 |
+
| 0.0507 | 30.0 | 7320 | 1.7316 | 0.2342 |
|
80 |
+
| 0.0388 | 31.0 | 7564 | 1.5750 | 0.2220 |
|
81 |
+
| 0.0264 | 32.0 | 7808 | 1.7028 | 0.2159 |
|
82 |
+
| 0.021 | 33.0 | 8052 | 1.6861 | 0.2322 |
|
83 |
+
| 0.0195 | 34.0 | 8296 | 1.7154 | 0.2077 |
|
84 |
+
| 0.0167 | 35.0 | 8540 | 1.5578 | 0.2138 |
|
85 |
+
|
86 |
+
|
87 |
+
### Framework versions
|
88 |
+
|
89 |
+
- Transformers 4.42.4
|
90 |
+
- Pytorch 2.1.0a0+b5021ba
|
91 |
+
- Datasets 2.20.0
|
92 |
+
- Tokenizers 0.19.1
|
config.json
ADDED
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "microsoft/trocr-small-printed",
|
3 |
+
"architectures": [
|
4 |
+
"VisionEncoderDecoderModel"
|
5 |
+
],
|
6 |
+
"decoder": {
|
7 |
+
"_name_or_path": "",
|
8 |
+
"activation_dropout": 0.0,
|
9 |
+
"activation_function": "relu",
|
10 |
+
"add_cross_attention": true,
|
11 |
+
"architectures": null,
|
12 |
+
"attention_dropout": 0.0,
|
13 |
+
"bad_words_ids": null,
|
14 |
+
"begin_suppress_tokens": null,
|
15 |
+
"bos_token_id": 0,
|
16 |
+
"chunk_size_feed_forward": 0,
|
17 |
+
"classifier_dropout": 0.0,
|
18 |
+
"cross_attention_hidden_size": 384,
|
19 |
+
"d_model": 256,
|
20 |
+
"decoder_attention_heads": 8,
|
21 |
+
"decoder_ffn_dim": 1024,
|
22 |
+
"decoder_layerdrop": 0.0,
|
23 |
+
"decoder_layers": 6,
|
24 |
+
"decoder_start_token_id": 2,
|
25 |
+
"diversity_penalty": 0.0,
|
26 |
+
"do_sample": false,
|
27 |
+
"dropout": 0.1,
|
28 |
+
"early_stopping": false,
|
29 |
+
"encoder_no_repeat_ngram_size": 0,
|
30 |
+
"eos_token_id": 2,
|
31 |
+
"exponential_decay_length_penalty": null,
|
32 |
+
"finetuning_task": null,
|
33 |
+
"forced_bos_token_id": null,
|
34 |
+
"forced_eos_token_id": null,
|
35 |
+
"id2label": {
|
36 |
+
"0": "LABEL_0",
|
37 |
+
"1": "LABEL_1"
|
38 |
+
},
|
39 |
+
"init_std": 0.02,
|
40 |
+
"is_decoder": true,
|
41 |
+
"is_encoder_decoder": false,
|
42 |
+
"label2id": {
|
43 |
+
"LABEL_0": 0,
|
44 |
+
"LABEL_1": 1
|
45 |
+
},
|
46 |
+
"layernorm_embedding": true,
|
47 |
+
"length_penalty": 1.0,
|
48 |
+
"max_length": 20,
|
49 |
+
"max_position_embeddings": 512,
|
50 |
+
"min_length": 0,
|
51 |
+
"model_type": "trocr",
|
52 |
+
"no_repeat_ngram_size": 0,
|
53 |
+
"num_beam_groups": 1,
|
54 |
+
"num_beams": 1,
|
55 |
+
"num_return_sequences": 1,
|
56 |
+
"output_attentions": false,
|
57 |
+
"output_hidden_states": false,
|
58 |
+
"output_scores": false,
|
59 |
+
"pad_token_id": 1,
|
60 |
+
"prefix": null,
|
61 |
+
"problem_type": null,
|
62 |
+
"pruned_heads": {},
|
63 |
+
"remove_invalid_values": false,
|
64 |
+
"repetition_penalty": 1.0,
|
65 |
+
"return_dict": true,
|
66 |
+
"return_dict_in_generate": false,
|
67 |
+
"scale_embedding": true,
|
68 |
+
"sep_token_id": null,
|
69 |
+
"suppress_tokens": null,
|
70 |
+
"task_specific_params": null,
|
71 |
+
"temperature": 1.0,
|
72 |
+
"tf_legacy_loss": false,
|
73 |
+
"tie_encoder_decoder": false,
|
74 |
+
"tie_word_embeddings": false,
|
75 |
+
"tokenizer_class": null,
|
76 |
+
"top_k": 50,
|
77 |
+
"top_p": 1.0,
|
78 |
+
"torch_dtype": null,
|
79 |
+
"torchscript": false,
|
80 |
+
"typical_p": 1.0,
|
81 |
+
"use_bfloat16": false,
|
82 |
+
"use_cache": false,
|
83 |
+
"use_learned_position_embeddings": true,
|
84 |
+
"vocab_size": 64044
|
85 |
+
},
|
86 |
+
"decoder_start_token_id": 0,
|
87 |
+
"early_stopping": true,
|
88 |
+
"encoder": {
|
89 |
+
"_name_or_path": "",
|
90 |
+
"add_cross_attention": false,
|
91 |
+
"architectures": null,
|
92 |
+
"attention_probs_dropout_prob": 0.0,
|
93 |
+
"bad_words_ids": null,
|
94 |
+
"begin_suppress_tokens": null,
|
95 |
+
"bos_token_id": null,
|
96 |
+
"chunk_size_feed_forward": 0,
|
97 |
+
"cross_attention_hidden_size": null,
|
98 |
+
"decoder_start_token_id": null,
|
99 |
+
"diversity_penalty": 0.0,
|
100 |
+
"do_sample": false,
|
101 |
+
"early_stopping": false,
|
102 |
+
"encoder_no_repeat_ngram_size": 0,
|
103 |
+
"encoder_stride": 16,
|
104 |
+
"eos_token_id": null,
|
105 |
+
"exponential_decay_length_penalty": null,
|
106 |
+
"finetuning_task": null,
|
107 |
+
"forced_bos_token_id": null,
|
108 |
+
"forced_eos_token_id": null,
|
109 |
+
"hidden_act": "gelu",
|
110 |
+
"hidden_dropout_prob": 0.0,
|
111 |
+
"hidden_size": 384,
|
112 |
+
"id2label": {
|
113 |
+
"0": "LABEL_0",
|
114 |
+
"1": "LABEL_1"
|
115 |
+
},
|
116 |
+
"image_size": 384,
|
117 |
+
"initializer_range": 0.02,
|
118 |
+
"intermediate_size": 1536,
|
119 |
+
"is_decoder": false,
|
120 |
+
"is_encoder_decoder": false,
|
121 |
+
"label2id": {
|
122 |
+
"LABEL_0": 0,
|
123 |
+
"LABEL_1": 1
|
124 |
+
},
|
125 |
+
"layer_norm_eps": 1e-12,
|
126 |
+
"length_penalty": 1.0,
|
127 |
+
"max_length": 20,
|
128 |
+
"min_length": 0,
|
129 |
+
"model_type": "deit",
|
130 |
+
"no_repeat_ngram_size": 0,
|
131 |
+
"num_attention_heads": 6,
|
132 |
+
"num_beam_groups": 1,
|
133 |
+
"num_beams": 1,
|
134 |
+
"num_channels": 3,
|
135 |
+
"num_hidden_layers": 12,
|
136 |
+
"num_return_sequences": 1,
|
137 |
+
"output_attentions": false,
|
138 |
+
"output_hidden_states": false,
|
139 |
+
"output_scores": false,
|
140 |
+
"pad_token_id": null,
|
141 |
+
"patch_size": 16,
|
142 |
+
"prefix": null,
|
143 |
+
"problem_type": null,
|
144 |
+
"pruned_heads": {},
|
145 |
+
"qkv_bias": true,
|
146 |
+
"remove_invalid_values": false,
|
147 |
+
"repetition_penalty": 1.0,
|
148 |
+
"return_dict": true,
|
149 |
+
"return_dict_in_generate": false,
|
150 |
+
"sep_token_id": null,
|
151 |
+
"suppress_tokens": null,
|
152 |
+
"task_specific_params": null,
|
153 |
+
"temperature": 1.0,
|
154 |
+
"tf_legacy_loss": false,
|
155 |
+
"tie_encoder_decoder": false,
|
156 |
+
"tie_word_embeddings": true,
|
157 |
+
"tokenizer_class": null,
|
158 |
+
"top_k": 50,
|
159 |
+
"top_p": 1.0,
|
160 |
+
"torch_dtype": null,
|
161 |
+
"torchscript": false,
|
162 |
+
"typical_p": 1.0,
|
163 |
+
"use_bfloat16": false
|
164 |
+
},
|
165 |
+
"eos_token_id": 2,
|
166 |
+
"is_encoder_decoder": true,
|
167 |
+
"length_penalty": 2.0,
|
168 |
+
"max_length": 64,
|
169 |
+
"model_type": "vision-encoder-decoder",
|
170 |
+
"no_repeat_ngram_size": 3,
|
171 |
+
"num_beams": 4,
|
172 |
+
"pad_token_id": 1,
|
173 |
+
"tie_word_embeddings": false,
|
174 |
+
"torch_dtype": "float32",
|
175 |
+
"transformers_version": "4.42.4",
|
176 |
+
"vocab_size": 64044
|
177 |
+
}
|
generation_config.json
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token_id": 0,
|
3 |
+
"decoder_start_token_id": 0,
|
4 |
+
"early_stopping": true,
|
5 |
+
"eos_token_id": 2,
|
6 |
+
"length_penalty": 2.0,
|
7 |
+
"max_length": 64,
|
8 |
+
"no_repeat_ngram_size": 3,
|
9 |
+
"num_beams": 4,
|
10 |
+
"pad_token_id": 1,
|
11 |
+
"transformers_version": "4.42.4",
|
12 |
+
"use_cache": false
|
13 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e28e2c89518b7b682e1aa1975f08597e0c9c25a3336c6aba88ed5a52606954c3
|
3 |
+
size 246430696
|
preprocessor_config.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_size": {
|
3 |
+
"height": 224,
|
4 |
+
"width": 224
|
5 |
+
},
|
6 |
+
"do_center_crop": false,
|
7 |
+
"do_normalize": true,
|
8 |
+
"do_rescale": true,
|
9 |
+
"do_resize": true,
|
10 |
+
"image_mean": [
|
11 |
+
0.5,
|
12 |
+
0.5,
|
13 |
+
0.5
|
14 |
+
],
|
15 |
+
"image_processor_type": "DeiTImageProcessor",
|
16 |
+
"image_std": [
|
17 |
+
0.5,
|
18 |
+
0.5,
|
19 |
+
0.5
|
20 |
+
],
|
21 |
+
"resample": 3,
|
22 |
+
"rescale_factor": 0.00392156862745098,
|
23 |
+
"size": {
|
24 |
+
"height": 384,
|
25 |
+
"width": 384
|
26 |
+
}
|
27 |
+
}
|
runs/Jul19_08-25-04_c7563290c136/events.out.tfevents.1721377505.c7563290c136.2155.4
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9ce4ea4f05647936ffabd1744258f6b9c5c46067936b9d3d443af081b937ecf5
|
3 |
+
size 27911
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:6f44ea64464682100be27021a5049098da6857c411809b89599a189ea4cc4bc8
|
3 |
+
size 5240
|