serdarcaglar commited on
Commit
4d19101
1 Parent(s): ae91c67

Add SetFit model

Browse files
Files changed (4) hide show
  1. README.md +28 -26
  2. config.json +1 -1
  3. model.safetensors +1 -1
  4. model_head.pkl +1 -1
README.md CHANGED
@@ -8,12 +8,13 @@ tags:
8
  metrics:
9
  - accuracy
10
  widget:
11
- - text: Can you name three different types of fruits?
12
- - text: What is the capital city of your state?
13
- - text: If 2 apples cost $1, how much would 5 apples cost?
14
- - text: John had 8 marbles. He lost 4 marbles and then got 3 new ones. How many marbles
15
- does John have now?
16
- - text: What is the name of the civil rights leader who said 'I have a dream'?
 
17
  pipeline_tag: text-classification
18
  inference: true
19
  base_model: sentence-transformers/all-MiniLM-L6-v2
@@ -61,10 +62,10 @@ The model has been trained using an efficient few-shot learning technique that i
61
  - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
62
 
63
  ### Model Labels
64
- | Label | Examples |
65
- |:---------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
66
- | math | <ul><li>'Which unit would you use to measure how much milk you need for your cereal: cups or gallons?'</li><li>'What is the volume of a cube with side length 4 cm?'</li><li>'If school starts at 8:30 AM and ends at 3:15 PM, how many hours are there in a school day?'</li></ul> |
67
- | non_math | <ul><li>'What is the name of the long river that runs through the middle of the US?'</li><li>'What do we call the action of objects changing their position?'</li><li>'What is the currency used in Japan?'</li></ul> |
68
 
69
  ## Evaluation
70
 
@@ -91,7 +92,7 @@ from setfit import SetFitModel
91
  # Download from the 🤗 Hub
92
  model = SetFitModel.from_pretrained("serdarcaglar/primary-school-math-question")
93
  # Run inference
94
- preds = model("What is the capital city of your state?")
95
  ```
96
 
97
  <!--
@@ -123,12 +124,12 @@ preds = model("What is the capital city of your state?")
123
  ### Training Set Metrics
124
  | Training set | Min | Median | Max |
125
  |:-------------|:----|:--------|:----|
126
- | Word count | 1 | 12.5378 | 33 |
127
 
128
  | Label | Training Sample Count |
129
  |:---------|:----------------------|
130
- | math | 141 |
131
- | non_math | 97 |
132
 
133
  ### Training Hyperparameters
134
  - batch_size: (16, 16)
@@ -151,18 +152,19 @@ preds = model("What is the capital city of your state?")
151
  ### Training Results
152
  | Epoch | Step | Training Loss | Validation Loss |
153
  |:------:|:----:|:-------------:|:---------------:|
154
- | 0.0017 | 1 | 0.3115 | - |
155
- | 0.0840 | 50 | 0.1498 | - |
156
- | 0.1681 | 100 | 0.0127 | - |
157
- | 0.2521 | 150 | 0.0056 | - |
158
- | 0.3361 | 200 | 0.0019 | - |
159
- | 0.4202 | 250 | 0.0007 | - |
160
- | 0.5042 | 300 | 0.0016 | - |
161
- | 0.5882 | 350 | 0.0019 | - |
162
- | 0.6723 | 400 | 0.0005 | - |
163
- | 0.7563 | 450 | 0.0009 | - |
164
- | 0.8403 | 500 | 0.0009 | - |
165
- | 0.9244 | 550 | 0.0008 | - |
 
166
 
167
  ### Framework Versions
168
  - Python: 3.10.12
 
8
  metrics:
9
  - accuracy
10
  widget:
11
+ - text: If you have 3 red apples and 2 green apples, how many apples do you have in
12
+ total?
13
+ - text: Can you name three different colors?
14
+ - text: If you have 15 cookies and you share them equally among 3 friends, how many
15
+ cookies does each friend get?
16
+ - text: Which state is known as the Sunshine State?
17
+ - text: John has 2 more toy cars than Sam. If Sam has 6 cars, how many does John have?
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 is the largest ocean on Earth?'</li><li>'What is the name of the galaxy that contains our solar system?'</li><li>'What is the name of the ocean on the east coast of the United States?'</li></ul> |
68
+ | math | <ul><li>'Which is more: 7 or 9?'</li><li>'There are 20 chocolates, and you want to share them equally among 4 friends. How many chocolates will each friend get?'</li><li>"If the teacher says 'Alice has 3 more apples than Bob', how can you represent this using numbers and symbols?"</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("Can you name three different colors?")
96
  ```
97
 
98
  <!--
 
124
  ### Training Set Metrics
125
  | Training set | Min | Median | Max |
126
  |:-------------|:----|:--------|:----|
127
+ | Word count | 1 | 12.4979 | 33 |
128
 
129
  | Label | Training Sample Count |
130
  |:---------|:----------------------|
131
+ | math | 142 |
132
+ | non_math | 99 |
133
 
134
  ### Training Hyperparameters
135
  - batch_size: (16, 16)
 
152
  ### Training Results
153
  | Epoch | Step | Training Loss | Validation Loss |
154
  |:------:|:----:|:-------------:|:---------------:|
155
+ | 0.0017 | 1 | 0.336 | - |
156
+ | 0.0829 | 50 | 0.1156 | - |
157
+ | 0.1658 | 100 | 0.0062 | - |
158
+ | 0.2488 | 150 | 0.0026 | - |
159
+ | 0.3317 | 200 | 0.0025 | - |
160
+ | 0.4146 | 250 | 0.0022 | - |
161
+ | 0.4975 | 300 | 0.0024 | - |
162
+ | 0.5804 | 350 | 0.0009 | - |
163
+ | 0.6633 | 400 | 0.0009 | - |
164
+ | 0.7463 | 450 | 0.0007 | - |
165
+ | 0.8292 | 500 | 0.0004 | - |
166
+ | 0.9121 | 550 | 0.0002 | - |
167
+ | 0.9950 | 600 | 0.0007 | - |
168
 
169
  ### Framework Versions
170
  - Python: 3.10.12
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "serdarcaglar/primary-school-math-question",
3
  "architectures": [
4
  "BertModel"
5
  ],
 
1
  {
2
+ "_name_or_path": "sentence-transformers/all-MiniLM-L6-v2",
3
  "architectures": [
4
  "BertModel"
5
  ],
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:7c383fc411cebd9c2fd39b6391cd0c511b5c703e0c0b1cba4b768b9206d2cdb3
3
  size 90864192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:98045fe64d40afc0b7c7b45aab38f4d696c053bc2af9d6c3f279dc6b4c975a62
3
  size 90864192
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:54154be49871204f7afa49967c5b22cf6d928cb8250214a377450976b36b7891
3
  size 3967
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:429ea5b4f0ed3110e9268c8fe2f2e6de0c91c07821cdeceef6f8722e304647f1
3
  size 3967