kenhktsui commited on
Commit
66a5b47
1 Parent(s): 5ff6cd0

Add SetFit model

Browse files
Files changed (4) hide show
  1. README.md +35 -40
  2. config.json +1 -1
  3. model.safetensors +1 -1
  4. 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: '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,7 +37,7 @@ model-index:
41
  split: test
42
  metrics:
43
  - type: f1
44
- value: 0.8778280542986425
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
- | 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,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("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,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 | 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)
@@ -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.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
 
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/step_86",
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:8393ae4823472d6c32d47fa86f970a0dadbf8704ce3d5fc347b85821d7958c4b
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:d36536d6da706f54889140881d757b3ba8d5691b65cf6f0fef8dec6615742601
3
  size 7007
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:33fad9c504721ef71283019aaa62528ecb4781ad9965b99651922f759d8c8d16
3
  size 7007