serdarcaglar commited on
Commit
bd76352
1 Parent(s): 0f065c0

Add SetFit model

Browse files
Files changed (4) hide show
  1. README.md +25 -24
  2. config_setfit.json +2 -2
  3. model.safetensors +1 -1
  4. model_head.pkl +1 -1
README.md CHANGED
@@ -8,11 +8,12 @@ tags:
8
  metrics:
9
  - accuracy
10
  widget:
11
- - text: Can you name three different types of weather?
12
- - text: Which state is known as the Sunshine State?
13
- - text: If a dozen eggs cost $3, how much do 3 dozen eggs cost?
14
- - text: What is the name of the mountain range on the west coast?
15
- - text: Can you name two different habitats where animals live?
 
16
  pipeline_tag: text-classification
17
  inference: true
18
  base_model: sentence-transformers/all-MiniLM-L6-v2
@@ -60,10 +61,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
- | math | <ul><li>'Which is more: 7 or 9?'</li><li>"How can you measure the amount of liquid in a cup if you don't have a measuring cup?"</li><li>'What is the name of a shape with 5 equal sides and 5 equal angles?'</li></ul> |
66
- | non_math | <ul><li>'Can you name two different holidays celebrated in the springtime?'</li><li>'Who discovered gravity?'</li><li>'Energy'</li></ul> |
67
 
68
  ## Evaluation
69
 
@@ -90,7 +91,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("Which state is known as the Sunshine State?")
94
  ```
95
 
96
  <!--
@@ -122,12 +123,12 @@ preds = model("Which state is known as the Sunshine State?")
122
  ### Training Set Metrics
123
  | Training set | Min | Median | Max |
124
  |:-------------|:----|:--------|:----|
125
- | Word count | 1 | 12.5232 | 33 |
126
 
127
  | Label | Training Sample Count |
128
  |:---------|:----------------------|
129
  | math | 141 |
130
- | non_math | 96 |
131
 
132
  ### Training Hyperparameters
133
  - batch_size: (16, 16)
@@ -150,18 +151,18 @@ preds = model("Which state is known as the Sunshine State?")
150
  ### Training Results
151
  | Epoch | Step | Training Loss | Validation Loss |
152
  |:------:|:----:|:-------------:|:---------------:|
153
- | 0.0017 | 1 | 0.3751 | - |
154
- | 0.0843 | 50 | 0.1394 | - |
155
- | 0.1686 | 100 | 0.0114 | - |
156
- | 0.2530 | 150 | 0.0045 | - |
157
- | 0.3373 | 200 | 0.0026 | - |
158
- | 0.4216 | 250 | 0.0023 | - |
159
- | 0.5059 | 300 | 0.0014 | - |
160
- | 0.5902 | 350 | 0.0014 | - |
161
- | 0.6745 | 400 | 0.0004 | - |
162
- | 0.7589 | 450 | 0.0008 | - |
163
- | 0.8432 | 500 | 0.0007 | - |
164
- | 0.9275 | 550 | 0.0008 | - |
165
 
166
  ### Framework Versions
167
  - Python: 3.10.12
 
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
  - **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
  # 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
  ### 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
  ### 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
config_setfit.json CHANGED
@@ -1,7 +1,7 @@
1
  {
 
2
  "labels": [
3
  "math",
4
  "non_math"
5
- ],
6
- "normalize_embeddings": false
7
  }
 
1
  {
2
+ "normalize_embeddings": false,
3
  "labels": [
4
  "math",
5
  "non_math"
6
+ ]
 
7
  }
model.safetensors CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0e330952e79f9c57d40ea47b439bfaf3667cf66eff839aae46f3645bebaab310
3
  size 90864192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7c383fc411cebd9c2fd39b6391cd0c511b5c703e0c0b1cba4b768b9206d2cdb3
3
  size 90864192
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:0a327dca371ff12fbf0b79715aef5a8ea9da7b5df410bdaecd27092fc692fb16
3
  size 3967
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54154be49871204f7afa49967c5b22cf6d928cb8250214a377450976b36b7891
3
  size 3967