Token Classification
GLiNER
PyTorch
multilingual
NER
GLiNER
information extraction
encoder
entity recognition
Ihor commited on
Commit
6f3f024
·
verified ·
1 Parent(s): b70a0a6

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,217 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "class_token_index": -1,
3
+ "dropout": 0.4,
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": "sentence-transformers/all-MiniLM-L6-v2",
101
+ "labels_encoder_config": {
102
+ "_name_or_path": "sentence-transformers/all-MiniLM-L6-v2",
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
+ "gradient_checkpointing": false,
125
+ "hidden_act": "gelu",
126
+ "hidden_dropout_prob": 0.1,
127
+ "hidden_size": 384,
128
+ "id2label": {
129
+ "0": "LABEL_0",
130
+ "1": "LABEL_1"
131
+ },
132
+ "initializer_range": 0.02,
133
+ "intermediate_size": 1536,
134
+ "is_decoder": false,
135
+ "is_encoder_decoder": false,
136
+ "label2id": {
137
+ "LABEL_0": 0,
138
+ "LABEL_1": 1
139
+ },
140
+ "layer_norm_eps": 1e-12,
141
+ "length_penalty": 1.0,
142
+ "max_length": 20,
143
+ "max_position_embeddings": 512,
144
+ "min_length": 0,
145
+ "model_type": "bert",
146
+ "no_repeat_ngram_size": 0,
147
+ "num_attention_heads": 12,
148
+ "num_beam_groups": 1,
149
+ "num_beams": 1,
150
+ "num_hidden_layers": 6,
151
+ "num_return_sequences": 1,
152
+ "output_attentions": false,
153
+ "output_hidden_states": false,
154
+ "output_scores": false,
155
+ "pad_token_id": 0,
156
+ "position_embedding_type": "absolute",
157
+ "prefix": null,
158
+ "problem_type": null,
159
+ "pruned_heads": {},
160
+ "remove_invalid_values": false,
161
+ "repetition_penalty": 1.0,
162
+ "return_dict": true,
163
+ "return_dict_in_generate": false,
164
+ "sep_token_id": null,
165
+ "suppress_tokens": null,
166
+ "task_specific_params": null,
167
+ "temperature": 1.0,
168
+ "tf_legacy_loss": false,
169
+ "tie_encoder_decoder": false,
170
+ "tie_word_embeddings": true,
171
+ "tokenizer_class": null,
172
+ "top_k": 50,
173
+ "top_p": 1.0,
174
+ "torch_dtype": null,
175
+ "torchscript": false,
176
+ "type_vocab_size": 2,
177
+ "typical_p": 1.0,
178
+ "use_bfloat16": false,
179
+ "use_cache": true,
180
+ "vocab_size": 30522
181
+ },
182
+ "log_dir": "biencoder/",
183
+ "loss_alpha": -1,
184
+ "loss_gamma": 0,
185
+ "loss_reduction": "sum",
186
+ "lr_encoder": "1e-5",
187
+ "lr_others": "5e-5",
188
+ "max_grad_norm": 10.0,
189
+ "max_len": 386,
190
+ "max_neg_type_ratio": 1,
191
+ "max_types": 25,
192
+ "max_width": 12,
193
+ "model_name": "microsoft/deberta-v3-small",
194
+ "model_type": "gliner",
195
+ "name": "span level gliner",
196
+ "num_steps": 120000,
197
+ "post_fusion_schema": "",
198
+ "prev_path": null,
199
+ "random_drop": true,
200
+ "root_dir": "gliner_logs",
201
+ "save_total_limit": 3,
202
+ "scheduler_type": "cosine",
203
+ "sep_token": "<<SEP>>",
204
+ "shuffle_types": true,
205
+ "size_sup": -1,
206
+ "span_mode": "markerV0",
207
+ "subtoken_pooling": "first",
208
+ "train_batch_size": 8,
209
+ "train_data": "data.json",
210
+ "transformers_version": "4.40.2",
211
+ "val_data_dir": "none",
212
+ "vocab_size": -1,
213
+ "warmup_ratio": 0.1,
214
+ "weight_decay_encoder": 0.01,
215
+ "weight_decay_other": 0.01,
216
+ "words_splitter_type": "whitespace"
217
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:13bb508286910c23fd3c0260759389521add1863bf71c4f468c9dec3c7d1aea5
3
+ size 756513098
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,179 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 4.0558810274898605,
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.22532672374943669,
13
+ "grad_norm": 1464.645751953125,
14
+ "learning_rate": 1.6666666666666667e-06,
15
+ "loss": 419.737,
16
+ "step": 500
17
+ },
18
+ {
19
+ "epoch": 0.45065344749887337,
20
+ "grad_norm": 3850.259033203125,
21
+ "learning_rate": 3.3333333333333333e-06,
22
+ "loss": 377.5664,
23
+ "step": 1000
24
+ },
25
+ {
26
+ "epoch": 0.67598017124831,
27
+ "grad_norm": 1552.3658447265625,
28
+ "learning_rate": 5e-06,
29
+ "loss": 359.1407,
30
+ "step": 1500
31
+ },
32
+ {
33
+ "epoch": 0.9013068949977467,
34
+ "grad_norm": 1931.043212890625,
35
+ "learning_rate": 6.666666666666667e-06,
36
+ "loss": 363.6383,
37
+ "step": 2000
38
+ },
39
+ {
40
+ "epoch": 1.0,
41
+ "eval_loss": 337.4689025878906,
42
+ "eval_runtime": 13.0417,
43
+ "eval_samples_per_second": 151.284,
44
+ "eval_steps_per_second": 18.939,
45
+ "step": 2219
46
+ },
47
+ {
48
+ "epoch": 1.1266336187471835,
49
+ "grad_norm": 1212.9539794921875,
50
+ "learning_rate": 8.333333333333334e-06,
51
+ "loss": 344.8475,
52
+ "step": 2500
53
+ },
54
+ {
55
+ "epoch": 1.35196034249662,
56
+ "grad_norm": 1241.7996826171875,
57
+ "learning_rate": 1e-05,
58
+ "loss": 350.3084,
59
+ "step": 3000
60
+ },
61
+ {
62
+ "epoch": 1.5772870662460567,
63
+ "grad_norm": 2845.786376953125,
64
+ "learning_rate": 9.991540791356342e-06,
65
+ "loss": 341.8033,
66
+ "step": 3500
67
+ },
68
+ {
69
+ "epoch": 1.8026137899954935,
70
+ "grad_norm": 1714.59423828125,
71
+ "learning_rate": 9.966191788709716e-06,
72
+ "loss": 337.2936,
73
+ "step": 4000
74
+ },
75
+ {
76
+ "epoch": 2.0,
77
+ "eval_loss": 326.2698974609375,
78
+ "eval_runtime": 13.0537,
79
+ "eval_samples_per_second": 151.145,
80
+ "eval_steps_per_second": 18.922,
81
+ "step": 4438
82
+ },
83
+ {
84
+ "epoch": 2.0279405137449302,
85
+ "grad_norm": 2061.15966796875,
86
+ "learning_rate": 9.924038765061042e-06,
87
+ "loss": 338.1808,
88
+ "step": 4500
89
+ },
90
+ {
91
+ "epoch": 2.253267237494367,
92
+ "grad_norm": 1502.1851806640625,
93
+ "learning_rate": 9.86522435289912e-06,
94
+ "loss": 325.4306,
95
+ "step": 5000
96
+ },
97
+ {
98
+ "epoch": 2.4785939612438037,
99
+ "grad_norm": 1462.711669921875,
100
+ "learning_rate": 9.789947561577445e-06,
101
+ "loss": 320.5629,
102
+ "step": 5500
103
+ },
104
+ {
105
+ "epoch": 2.70392068499324,
106
+ "grad_norm": 3903.998046875,
107
+ "learning_rate": 9.698463103929542e-06,
108
+ "loss": 322.1042,
109
+ "step": 6000
110
+ },
111
+ {
112
+ "epoch": 2.9292474087426768,
113
+ "grad_norm": 1786.909423828125,
114
+ "learning_rate": 9.591080534401371e-06,
115
+ "loss": 327.4969,
116
+ "step": 6500
117
+ },
118
+ {
119
+ "epoch": 3.0,
120
+ "eval_loss": 320.3514099121094,
121
+ "eval_runtime": 13.0727,
122
+ "eval_samples_per_second": 150.926,
123
+ "eval_steps_per_second": 18.894,
124
+ "step": 6657
125
+ },
126
+ {
127
+ "epoch": 3.1545741324921135,
128
+ "grad_norm": 1130.3773193359375,
129
+ "learning_rate": 9.468163201617063e-06,
130
+ "loss": 300.7485,
131
+ "step": 7000
132
+ },
133
+ {
134
+ "epoch": 3.3799008562415502,
135
+ "grad_norm": 1423.0567626953125,
136
+ "learning_rate": 9.330127018922195e-06,
137
+ "loss": 312.8204,
138
+ "step": 7500
139
+ },
140
+ {
141
+ "epoch": 3.605227579990987,
142
+ "grad_norm": 1232.428955078125,
143
+ "learning_rate": 9.177439057064684e-06,
144
+ "loss": 307.7865,
145
+ "step": 8000
146
+ },
147
+ {
148
+ "epoch": 3.8305543037404237,
149
+ "grad_norm": 1071.1146240234375,
150
+ "learning_rate": 9.01061596377522e-06,
151
+ "loss": 295.8372,
152
+ "step": 8500
153
+ },
154
+ {
155
+ "epoch": 4.0,
156
+ "eval_loss": 318.1500244140625,
157
+ "eval_runtime": 13.0462,
158
+ "eval_samples_per_second": 151.232,
159
+ "eval_steps_per_second": 18.933,
160
+ "step": 8876
161
+ },
162
+ {
163
+ "epoch": 4.0558810274898605,
164
+ "grad_norm": 2371.276123046875,
165
+ "learning_rate": 8.83022221559489e-06,
166
+ "loss": 303.3605,
167
+ "step": 9000
168
+ }
169
+ ],
170
+ "logging_steps": 500,
171
+ "max_steps": 30000,
172
+ "num_input_tokens_seen": 0,
173
+ "num_train_epochs": 14,
174
+ "save_steps": 3000,
175
+ "total_flos": 0.0,
176
+ "train_batch_size": 8,
177
+ "trial_name": null,
178
+ "trial_params": null
179
+ }