Token Classification
GLiNER
PyTorch
davidmezzetti commited on
Commit
3300cbf
·
1 Parent(s): e27342b

Initial version

Browse files
README.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - en
5
+ - fr
6
+ - de
7
+ - es
8
+ - pt
9
+ - it
10
+ library_name: gliner
11
+ pipeline_tag: token-classification
12
+ datasets:
13
+ - urchade/synthetic-pii-ner-mistral-v1
14
+ ---
15
+
16
+ # Model Card for GLiNER BERT Tiny
17
+
18
+ [GLiNER](https://github.com/urchade/GLiNER) model using [BERT Tiny](https://huggingface.co/google/bert_uncased_L-2_H-128_A-2) as the base model with [urchade/synthetic-pii-ner-mistral-v1](https://huggingface.co/datasets/urchade/synthetic-pii-ner-mistral-v1) as the training dataset.
19
+
20
+ This model is primarily designed for unit tests in limited compute enviornments such as GitHub Actions. But it does work to an extent for basic use cases.
gliner_config.json ADDED
@@ -0,0 +1,208 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "class_token_index": -1,
3
+ "dropout": 0.4,
4
+ "embed_ent_token": true,
5
+ "encoder_config": {
6
+ "_attn_implementation_autoset": false,
7
+ "_name_or_path": "google/bert_uncased_L-2_H-128_A-2",
8
+ "add_cross_attention": false,
9
+ "architectures": null,
10
+ "attention_probs_dropout_prob": 0.1,
11
+ "bad_words_ids": null,
12
+ "begin_suppress_tokens": null,
13
+ "bos_token_id": null,
14
+ "chunk_size_feed_forward": 0,
15
+ "classifier_dropout": null,
16
+ "cross_attention_hidden_size": null,
17
+ "decoder_start_token_id": null,
18
+ "diversity_penalty": 0.0,
19
+ "do_sample": false,
20
+ "early_stopping": false,
21
+ "encoder_no_repeat_ngram_size": 0,
22
+ "eos_token_id": null,
23
+ "exponential_decay_length_penalty": null,
24
+ "finetuning_task": null,
25
+ "forced_bos_token_id": null,
26
+ "forced_eos_token_id": null,
27
+ "hidden_act": "gelu",
28
+ "hidden_dropout_prob": 0.1,
29
+ "hidden_size": 128,
30
+ "id2label": {
31
+ "0": "LABEL_0",
32
+ "1": "LABEL_1"
33
+ },
34
+ "initializer_range": 0.02,
35
+ "intermediate_size": 512,
36
+ "is_decoder": false,
37
+ "is_encoder_decoder": false,
38
+ "label2id": {
39
+ "LABEL_0": 0,
40
+ "LABEL_1": 1
41
+ },
42
+ "layer_norm_eps": 1e-12,
43
+ "length_penalty": 1.0,
44
+ "max_length": 20,
45
+ "max_position_embeddings": 512,
46
+ "min_length": 0,
47
+ "model_type": "bert",
48
+ "no_repeat_ngram_size": 0,
49
+ "num_attention_heads": 2,
50
+ "num_beam_groups": 1,
51
+ "num_beams": 1,
52
+ "num_hidden_layers": 2,
53
+ "num_return_sequences": 1,
54
+ "output_attentions": false,
55
+ "output_hidden_states": false,
56
+ "output_scores": false,
57
+ "pad_token_id": 0,
58
+ "position_embedding_type": "absolute",
59
+ "prefix": null,
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
+ "sep_token_id": null,
67
+ "suppress_tokens": null,
68
+ "task_specific_params": null,
69
+ "temperature": 1.0,
70
+ "tf_legacy_loss": false,
71
+ "tie_encoder_decoder": false,
72
+ "tie_word_embeddings": true,
73
+ "tokenizer_class": null,
74
+ "top_k": 50,
75
+ "top_p": 1.0,
76
+ "torch_dtype": null,
77
+ "torchscript": false,
78
+ "type_vocab_size": 2,
79
+ "typical_p": 1.0,
80
+ "use_bfloat16": false,
81
+ "use_cache": true,
82
+ "vocab_size": 30522
83
+ },
84
+ "ent_token": "<<ENT>>",
85
+ "eval_every": 1000,
86
+ "fine_tune": true,
87
+ "freeze_token_rep": false,
88
+ "fuse_layers": false,
89
+ "has_rnn": true,
90
+ "hidden_size": 128,
91
+ "label_smoothing": 0,
92
+ "labels_encoder": "google/bert_uncased_L-2_H-128_A-2",
93
+ "labels_encoder_config": {
94
+ "_attn_implementation_autoset": false,
95
+ "_name_or_path": "google/bert_uncased_L-2_H-128_A-2",
96
+ "add_cross_attention": false,
97
+ "architectures": null,
98
+ "attention_probs_dropout_prob": 0.1,
99
+ "bad_words_ids": null,
100
+ "begin_suppress_tokens": null,
101
+ "bos_token_id": null,
102
+ "chunk_size_feed_forward": 0,
103
+ "classifier_dropout": null,
104
+ "cross_attention_hidden_size": null,
105
+ "decoder_start_token_id": null,
106
+ "diversity_penalty": 0.0,
107
+ "do_sample": false,
108
+ "early_stopping": false,
109
+ "encoder_no_repeat_ngram_size": 0,
110
+ "eos_token_id": null,
111
+ "exponential_decay_length_penalty": null,
112
+ "finetuning_task": null,
113
+ "forced_bos_token_id": null,
114
+ "forced_eos_token_id": null,
115
+ "hidden_act": "gelu",
116
+ "hidden_dropout_prob": 0.1,
117
+ "hidden_size": 128,
118
+ "id2label": {
119
+ "0": "LABEL_0",
120
+ "1": "LABEL_1"
121
+ },
122
+ "initializer_range": 0.02,
123
+ "intermediate_size": 512,
124
+ "is_decoder": false,
125
+ "is_encoder_decoder": false,
126
+ "label2id": {
127
+ "LABEL_0": 0,
128
+ "LABEL_1": 1
129
+ },
130
+ "layer_norm_eps": 1e-12,
131
+ "length_penalty": 1.0,
132
+ "max_length": 20,
133
+ "max_position_embeddings": 512,
134
+ "min_length": 0,
135
+ "model_type": "bert",
136
+ "no_repeat_ngram_size": 0,
137
+ "num_attention_heads": 2,
138
+ "num_beam_groups": 1,
139
+ "num_beams": 1,
140
+ "num_hidden_layers": 2,
141
+ "num_return_sequences": 1,
142
+ "output_attentions": false,
143
+ "output_hidden_states": false,
144
+ "output_scores": false,
145
+ "pad_token_id": 0,
146
+ "position_embedding_type": "absolute",
147
+ "prefix": null,
148
+ "problem_type": null,
149
+ "pruned_heads": {},
150
+ "remove_invalid_values": false,
151
+ "repetition_penalty": 1.0,
152
+ "return_dict": true,
153
+ "return_dict_in_generate": false,
154
+ "sep_token_id": null,
155
+ "suppress_tokens": null,
156
+ "task_specific_params": null,
157
+ "temperature": 1.0,
158
+ "tf_legacy_loss": false,
159
+ "tie_encoder_decoder": false,
160
+ "tie_word_embeddings": true,
161
+ "tokenizer_class": null,
162
+ "top_k": 50,
163
+ "top_p": 1.0,
164
+ "torch_dtype": null,
165
+ "torchscript": false,
166
+ "type_vocab_size": 2,
167
+ "typical_p": 1.0,
168
+ "use_bfloat16": false,
169
+ "use_cache": true,
170
+ "vocab_size": 30522
171
+ },
172
+ "log_dir": "models/",
173
+ "loss_alpha": -1,
174
+ "loss_gamma": 0,
175
+ "loss_reduction": "sum",
176
+ "lr_encoder": "1e-5",
177
+ "lr_others": "5e-5",
178
+ "max_grad_norm": 10.0,
179
+ "max_len": 386,
180
+ "max_neg_type_ratio": 1,
181
+ "max_types": 25,
182
+ "max_width": 12,
183
+ "model_name": "google/bert_uncased_L-2_H-128_A-2",
184
+ "model_type": "gliner",
185
+ "name": "span level gliner",
186
+ "num_post_fusion_layers": 1,
187
+ "num_steps": 30000,
188
+ "post_fusion_schema": "",
189
+ "prev_path": null,
190
+ "random_drop": true,
191
+ "root_dir": "gliner_logs",
192
+ "save_total_limit": 3,
193
+ "scheduler_type": "cosine",
194
+ "sep_token": "<<SEP>>",
195
+ "shuffle_types": true,
196
+ "size_sup": -1,
197
+ "span_mode": "markerV0",
198
+ "subtoken_pooling": "first",
199
+ "train_batch_size": 8,
200
+ "train_data": "data.json",
201
+ "transformers_version": "4.47.1",
202
+ "val_data_dir": "none",
203
+ "vocab_size": -1,
204
+ "warmup_ratio": 0.1,
205
+ "weight_decay_encoder": 0.01,
206
+ "weight_decay_other": 0.01,
207
+ "words_splitter_type": "whitespace"
208
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:472e54db2392336cd464e5c2d53396ff9ce473b7384c316159a853ef555dafb0
3
+ size 37889547
special_tokens_map.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "cls_token": "[CLS]",
3
+ "mask_token": "[MASK]",
4
+ "pad_token": "[PAD]",
5
+ "sep_token": "[SEP]",
6
+ "unk_token": "[UNK]"
7
+ }
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
+ "100": {
12
+ "content": "[UNK]",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "101": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "102": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "103": {
36
+ "content": "[MASK]",
37
+ "lstrip": false,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "clean_up_tokenization_spaces": true,
45
+ "cls_token": "[CLS]",
46
+ "do_basic_tokenize": true,
47
+ "do_lower_case": true,
48
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 1000000000000000019884624838656,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }