Add SetFit model
Browse files- README.md +46 -59
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -11,11 +11,14 @@ metrics:
|
|
11 |
- recall
|
12 |
- f1
|
13 |
widget:
|
14 |
-
- text:
|
15 |
-
|
16 |
-
- text:
|
17 |
-
- text: '
|
18 |
-
|
|
|
|
|
|
|
19 |
pipeline_tag: text-classification
|
20 |
inference: true
|
21 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -31,16 +34,16 @@ model-index:
|
|
31 |
split: test
|
32 |
metrics:
|
33 |
- type: accuracy
|
34 |
-
value: 0.
|
35 |
name: Accuracy
|
36 |
- type: precision
|
37 |
-
value: 0.
|
38 |
name: Precision
|
39 |
- type: recall
|
40 |
-
value: 0.
|
41 |
name: Recall
|
42 |
- type: f1
|
43 |
-
value: 0.
|
44 |
name: F1
|
45 |
---
|
46 |
|
@@ -72,17 +75,17 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
72 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
73 |
|
74 |
### Model Labels
|
75 |
-
| Label | Examples
|
76 |
-
|
77 |
-
|
|
78 |
-
|
|
79 |
|
80 |
## Evaluation
|
81 |
|
82 |
### Metrics
|
83 |
| Label | Accuracy | Precision | Recall | F1 |
|
84 |
|:--------|:---------|:----------|:-------|:-------|
|
85 |
-
| **all** | 0.
|
86 |
|
87 |
## Uses
|
88 |
|
@@ -102,7 +105,7 @@ from setfit import SetFitModel
|
|
102 |
# Download from the 🤗 Hub
|
103 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
104 |
# Run inference
|
105 |
-
preds = model("
|
106 |
```
|
107 |
|
108 |
<!--
|
@@ -134,12 +137,12 @@ preds = model(": Session")
|
|
134 |
### Training Set Metrics
|
135 |
| Training set | Min | Median | Max |
|
136 |
|:-------------|:----|:-------|:----|
|
137 |
-
| Word count | 1 | 8.
|
138 |
|
139 |
| Label | Training Sample Count |
|
140 |
|:------|:----------------------|
|
141 |
-
| False |
|
142 |
-
| True |
|
143 |
|
144 |
### Training Hyperparameters
|
145 |
- batch_size: (16, 2)
|
@@ -163,47 +166,31 @@ preds = model(": Session")
|
|
163 |
### Training Results
|
164 |
| Epoch | Step | Training Loss | Validation Loss |
|
165 |
|:------:|:----:|:-------------:|:---------------:|
|
166 |
-
| 0.
|
167 |
-
| 0.
|
168 |
-
| 0.
|
169 |
-
| 0.
|
170 |
-
| 0.
|
171 |
-
| 0.
|
172 |
-
| 0.
|
173 |
-
| 0.
|
174 |
-
| 0.
|
175 |
-
| 0.
|
176 |
-
| 0.
|
177 |
-
| 0.
|
178 |
-
| 0.
|
179 |
-
| 0.
|
180 |
-
| 0.
|
181 |
-
| 0.
|
182 |
-
| 0.
|
183 |
-
| 0.
|
184 |
-
| 0.
|
185 |
-
| 0.
|
186 |
-
| 0.
|
187 |
-
| 0.
|
188 |
-
| 0.
|
189 |
-
| 0.
|
190 |
-
| 0
|
191 |
-
| 0.625 | 1250 | 0.0005 | - |
|
192 |
-
| 0.65 | 1300 | 0.0111 | - |
|
193 |
-
| 0.675 | 1350 | 0.002 | - |
|
194 |
-
| 0.7 | 1400 | 0.0082 | - |
|
195 |
-
| 0.725 | 1450 | 0.0009 | - |
|
196 |
-
| 0.75 | 1500 | 0.0018 | - |
|
197 |
-
| 0.775 | 1550 | 0.0003 | - |
|
198 |
-
| 0.8 | 1600 | 0.0108 | - |
|
199 |
-
| 0.825 | 1650 | 0.0009 | - |
|
200 |
-
| 0.85 | 1700 | 0.0003 | - |
|
201 |
-
| 0.875 | 1750 | 0.0009 | - |
|
202 |
-
| 0.9 | 1800 | 0.0038 | - |
|
203 |
-
| 0.925 | 1850 | 0.0406 | - |
|
204 |
-
| 0.95 | 1900 | 0.0012 | - |
|
205 |
-
| 0.975 | 1950 | 0.0024 | - |
|
206 |
-
| 1.0 | 2000 | 0.0004 | - |
|
207 |
|
208 |
### Framework Versions
|
209 |
- Python: 3.11.0
|
|
|
11 |
- recall
|
12 |
- f1
|
13 |
widget:
|
14 |
+
- text: Maintenance to the cambridge.org website is scheduled for 14 March at 12am
|
15 |
+
– 8am GMT.
|
16 |
+
- text: Quarterly Earnings
|
17 |
+
- text: 'So set sail for Long John Silver''s and discover why wa''re America''s most
|
18 |
+
popular sealood vestments antannro fi '
|
19 |
+
- text: "\n OPEC oil price\
|
20 |
+
\ annually 1960-2024\n "
|
21 |
+
- text: 'RUSSELL WILSON OF THE SEATTLE SEAHAWKS — DURING SUPER BOWL XLVIII '
|
22 |
pipeline_tag: text-classification
|
23 |
inference: true
|
24 |
base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
34 |
split: test
|
35 |
metrics:
|
36 |
- type: accuracy
|
37 |
+
value: 0.8083333333333333
|
38 |
name: Accuracy
|
39 |
- type: precision
|
40 |
+
value: 0.7894736842105263
|
41 |
name: Precision
|
42 |
- type: recall
|
43 |
+
value: 0.8035714285714286
|
44 |
name: Recall
|
45 |
- type: f1
|
46 |
+
value: 0.7964601769911505
|
47 |
name: F1
|
48 |
---
|
49 |
|
|
|
75 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
76 |
|
77 |
### Model Labels
|
78 |
+
| Label | Examples |
|
79 |
+
|:------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
80 |
+
| False | <ul><li>'Learn more about this provider'</li><li>'Verletzte und Festnahmen'</li><li>'Bulgaria'</li></ul> |
|
81 |
+
| True | <ul><li>'Free Quotes on Doors '</li><li>'Pakistan Cricket Board, Gaddafi Stadium, Ferozepur Road, Lahore, Pakistan. E-Mail: careers@pcb.com.pk '</li><li>"‘here's a new predator in the urban jungle "</li></ul> |
|
82 |
|
83 |
## Evaluation
|
84 |
|
85 |
### Metrics
|
86 |
| Label | Accuracy | Precision | Recall | F1 |
|
87 |
|:--------|:---------|:----------|:-------|:-------|
|
88 |
+
| **all** | 0.8083 | 0.7895 | 0.8036 | 0.7965 |
|
89 |
|
90 |
## Uses
|
91 |
|
|
|
105 |
# Download from the 🤗 Hub
|
106 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
107 |
# Run inference
|
108 |
+
preds = model("Quarterly Earnings")
|
109 |
```
|
110 |
|
111 |
<!--
|
|
|
137 |
### Training Set Metrics
|
138 |
| Training set | Min | Median | Max |
|
139 |
|:-------------|:----|:-------|:----|
|
140 |
+
| Word count | 1 | 8.2229 | 242 |
|
141 |
|
142 |
| Label | Training Sample Count |
|
143 |
|:------|:----------------------|
|
144 |
+
| False | 236 |
|
145 |
+
| True | 244 |
|
146 |
|
147 |
### Training Hyperparameters
|
148 |
- batch_size: (16, 2)
|
|
|
166 |
### Training Results
|
167 |
| Epoch | Step | Training Loss | Validation Loss |
|
168 |
|:------:|:----:|:-------------:|:---------------:|
|
169 |
+
| 0.0008 | 1 | 0.3892 | - |
|
170 |
+
| 0.0417 | 50 | 0.2262 | - |
|
171 |
+
| 0.0833 | 100 | 0.2138 | - |
|
172 |
+
| 0.125 | 150 | 0.1058 | - |
|
173 |
+
| 0.1667 | 200 | 0.1327 | - |
|
174 |
+
| 0.2083 | 250 | 0.098 | - |
|
175 |
+
| 0.25 | 300 | 0.0719 | - |
|
176 |
+
| 0.2917 | 350 | 0.0634 | - |
|
177 |
+
| 0.3333 | 400 | 0.0021 | - |
|
178 |
+
| 0.375 | 450 | 0.0084 | - |
|
179 |
+
| 0.4167 | 500 | 0.0799 | - |
|
180 |
+
| 0.4583 | 550 | 0.0822 | - |
|
181 |
+
| 0.5 | 600 | 0.0775 | - |
|
182 |
+
| 0.5417 | 650 | 0.0114 | - |
|
183 |
+
| 0.5833 | 700 | 0.0013 | - |
|
184 |
+
| 0.625 | 750 | 0.0121 | - |
|
185 |
+
| 0.6667 | 800 | 0.1034 | - |
|
186 |
+
| 0.7083 | 850 | 0.0539 | - |
|
187 |
+
| 0.75 | 900 | 0.0076 | - |
|
188 |
+
| 0.7917 | 950 | 0.0114 | - |
|
189 |
+
| 0.8333 | 1000 | 0.0223 | - |
|
190 |
+
| 0.875 | 1050 | 0.0208 | - |
|
191 |
+
| 0.9167 | 1100 | 0.0246 | - |
|
192 |
+
| 0.9583 | 1150 | 0.0098 | - |
|
193 |
+
| 1.0 | 1200 | 0.003 | - |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
194 |
|
195 |
### Framework Versions
|
196 |
- Python: 3.11.0
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 437967672
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1dce3490c1781a93d8a6bc3b433e33b2f24c7458d050821ab4c70090abe529ca
|
3 |
size 437967672
|
model_head.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 6991
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:43732b1b3359749d4d2294079fbe7f24336e077549284d45e08b3b566f444501
|
3 |
size 6991
|