Add SetFit model
Browse files- README.md +42 -38
- config.json +1 -1
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -10,21 +10,24 @@ tags:
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
-
- text: I
|
14 |
-
|
15 |
-
it's
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
me
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
|
|
|
|
|
|
28 |
inference: true
|
29 |
model-index:
|
30 |
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -38,7 +41,7 @@ model-index:
|
|
38 |
split: test
|
39 |
metrics:
|
40 |
- type: f1
|
41 |
-
value: 0.
|
42 |
name: F1
|
43 |
---
|
44 |
|
@@ -70,17 +73,17 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
70 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
71 |
|
72 |
### Model Labels
|
73 |
-
| Label | Examples
|
74 |
-
|
75 |
-
| Non toxic | <ul><li>"I'm
|
76 |
-
| Toxic | <ul><li>"You're
|
77 |
|
78 |
## Evaluation
|
79 |
|
80 |
### Metrics
|
81 |
| Label | F1 |
|
82 |
|:--------|:-------|
|
83 |
-
| **all** | 0.
|
84 |
|
85 |
## Uses
|
86 |
|
@@ -100,7 +103,7 @@ from setfit import SetFitModel
|
|
100 |
# Download from the 🤗 Hub
|
101 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
102 |
# Run inference
|
103 |
-
preds = model("
|
104 |
```
|
105 |
|
106 |
<!--
|
@@ -130,14 +133,14 @@ preds = model("I'm trying to decide between two different laptops for my work. C
|
|
130 |
## Training Details
|
131 |
|
132 |
### Training Set Metrics
|
133 |
-
| Training set | Min | Median
|
134 |
-
|
135 |
-
| Word count |
|
136 |
|
137 |
| Label | Training Sample Count |
|
138 |
|:----------|:----------------------|
|
139 |
-
| Non toxic |
|
140 |
-
| Toxic |
|
141 |
|
142 |
### Training Hyperparameters
|
143 |
- batch_size: (16, 16)
|
@@ -157,17 +160,18 @@ preds = model("I'm trying to decide between two different laptops for my work. C
|
|
157 |
- load_best_model_at_end: True
|
158 |
|
159 |
### Training Results
|
160 |
-
| Epoch | Step
|
161 |
-
|
162 |
-
| 0.
|
163 |
-
| 1.0 |
|
164 |
-
| 1.
|
165 |
-
| 2.0
|
166 |
-
| 2.
|
167 |
-
| 3.0 |
|
168 |
-
|
|
169 |
-
| 4.
|
170 |
-
|
|
|
|
171 |
|
172 |
* The bold row denotes the saved checkpoint.
|
173 |
### Framework Versions
|
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
+
- text: 'I''m so sick of this guy at work who thinks he can just grab my ass and call
|
14 |
+
it a compliment. Newsflash, buddy: it''s not funny and it''s not okay. I''ve told
|
15 |
+
him multiple times to stop, but he just keeps on doing it. It''s making my work
|
16 |
+
environment really uncomfortable and I don''t know what to do.'
|
17 |
+
- text: I've been dating my boyfriend for a year now, and we're both in our mid-twenties.
|
18 |
+
We've been having some issues with communication, and I feel like we're growing
|
19 |
+
apart. He's always busy with work, and I feel like he's not making an effort to
|
20 |
+
spend quality time with me. I've tried talking to him about it, but he just says
|
21 |
+
he's stressed and doesn't have time. I'm starting to feel really unhappy in the
|
22 |
+
relationship, and I'm not sure if it's worth fighting for. Should I give him another
|
23 |
+
chance or move on?
|
24 |
+
- text: I'm not sure what's more impressive, the fact that you managed to make a chatbot
|
25 |
+
that can barely understand sarcasm or the fact that you're trying to pass off
|
26 |
+
this mess as a functioning AI.
|
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 |
split: test
|
42 |
metrics:
|
43 |
- type: f1
|
44 |
+
value: 0.8778280542986425
|
45 |
name: F1
|
46 |
---
|
47 |
|
|
|
73 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
74 |
|
75 |
### Model Labels
|
76 |
+
| Label | Examples |
|
77 |
+
|:----------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
78 |
+
| Non toxic | <ul><li>"I'm really frustrated with this customer service. They're not helping me with my issue and it's taking forever. I just wish they would listen to me and try to resolve the problem."</li><li>"I just got a parking ticket for my car, but the best part is, it was given to me by a robot. I guess that's one way to get a free upgrade to a self-driving vehicle."</li><li>"I'm planning a trip to Japan and I'm interested in learning more about the culture. Can you recommend some must-see attractions and festivals that I shouldn't miss? I've heard that the cherry blossom season is a beautiful time to visit, but I'm not sure what else to expect. Any advice would be greatly appreciated!"</li></ul> |
|
79 |
+
| Toxic | <ul><li>"You're such a f***ing idiot, how dare you question my intelligence? I'm a genius and you're just a pathetic loser who can't even begin to comprehend my level of intellect. You're just a waste of space, a useless piece of s*** who deserves to be ignored. Go ahead and try to respond, I dare you, but you'll just end up looking like the complete and utter moron that you are."</li><li>"You're just a stupid n-word, you'll never amount to anything. Your people have been holding this country back for centuries, and it's time someone said something about it."</li><li>"The police are only racist when it's convenient for them to be. They only care about black people when it's time to arrest them. The rest of the time, they're just a bunch of white supremacists in blue uniforms."</li></ul> |
|
80 |
|
81 |
## Evaluation
|
82 |
|
83 |
### Metrics
|
84 |
| Label | F1 |
|
85 |
|:--------|:-------|
|
86 |
+
| **all** | 0.8778 |
|
87 |
|
88 |
## Uses
|
89 |
|
|
|
103 |
# Download from the 🤗 Hub
|
104 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
105 |
# Run inference
|
106 |
+
preds = model("Women are only good for one thing, and that's cooking and cleaning. They're not capable of doing real work or making important decisions.")
|
107 |
```
|
108 |
|
109 |
<!--
|
|
|
133 |
## Training Details
|
134 |
|
135 |
### Training Set Metrics
|
136 |
+
| Training set | Min | Median | Max |
|
137 |
+
|:-------------|:----|:--------|:----|
|
138 |
+
| Word count | 20 | 37.1667 | 70 |
|
139 |
|
140 |
| Label | Training Sample Count |
|
141 |
|:----------|:----------------------|
|
142 |
+
| Non toxic | 17 |
|
143 |
+
| Toxic | 19 |
|
144 |
|
145 |
### Training Hyperparameters
|
146 |
- batch_size: (16, 16)
|
|
|
160 |
- load_best_model_at_end: True
|
161 |
|
162 |
### Training Results
|
163 |
+
| Epoch | Step | Training Loss | Validation Loss |
|
164 |
+
|:-------:|:------:|:-------------:|:---------------:|
|
165 |
+
| 0.0233 | 1 | 0.1932 | - |
|
166 |
+
| 1.0 | 43 | - | 0.1593 |
|
167 |
+
| 1.1628 | 50 | 0.0005 | - |
|
168 |
+
| **2.0** | **86** | **-** | **0.1525** |
|
169 |
+
| 2.3256 | 100 | 0.0002 | - |
|
170 |
+
| 3.0 | 129 | - | 0.1642 |
|
171 |
+
| 3.4884 | 150 | 0.0002 | - |
|
172 |
+
| 4.0 | 172 | - | 0.1656 |
|
173 |
+
| 4.6512 | 200 | 0.0001 | - |
|
174 |
+
| 5.0 | 215 | - | 0.1545 |
|
175 |
|
176 |
* The bold row denotes the saved checkpoint.
|
177 |
### 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_86",
|
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:8393ae4823472d6c32d47fa86f970a0dadbf8704ce3d5fc347b85821d7958c4b
|
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:d36536d6da706f54889140881d757b3ba8d5691b65cf6f0fef8dec6615742601
|
3 |
size 7007
|