kemonito233 commited on
Commit
716b02d
·
verified ·
1 Parent(s): 96e1a96

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ 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
1_Pooling/config.json ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "word_embedding_dimension": 768,
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 CHANGED
@@ -1,3 +1,259 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - setfit
4
+ - sentence-transformers
5
+ - text-classification
6
+ - generated_from_setfit_trainer
7
+ widget:
8
+ - text: ya tengo mi trámite autorizado
9
+ - text: que dijo
10
+ - text: No se encuentra
11
+ - text: deje su mensaje despues del tono.
12
+ - text: Borren mi número
13
+ metrics:
14
+ - accuracy
15
+ pipeline_tag: text-classification
16
+ library_name: setfit
17
+ inference: true
18
+ base_model: sentence-transformers/paraphrase-multilingual-mpnet-base-v2
19
+ model-index:
20
+ - name: SetFit with sentence-transformers/paraphrase-multilingual-mpnet-base-v2
21
+ results:
22
+ - task:
23
+ type: text-classification
24
+ name: Text Classification
25
+ dataset:
26
+ name: Unknown
27
+ type: unknown
28
+ split: test
29
+ metrics:
30
+ - type: accuracy
31
+ value: 0.7358490566037735
32
+ name: Accuracy
33
+ ---
34
+
35
+ # SetFit with sentence-transformers/paraphrase-multilingual-mpnet-base-v2
36
+
37
+ 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-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2) as the Sentence Transformer embedding model. A [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance is used for classification.
38
+
39
+ The model has been trained using an efficient few-shot learning technique that involves:
40
+
41
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
42
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
43
+
44
+ ## Model Details
45
+
46
+ ### Model Description
47
+ - **Model Type:** SetFit
48
+ - **Sentence Transformer body:** [sentence-transformers/paraphrase-multilingual-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-multilingual-mpnet-base-v2)
49
+ - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
50
+ - **Maximum Sequence Length:** 128 tokens
51
+ - **Number of Classes:** 27 classes
52
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
53
+ <!-- - **Language:** Unknown -->
54
+ <!-- - **License:** Unknown -->
55
+
56
+ ### Model Sources
57
+
58
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
59
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
60
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
61
+
62
+ ### Model Labels
63
+ | Label | Examples |
64
+ |:------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
65
+ | 21 | <ul><li>'Por que tienen mi nombre'</li><li>'yo no le di mis datos ni nada a viraal'</li><li>'Como obtuvo mi informacion'</li></ul> |
66
+ | 12 | <ul><li>'Luego veo'</li><li>'Lo voy a pensar'</li><li>'Dejame checarlo'</li></ul> |
67
+ | 18 | <ul><li>'Soy su hija'</li><li>'el no puede contestar ahorita'</li><li>'Soy su hijo'</li></ul> |
68
+ | 9 | <ul><li>'No quiero nada'</li><li>'No me interesa'</li><li>'No estoy interesado'</li></ul> |
69
+ | 7 | <ul><li>'Estoy boletinado'</li><li>'Nadie me presta'</li><li>'Mi buro está rojo'</li></ul> |
70
+ | 5 | <ul><li>'no es mi numero'</li><li>'esta equivocada'</li><li>'no lo conozco'</li></ul> |
71
+ | 24 | <ul><li>'Es rápido'</li><li>'En cuánto tiempo queda listo'</li><li>'Me urge el dinero, cuándo queda'</li></ul> |
72
+ | 13 | <ul><li>'quien me busca'</li><li>'de parte de quien'</li><li>'no se quien eres'</li></ul> |
73
+ | 15 | <ul><li>'La llamada se reenvio al buzon de voz,Graba tu mensaje despues del tono.'</li><li>'La llamada se reenvio al buzon de voz.'</li><li>'es el servicio de'</li></ul> |
74
+ | 22 | <ul><li>'Requisitos para el credito'</li><li>'Piden buro de credito'</li><li>'Piden aval'</li></ul> |
75
+ | 17 | <ul><li>'Tienen oficinas físicas'</li><li>'Con que banco es el credito'</li><li>'quienes son ustedes'</li></ul> |
76
+ | 20 | <ul><li>'sigue'</li><li>'bueno, bueno'</li><li>'habla'</li></ul> |
77
+ | 11 | <ul><li>'Márcame luego'</li><li>'Tengo prisa'</li><li>'Estoy trabajando'</li></ul> |
78
+ | 25 | <ul><li>'Tengo credito con Credifiel'</li><li>'No tengo capacidad de credito'</li><li>'quiero bajar mi deuda actual'</li></ul> |
79
+ | 1 | <ul><li>'quiero la cotizacion'</li><li>'Sí, me interesa'</li><li>'A ver, cuentame más'</li></ul> |
80
+ | 23 | <ul><li>'La tasa es fija'</li><li>'Es muy caro el interes'</li><li>'Deme el porcentaje de interes'</li></ul> |
81
+ | 6 | <ul><li>'Por el momento no'</li><li>'despues'</li><li>'Ahora no joven'</li></ul> |
82
+ | 26 | <ul><li>'ya mande mis papeles'</li><li>'Me atendio otra señorita'</li><li>'ya estoy en proceso con ustedes'</li></ul> |
83
+ | 14 | <ul><li>'quítenme de su lista'</li><li>'No necesito dinero, borren el número'</li><li>'No deseo recibir publicidad'</li></ul> |
84
+ | 0 | <ul><li>'No se, quizás'</li><li>'Mándalo a ver que tal'</li><li>'Dejame ver'</li></ul> |
85
+ | 10 | <ul><li>'Estoy bien así'</li><li>'No quiero endeudarme'</li><li>'Tengo dinero'</li></ul> |
86
+ | 2 | <ul><li>'Está enfermo'</li><li>'Está en el hospital'</li><li>'Tiene demencia'</li></ul> |
87
+ | 19 | <ul><li>'no le oí bien'</li><li>'puede repetir por favor'</li><li>'me lo puede repetir por favor'</li></ul> |
88
+ | 3 | <ul><li>'Es difunto'</li><li>'el ya no vive'</li><li>'Fallecio hace tiempo'</li></ul> |
89
+ | 8 | <ul><li>'No uso banca movil'</li><li>'No se hacer pagos digitales'</li><li>'No le se al celular'</li></ul> |
90
+ | 4 | <ul><li>'Anda fuera'</li><li>'Regresa más tarde'</li><li>'Salio'</li></ul> |
91
+ | 16 | <ul><li>'Hay gastos ocultos'</li><li>'No doy dinero por adelantado'</li><li>'Tiene costo el trámite'</li></ul> |
92
+
93
+ ## Evaluation
94
+
95
+ ### Metrics
96
+ | Label | Accuracy |
97
+ |:--------|:---------|
98
+ | **all** | 0.7358 |
99
+
100
+ ## Uses
101
+
102
+ ### Direct Use for Inference
103
+
104
+ First install the SetFit library:
105
+
106
+ ```bash
107
+ pip install setfit
108
+ ```
109
+
110
+ Then you can load this model and run inference.
111
+
112
+ ```python
113
+ from setfit import SetFitModel
114
+
115
+ # Download from the 🤗 Hub
116
+ model = SetFitModel.from_pretrained("setfit_model_id")
117
+ # Run inference
118
+ preds = model("que dijo")
119
+ ```
120
+
121
+ <!--
122
+ ### Downstream Use
123
+
124
+ *List how someone could finetune this model on their own dataset.*
125
+ -->
126
+
127
+ <!--
128
+ ### Out-of-Scope Use
129
+
130
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
131
+ -->
132
+
133
+ <!--
134
+ ## Bias, Risks and Limitations
135
+
136
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
137
+ -->
138
+
139
+ <!--
140
+ ### Recommendations
141
+
142
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
143
+ -->
144
+
145
+ ## Training Details
146
+
147
+ ### Training Set Metrics
148
+ | Training set | Min | Median | Max |
149
+ |:-------------|:----|:-------|:----|
150
+ | Word count | 1 | 3.7644 | 13 |
151
+
152
+ | Label | Training Sample Count |
153
+ |:------|:----------------------|
154
+ | 0 | 5 |
155
+ | 1 | 6 |
156
+ | 2 | 5 |
157
+ | 3 | 4 |
158
+ | 4 | 5 |
159
+ | 5 | 4 |
160
+ | 6 | 9 |
161
+ | 7 | 6 |
162
+ | 8 | 6 |
163
+ | 9 | 13 |
164
+ | 10 | 6 |
165
+ | 11 | 5 |
166
+ | 12 | 5 |
167
+ | 13 | 10 |
168
+ | 14 | 13 |
169
+ | 15 | 13 |
170
+ | 16 | 6 |
171
+ | 17 | 9 |
172
+ | 18 | 10 |
173
+ | 19 | 9 |
174
+ | 20 | 13 |
175
+ | 21 | 7 |
176
+ | 22 | 6 |
177
+ | 23 | 6 |
178
+ | 24 | 6 |
179
+ | 25 | 12 |
180
+ | 26 | 9 |
181
+
182
+ ### Training Hyperparameters
183
+ - batch_size: (16, 16)
184
+ - num_epochs: (1, 1)
185
+ - max_steps: -1
186
+ - sampling_strategy: oversampling
187
+ - num_iterations: 20
188
+ - body_learning_rate: (2e-05, 1e-05)
189
+ - head_learning_rate: 0.01
190
+ - loss: CosineSimilarityLoss
191
+ - distance_metric: cosine_distance
192
+ - margin: 0.25
193
+ - end_to_end: False
194
+ - use_amp: False
195
+ - warmup_proportion: 0.1
196
+ - l2_weight: 0.01
197
+ - seed: 42
198
+ - evaluation_strategy: epoch
199
+ - eval_max_steps: -1
200
+ - load_best_model_at_end: True
201
+
202
+ ### Training Results
203
+ | Epoch | Step | Training Loss | Validation Loss |
204
+ |:------:|:----:|:-------------:|:---------------:|
205
+ | 0.0019 | 1 | 0.1458 | - |
206
+ | 0.0962 | 50 | 0.1708 | - |
207
+ | 0.1923 | 100 | 0.1158 | - |
208
+ | 0.2885 | 150 | 0.059 | - |
209
+ | 0.3846 | 200 | 0.0494 | - |
210
+ | 0.4808 | 250 | 0.0337 | - |
211
+ | 0.5769 | 300 | 0.026 | - |
212
+ | 0.6731 | 350 | 0.0182 | - |
213
+ | 0.7692 | 400 | 0.0144 | - |
214
+ | 0.8654 | 450 | 0.0113 | - |
215
+ | 0.9615 | 500 | 0.0138 | - |
216
+ | 1.0 | 520 | - | 0.0688 |
217
+
218
+ ### Framework Versions
219
+ - Python: 3.12.12
220
+ - SetFit: 1.1.3
221
+ - Sentence Transformers: 5.2.0
222
+ - Transformers: 4.57.3
223
+ - PyTorch: 2.9.0+cpu
224
+ - Datasets: 4.0.0
225
+ - Tokenizers: 0.22.2
226
+
227
+ ## Citation
228
+
229
+ ### BibTeX
230
+ ```bibtex
231
+ @article{https://doi.org/10.48550/arxiv.2209.11055,
232
+ doi = {10.48550/ARXIV.2209.11055},
233
+ url = {https://arxiv.org/abs/2209.11055},
234
+ author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
235
+ keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
236
+ title = {Efficient Few-Shot Learning Without Prompts},
237
+ publisher = {arXiv},
238
+ year = {2022},
239
+ copyright = {Creative Commons Attribution 4.0 International}
240
+ }
241
+ ```
242
+
243
+ <!--
244
+ ## Glossary
245
+
246
+ *Clearly define terms in order to be accessible across audiences.*
247
+ -->
248
+
249
+ <!--
250
+ ## Model Card Authors
251
+
252
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
253
+ -->
254
+
255
+ <!--
256
+ ## Model Card Contact
257
+
258
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
259
+ -->
config.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "XLMRobertaModel"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "bos_token_id": 0,
7
+ "classifier_dropout": null,
8
+ "dtype": "float32",
9
+ "eos_token_id": 2,
10
+ "gradient_checkpointing": false,
11
+ "hidden_act": "gelu",
12
+ "hidden_dropout_prob": 0.1,
13
+ "hidden_size": 768,
14
+ "initializer_range": 0.02,
15
+ "intermediate_size": 3072,
16
+ "layer_norm_eps": 1e-05,
17
+ "max_position_embeddings": 514,
18
+ "model_type": "xlm-roberta",
19
+ "num_attention_heads": 12,
20
+ "num_hidden_layers": 12,
21
+ "output_past": true,
22
+ "pad_token_id": 1,
23
+ "position_embedding_type": "absolute",
24
+ "transformers_version": "4.57.3",
25
+ "type_vocab_size": 1,
26
+ "use_cache": true,
27
+ "vocab_size": 250002
28
+ }
config_sentence_transformers.json ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "__version__": {
3
+ "sentence_transformers": "5.2.0",
4
+ "transformers": "4.57.3",
5
+ "pytorch": "2.9.0+cpu"
6
+ },
7
+ "model_type": "SentenceTransformer",
8
+ "prompts": {
9
+ "query": "",
10
+ "document": ""
11
+ },
12
+ "default_prompt_name": null,
13
+ "similarity_fn_name": "cosine"
14
+ }
config_setfit.json ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ {
2
+ "labels": null,
3
+ "normalize_embeddings": false
4
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f09f5822fcb063607cfd4bdfbb8156e3dc617df0e5ae8eb5e41329d980d8f5d
3
+ size 1112197096
model_head.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0ef061d1bdfb131a4d3b01f89b6cd90f887ecedb1100c18b4c9d6556b4e85af3
3
+ size 167167
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
+ }
sentencepiece.bpe.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cfc8146abe2a0488e9e2a0c56de7952f7c11ab059eca145a0a727afce0db2865
3
+ size 5069051
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,62 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "eos_token": "</s>",
48
+ "extra_special_tokens": {},
49
+ "mask_token": "<mask>",
50
+ "max_length": 128,
51
+ "model_max_length": 128,
52
+ "pad_to_multiple_of": null,
53
+ "pad_token": "<pad>",
54
+ "pad_token_type_id": 0,
55
+ "padding_side": "right",
56
+ "sep_token": "</s>",
57
+ "stride": 0,
58
+ "tokenizer_class": "XLMRobertaTokenizer",
59
+ "truncation_side": "right",
60
+ "truncation_strategy": "longest_first",
61
+ "unk_token": "<unk>"
62
+ }