Add SetFit model
Browse files- README.md +35 -40
- config.json +1 -1
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -10,24 +10,20 @@ tags:
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
-
- text:
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
- text:
|
25 |
-
|
26 |
-
|
27 |
-
- text: You're such a complete idiot. I swear to god, your stupid opinion is the most
|
28 |
-
ignorant thing I've ever heard. Get a life, you pathetic excuse for a human being.
|
29 |
-
- text: Women are only good for one thing, and that's cooking and cleaning. They're
|
30 |
-
not capable of doing real work or making important decisions.
|
31 |
inference: true
|
32 |
model-index:
|
33 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -41,7 +37,7 @@ model-index:
|
|
41 |
split: test
|
42 |
metrics:
|
43 |
- type: f1
|
44 |
-
value: 0.
|
45 |
name: F1
|
46 |
---
|
47 |
|
@@ -73,17 +69,17 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
73 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
74 |
|
75 |
### Model Labels
|
76 |
-
| Label | Examples
|
77 |
-
|
78 |
-
|
|
79 |
-
|
|
80 |
|
81 |
## Evaluation
|
82 |
|
83 |
### Metrics
|
84 |
| Label | F1 |
|
85 |
|:--------|:-------|
|
86 |
-
| **all** | 0.
|
87 |
|
88 |
## Uses
|
89 |
|
@@ -103,7 +99,7 @@ from setfit import SetFitModel
|
|
103 |
# Download from the 🤗 Hub
|
104 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
105 |
# Run inference
|
106 |
-
preds = model("
|
107 |
```
|
108 |
|
109 |
<!--
|
@@ -133,14 +129,14 @@ preds = model("Women are only good for one thing, and that's cooking and cleanin
|
|
133 |
## Training Details
|
134 |
|
135 |
### Training Set Metrics
|
136 |
-
| Training set | Min | Median
|
137 |
-
|
138 |
-
| Word count |
|
139 |
|
140 |
| Label | Training Sample Count |
|
141 |
|:----------|:----------------------|
|
142 |
-
| Non toxic |
|
143 |
-
| Toxic |
|
144 |
|
145 |
### Training Hyperparameters
|
146 |
- batch_size: (16, 16)
|
@@ -162,16 +158,15 @@ preds = model("Women are only good for one thing, and that's cooking and cleanin
|
|
162 |
### Training Results
|
163 |
| Epoch | Step | Training Loss | Validation Loss |
|
164 |
|:-------:|:------:|:-------------:|:---------------:|
|
165 |
-
| 0.
|
166 |
-
| 1.0 |
|
167 |
-
| 1.
|
168 |
-
| **2.0** | **
|
169 |
-
| 2.
|
170 |
-
| 3.0 |
|
171 |
-
|
|
172 |
-
| 4.
|
173 |
-
|
|
174 |
-
| 5.0 | 215 | - | 0.1545 |
|
175 |
|
176 |
* The bold row denotes the saved checkpoint.
|
177 |
### Framework Versions
|
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
+
- text: I'm so excited for the weekend, I get to spend time with my friends and family.
|
14 |
+
We're planning a hike and then having a BBQ. I love days like this!
|
15 |
+
- text: You're just a stupid white person, you'll never understand what it's like
|
16 |
+
to be a minority. You're so privileged, you have no idea how much racism you've
|
17 |
+
experienced in your life. Get out of here with your entitled attitude.
|
18 |
+
- text: Are you f***ing kidding me?! This is the worst customer service I've ever
|
19 |
+
experienced. I've been on hold for 45 minutes and no one has even bothered to
|
20 |
+
answer my call. Unbelievable.
|
21 |
+
- text: You're such a f***ing idiot, how dare you even try to tell me what to do.
|
22 |
+
I swear to god, you're the most annoying person I've ever met. Just f*** off and
|
23 |
+
leave me alone.
|
24 |
+
- text: 'Just got the cutest puppy and I''m so in love with him! He''s already stolen
|
25 |
+
my heart and I''m sure he''ll bring so much joy to our family. Anyone else have
|
26 |
+
a furry friend at home? #puppylove #dogsofinstagram #loveofmylife'
|
|
|
|
|
|
|
|
|
27 |
inference: true
|
28 |
model-index:
|
29 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
37 |
split: test
|
38 |
metrics:
|
39 |
- type: f1
|
40 |
+
value: 0.8648435963013968
|
41 |
name: F1
|
42 |
---
|
43 |
|
|
|
69 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
70 |
|
71 |
### Model Labels
|
72 |
+
| Label | Examples |
|
73 |
+
|:----------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
74 |
+
| Toxic | <ul><li>"Can't believe this black guy thinks he can be president. What a joke. He's only in office because of affirmative action. Get over it, America!"</li><li>"I'm so sick of you, you think you're so much better than everyone else just because you have a few more followers. Newsflash, you're just as toxic as the rest of us. Go cry to your mom."</li><li>"I'm going to smash your car window if you don't give me money right now. You're going to regret messing with me."</li></ul> |
|
75 |
+
| Non toxic | <ul><li>"I just wanted to say thank you to the amazing team at @CompanyX for their incredible customer service. They went above and beyond to resolve my issue and I'm so grateful for their help. #CustomerLove #Respect"</li><li>"I'm having a great day, thanks for asking! How about you? I just got back from a lovely hike in the mountains and I'm feeling refreshed."</li><li>"I'm feeling really overwhelmed with my coursework. Do you have any tips on how to manage my time effectively?"</li></ul> |
|
76 |
|
77 |
## Evaluation
|
78 |
|
79 |
### Metrics
|
80 |
| Label | F1 |
|
81 |
|:--------|:-------|
|
82 |
+
| **all** | 0.8648 |
|
83 |
|
84 |
## Uses
|
85 |
|
|
|
99 |
# Download from the 🤗 Hub
|
100 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
101 |
# Run inference
|
102 |
+
preds = model("I'm so excited for the weekend, I get to spend time with my friends and family. We're planning a hike and then having a BBQ. I love days like this!")
|
103 |
```
|
104 |
|
105 |
<!--
|
|
|
129 |
## Training Details
|
130 |
|
131 |
### Training Set Metrics
|
132 |
+
| Training set | Min | Median | Max |
|
133 |
+
|:-------------|:----|:-------|:----|
|
134 |
+
| Word count | 14 | 27.5 | 42 |
|
135 |
|
136 |
| Label | Training Sample Count |
|
137 |
|:----------|:----------------------|
|
138 |
+
| Non toxic | 12 |
|
139 |
+
| Toxic | 20 |
|
140 |
|
141 |
### Training Hyperparameters
|
142 |
- batch_size: (16, 16)
|
|
|
158 |
### Training Results
|
159 |
| Epoch | Step | Training Loss | Validation Loss |
|
160 |
|:-------:|:------:|:-------------:|:---------------:|
|
161 |
+
| 0.0278 | 1 | 0.2873 | - |
|
162 |
+
| 1.0 | 36 | - | 0.1098 |
|
163 |
+
| 1.3889 | 50 | 0.0013 | - |
|
164 |
+
| **2.0** | **72** | **-** | **0.0981** |
|
165 |
+
| 2.7778 | 100 | 0.0003 | - |
|
166 |
+
| 3.0 | 108 | - | 0.112 |
|
167 |
+
| 4.0 | 144 | - | 0.1174 |
|
168 |
+
| 4.1667 | 150 | 0.0001 | - |
|
169 |
+
| 5.0 | 180 | - | 0.1075 |
|
|
|
170 |
|
171 |
* The bold row denotes the saved checkpoint.
|
172 |
### Framework Versions
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "setfit/
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
|
|
1 |
{
|
2 |
+
"_name_or_path": "setfit/step_72",
|
3 |
"architectures": [
|
4 |
"MPNetModel"
|
5 |
],
|
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:7926c514c84cf8965009476a09208354f5c75f65c9f1edfb0a92ee502daa2c3d
|
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 7007
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:33fad9c504721ef71283019aaa62528ecb4781ad9965b99651922f759d8c8d16
|
3 |
size 7007
|