Token Classification
GLiNER
PyTorch
multilingual
NER
GLiNER
information extraction
encoder
entity recognition
Ihor commited on
Commit
8d56222
1 Parent(s): 797ac65

Upload folder using huggingface_hub

Browse files
gliner_config.json ADDED
@@ -0,0 +1,209 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "class_token_index": -1,
3
+ "dropout": 0.4,
4
+ "embed_ent_token": true,
5
+ "encoder_config": {
6
+ "_name_or_path": "knowledgator/Sheared-LLaMA-encoder-1.3B",
7
+ "add_cross_attention": false,
8
+ "architectures": [
9
+ "LlamaBiModel"
10
+ ],
11
+ "attention_bias": false,
12
+ "attention_dropout": 0.0,
13
+ "bad_words_ids": null,
14
+ "begin_suppress_tokens": null,
15
+ "bos_token_id": 1,
16
+ "chunk_size_feed_forward": 0,
17
+ "cross_attention_hidden_size": null,
18
+ "decoder_start_token_id": null,
19
+ "diversity_penalty": 0.0,
20
+ "do_sample": false,
21
+ "early_stopping": false,
22
+ "encoder_no_repeat_ngram_size": 0,
23
+ "eos_token_id": 2,
24
+ "exponential_decay_length_penalty": null,
25
+ "finetuning_task": null,
26
+ "forced_bos_token_id": null,
27
+ "forced_eos_token_id": null,
28
+ "hidden_act": "silu",
29
+ "hidden_size": 2048,
30
+ "id2label": {
31
+ "0": "LABEL_0",
32
+ "1": "LABEL_1"
33
+ },
34
+ "initializer_range": 0.02,
35
+ "intermediate_size": 5504,
36
+ "is_decoder": false,
37
+ "is_encoder_decoder": false,
38
+ "label2id": {
39
+ "LABEL_0": 0,
40
+ "LABEL_1": 1
41
+ },
42
+ "length_penalty": 1.0,
43
+ "max_length": 20,
44
+ "max_position_embeddings": 4096,
45
+ "min_length": 0,
46
+ "model_type": "llama",
47
+ "no_repeat_ngram_size": 0,
48
+ "num_attention_heads": 16,
49
+ "num_beam_groups": 1,
50
+ "num_beams": 1,
51
+ "num_hidden_layers": 24,
52
+ "num_key_value_heads": 16,
53
+ "num_return_sequences": 1,
54
+ "output_attentions": false,
55
+ "output_hidden_states": false,
56
+ "output_scores": false,
57
+ "pad_token_id": 0,
58
+ "prefix": null,
59
+ "pretraining_tp": 1,
60
+ "problem_type": null,
61
+ "pruned_heads": {},
62
+ "remove_invalid_values": false,
63
+ "repetition_penalty": 1.0,
64
+ "return_dict": true,
65
+ "return_dict_in_generate": false,
66
+ "rms_norm_eps": 1e-05,
67
+ "rope_scaling": null,
68
+ "rope_theta": 10000.0,
69
+ "sep_token_id": null,
70
+ "suppress_tokens": null,
71
+ "task_specific_params": null,
72
+ "temperature": 1.0,
73
+ "tf_legacy_loss": false,
74
+ "tie_encoder_decoder": false,
75
+ "tie_word_embeddings": false,
76
+ "tokenizer_class": null,
77
+ "top_k": 50,
78
+ "top_p": 1.0,
79
+ "torch_dtype": "bfloat16",
80
+ "torchscript": false,
81
+ "typical_p": 1.0,
82
+ "use_bfloat16": false,
83
+ "use_cache": true,
84
+ "vocab_size": 32000
85
+ },
86
+ "ent_token": "<<ENT>>",
87
+ "eval_every": 3000,
88
+ "fine_tune": true,
89
+ "freeze_token_rep": false,
90
+ "fuse_layers": false,
91
+ "has_rnn": true,
92
+ "hidden_size": 1024,
93
+ "label_smoothing": 0,
94
+ "labels_encoder": "BAAI/bge-small-en-v1.5",
95
+ "labels_encoder_config": {
96
+ "_name_or_path": "BAAI/bge-small-en-v1.5",
97
+ "add_cross_attention": false,
98
+ "architectures": [
99
+ "BertModel"
100
+ ],
101
+ "attention_probs_dropout_prob": 0.1,
102
+ "bad_words_ids": null,
103
+ "begin_suppress_tokens": null,
104
+ "bos_token_id": null,
105
+ "chunk_size_feed_forward": 0,
106
+ "classifier_dropout": null,
107
+ "cross_attention_hidden_size": null,
108
+ "decoder_start_token_id": null,
109
+ "diversity_penalty": 0.0,
110
+ "do_sample": false,
111
+ "early_stopping": false,
112
+ "encoder_no_repeat_ngram_size": 0,
113
+ "eos_token_id": null,
114
+ "exponential_decay_length_penalty": null,
115
+ "finetuning_task": null,
116
+ "forced_bos_token_id": null,
117
+ "forced_eos_token_id": null,
118
+ "hidden_act": "gelu",
119
+ "hidden_dropout_prob": 0.1,
120
+ "hidden_size": 384,
121
+ "id2label": {
122
+ "0": "LABEL_0"
123
+ },
124
+ "initializer_range": 0.02,
125
+ "intermediate_size": 1536,
126
+ "is_decoder": false,
127
+ "is_encoder_decoder": false,
128
+ "label2id": {
129
+ "LABEL_0": 0
130
+ },
131
+ "layer_norm_eps": 1e-12,
132
+ "length_penalty": 1.0,
133
+ "max_length": 20,
134
+ "max_position_embeddings": 512,
135
+ "min_length": 0,
136
+ "model_type": "bert",
137
+ "no_repeat_ngram_size": 0,
138
+ "num_attention_heads": 12,
139
+ "num_beam_groups": 1,
140
+ "num_beams": 1,
141
+ "num_hidden_layers": 12,
142
+ "num_return_sequences": 1,
143
+ "output_attentions": false,
144
+ "output_hidden_states": false,
145
+ "output_scores": false,
146
+ "pad_token_id": 0,
147
+ "position_embedding_type": "absolute",
148
+ "prefix": null,
149
+ "problem_type": null,
150
+ "pruned_heads": {},
151
+ "remove_invalid_values": false,
152
+ "repetition_penalty": 1.0,
153
+ "return_dict": true,
154
+ "return_dict_in_generate": false,
155
+ "sep_token_id": null,
156
+ "suppress_tokens": null,
157
+ "task_specific_params": null,
158
+ "temperature": 1.0,
159
+ "tf_legacy_loss": false,
160
+ "tie_encoder_decoder": false,
161
+ "tie_word_embeddings": true,
162
+ "tokenizer_class": null,
163
+ "top_k": 50,
164
+ "top_p": 1.0,
165
+ "torch_dtype": "float32",
166
+ "torchscript": false,
167
+ "type_vocab_size": 2,
168
+ "typical_p": 1.0,
169
+ "use_bfloat16": false,
170
+ "use_cache": true,
171
+ "vocab_size": 30522
172
+ },
173
+ "log_dir": "llama/",
174
+ "loss_alpha": 0.75,
175
+ "loss_gamma": 0,
176
+ "loss_reduction": "sum",
177
+ "lr_encoder": "1e-5",
178
+ "lr_others": "3e-5",
179
+ "max_grad_norm": 1.0,
180
+ "max_len": 512,
181
+ "max_neg_type_ratio": 1,
182
+ "max_types": 100,
183
+ "max_width": 12,
184
+ "model_name": "knowledgator/Sheared-LLaMA-encoder-1.3B",
185
+ "model_type": "gliner",
186
+ "name": "span level gliner",
187
+ "num_post_fusion_layers": 1,
188
+ "num_steps": 100000,
189
+ "post_fusion_schema": "",
190
+ "prev_path": null,
191
+ "random_drop": true,
192
+ "root_dir": "gliner_logs",
193
+ "save_total_limit": 3,
194
+ "scheduler_type": "cosine",
195
+ "sep_token": "<<SEP>>",
196
+ "shuffle_types": true,
197
+ "size_sup": -1,
198
+ "span_mode": "markerV0",
199
+ "subtoken_pooling": "first",
200
+ "train_batch_size": 8,
201
+ "train_data": "data/nuner_train.json",
202
+ "transformers_version": "4.40.2",
203
+ "val_data_dir": "none",
204
+ "vocab_size": -1,
205
+ "warmup_ratio": 0.0,
206
+ "weight_decay_encoder": 0.1,
207
+ "weight_decay_other": 0.1,
208
+ "words_splitter_type": "whitespace"
209
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ee0b735d26d3c11f5ebd9f69d64019639163f87cd50f04c200d7b8c13d3546e7
3
+ size 5439423806
special_tokens_map.json ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": true,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "eos_token": {
10
+ "content": "</s>",
11
+ "lstrip": false,
12
+ "normalized": true,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "mask_token": {
17
+ "content": "_",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "pad_token": {
24
+ "content": "</s>",
25
+ "lstrip": false,
26
+ "normalized": true,
27
+ "rstrip": false,
28
+ "single_word": false
29
+ },
30
+ "unk_token": {
31
+ "content": "<unk>",
32
+ "lstrip": false,
33
+ "normalized": true,
34
+ "rstrip": false,
35
+ "single_word": false
36
+ }
37
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9e556afd44213b6bd1be2b850ebbbd98f5481437a8021afaf58ee7fb1818d347
3
+ size 499723
tokenizer_config.json ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": true,
3
+ "add_eos_token": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<unk>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<s>",
15
+ "lstrip": false,
16
+ "normalized": true,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "</s>",
23
+ "lstrip": false,
24
+ "normalized": true,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "29918": {
30
+ "content": "_",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ }
37
+ },
38
+ "bos_token": "<s>",
39
+ "clean_up_tokenization_spaces": false,
40
+ "eos_token": "</s>",
41
+ "mask_token": "_",
42
+ "model_max_length": 1000000000000000019884624838656,
43
+ "pad_token": "</s>",
44
+ "sp_model_kwargs": {},
45
+ "tokenizer_class": "LlamaTokenizer",
46
+ "unk_token": "<unk>",
47
+ "use_default_system_prompt": false
48
+ }
trainer_state.json ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "best_metric": null,
3
+ "best_model_checkpoint": null,
4
+ "epoch": 0.07663422484481569,
5
+ "eval_steps": 500,
6
+ "global_step": 1000,
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.007663422484481569,
13
+ "grad_norm": 2411.532470703125,
14
+ "learning_rate": 5.555555555555555e-07,
15
+ "loss": 152.2018,
16
+ "step": 100
17
+ },
18
+ {
19
+ "epoch": 0.015326844968963138,
20
+ "grad_norm": 1508.88134765625,
21
+ "learning_rate": 1.111111111111111e-06,
22
+ "loss": 142.6181,
23
+ "step": 200
24
+ },
25
+ {
26
+ "epoch": 0.022990267453444707,
27
+ "grad_norm": 1164.76953125,
28
+ "learning_rate": 1.6666666666666667e-06,
29
+ "loss": 123.6666,
30
+ "step": 300
31
+ },
32
+ {
33
+ "epoch": 0.030653689937926276,
34
+ "grad_norm": 1428.1673583984375,
35
+ "learning_rate": 2.222222222222222e-06,
36
+ "loss": 117.5532,
37
+ "step": 400
38
+ },
39
+ {
40
+ "epoch": 0.038317112422407845,
41
+ "grad_norm": 421.33551025390625,
42
+ "learning_rate": 2.7777777777777783e-06,
43
+ "loss": 113.8976,
44
+ "step": 500
45
+ },
46
+ {
47
+ "epoch": 0.045980534906889414,
48
+ "grad_norm": 302.48614501953125,
49
+ "learning_rate": 3.3333333333333333e-06,
50
+ "loss": 106.6907,
51
+ "step": 600
52
+ },
53
+ {
54
+ "epoch": 0.05364395739137098,
55
+ "grad_norm": 221.99728393554688,
56
+ "learning_rate": 3.88888888888889e-06,
57
+ "loss": 108.7462,
58
+ "step": 700
59
+ },
60
+ {
61
+ "epoch": 0.06130737987585255,
62
+ "grad_norm": 630.5855102539062,
63
+ "learning_rate": 4.444444444444444e-06,
64
+ "loss": 88.6301,
65
+ "step": 800
66
+ },
67
+ {
68
+ "epoch": 0.06897080236033412,
69
+ "grad_norm": 749.811279296875,
70
+ "learning_rate": 5e-06,
71
+ "loss": 91.8458,
72
+ "step": 900
73
+ },
74
+ {
75
+ "epoch": 0.07663422484481569,
76
+ "grad_norm": 168.46031188964844,
77
+ "learning_rate": 4.938271604938272e-06,
78
+ "loss": 94.57,
79
+ "step": 1000
80
+ }
81
+ ],
82
+ "logging_steps": 100,
83
+ "max_steps": 9000,
84
+ "num_input_tokens_seen": 0,
85
+ "num_train_epochs": 1,
86
+ "save_steps": 500,
87
+ "total_flos": 0.0,
88
+ "train_batch_size": 8,
89
+ "trial_name": null,
90
+ "trial_params": null
91
+ }