lgsilvaesilva commited on
Commit
44eec2e
·
verified ·
1 Parent(s): e5658bb

Push model using huggingface_hub.

Browse files
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
37
+ unigram.json filter=lfs diff=lfs merge=lfs -text
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 384,
3
+ "pooling_mode_cls_token": false,
4
+ "pooling_mode_mean_tokens": true,
5
+ "pooling_mode_max_tokens": false,
6
+ "pooling_mode_mean_sqrt_len_tokens": false,
7
+ "pooling_mode_weightedmean_tokens": false,
8
+ "pooling_mode_lasttoken": false,
9
+ "include_prompt": true
10
+ }
README.md ADDED
@@ -0,0 +1,275 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - setfit
4
+ - sentence-transformers
5
+ - text-classification
6
+ - generated_from_setfit_trainer
7
+ widget:
8
+ - text: "6) Implement advocacy strategies with heads of government ministries, departments\
9
+ \ \n\nand institutions, national, district and local leaders on solutions to major\
10
+ \ nutrition \nproblems."
11
+ - text: 'The Government plans to continue its interventions aimed at increasing access
12
+ to drinking water by:
13
+
14
+ - in rural areas, constructing an additional 2 500 water points (mainly boreholes)
15
+ and rehabilitating an extra 2 000 existing water points.
16
+
17
+ - in urban and pre-urban areas, rehabilitating and constructing water supply infrastructure
18
+ in the various urban towns.
19
+
20
+ The Government will also, in terms of sanitation, continue to promote community-based
21
+ approaches and construct facilities.
22
+
23
+
24
+ Objective: ensure adequate access to sanitation facilities and increase access
25
+ to clean and safe drinking water from 64% (2014) to 67% of the population in urban
26
+ areas and from 83% (2014) to 85% in urban and pre-urban areas.
27
+
28
+
29
+ '
30
+ - text: "Specific objective\ni) to improve safe water supply services to the people\
31
+ \ in the rural communities\nii) to improve the water supply service levels in\
32
+ \ rural area to enable rural the population in the \nproject areas to increase\
33
+ \ their economic income through incorporating back yard or mini \nirrigation system."
34
+ - text: "Social security contributions \n\nLabor \nMarkets \n\nActivation measures\
35
+ \ \n\n• During the period of state of emergency, all training activities \nrecognized\
36
+ \ by the Ministry of Labor and Social Protection can be \ndelivered online."
37
+ - text: "Training infrastructure will be adapted to accommodate \nnew\tprogrammes."
38
+ metrics:
39
+ - accuracy
40
+ pipeline_tag: text-classification
41
+ library_name: setfit
42
+ inference: false
43
+ base_model: sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
44
+ ---
45
+
46
+ # SetFit with sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
47
+
48
+ This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2) as the Sentence Transformer embedding model. A OneVsRestClassifier instance is used for classification.
49
+
50
+ The model has been trained using an efficient few-shot learning technique that involves:
51
+
52
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
53
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
54
+
55
+ ## Model Details
56
+
57
+ ### Model Description
58
+ - **Model Type:** SetFit
59
+ - **Sentence Transformer body:** [sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2)
60
+ - **Classification head:** a OneVsRestClassifier instance
61
+ - **Maximum Sequence Length:** 128 tokens
62
+ <!-- - **Number of Classes:** Unknown -->
63
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
64
+ <!-- - **Language:** Unknown -->
65
+ <!-- - **License:** Unknown -->
66
+
67
+ ### Model Sources
68
+
69
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
70
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
71
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
72
+
73
+ ## Uses
74
+
75
+ ### Direct Use for Inference
76
+
77
+ First install the SetFit library:
78
+
79
+ ```bash
80
+ pip install setfit
81
+ ```
82
+
83
+ Then you can load this model and run inference.
84
+
85
+ ```python
86
+ from setfit import SetFitModel
87
+
88
+ # Download from the 🤗 Hub
89
+ model = SetFitModel.from_pretrained("faodl/model_g20_multilabel")
90
+ # Run inference
91
+ preds = model("Training infrastructure will be adapted to accommodate
92
+ new programmes.")
93
+ ```
94
+
95
+ <!--
96
+ ### Downstream Use
97
+
98
+ *List how someone could finetune this model on their own dataset.*
99
+ -->
100
+
101
+ <!--
102
+ ### Out-of-Scope Use
103
+
104
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
105
+ -->
106
+
107
+ <!--
108
+ ## Bias, Risks and Limitations
109
+
110
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
111
+ -->
112
+
113
+ <!--
114
+ ### Recommendations
115
+
116
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
117
+ -->
118
+
119
+ ## Training Details
120
+
121
+ ### Training Set Metrics
122
+ | Training set | Min | Median | Max |
123
+ |:-------------|:----|:--------|:-----|
124
+ | Word count | 1 | 48.9866 | 1181 |
125
+
126
+ ### Training Hyperparameters
127
+ - batch_size: (16, 16)
128
+ - num_epochs: (1, 1)
129
+ - max_steps: -1
130
+ - sampling_strategy: oversampling
131
+ - num_iterations: 50
132
+ - body_learning_rate: (2e-05, 2e-05)
133
+ - head_learning_rate: 2e-05
134
+ - loss: CosineSimilarityLoss
135
+ - distance_metric: cosine_distance
136
+ - margin: 0.25
137
+ - end_to_end: False
138
+ - use_amp: False
139
+ - warmup_proportion: 0.1
140
+ - l2_weight: 0.01
141
+ - seed: 42
142
+ - eval_max_steps: -1
143
+ - load_best_model_at_end: False
144
+
145
+ ### Training Results
146
+ | Epoch | Step | Training Loss | Validation Loss |
147
+ |:------:|:----:|:-------------:|:---------------:|
148
+ | 0.0002 | 1 | 0.2348 | - |
149
+ | 0.0119 | 50 | 0.1747 | - |
150
+ | 0.0237 | 100 | 0.153 | - |
151
+ | 0.0356 | 150 | 0.1314 | - |
152
+ | 0.0475 | 200 | 0.1263 | - |
153
+ | 0.0593 | 250 | 0.1168 | - |
154
+ | 0.0712 | 300 | 0.116 | - |
155
+ | 0.0831 | 350 | 0.098 | - |
156
+ | 0.0949 | 400 | 0.1085 | - |
157
+ | 0.1068 | 450 | 0.0975 | - |
158
+ | 0.1187 | 500 | 0.094 | - |
159
+ | 0.1305 | 550 | 0.082 | - |
160
+ | 0.1424 | 600 | 0.0856 | - |
161
+ | 0.1543 | 650 | 0.0838 | - |
162
+ | 0.1662 | 700 | 0.0762 | - |
163
+ | 0.1780 | 750 | 0.0722 | - |
164
+ | 0.1899 | 800 | 0.0722 | - |
165
+ | 0.2018 | 850 | 0.0634 | - |
166
+ | 0.2136 | 900 | 0.0584 | - |
167
+ | 0.2255 | 950 | 0.0664 | - |
168
+ | 0.2374 | 1000 | 0.0688 | - |
169
+ | 0.2492 | 1050 | 0.0629 | - |
170
+ | 0.2611 | 1100 | 0.0579 | - |
171
+ | 0.2730 | 1150 | 0.0652 | - |
172
+ | 0.2848 | 1200 | 0.0573 | - |
173
+ | 0.2967 | 1250 | 0.0584 | - |
174
+ | 0.3086 | 1300 | 0.0558 | - |
175
+ | 0.3204 | 1350 | 0.0586 | - |
176
+ | 0.3323 | 1400 | 0.0574 | - |
177
+ | 0.3442 | 1450 | 0.0444 | - |
178
+ | 0.3560 | 1500 | 0.0462 | - |
179
+ | 0.3679 | 1550 | 0.0488 | - |
180
+ | 0.3798 | 1600 | 0.0505 | - |
181
+ | 0.3916 | 1650 | 0.0529 | - |
182
+ | 0.4035 | 1700 | 0.0487 | - |
183
+ | 0.4154 | 1750 | 0.0459 | - |
184
+ | 0.4272 | 1800 | 0.0531 | - |
185
+ | 0.4391 | 1850 | 0.0448 | - |
186
+ | 0.4510 | 1900 | 0.0382 | - |
187
+ | 0.4629 | 1950 | 0.0457 | - |
188
+ | 0.4747 | 2000 | 0.0493 | - |
189
+ | 0.4866 | 2050 | 0.0488 | - |
190
+ | 0.4985 | 2100 | 0.049 | - |
191
+ | 0.5103 | 2150 | 0.0495 | - |
192
+ | 0.5222 | 2200 | 0.0402 | - |
193
+ | 0.5341 | 2250 | 0.0493 | - |
194
+ | 0.5459 | 2300 | 0.0496 | - |
195
+ | 0.5578 | 2350 | 0.0438 | - |
196
+ | 0.5697 | 2400 | 0.0361 | - |
197
+ | 0.5815 | 2450 | 0.0428 | - |
198
+ | 0.5934 | 2500 | 0.0419 | - |
199
+ | 0.6053 | 2550 | 0.0416 | - |
200
+ | 0.6171 | 2600 | 0.0338 | - |
201
+ | 0.6290 | 2650 | 0.0397 | - |
202
+ | 0.6409 | 2700 | 0.0385 | - |
203
+ | 0.6527 | 2750 | 0.0285 | - |
204
+ | 0.6646 | 2800 | 0.0461 | - |
205
+ | 0.6765 | 2850 | 0.0341 | - |
206
+ | 0.6883 | 2900 | 0.0379 | - |
207
+ | 0.7002 | 2950 | 0.0435 | - |
208
+ | 0.7121 | 3000 | 0.0341 | - |
209
+ | 0.7239 | 3050 | 0.0395 | - |
210
+ | 0.7358 | 3100 | 0.0424 | - |
211
+ | 0.7477 | 3150 | 0.0415 | - |
212
+ | 0.7596 | 3200 | 0.0422 | - |
213
+ | 0.7714 | 3250 | 0.0402 | - |
214
+ | 0.7833 | 3300 | 0.0309 | - |
215
+ | 0.7952 | 3350 | 0.0379 | - |
216
+ | 0.8070 | 3400 | 0.039 | - |
217
+ | 0.8189 | 3450 | 0.0427 | - |
218
+ | 0.8308 | 3500 | 0.0331 | - |
219
+ | 0.8426 | 3550 | 0.0457 | - |
220
+ | 0.8545 | 3600 | 0.0306 | - |
221
+ | 0.8664 | 3650 | 0.034 | - |
222
+ | 0.8782 | 3700 | 0.0354 | - |
223
+ | 0.8901 | 3750 | 0.0393 | - |
224
+ | 0.9020 | 3800 | 0.036 | - |
225
+ | 0.9138 | 3850 | 0.0339 | - |
226
+ | 0.9257 | 3900 | 0.0332 | - |
227
+ | 0.9376 | 3950 | 0.0274 | - |
228
+ | 0.9494 | 4000 | 0.0372 | - |
229
+ | 0.9613 | 4050 | 0.0319 | - |
230
+ | 0.9732 | 4100 | 0.0339 | - |
231
+ | 0.9850 | 4150 | 0.0349 | - |
232
+ | 0.9969 | 4200 | 0.0383 | - |
233
+
234
+ ### Framework Versions
235
+ - Python: 3.11.13
236
+ - SetFit: 1.1.2
237
+ - Sentence Transformers: 4.1.0
238
+ - Transformers: 4.52.4
239
+ - PyTorch: 2.6.0+cu124
240
+ - Datasets: 3.6.0
241
+ - Tokenizers: 0.21.1
242
+
243
+ ## Citation
244
+
245
+ ### BibTeX
246
+ ```bibtex
247
+ @article{https://doi.org/10.48550/arxiv.2209.11055,
248
+ doi = {10.48550/ARXIV.2209.11055},
249
+ url = {https://arxiv.org/abs/2209.11055},
250
+ author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
251
+ keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
252
+ title = {Efficient Few-Shot Learning Without Prompts},
253
+ publisher = {arXiv},
254
+ year = {2022},
255
+ copyright = {Creative Commons Attribution 4.0 International}
256
+ }
257
+ ```
258
+
259
+ <!--
260
+ ## Glossary
261
+
262
+ *Clearly define terms in order to be accessible across audiences.*
263
+ -->
264
+
265
+ <!--
266
+ ## Model Card Authors
267
+
268
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
269
+ -->
270
+
271
+ <!--
272
+ ## Model Card Contact
273
+
274
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
275
+ -->
config.json ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "classifier_dropout": null,
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 384,
11
+ "initializer_range": 0.02,
12
+ "intermediate_size": 1536,
13
+ "layer_norm_eps": 1e-12,
14
+ "max_position_embeddings": 512,
15
+ "model_type": "bert",
16
+ "num_attention_heads": 12,
17
+ "num_hidden_layers": 12,
18
+ "pad_token_id": 0,
19
+ "position_embedding_type": "absolute",
20
+ "torch_dtype": "float32",
21
+ "transformers_version": "4.52.4",
22
+ "type_vocab_size": 2,
23
+ "use_cache": true,
24
+ "vocab_size": 250037
25
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "4.1.0",
4
+ "transformers": "4.52.4",
5
+ "pytorch": "2.6.0+cu124"
6
+ },
7
+ "prompts": {},
8
+ "default_prompt_name": null,
9
+ "similarity_fn_name": "cosine"
10
+ }
config_setfit.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "normalize_embeddings": false,
3
+ "labels": null
4
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:319ff3eb252ff5b025d9e787dabb22b85d63526678b9147b92b2dd1848e293c7
3
+ size 470637416
model_head.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c5a9e9636979698c03169a08e3d635b4eda4a0b42a189fef06e23043057d26f
3
+ size 158020
modules.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "idx": 0,
4
+ "name": "0",
5
+ "path": "",
6
+ "type": "sentence_transformers.models.Transformer"
7
+ },
8
+ {
9
+ "idx": 1,
10
+ "name": "1",
11
+ "path": "1_Pooling",
12
+ "type": "sentence_transformers.models.Pooling"
13
+ }
14
+ ]
sentence_bert_config.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "max_seq_length": 128,
3
+ "do_lower_case": false
4
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": {
3
+ "content": "<s>",
4
+ "lstrip": false,
5
+ "normalized": false,
6
+ "rstrip": false,
7
+ "single_word": false
8
+ },
9
+ "cls_token": {
10
+ "content": "<s>",
11
+ "lstrip": false,
12
+ "normalized": false,
13
+ "rstrip": false,
14
+ "single_word": false
15
+ },
16
+ "eos_token": {
17
+ "content": "</s>",
18
+ "lstrip": false,
19
+ "normalized": false,
20
+ "rstrip": false,
21
+ "single_word": false
22
+ },
23
+ "mask_token": {
24
+ "content": "<mask>",
25
+ "lstrip": true,
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": "</s>",
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": false,
48
+ "rstrip": false,
49
+ "single_word": false
50
+ }
51
+ }
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cad551d5600a84242d0973327029452a1e3672ba6313c2a3c3d69c4310e12719
3
+ size 17082987
tokenizer_config.json ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<s>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<pad>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "</s>",
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": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "250001": {
36
+ "content": "<mask>",
37
+ "lstrip": true,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "<s>",
45
+ "clean_up_tokenization_spaces": false,
46
+ "cls_token": "<s>",
47
+ "do_lower_case": true,
48
+ "eos_token": "</s>",
49
+ "extra_special_tokens": {},
50
+ "mask_token": "<mask>",
51
+ "max_length": 128,
52
+ "model_max_length": 128,
53
+ "pad_to_multiple_of": null,
54
+ "pad_token": "<pad>",
55
+ "pad_token_type_id": 0,
56
+ "padding_side": "right",
57
+ "sep_token": "</s>",
58
+ "stride": 0,
59
+ "strip_accents": null,
60
+ "tokenize_chinese_chars": true,
61
+ "tokenizer_class": "BertTokenizer",
62
+ "truncation_side": "right",
63
+ "truncation_strategy": "longest_first",
64
+ "unk_token": "<unk>"
65
+ }
unigram.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:da145b5e7700ae40f16691ec32a0b1fdc1ee3298db22a31ea55f57a966c4a65d
3
+ size 14763260