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

Add SetFit model

Browse files
Files changed (4) hide show
  1. README.md +28 -30
  2. config.json +1 -1
  3. model.safetensors +1 -1
  4. model_head.pkl +1 -1
README.md CHANGED
@@ -8,14 +8,11 @@ tags:
8
  metrics:
9
  - accuracy
10
  widget:
11
- - text: Sarah has 10 stickers. She gives 3 to her friend. What fraction of her stickers
12
- did Sarah give away?
13
- - text: If you have 8 apples and you eat 3 of them, how many apples do you have left?
14
- - text: 'What simple strategy could you use to solve this word problem: ''Mike had
15
- 9 candies...'''
16
- - text: If you have 20 marbles and you give 5 of them to your friend, how many marbles
17
- do you have left?
18
- - text: What is the name of the holiday that celebrates workers in September?
19
  pipeline_tag: text-classification
20
  inference: true
21
  base_model: sentence-transformers/all-MiniLM-L6-v2
@@ -63,10 +60,10 @@ The model has been trained using an efficient few-shot learning technique that i
63
  - **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
64
 
65
  ### Model Labels
66
- | Label | Examples |
67
- |:---------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
68
- | math | <ul><li>'There are 10 frogs on a log. Some frogs jumped off and now there are 6 frogs left. How can you show this using an equation?'</li><li>'Sarah has 9 stickers. She gives 3 stickers to her brother. How many stickers does Sarah have left?'</li><li>'Which 3D shape has one curved surface?'</li></ul> |
69
- | non_math | <ul><li>'What is the currency used in Japan?'</li><li>'What do you call a baby kangaroo?'</li><li>'What is the capital city of Canada, our neighbor to the north?'</li></ul> |
70
 
71
  ## Evaluation
72
 
@@ -93,7 +90,7 @@ from setfit import SetFitModel
93
  # Download from the 🤗 Hub
94
  model = SetFitModel.from_pretrained("serdarcaglar/primary-school-math-question")
95
  # Run inference
96
- preds = model("What is the name of the holiday that celebrates workers in September?")
97
  ```
98
 
99
  <!--
@@ -123,14 +120,14 @@ preds = model("What is the name of the holiday that celebrates workers in Septem
123
  ## Training Details
124
 
125
  ### Training Set Metrics
126
- | Training set | Min | Median | Max |
127
- |:-------------|:----|:-------|:----|
128
- | Word count | 3 | 13.765 | 33 |
129
 
130
  | Label | Training Sample Count |
131
  |:---------|:----------------------|
132
  | math | 141 |
133
- | non_math | 59 |
134
 
135
  ### Training Hyperparameters
136
  - batch_size: (16, 16)
@@ -151,19 +148,20 @@ preds = model("What is the name of the holiday that celebrates workers in Septem
151
  - load_best_model_at_end: False
152
 
153
  ### Training Results
154
- | Epoch | Step | Training Loss | Validation Loss |
155
- |:-----:|:----:|:-------------:|:---------------:|
156
- | 0.002 | 1 | 0.3356 | - |
157
- | 0.1 | 50 | 0.0577 | - |
158
- | 0.2 | 100 | 0.0053 | - |
159
- | 0.3 | 150 | 0.0025 | - |
160
- | 0.4 | 200 | 0.0016 | - |
161
- | 0.5 | 250 | 0.0008 | - |
162
- | 0.6 | 300 | 0.0003 | - |
163
- | 0.7 | 350 | 0.0005 | - |
164
- | 0.8 | 400 | 0.0006 | - |
165
- | 0.9 | 450 | 0.0005 | - |
166
- | 1.0 | 500 | 0.0009 | - |
 
167
 
168
  ### Framework Versions
169
  - Python: 3.10.12
 
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
  - **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
  # 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
  <!--
 
120
  ## Training Details
121
 
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)
 
148
  - load_best_model_at_end: False
149
 
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
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:a198728b33c01021393ca5286275dc9f7ba1a04fbc1c249988448e4a66495423
3
  size 90864192
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0e330952e79f9c57d40ea47b439bfaf3667cf66eff839aae46f3645bebaab310
3
  size 90864192
model_head.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:e83b3814b7d0982f27fc588fdb5cf8ddfc79d878193256a93f662dc8a86d6e02
3
  size 3967
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0a327dca371ff12fbf0b79715aef5a8ea9da7b5df410bdaecd27092fc692fb16
3
  size 3967