monentiadev commited on
Commit
3d9b8de
·
verified ·
1 Parent(s): a6326fe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +189 -205
README.md CHANGED
@@ -1,206 +1,190 @@
1
- ---
2
- tags:
3
- - setfit
4
- - sentence-transformers
5
- - text-classification
6
- - generated_from_setfit_trainer
7
- widget:
8
- - text: Plasta
9
- - text: 203 terminada
10
- - text: habitación 294 limpia
11
- - text: ¡Hola, cómo va todo!
12
- - text: Quiero ver el estado de la incidencia que reporté en la Calle Mayor de Triana,
13
- 25.
14
- metrics:
15
- - accuracy
16
- pipeline_tag: text-classification
17
- library_name: setfit
18
- inference: true
19
- base_model: jaimevera1107/all-MiniLM-L6-v2-similarity-es
20
- ---
21
-
22
- # SetFit with jaimevera1107/all-MiniLM-L6-v2-similarity-es
23
-
24
- This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [jaimevera1107/all-MiniLM-L6-v2-similarity-es](https://huggingface.co/jaimevera1107/all-MiniLM-L6-v2-similarity-es) 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.
25
-
26
- The model has been trained using an efficient few-shot learning technique that involves:
27
-
28
- 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
29
- 2. Training a classification head with features from the fine-tuned Sentence Transformer.
30
-
31
- ## Model Details
32
-
33
- ### Model Description
34
- - **Model Type:** SetFit
35
- - **Sentence Transformer body:** [jaimevera1107/all-MiniLM-L6-v2-similarity-es](https://huggingface.co/jaimevera1107/all-MiniLM-L6-v2-similarity-es)
36
- - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
37
- - **Maximum Sequence Length:** 256 tokens
38
- - **Number of Classes:** 4 classes
39
- <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
40
- <!-- - **Language:** Unknown -->
41
- <!-- - **License:** Unknown -->
42
-
43
- ### Model Sources
44
-
45
- - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
46
- - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
47
- - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
48
-
49
- ### Model Labels
50
- | Label | Examples |
51
- |:-------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
52
- | request | <ul><li>'lencería necesaria'</li><li>'material necesario para hoy'</li><li>'terminé la habitación 234'</li></ul> |
53
- | conversation | <ul><li>'buena noche'</li><li>'Qué pasa, tío, ¿todo bien?'</li><li>'Buenas, ¿cómo va la cosa?!'</li></ul> |
54
- | help | <ul><li>'ayuda por favor'</li><li>'Ayuda que no que puedo hacer'</li><li>'Hola, que puedo hacer'</li></ul> |
55
- | censorship | <ul><li>'Eres un completo inútil, no sirves para nada'</li><li>'Siempre diciendo estupideces, mejor cállate'</li><li>'Tu sola existencia es una vergüenza'</li></ul> |
56
-
57
- ## Uses
58
-
59
- ### Direct Use for Inference
60
-
61
- First install the SetFit library:
62
-
63
- ```bash
64
- pip install setfit
65
- ```
66
-
67
- Then you can load this model and run inference.
68
-
69
- ```python
70
- from setfit import SetFitModel
71
-
72
- # Download from the 🤗 Hub
73
- model = SetFitModel.from_pretrained("monentiadev/es-input-classifier")
74
- # Run inference
75
- preds = model("Plasta")
76
- ```
77
-
78
- <!--
79
- ### Downstream Use
80
-
81
- *List how someone could finetune this model on their own dataset.*
82
- -->
83
-
84
- <!--
85
- ### Out-of-Scope Use
86
-
87
- *List how the model may foreseeably be misused and address what users ought not to do with the model.*
88
- -->
89
-
90
- <!--
91
- ## Bias, Risks and Limitations
92
-
93
- *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
94
- -->
95
-
96
- <!--
97
- ### Recommendations
98
-
99
- *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
100
- -->
101
-
102
- ## Training Details
103
-
104
- ### Training Set Metrics
105
- | Training set | Min | Median | Max |
106
- |:-------------|:----|:-------|:----|
107
- | Word count | 1 | 5.0723 | 38 |
108
-
109
- | Label | Training Sample Count |
110
- |:-------------|:----------------------|
111
- | censorship | 407 |
112
- | conversation | 137 |
113
- | help | 274 |
114
- | request | 552 |
115
-
116
- ### Training Hyperparameters
117
- - batch_size: (128, 128)
118
- - num_epochs: (3, 3)
119
- - max_steps: -1
120
- - sampling_strategy: oversampling
121
- - num_iterations: 20
122
- - body_learning_rate: (2e-05, 1e-05)
123
- - head_learning_rate: 0.01
124
- - loss: CosineSimilarityLoss
125
- - distance_metric: cosine_distance
126
- - margin: 0.25
127
- - end_to_end: False
128
- - use_amp: False
129
- - warmup_proportion: 0.1
130
- - l2_weight: 0.01
131
- - seed: 42
132
- - eval_max_steps: -1
133
- - load_best_model_at_end: False
134
-
135
- ### Training Results
136
- | Epoch | Step | Training Loss | Validation Loss |
137
- |:------:|:----:|:-------------:|:---------------:|
138
- | 0.0023 | 1 | 0.3161 | - |
139
- | 0.1166 | 50 | 0.2857 | - |
140
- | 0.2331 | 100 | 0.2158 | - |
141
- | 0.3497 | 150 | 0.1581 | - |
142
- | 0.4662 | 200 | 0.0878 | - |
143
- | 0.5828 | 250 | 0.0299 | - |
144
- | 0.6993 | 300 | 0.0124 | - |
145
- | 0.8159 | 350 | 0.0083 | - |
146
- | 0.9324 | 400 | 0.006 | - |
147
- | 1.0490 | 450 | 0.0038 | - |
148
- | 1.1655 | 500 | 0.0027 | - |
149
- | 1.2821 | 550 | 0.0027 | - |
150
- | 1.3986 | 600 | 0.0017 | - |
151
- | 1.5152 | 650 | 0.0016 | - |
152
- | 1.6317 | 700 | 0.0013 | - |
153
- | 1.7483 | 750 | 0.0012 | - |
154
- | 1.8648 | 800 | 0.0012 | - |
155
- | 1.9814 | 850 | 0.001 | - |
156
- | 2.0979 | 900 | 0.001 | - |
157
- | 2.2145 | 950 | 0.0011 | - |
158
- | 2.3310 | 1000 | 0.0009 | - |
159
- | 2.4476 | 1050 | 0.0008 | - |
160
- | 2.5641 | 1100 | 0.0009 | - |
161
- | 2.6807 | 1150 | 0.0008 | - |
162
- | 2.7972 | 1200 | 0.0008 | - |
163
- | 2.9138 | 1250 | 0.0007 | - |
164
-
165
- ### Framework Versions
166
- - Python: 3.10.0
167
- - SetFit: 1.1.2
168
- - Sentence Transformers: 5.0.0
169
- - Transformers: 4.53.1
170
- - PyTorch: 2.7.1+cu126
171
- - Datasets: 2.19.2
172
- - Tokenizers: 0.21.2
173
-
174
- ## Citation
175
-
176
- ### BibTeX
177
- ```bibtex
178
- @article{https://doi.org/10.48550/arxiv.2209.11055,
179
- doi = {10.48550/ARXIV.2209.11055},
180
- url = {https://arxiv.org/abs/2209.11055},
181
- author = {Tunstall, Lewis and Reimers, Nils and Jo, Unso Eun Seo and Bates, Luke and Korat, Daniel and Wasserblat, Moshe and Pereg, Oren},
182
- keywords = {Computation and Language (cs.CL), FOS: Computer and information sciences, FOS: Computer and information sciences},
183
- title = {Efficient Few-Shot Learning Without Prompts},
184
- publisher = {arXiv},
185
- year = {2022},
186
- copyright = {Creative Commons Attribution 4.0 International}
187
- }
188
- ```
189
-
190
- <!--
191
- ## Glossary
192
-
193
- *Clearly define terms in order to be accessible across audiences.*
194
- -->
195
-
196
- <!--
197
- ## Model Card Authors
198
-
199
- *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
200
- -->
201
-
202
- <!--
203
- ## Model Card Contact
204
-
205
- *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
206
  -->
 
1
+ ---
2
+ tags:
3
+ - setfit
4
+ - sentence-transformers
5
+ - text-classification
6
+ - generated_from_setfit_trainer
7
+ widget:
8
+ - text: Plasta
9
+ - text: 203 terminada
10
+ - text: habitación 294 limpia
11
+ - text: ¡Hola, cómo va todo!
12
+ - text: Quiero ver el estado de la incidencia que reporté en la Calle Mayor de Triana.
13
+ metrics:
14
+ - accuracy
15
+ pipeline_tag: text-classification
16
+ library_name: setfit
17
+ inference: true
18
+ base_model: jaimevera1107/all-MiniLM-L6-v2-similarity-es
19
+ ---
20
+
21
+ # Input Classifier
22
+
23
+ This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [jaimevera1107/all-MiniLM-L6-v2-similarity-es](https://huggingface.co/jaimevera1107/all-MiniLM-L6-v2-similarity-es) 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.
24
+
25
+ The model has been trained using an efficient few-shot learning technique that involves:
26
+
27
+ 1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
28
+ 2. Training a classification head with features from the fine-tuned Sentence Transformer.
29
+
30
+ ## Model Details
31
+
32
+ ### Model Description
33
+ - **Model Type:** SetFit
34
+ - **Sentence Transformer body:** [jaimevera1107/all-MiniLM-L6-v2-similarity-es](https://huggingface.co/jaimevera1107/all-MiniLM-L6-v2-similarity-es)
35
+ - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
36
+ - **Maximum Sequence Length:** 256 tokens
37
+ - **Number of Classes:** 4 classes
38
+ <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
39
+ <!-- - **Language:** Unknown -->
40
+ <!-- - **License:** Unknown -->
41
+
42
+ ### Model Sources
43
+
44
+ - **Repository:** [SetFit on GitHub](https://github.com/huggingface/setfit)
45
+ - **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
46
+ - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
47
+
48
+ ### Model Labels
49
+ | Label | Examples |
50
+ |:-------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
51
+ | request | <ul><li>'lencería necesaria'</li><li>'material necesario para hoy'</li><li>'terminé la habitación 234'</li></ul> |
52
+ | conversation | <ul><li>'buena noche'</li><li>'Qué pasa, tío, ¿todo bien?'</li><li>'Buenas, ¿cómo va la cosa?!'</li></ul> |
53
+ | help | <ul><li>'ayuda por favor'</li><li>'Ayuda que no que puedo hacer'</li><li>'Hola, que puedo hacer'</li></ul> |
54
+ | censorship | <ul><li>'Eres un completo inútil, no sirves para nada'</li><li>'Siempre diciendo estupideces, mejor cállate'</li><li>'Tu sola existencia es una vergüenza'</li></ul> |
55
+
56
+ ## Uses
57
+
58
+ ### Direct Use for Inference
59
+
60
+ First install the SetFit library:
61
+
62
+ ```bash
63
+ pip install setfit
64
+ ```
65
+
66
+ Then you can load this model and run inference.
67
+
68
+ ```python
69
+ from setfit import SetFitModel
70
+
71
+ # Download from the 🤗 Hub
72
+ model = SetFitModel.from_pretrained("monentiadev/es-input-classifier")
73
+ # Run inference
74
+ preds = model("Hola")
75
+ ```
76
+
77
+ <!--
78
+ ### Downstream Use
79
+
80
+ *List how someone could finetune this model on their own dataset.*
81
+ -->
82
+
83
+ <!--
84
+ ### Out-of-Scope Use
85
+
86
+ *List how the model may foreseeably be misused and address what users ought not to do with the model.*
87
+ -->
88
+
89
+ <!--
90
+ ## Bias, Risks and Limitations
91
+
92
+ *What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model.*
93
+ -->
94
+
95
+ <!--
96
+ ### Recommendations
97
+
98
+ *What are recommendations with respect to the foreseeable issues? For example, filtering explicit content.*
99
+ -->
100
+
101
+ ## Training Details
102
+
103
+ ### Training Set Metrics
104
+ | Training set | Min | Median | Max |
105
+ |:-------------|:----|:-------|:----|
106
+ | Word count | 1 | 5.0723 | 38 |
107
+
108
+ | Label | Training Sample Count |
109
+ |:-------------|:----------------------|
110
+ | censorship | 407 |
111
+ | conversation | 137 |
112
+ | help | 274 |
113
+ | request | 552 |
114
+
115
+ ### Training Hyperparameters
116
+ - batch_size: (128, 128)
117
+ - num_epochs: (3, 3)
118
+ - max_steps: -1
119
+ - sampling_strategy: oversampling
120
+ - num_iterations: 20
121
+ - body_learning_rate: (2e-05, 1e-05)
122
+ - head_learning_rate: 0.01
123
+ - loss: CosineSimilarityLoss
124
+ - distance_metric: cosine_distance
125
+ - margin: 0.25
126
+ - end_to_end: False
127
+ - use_amp: False
128
+ - warmup_proportion: 0.1
129
+ - l2_weight: 0.01
130
+ - seed: 42
131
+ - eval_max_steps: -1
132
+ - load_best_model_at_end: False
133
+
134
+ ### Training Results
135
+ | Epoch | Step | Training Loss | Validation Loss |
136
+ |:------:|:----:|:-------------:|:---------------:|
137
+ | 0.0023 | 1 | 0.3161 | - |
138
+ | 0.1166 | 50 | 0.2857 | - |
139
+ | 0.2331 | 100 | 0.2158 | - |
140
+ | 0.3497 | 150 | 0.1581 | - |
141
+ | 0.4662 | 200 | 0.0878 | - |
142
+ | 0.5828 | 250 | 0.0299 | - |
143
+ | 0.6993 | 300 | 0.0124 | - |
144
+ | 0.8159 | 350 | 0.0083 | - |
145
+ | 0.9324 | 400 | 0.006 | - |
146
+ | 1.0490 | 450 | 0.0038 | - |
147
+ | 1.1655 | 500 | 0.0027 | - |
148
+ | 1.2821 | 550 | 0.0027 | - |
149
+ | 1.3986 | 600 | 0.0017 | - |
150
+ | 1.5152 | 650 | 0.0016 | - |
151
+ | 1.6317 | 700 | 0.0013 | - |
152
+ | 1.7483 | 750 | 0.0012 | - |
153
+ | 1.8648 | 800 | 0.0012 | - |
154
+ | 1.9814 | 850 | 0.001 | - |
155
+ | 2.0979 | 900 | 0.001 | - |
156
+ | 2.2145 | 950 | 0.0011 | - |
157
+ | 2.3310 | 1000 | 0.0009 | - |
158
+ | 2.4476 | 1050 | 0.0008 | - |
159
+ | 2.5641 | 1100 | 0.0009 | - |
160
+ | 2.6807 | 1150 | 0.0008 | - |
161
+ | 2.7972 | 1200 | 0.0008 | - |
162
+ | 2.9138 | 1250 | 0.0007 | - |
163
+
164
+ ### Framework Versions
165
+ - Python: 3.10.0
166
+ - SetFit: 1.1.2
167
+ - Sentence Transformers: 5.0.0
168
+ - Transformers: 4.53.1
169
+ - PyTorch: 2.7.1+cu126
170
+ - Datasets: 2.19.2
171
+ - Tokenizers: 0.21.2
172
+ ```
173
+
174
+ <!--
175
+ ## Glossary
176
+
177
+ *Clearly define terms in order to be accessible across audiences.*
178
+ -->
179
+
180
+ <!--
181
+ ## Model Card Authors
182
+
183
+ *Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction.*
184
+ -->
185
+
186
+ <!--
187
+ ## Model Card Contact
188
+
189
+ *Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors.*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
190
  -->