serdarcaglar commited on
Commit
62e9c55
1 Parent(s): a1606eb

Add SetFit model

Browse files
Files changed (4) hide show
  1. README.md +21 -18
  2. config_setfit.json +5 -2
  3. model.safetensors +1 -1
  4. model_head.pkl +2 -2
README.md CHANGED
@@ -8,11 +8,13 @@ tags:
8
  metrics:
9
  - accuracy
10
  widget:
11
- - text: What is the capital of France?
12
- - text: What do you call a group of lions?
13
- - text: Who wrote 'To Kill a Mockingbird'?
14
- - text: What is the largest ocean on Earth?
15
- - text: How many sides does a square have?
 
 
16
  pipeline_tag: text-classification
17
  inference: true
18
  base_model: sentence-transformers/all-MiniLM-L6-v2
@@ -60,10 +62,10 @@ The model has been trained using an efficient few-shot learning technique that i
60
  - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
61
 
62
  ### Model Labels
63
- | Label | Examples |
64
- |:------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
65
- | 0 | <ul><li>'What is the tallest animal in the world?'</li><li>'What is the main ingredient in guacamole?'</li><li>'What do you call a baby kangaroo?'</li></ul> |
66
- | 1 | <ul><li>'What is the sum of 7 and 5?'</li><li>'If there are 3 pencils in each pack and you have 7 packs, how many pencils do you have altogether?'</li><li>'If a pencil is 15 centimeters long and another pencil is 10 centimeters long, what is the total length of both pencils?'</li></ul> |
67
 
68
  ## Evaluation
69
 
@@ -90,7 +92,7 @@ from setfit import SetFitModel
90
  # Download from the 🤗 Hub
91
  model = SetFitModel.from_pretrained("serdarcaglar/primary-school-math-question")
92
  # Run inference
93
- preds = model("What is the capital of France?")
94
  ```
95
 
96
  <!--
@@ -122,12 +124,12 @@ preds = model("What is the capital of France?")
122
  ### Training Set Metrics
123
  | Training set | Min | Median | Max |
124
  |:-------------|:----|:--------|:----|
125
- | Word count | 3 | 10.9388 | 23 |
126
 
127
- | Label | Training Sample Count |
128
- |:------|:----------------------|
129
- | 0 | 29 |
130
- | 1 | 20 |
131
 
132
  ### Training Hyperparameters
133
  - batch_size: (16, 16)
@@ -150,9 +152,10 @@ preds = model("What is the capital of France?")
150
  ### Training Results
151
  | Epoch | Step | Training Loss | Validation Loss |
152
  |:------:|:----:|:-------------:|:---------------:|
153
- | 0.0081 | 1 | 0.2707 | - |
154
- | 0.4065 | 50 | 0.0183 | - |
155
- | 0.8130 | 100 | 0.0032 | - |
 
156
 
157
  ### Framework Versions
158
  - Python: 3.10.12
 
8
  metrics:
9
  - accuracy
10
  widget:
11
+ - text: If you have 20 marbles and you give 5 of them to your friend, how many marbles
12
+ do you have left?
13
+ - text: If a dozen eggs cost $3, how much do 3 dozen eggs cost?
14
+ - text: If a train leaves the station at 9:00 AM and arrives at its destination at
15
+ 11:30 AM, how long is the journey?
16
+ - text: What is the chemical symbol for water?
17
+ - text: Who painted the Mona Lisa?
18
  pipeline_tag: text-classification
19
  inference: true
20
  base_model: sentence-transformers/all-MiniLM-L6-v2
 
62
  - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
63
 
64
  ### Model Labels
65
+ | Label | Examples |
66
+ |:---------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
67
+ | non_math | <ul><li>'What do you call a baby kangaroo?'</li><li>'What is the currency used in Japan?'</li><li>'What is the smallest planet in our solar system?'</li></ul> |
68
+ | math | <ul><li>'What is the number that comes after 15?'</li><li>'What is the sum of 18 and 27?'</li><li>'There are 8 apples on the table. If you add 3 more apples, how many apples are there in total?'</li></ul> |
69
 
70
  ## Evaluation
71
 
 
92
  # Download from the 🤗 Hub
93
  model = SetFitModel.from_pretrained("serdarcaglar/primary-school-math-question")
94
  # Run inference
95
+ preds = model("Who painted the Mona Lisa?")
96
  ```
97
 
98
  <!--
 
124
  ### Training Set Metrics
125
  | Training set | Min | Median | Max |
126
  |:-------------|:----|:--------|:----|
127
+ | Word count | 3 | 10.8406 | 23 |
128
 
129
+ | Label | Training Sample Count |
130
+ |:---------|:----------------------|
131
+ | math | 40 |
132
+ | non_math | 29 |
133
 
134
  ### Training Hyperparameters
135
  - batch_size: (16, 16)
 
152
  ### Training Results
153
  | Epoch | Step | Training Loss | Validation Loss |
154
  |:------:|:----:|:-------------:|:---------------:|
155
+ | 0.0058 | 1 | 0.2737 | - |
156
+ | 0.2890 | 50 | 0.0212 | - |
157
+ | 0.5780 | 100 | 0.0037 | - |
158
+ | 0.8671 | 150 | 0.0023 | - |
159
 
160
  ### Framework Versions
161
  - Python: 3.10.12
config_setfit.json CHANGED
@@ -1,4 +1,7 @@
1
  {
2
- "normalize_embeddings": false,
3
- "labels": null
 
 
 
4
  }
 
1
  {
2
+ "labels": [
3
+ "math",
4
+ "non_math"
5
+ ],
6
+ "normalize_embeddings": false
7
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:1f05693d3ce3b6d406824e39bfc738827982da4795d791035c208187cefc827b
3
  size 90864192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b23a7b11036a5a3ed6d7fa78520930502934b3c0fdf69c69a7dae06e24a31106
3
  size 90864192
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2c0f268519c4bebe519f6cdf0b832121d8059e6baf32a395860ef0e9b7e0f4da
3
- size 3935
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d0cae6363f78c05e9e530147c0a21ae4a56abfac59b6f4fb1578ee8daf34680e
3
+ size 3967