Add SetFit model
Browse files- README.md +47 -47
- model.safetensors +1 -1
- model_head.pkl +2 -2
README.md
CHANGED
@@ -5,27 +5,27 @@ tags:
|
|
5 |
- sentence-transformers
|
6 |
- text-classification
|
7 |
- generated_from_setfit_trainer
|
8 |
-
base_model:
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
widget:
|
12 |
-
- text: '
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
- text:
|
23 |
-
|
24 |
-
|
25 |
pipeline_tag: text-classification
|
26 |
inference: true
|
27 |
model-index:
|
28 |
-
- name: SetFit with
|
29 |
results:
|
30 |
- task:
|
31 |
type: text-classification
|
@@ -36,13 +36,13 @@ model-index:
|
|
36 |
split: test
|
37 |
metrics:
|
38 |
- type: accuracy
|
39 |
-
value: 0.
|
40 |
name: Accuracy
|
41 |
---
|
42 |
|
43 |
-
# SetFit with
|
44 |
|
45 |
-
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [
|
46 |
|
47 |
The model has been trained using an efficient few-shot learning technique that involves:
|
48 |
|
@@ -53,7 +53,7 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
53 |
|
54 |
### Model Description
|
55 |
- **Model Type:** SetFit
|
56 |
-
- **Sentence Transformer body:** [
|
57 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
58 |
- **Maximum Sequence Length:** 256 tokens
|
59 |
- **Number of Classes:** 4 classes
|
@@ -68,19 +68,19 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
68 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
69 |
|
70 |
### Model Labels
|
71 |
-
| Label | Examples
|
72 |
-
|
73 |
-
| 1
|
74 |
-
| 2
|
75 |
-
| 3
|
76 |
-
| 0
|
77 |
|
78 |
## Evaluation
|
79 |
|
80 |
### Metrics
|
81 |
| Label | Accuracy |
|
82 |
|:--------|:---------|
|
83 |
-
| **all** | 0.
|
84 |
|
85 |
## Uses
|
86 |
|
@@ -100,7 +100,7 @@ from setfit import SetFitModel
|
|
100 |
# Download from the 🤗 Hub
|
101 |
model = SetFitModel.from_pretrained("Omar-Nasr/setfitmodel")
|
102 |
# Run inference
|
103 |
-
preds = model("
|
104 |
```
|
105 |
|
106 |
<!--
|
@@ -130,16 +130,16 @@ preds = model(" I have to go outside and meet people personally")
|
|
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 |
-
| 0
|
140 |
-
| 1
|
141 |
-
| 2
|
142 |
-
| 3
|
143 |
|
144 |
### Training Hyperparameters
|
145 |
- batch_size: (8, 8)
|
@@ -161,19 +161,19 @@ preds = model(" I have to go outside and meet people personally")
|
|
161 |
### Training Results
|
162 |
| Epoch | Step | Training Loss | Validation Loss |
|
163 |
|:------:|:----:|:-------------:|:---------------:|
|
164 |
-
| 0.0017 | 1 | 0.
|
165 |
-
| 0.0833 | 50 | 0.
|
166 |
-
| 0.1667 | 100 | 0.
|
167 |
-
| 0.25 | 150 | 0.
|
168 |
-
| 0.3333 | 200 | 0.
|
169 |
-
| 0.4167 | 250 | 0.
|
170 |
-
| 0.5 | 300 | 0.
|
171 |
-
| 0.5833 | 350 | 0.
|
172 |
-
| 0.6667 | 400 | 0.
|
173 |
-
| 0.75 | 450 | 0.
|
174 |
-
| 0.8333 | 500 | 0.
|
175 |
-
| 0.9167 | 550 | 0.
|
176 |
-
| 1.0 | 600 | 0.
|
177 |
|
178 |
### Framework Versions
|
179 |
- Python: 3.10.13
|
|
|
5 |
- sentence-transformers
|
6 |
- text-classification
|
7 |
- generated_from_setfit_trainer
|
8 |
+
base_model: Omar-Nasr/setfitmodel
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
widget:
|
12 |
+
- text: ' Like jumping into a pool, or starting an assignment'
|
13 |
+
- text: ' That''s kind of the nature of my volunteer work, but you could volunteer
|
14 |
+
with a food bank or boys and girls club, which would involve more social interaction
|
15 |
+
Just breaking that cycle by going for a short walk around the neighbourhood is
|
16 |
+
a good idea'
|
17 |
+
- text: ' And you will have the confidence inside of you, so you wont have to worry
|
18 |
+
about the outside so much'
|
19 |
+
- text: ' Do your make up then, get out of that hotel room and take your notes with
|
20 |
+
you! Go for a walk, try to focus on your senses (the smells, the sounds, the winds
|
21 |
+
and the temperature, possible the sun burning your skin)'
|
22 |
+
- text: I would disagree as I usually read people well and could see that he was not
|
23 |
+
comfortable talking with me, in the first lunch break he left after 5 minutes
|
24 |
+
and said he wanted to take a walk around the building
|
25 |
pipeline_tag: text-classification
|
26 |
inference: true
|
27 |
model-index:
|
28 |
+
- name: SetFit with Omar-Nasr/setfitmodel
|
29 |
results:
|
30 |
- task:
|
31 |
type: text-classification
|
|
|
36 |
split: test
|
37 |
metrics:
|
38 |
- type: accuracy
|
39 |
+
value: 0.4666666666666667
|
40 |
name: Accuracy
|
41 |
---
|
42 |
|
43 |
+
# SetFit with Omar-Nasr/setfitmodel
|
44 |
|
45 |
+
This is a [SetFit](https://github.com/huggingface/setfit) model that can be used for Text Classification. This SetFit model uses [Omar-Nasr/setfitmodel](https://huggingface.co/Omar-Nasr/setfitmodel) 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.
|
46 |
|
47 |
The model has been trained using an efficient few-shot learning technique that involves:
|
48 |
|
|
|
53 |
|
54 |
### Model Description
|
55 |
- **Model Type:** SetFit
|
56 |
+
- **Sentence Transformer body:** [Omar-Nasr/setfitmodel](https://huggingface.co/Omar-Nasr/setfitmodel)
|
57 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
58 |
- **Maximum Sequence Length:** 256 tokens
|
59 |
- **Number of Classes:** 4 classes
|
|
|
68 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
69 |
|
70 |
### Model Labels
|
71 |
+
| Label | Examples |
|
72 |
+
|:------|:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
73 |
+
| 1.0 | <ul><li>' Go out for a walk once a day additionally and slowly start increasing the time you spend outside Go out for a walk once a day additionally and slowly start increasing the time you spend outside Start doing sport, either outdoors or at a gym If you can, try to take your dog to a dog park or something like that'</li><li>" Now I'm not saying to go to a party on the spot, just go out, shop, take a walk in the park, that kind of thing Now I'm not saying to go to a party on the spot, just go out, shop, take a walk in the park, that kind of thing"</li><li>' antidepressants, therapy, meditation, walking in nature (these work for me idk about other people) antidepressants, therapy, meditation, walking in nature (these work for me idk about other people) '</li></ul> |
|
74 |
+
| 2.0 | <ul><li>'Try playing soccer haha'</li><li>" I didn't go outside too much"</li><li>" But we can't sleep in a hotel, we have go camping"</li></ul> |
|
75 |
+
| 3.0 | <ul><li>" I don't know anyone in the city, I don't think I have enough courage to go outside alone"</li><li>" But even then, I didn't have any other problems outside school I still had no friends at European school, I haven't had any walks which I had constantly with my friends back in Ukraine"</li><li>" For the past two months I've been doing my usual; not going outside just watching South Park and only going out when someone drags me For the past two months I've been doing my usual; not going outside just watching South Park and only going out when someone drags me"</li></ul> |
|
76 |
+
| 0.0 | <ul><li>' I would do this too but then I run the risk of meeting someone I know lol'</li><li>" Does it matter you are alone? NO Does it matter you can't run the full marathon at top speed? NO Are you useless? NO Seriously nobody is going to pay attention to you and think you are a lonely loser"</li><li>' If anything you should be thinking about wearing sun screen so you retain your good skin as it becomes your ally as you age outside'</li></ul> |
|
77 |
|
78 |
## Evaluation
|
79 |
|
80 |
### Metrics
|
81 |
| Label | Accuracy |
|
82 |
|:--------|:---------|
|
83 |
+
| **all** | 0.4667 |
|
84 |
|
85 |
## Uses
|
86 |
|
|
|
100 |
# Download from the 🤗 Hub
|
101 |
model = SetFitModel.from_pretrained("Omar-Nasr/setfitmodel")
|
102 |
# Run inference
|
103 |
+
preds = model(" Like jumping into a pool, or starting an assignment")
|
104 |
```
|
105 |
|
106 |
<!--
|
|
|
130 |
## Training Details
|
131 |
|
132 |
### Training Set Metrics
|
133 |
+
| Training set | Min | Median | Max |
|
134 |
+
|:-------------|:----|:-------|:-----|
|
135 |
+
| Word count | 4 | 49.85 | 1083 |
|
136 |
|
137 |
| Label | Training Sample Count |
|
138 |
|:------|:----------------------|
|
139 |
+
| 0.0 | 20 |
|
140 |
+
| 1.0 | 20 |
|
141 |
+
| 2.0 | 20 |
|
142 |
+
| 3.0 | 20 |
|
143 |
|
144 |
### Training Hyperparameters
|
145 |
- batch_size: (8, 8)
|
|
|
161 |
### Training Results
|
162 |
| Epoch | Step | Training Loss | Validation Loss |
|
163 |
|:------:|:----:|:-------------:|:---------------:|
|
164 |
+
| 0.0017 | 1 | 0.0931 | - |
|
165 |
+
| 0.0833 | 50 | 0.001 | - |
|
166 |
+
| 0.1667 | 100 | 0.0002 | - |
|
167 |
+
| 0.25 | 150 | 0.0 | - |
|
168 |
+
| 0.3333 | 200 | 0.0 | - |
|
169 |
+
| 0.4167 | 250 | 0.0 | - |
|
170 |
+
| 0.5 | 300 | 0.0 | - |
|
171 |
+
| 0.5833 | 350 | 0.0 | - |
|
172 |
+
| 0.6667 | 400 | 0.0 | - |
|
173 |
+
| 0.75 | 450 | 0.0 | - |
|
174 |
+
| 0.8333 | 500 | 0.0 | - |
|
175 |
+
| 0.9167 | 550 | 0.0 | - |
|
176 |
+
| 1.0 | 600 | 0.0 | - |
|
177 |
|
178 |
### Framework Versions
|
179 |
- Python: 3.10.13
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 1421483904
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d74b9e693c4bec6d33454703d1b488f06cf5995a92c194f7ffd30fe86d02b5dc
|
3 |
size 1421483904
|
model_head.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9cde52a221254c0bce19882f7cf15d51fa94308dabee07838bf700e1af322569
|
3 |
+
size 33639
|