Token Classification
GLiNER
PyTorch
multilingual
Ihor commited on
Commit
92886f2
1 Parent(s): 42ec90f

Upload folder using huggingface_hub

Browse files
added_tokens.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ {
2
+ "[MASK]": 128000
3
+ }
gliner_config.json ADDED
@@ -0,0 +1,214 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "class_token_index": -1,
3
+ "dropout": 0.3,
4
+ "encoder_config": {
5
+ "_name_or_path": "microsoft/deberta-v3-small",
6
+ "add_cross_attention": false,
7
+ "architectures": null,
8
+ "attention_probs_dropout_prob": 0.1,
9
+ "bad_words_ids": null,
10
+ "begin_suppress_tokens": null,
11
+ "bos_token_id": null,
12
+ "chunk_size_feed_forward": 0,
13
+ "cross_attention_hidden_size": null,
14
+ "decoder_start_token_id": null,
15
+ "diversity_penalty": 0.0,
16
+ "do_sample": false,
17
+ "early_stopping": false,
18
+ "encoder_no_repeat_ngram_size": 0,
19
+ "eos_token_id": null,
20
+ "exponential_decay_length_penalty": null,
21
+ "finetuning_task": null,
22
+ "forced_bos_token_id": null,
23
+ "forced_eos_token_id": null,
24
+ "hidden_act": "gelu",
25
+ "hidden_dropout_prob": 0.1,
26
+ "hidden_size": 768,
27
+ "id2label": {
28
+ "0": "LABEL_0",
29
+ "1": "LABEL_1"
30
+ },
31
+ "initializer_range": 0.02,
32
+ "intermediate_size": 3072,
33
+ "is_decoder": false,
34
+ "is_encoder_decoder": false,
35
+ "label2id": {
36
+ "LABEL_0": 0,
37
+ "LABEL_1": 1
38
+ },
39
+ "layer_norm_eps": 1e-07,
40
+ "length_penalty": 1.0,
41
+ "max_length": 20,
42
+ "max_position_embeddings": 512,
43
+ "max_relative_positions": -1,
44
+ "min_length": 0,
45
+ "model_type": "deberta-v2",
46
+ "no_repeat_ngram_size": 0,
47
+ "norm_rel_ebd": "layer_norm",
48
+ "num_attention_heads": 12,
49
+ "num_beam_groups": 1,
50
+ "num_beams": 1,
51
+ "num_hidden_layers": 6,
52
+ "num_return_sequences": 1,
53
+ "output_attentions": false,
54
+ "output_hidden_states": false,
55
+ "output_scores": false,
56
+ "pad_token_id": 0,
57
+ "pooler_dropout": 0,
58
+ "pooler_hidden_act": "gelu",
59
+ "pooler_hidden_size": 768,
60
+ "pos_att_type": [
61
+ "p2c",
62
+ "c2p"
63
+ ],
64
+ "position_biased_input": false,
65
+ "position_buckets": 256,
66
+ "prefix": null,
67
+ "problem_type": null,
68
+ "pruned_heads": {},
69
+ "relative_attention": true,
70
+ "remove_invalid_values": false,
71
+ "repetition_penalty": 1.0,
72
+ "return_dict": true,
73
+ "return_dict_in_generate": false,
74
+ "sep_token_id": null,
75
+ "share_att_key": true,
76
+ "suppress_tokens": null,
77
+ "task_specific_params": null,
78
+ "temperature": 1.0,
79
+ "tf_legacy_loss": false,
80
+ "tie_encoder_decoder": false,
81
+ "tie_word_embeddings": true,
82
+ "tokenizer_class": null,
83
+ "top_k": 50,
84
+ "top_p": 1.0,
85
+ "torch_dtype": null,
86
+ "torchscript": false,
87
+ "type_vocab_size": 0,
88
+ "typical_p": 1.0,
89
+ "use_bfloat16": false,
90
+ "vocab_size": 128100
91
+ },
92
+ "ent_token": "<<ENT>>",
93
+ "eval_every": 5000,
94
+ "fine_tune": true,
95
+ "freeze_token_rep": false,
96
+ "fuse_layers": false,
97
+ "has_rnn": true,
98
+ "hidden_size": 768,
99
+ "label_smoothing": 0,
100
+ "labels_encoder": "BAAI/bge-small-en-v1.5",
101
+ "labels_encoder_config": {
102
+ "_name_or_path": "BAAI/bge-small-en-v1.5",
103
+ "add_cross_attention": false,
104
+ "architectures": [
105
+ "BertModel"
106
+ ],
107
+ "attention_probs_dropout_prob": 0.1,
108
+ "bad_words_ids": null,
109
+ "begin_suppress_tokens": null,
110
+ "bos_token_id": null,
111
+ "chunk_size_feed_forward": 0,
112
+ "classifier_dropout": null,
113
+ "cross_attention_hidden_size": null,
114
+ "decoder_start_token_id": null,
115
+ "diversity_penalty": 0.0,
116
+ "do_sample": false,
117
+ "early_stopping": false,
118
+ "encoder_no_repeat_ngram_size": 0,
119
+ "eos_token_id": null,
120
+ "exponential_decay_length_penalty": null,
121
+ "finetuning_task": null,
122
+ "forced_bos_token_id": null,
123
+ "forced_eos_token_id": null,
124
+ "hidden_act": "gelu",
125
+ "hidden_dropout_prob": 0.1,
126
+ "hidden_size": 384,
127
+ "id2label": {
128
+ "0": "LABEL_0"
129
+ },
130
+ "initializer_range": 0.02,
131
+ "intermediate_size": 1536,
132
+ "is_decoder": false,
133
+ "is_encoder_decoder": false,
134
+ "label2id": {
135
+ "LABEL_0": 0
136
+ },
137
+ "layer_norm_eps": 1e-12,
138
+ "length_penalty": 1.0,
139
+ "max_length": 20,
140
+ "max_position_embeddings": 512,
141
+ "min_length": 0,
142
+ "model_type": "bert",
143
+ "no_repeat_ngram_size": 0,
144
+ "num_attention_heads": 12,
145
+ "num_beam_groups": 1,
146
+ "num_beams": 1,
147
+ "num_hidden_layers": 12,
148
+ "num_return_sequences": 1,
149
+ "output_attentions": false,
150
+ "output_hidden_states": false,
151
+ "output_scores": false,
152
+ "pad_token_id": 0,
153
+ "position_embedding_type": "absolute",
154
+ "prefix": null,
155
+ "problem_type": null,
156
+ "pruned_heads": {},
157
+ "remove_invalid_values": false,
158
+ "repetition_penalty": 1.0,
159
+ "return_dict": true,
160
+ "return_dict_in_generate": false,
161
+ "sep_token_id": null,
162
+ "suppress_tokens": null,
163
+ "task_specific_params": null,
164
+ "temperature": 1.0,
165
+ "tf_legacy_loss": false,
166
+ "tie_encoder_decoder": false,
167
+ "tie_word_embeddings": true,
168
+ "tokenizer_class": null,
169
+ "top_k": 50,
170
+ "top_p": 1.0,
171
+ "torch_dtype": "float32",
172
+ "torchscript": false,
173
+ "type_vocab_size": 2,
174
+ "typical_p": 1.0,
175
+ "use_bfloat16": false,
176
+ "use_cache": true,
177
+ "vocab_size": 30522
178
+ },
179
+ "log_dir": "deberta/",
180
+ "loss_alpha": 0.75,
181
+ "loss_gamma": 2,
182
+ "loss_reduction": "sum",
183
+ "lr_encoder": "1e-5",
184
+ "lr_others": "5e-5",
185
+ "max_grad_norm": 10.0,
186
+ "max_len": 512,
187
+ "max_neg_type_ratio": 1,
188
+ "max_types": 100,
189
+ "max_width": 12,
190
+ "model_name": "microsoft/deberta-v3-small",
191
+ "model_type": "gliner",
192
+ "name": "span level gliner",
193
+ "num_steps": 100000,
194
+ "post_fusion_schema": "l2l-l2t-t2l",
195
+ "prev_path": null,
196
+ "random_drop": true,
197
+ "root_dir": "gliner_logs",
198
+ "save_total_limit": 3,
199
+ "scheduler_type": "cosine",
200
+ "sep_token": "<<SEP>>",
201
+ "shuffle_types": true,
202
+ "size_sup": -1,
203
+ "span_mode": "markerV0",
204
+ "subtoken_pooling": "first",
205
+ "train_batch_size": 8,
206
+ "train_data": "data/nuner_train.json",
207
+ "transformers_version": "4.40.2",
208
+ "val_data_dir": "none",
209
+ "vocab_size": -1,
210
+ "warmup_ratio": 0.05,
211
+ "weight_decay_encoder": 0.1,
212
+ "weight_decay_other": 0.1,
213
+ "words_splitter_type": "whitespace"
214
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:96573b5234eb8e56696e9f452af230f38a3b67fe3f351b89c385dacaba2e1358
3
+ size 832259818
rng_state.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8233421556158558e19337497b3965c5a35363adaf30da78ed1bdec1b3b58a41
3
+ size 14244
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "[CLS]",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "[CLS]",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "[SEP]",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "[MASK]",
25
+ "lstrip": false,
26
+ "normalized": false,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "pad_token": {
31
+ "content": "[PAD]",
32
+ "lstrip": false,
33
+ "normalized": false,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ },
37
+ "sep_token": {
38
+ "content": "[SEP]",
39
+ "lstrip": false,
40
+ "normalized": false,
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
+ }
spm.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c679fbf93643d19aab7ee10c0b99e460bdbc02fedf34b92b05af343b4af586fd
3
+ size 2464616
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "1": {
12
+ "content": "[CLS]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[SEP]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[UNK]",
29
+ "lstrip": false,
30
+ "normalized": true,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "128000": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "[CLS]",
45
+ "clean_up_tokenization_spaces": true,
46
+ "cls_token": "[CLS]",
47
+ "do_lower_case": false,
48
+ "eos_token": "[SEP]",
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 1000000000000000019884624838656,
51
+ "pad_token": "[PAD]",
52
+ "sep_token": "[SEP]",
53
+ "sp_model_kwargs": {},
54
+ "split_by_punct": false,
55
+ "tokenizer_class": "DebertaV2Tokenizer",
56
+ "unk_token": "[UNK]",
57
+ "vocab_type": "spm"
58
+ }
trainer_state.json ADDED
@@ -0,0 +1,163 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 2.2941626306398164,
5
+ "eval_steps": 500,
6
+ "global_step": 9000,
7
+ "is_hyper_param_search": false,
8
+ "is_local_process_zero": true,
9
+ "is_world_process_zero": true,
10
+ "log_history": [
11
+ {
12
+ "epoch": 0.1274534794799898,
13
+ "grad_norm": 855.9707641601562,
14
+ "learning_rate": 9.999156208166614e-06,
15
+ "loss": 74.3469,
16
+ "step": 500
17
+ },
18
+ {
19
+ "epoch": 0.2549069589599796,
20
+ "grad_norm": 302.50543212890625,
21
+ "learning_rate": 9.89824533543787e-06,
22
+ "loss": 61.1889,
23
+ "step": 1000
24
+ },
25
+ {
26
+ "epoch": 0.3823604384399694,
27
+ "grad_norm": 495.7685546875,
28
+ "learning_rate": 9.632470336074009e-06,
29
+ "loss": 57.9995,
30
+ "step": 1500
31
+ },
32
+ {
33
+ "epoch": 0.5098139179199592,
34
+ "grad_norm": 265.8482666015625,
35
+ "learning_rate": 9.21077660993783e-06,
36
+ "loss": 57.4618,
37
+ "step": 2000
38
+ },
39
+ {
40
+ "epoch": 0.637267397399949,
41
+ "grad_norm": 1070.9898681640625,
42
+ "learning_rate": 8.647357437093104e-06,
43
+ "loss": 53.0734,
44
+ "step": 2500
45
+ },
46
+ {
47
+ "epoch": 0.7647208768799388,
48
+ "grad_norm": 607.1848754882812,
49
+ "learning_rate": 7.961176263324902e-06,
50
+ "loss": 54.122,
51
+ "step": 3000
52
+ },
53
+ {
54
+ "epoch": 0.8921743563599286,
55
+ "grad_norm": 299.444091796875,
56
+ "learning_rate": 7.175328432410367e-06,
57
+ "loss": 55.9574,
58
+ "step": 3500
59
+ },
60
+ {
61
+ "epoch": 1.0,
62
+ "eval_loss": 2435.821044921875,
63
+ "eval_runtime": 13.0829,
64
+ "eval_samples_per_second": 266.532,
65
+ "eval_steps_per_second": 33.326,
66
+ "step": 3923
67
+ },
68
+ {
69
+ "epoch": 1.0196278358399185,
70
+ "grad_norm": 313.2464294433594,
71
+ "learning_rate": 6.3162638478229965e-06,
72
+ "loss": 52.9767,
73
+ "step": 4000
74
+ },
75
+ {
76
+ "epoch": 1.1470813153199082,
77
+ "grad_norm": 406.19097900390625,
78
+ "learning_rate": 5.412896727361663e-06,
79
+ "loss": 49.7189,
80
+ "step": 4500
81
+ },
82
+ {
83
+ "epoch": 1.274534794799898,
84
+ "grad_norm": 227.44325256347656,
85
+ "learning_rate": 4.495632414398659e-06,
86
+ "loss": 48.3298,
87
+ "step": 5000
88
+ },
89
+ {
90
+ "epoch": 1.401988274279888,
91
+ "grad_norm": 292.7037353515625,
92
+ "learning_rate": 3.595344001132154e-06,
93
+ "loss": 50.4245,
94
+ "step": 5500
95
+ },
96
+ {
97
+ "epoch": 1.5294417537598777,
98
+ "grad_norm": 522.2669677734375,
99
+ "learning_rate": 2.7423332084455543e-06,
100
+ "loss": 49.8634,
101
+ "step": 6000
102
+ },
103
+ {
104
+ "epoch": 1.6568952332398674,
105
+ "grad_norm": 408.0614929199219,
106
+ "learning_rate": 1.965310496864217e-06,
107
+ "loss": 49.0125,
108
+ "step": 6500
109
+ },
110
+ {
111
+ "epoch": 1.7843487127198574,
112
+ "grad_norm": 722.4154052734375,
113
+ "learning_rate": 1.290428735823593e-06,
114
+ "loss": 44.8823,
115
+ "step": 7000
116
+ },
117
+ {
118
+ "epoch": 1.911802192199847,
119
+ "grad_norm": 383.4438171386719,
120
+ "learning_rate": 7.404029558083653e-07,
121
+ "loss": 47.8235,
122
+ "step": 7500
123
+ },
124
+ {
125
+ "epoch": 2.0,
126
+ "eval_loss": 2325.86083984375,
127
+ "eval_runtime": 13.1669,
128
+ "eval_samples_per_second": 264.831,
129
+ "eval_steps_per_second": 33.113,
130
+ "step": 7846
131
+ },
132
+ {
133
+ "epoch": 2.039255671679837,
134
+ "grad_norm": 408.5860290527344,
135
+ "learning_rate": 3.337458105627145e-07,
136
+ "loss": 44.1611,
137
+ "step": 8000
138
+ },
139
+ {
140
+ "epoch": 2.166709151159827,
141
+ "grad_norm": 252.09278869628906,
142
+ "learning_rate": 8.414448202622494e-08,
143
+ "loss": 45.9323,
144
+ "step": 8500
145
+ },
146
+ {
147
+ "epoch": 2.2941626306398164,
148
+ "grad_norm": 174.15538024902344,
149
+ "learning_rate": 0.0,
150
+ "loss": 47.7162,
151
+ "step": 9000
152
+ }
153
+ ],
154
+ "logging_steps": 500,
155
+ "max_steps": 9000,
156
+ "num_input_tokens_seen": 0,
157
+ "num_train_epochs": 3,
158
+ "save_steps": 3000,
159
+ "total_flos": 0.0,
160
+ "train_batch_size": 8,
161
+ "trial_name": null,
162
+ "trial_params": null
163
+ }