reecursion commited on
Commit
7332bf0
1 Parent(s): 6f71863

Add SetFit model

Browse files
Files changed (4) hide show
  1. README.md +35 -33
  2. config_setfit.json +2 -2
  3. model.safetensors +1 -1
  4. model_head.pkl +2 -2
README.md CHANGED
@@ -8,26 +8,26 @@ tags:
8
  metrics:
9
  - accuracy
10
  widget:
11
- - text: He is Male, his heart rate is 70, he walks 8700 steps daily, and is Normal
12
- Weight. He slept at 23 hrs. Yesterday, he slept from 23hrs to 7 hrs, with a duration
13
- of 580 minutes and 4 interruptions. The day before yesterday, he slept from 22
14
- hrs to 6 hrs, with a duration of 490 minutes and 2 interruptions.
15
- - text: She is Female, her heart rate is 87, she walks 5300 steps daily and is Overweight.
16
- She slept at 22 hrs. Yesterday, she slept from 21 hrs to 6 hrs, with a duration
17
- of 510 minutes and 5 interruptions. The day before yesterday, she slept from 21
18
- hrs to 6 hrs, with a duration of 410 minutes and 3 interruptions.
19
- - text: She is Female, her heart rate is 83, she walks 4700 steps daily and is Overweight.
20
- She slept at 22 hrs. Yesterday, she slept from 21 hrs to 6 hrs, with a duration
21
- of 490 minutes and 5 interruptions. The day before yesterday, she slept from 21
22
- hrs to 5 hrs, with a duration of 390 minutes and 2 interruptions.
23
- - text: She is Female, her heart rate is 87, she walks 5700 steps daily and is Overweight.
24
- She slept at 22 hrs. Yesterday, she slept from 21 hrs to 6 hrs, with a duration
25
- of 540 minutes and 5 interruptions. The day before yesterday, she slept from 21
26
- hrs to 6 hrs, with a duration of 430 minutes and 3 interruptions.
27
- - text: She is Female, her heart rate is 85, she walks 5400 steps daily and is Overweight.
28
- She slept at 22 hrs. Yesterday, she slept from 21 hrs to 6 hrs, with a duration
29
- of 530 minutes and 5 interruptions. The day before yesterday, she slept from 21
30
- hrs to 5 hrs, with a duration of 400 minutes and 2 interruptions.
31
  pipeline_tag: text-classification
32
  inference: true
33
  base_model: sentence-transformers/paraphrase-mpnet-base-v2
@@ -43,7 +43,7 @@ model-index:
43
  split: test
44
  metrics:
45
  - type: accuracy
46
- value: 0.8235294117647058
47
  name: Accuracy
48
  ---
49
 
@@ -63,7 +63,7 @@ The model has been trained using an efficient few-shot learning technique that i
63
  - **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
64
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
65
  - **Maximum Sequence Length:** 512 tokens
66
- - **Number of Classes:** 2 classes
67
  <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
68
  <!-- - **Language:** Unknown -->
69
  <!-- - **License:** Unknown -->
@@ -75,17 +75,18 @@ The model has been trained using an efficient few-shot learning technique that i
75
  - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
76
 
77
  ### Model Labels
78
- | Label | Examples |
79
- |:------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
80
- | 0 | <ul><li>'He is Male, his heart rate is 64, he walks 10000 steps daily, and is Normal Weight. He slept at 23 hrs. Yesterday, he slept from 2hrs to 10 hrs, with a duration of 480 minutes and 3 interruptions. The day before yesterday, he slept from 4 hrs to 6 hrs, with a duration of 120 minutes and 1 interruptions.'</li><li>'He is Male, his heart rate is 68, he walks 12000 steps daily, and is Normal Weight. He slept at 22 hrs. Yesterday, he slept from 22hrs to 6 hrs, with a duration of 510 minutes and 3 interruptions. The day before yesterday, he slept from 21 hrs to 6 hrs, with a duration of 420 minutes and 1 interruptions.'</li><li>'He is Male, his heart rate is 75, he walks 9000 steps daily, and is Normal Weight. He slept at 23 hrs. Yesterday, he slept from 23hrs to 7 hrs, with a duration of 510 minutes and 4 interruptions. The day before yesterday, he slept from 22 hrs to 6 hrs, with a duration of 420 minutes and 2 interruptions.'</li></ul> |
81
- | 1 | <ul><li>'She is Female, her heart rate is 89, she walks 3873 steps daily and is Overweight. She slept at 23 hrs. Yesterday, she slept from 23 hrs to 7 hrs, with a duration of 472 minutes and 5 interruptions. The day before yesterday, she slept from 23 hrs to 5 hrs, with a duration of 344 minutes and 6 interruptions.'</li><li>'She is Female, her heart rate is 66, she walks 2413 steps daily and is Underweight. She slept at 2 hrs. Yesterday, she slept from 4 hrs to 6 hrs, with a duration of 120 minutes and 1 interruptions. The day before yesterday, she slept from 4 hrs to 9 hrs, with a duration of 300 minutes and 2 interruptions.'</li><li>'He is Male, his heart rate is 72, he walks 7500 steps daily, and is Normal Weight. He slept at 22 hrs. Yesterday, he slept from 22hrs to 6 hrs, with a duration of 450 minutes and 4 interruptions. The day before yesterday, he slept from 21 hrs to 6 hrs, with a duration of 390 minutes and 2 interruptions.'</li></ul> |
 
82
 
83
  ## Evaluation
84
 
85
  ### Metrics
86
  | Label | Accuracy |
87
  |:--------|:---------|
88
- | **all** | 0.8235 |
89
 
90
  ## Uses
91
 
@@ -105,7 +106,7 @@ from setfit import SetFitModel
105
  # Download from the 🤗 Hub
106
  model = SetFitModel.from_pretrained("reecursion/few-shot-stress-detection")
107
  # Run inference
108
- preds = model("He is Male, his heart rate is 70, he walks 8700 steps daily, and is Normal Weight. He slept at 23 hrs. Yesterday, he slept from 23hrs to 7 hrs, with a duration of 580 minutes and 4 interruptions. The day before yesterday, he slept from 22 hrs to 6 hrs, with a duration of 490 minutes and 2 interruptions.")
109
  ```
110
 
111
  <!--
@@ -137,12 +138,13 @@ preds = model("He is Male, his heart rate is 70, he walks 8700 steps daily, and
137
  ### Training Set Metrics
138
  | Training set | Min | Median | Max |
139
  |:-------------|:----|:-------|:----|
140
- | Word count | 60 | 60.0 | 60 |
141
 
142
  | Label | Training Sample Count |
143
  |:------|:----------------------|
144
- | 0 | 3 |
145
- | 1 | 5 |
 
146
 
147
  ### Training Hyperparameters
148
  - batch_size: (16, 16)
@@ -165,12 +167,12 @@ preds = model("He is Male, his heart rate is 70, he walks 8700 steps daily, and
165
  ### Training Results
166
  | Epoch | Step | Training Loss | Validation Loss |
167
  |:-----:|:----:|:-------------:|:---------------:|
168
- | 0.05 | 1 | 0.4058 | - |
169
 
170
  ### Framework Versions
171
  - Python: 3.10.12
172
  - SetFit: 1.0.3
173
- - Sentence Transformers: 2.5.1
174
  - Transformers: 4.38.2
175
  - PyTorch: 2.2.1+cu121
176
  - Datasets: 2.18.0
 
8
  metrics:
9
  - accuracy
10
  widget:
11
+ - text: She is Female, her heart rate is 63, she walks 5000 steps daily and is Underweight.
12
+ She slept at 22 hrs. Yesterday, she slept from 21.0 hrs to 5.0 hrs, with a duration
13
+ of 380.0 minutes and 1 interruptions. The day before yesterday, she slept from
14
+ 22.0 hrs to 7.0 hrs, with a duration of 440.0 minutes and 0 interruptions.
15
+ - text: He is Male, his heart rate is 70, he walks 8500 steps daily, and is Normal.
16
+ He slept at 23 hrs. Yesterday, he slept from 23.0hrs to 8.0 hrs, with a duration
17
+ of 350.0 minutes and 3 interruptions. The day before yesterday, he slept from
18
+ 22.0 hrs to 6.0 hrs, with a duration of 390.0 minutes and 1 interruptions.
19
+ - text: She is Female, her heart rate is 85, she walks 3000 steps daily and is Overweight.
20
+ She slept at 5 hrs. Yesterday, she slept from 6.0 hrs to 8.0 hrs, with a duration
21
+ of 280.0 minutes and 2 interruptions. The day before yesterday, she slept from
22
+ 5.0 hrs to 9.0 hrs, with a duration of 320.0 minutes and 7 interruptions.
23
+ - text: He is Male, his heart rate is 92, he walks 7500 steps daily, and is Normal.
24
+ He slept at 4 hrs. Yesterday, he slept from 5.0hrs to 9.0 hrs, with a duration
25
+ of 320.0 minutes and 3 interruptions. The day before yesterday, he slept from
26
+ 4.0 hrs to 10.0 hrs, with a duration of 350.0 minutes and 2 interruptions.
27
+ - text: He is Male, his heart rate is 93, he walks 9800 steps daily, and is Normal.
28
+ He slept at 0 hrs. Yesterday, he slept from 23.0hrs to 7.0 hrs, with a duration
29
+ of 460.0 minutes and 0 interruptions. The day before yesterday, he slept from
30
+ 23.0 hrs to 7.0 hrs, with a duration of 425.0 minutes and 1 interruptions.
31
  pipeline_tag: text-classification
32
  inference: true
33
  base_model: sentence-transformers/paraphrase-mpnet-base-v2
 
43
  split: test
44
  metrics:
45
  - type: accuracy
46
+ value: 0.6666666666666666
47
  name: Accuracy
48
  ---
49
 
 
63
  - **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
64
  - **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
65
  - **Maximum Sequence Length:** 512 tokens
66
+ - **Number of Classes:** 3 classes
67
  <!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
68
  <!-- - **Language:** Unknown -->
69
  <!-- - **License:** Unknown -->
 
75
  - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
76
 
77
  ### Model Labels
78
+ | Label | Examples |
79
+ |:------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
80
+ | 1 | <ul><li>'He is Male, his heart rate is 64, he walks 10000 steps daily, and is Normal. He slept at 11 hrs. Yesterday, he slept from 22.0hrs to 11.0 hrs, with a duration of 765.0 minutes and 2 interruptions. The day before yesterday, he slept from 23.0 hrs to 8.0 hrs, with a duration of 527.0 minutes and 4 interruptions.'</li><li>'She is Female, her heart rate is 89, she walks 3873 steps daily and is Overweight. She slept at 10 hrs. Yesterday, she slept from 4.0 hrs to 6.0 hrs, with a duration of 120.0 minutes and 1 interruptions. The day before yesterday, she slept from 4.0 hrs to 9.0 hrs, with a duration of 300.0 minutes and 2 interruptions.'</li><li>'She is Female, her heart rate is 68, she walks 11000 steps daily and is Normal. She slept at 10 hrs. Yesterday, she slept from 1.0 hrs to 9.0 hrs, with a duration of 495.0 minutes and 0 interruptions. The day before yesterday, she slept from 1.0 hrs to 10.0 hrs, with a duration of 540.0 minutes and 1 interruptions.'</li></ul> |
81
+ | 2 | <ul><li>'She is Female, her heart rate is 66, she walks 2413 steps daily and is Underweight. She slept at 8 hrs. Yesterday, she slept from 23.0 hrs to 7.0 hrs, with a duration of 472.0 minutes and 5 interruptions. The day before yesterday, she slept from 23.0 hrs to 5.0 hrs, with a duration of 344.0 minutes and 6 interruptions.'</li><li>'He is Male, his heart rate is 95, he walks 9000 steps daily, and is Normal. He slept at 10 hrs. Yesterday, he slept from 4.0hrs to 9.0 hrs, with a duration of 323.0 minutes and 5 interruptions. The day before yesterday, he slept from 2.0 hrs to 10.0 hrs, with a duration of 501.0 minutes and 6 interruptions.'</li><li>'She is Female, her heart rate is 66, she walks 2413 steps daily and is Underweight. She slept at 23 hrs. Yesterday, she slept from 23.0 hrs to 7.0 hrs, with a duration of 472.0 minutes and 5 interruptions. The day before yesterday, she slept from 23.0 hrs to 5.0 hrs, with a duration of 344.0 minutes and 6 interruptions.'</li></ul> |
82
+ | 0 | <ul><li>'She is Female, her heart rate is 100, she walks 8000 steps daily and is Normal. She slept at 7 hrs. Yesterday, she slept from 2.0 hrs to 7.0 hrs, with a duration of 323.0 minutes and 0 interruptions. The day before yesterday, she slept from 0.0 hrs to 6.0 hrs, with a duration of 395.0 minutes and 2 interruptions.'</li><li>'He is Male, his heart rate is 93, he walks 9800 steps daily, and is Normal. He slept at 9 hrs. Yesterday, he slept from 23.0hrs to 7.0 hrs, with a duration of 460.0 minutes and 0 interruptions. The day before yesterday, he slept from 23.0 hrs to 7.0 hrs, with a duration of 425.0 minutes and 1 interruptions.'</li></ul> |
83
 
84
  ## Evaluation
85
 
86
  ### Metrics
87
  | Label | Accuracy |
88
  |:--------|:---------|
89
+ | **all** | 0.6667 |
90
 
91
  ## Uses
92
 
 
106
  # Download from the 🤗 Hub
107
  model = SetFitModel.from_pretrained("reecursion/few-shot-stress-detection")
108
  # Run inference
109
+ preds = model("He is Male, his heart rate is 92, he walks 7500 steps daily, and is Normal. He slept at 4 hrs. Yesterday, he slept from 5.0hrs to 9.0 hrs, with a duration of 320.0 minutes and 3 interruptions. The day before yesterday, he slept from 4.0 hrs to 10.0 hrs, with a duration of 350.0 minutes and 2 interruptions.")
110
  ```
111
 
112
  <!--
 
138
  ### Training Set Metrics
139
  | Training set | Min | Median | Max |
140
  |:-------------|:----|:-------|:----|
141
+ | Word count | 59 | 59.5 | 60 |
142
 
143
  | Label | Training Sample Count |
144
  |:------|:----------------------|
145
+ | 0 | 2 |
146
+ | 1 | 10 |
147
+ | 2 | 4 |
148
 
149
  ### Training Hyperparameters
150
  - batch_size: (16, 16)
 
167
  ### Training Results
168
  | Epoch | Step | Training Loss | Validation Loss |
169
  |:-----:|:----:|:-------------:|:---------------:|
170
+ | 0.025 | 1 | 0.421 | - |
171
 
172
  ### Framework Versions
173
  - Python: 3.10.12
174
  - SetFit: 1.0.3
175
+ - Sentence Transformers: 2.6.1
176
  - Transformers: 4.38.2
177
  - PyTorch: 2.2.1+cu121
178
  - Datasets: 2.18.0
config_setfit.json CHANGED
@@ -1,4 +1,4 @@
1
  {
2
- "normalize_embeddings": false,
3
- "labels": null
4
  }
 
1
  {
2
+ "labels": null,
3
+ "normalize_embeddings": false
4
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:c28086f4c32e69f86f958c932a2ecf04e471002bf26d158d1c5dd7eba34843dc
3
  size 437967672
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b5e5d2862434f140aa6ee6ea39526b6ba1b4c87dd390d128ebb4b8ba8a0e5fad
3
  size 437967672
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:52e7673808b78123771f30e8f5b89750df074cfccf591baa5f7b618ad2ed4398
3
- size 7007
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3c8d640cfc87089e41003578226da120e71df28f2d586e16ecb5badd0fa69150
3
+ size 19327