serdarcaglar
commited on
Add SetFit model
Browse files- README.md +29 -21
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -8,13 +8,14 @@ tags:
|
|
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:
|
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,10 +63,10 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
62 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
63 |
|
64 |
### Model Labels
|
65 |
-
| Label | Examples
|
66 |
-
|
67 |
-
|
|
68 |
-
|
|
69 |
|
70 |
## Evaluation
|
71 |
|
@@ -92,7 +93,7 @@ from setfit import SetFitModel
|
|
92 |
# Download from the 🤗 Hub
|
93 |
model = SetFitModel.from_pretrained("serdarcaglar/primary-school-math-question")
|
94 |
# Run inference
|
95 |
-
preds = model("
|
96 |
```
|
97 |
|
98 |
<!--
|
@@ -122,14 +123,14 @@ preds = model("Who painted the Mona Lisa?")
|
|
122 |
## Training Details
|
123 |
|
124 |
### Training Set Metrics
|
125 |
-
| Training set | Min | Median
|
126 |
-
|
127 |
-
| Word count | 3 |
|
128 |
|
129 |
| Label | Training Sample Count |
|
130 |
|:---------|:----------------------|
|
131 |
-
| math |
|
132 |
-
| non_math |
|
133 |
|
134 |
### Training Hyperparameters
|
135 |
- batch_size: (16, 16)
|
@@ -150,12 +151,19 @@ preds = model("Who painted the Mona Lisa?")
|
|
150 |
- load_best_model_at_end: False
|
151 |
|
152 |
### Training Results
|
153 |
-
| Epoch
|
154 |
-
|
155 |
-
| 0.
|
156 |
-
| 0.
|
157 |
-
| 0.
|
158 |
-
| 0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
159 |
|
160 |
### Framework Versions
|
161 |
- Python: 3.10.12
|
|
|
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 |
- **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 |
# 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 |
## 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 |
- 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
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 90864192
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a198728b33c01021393ca5286275dc9f7ba1a04fbc1c249988448e4a66495423
|
3 |
size 90864192
|
model_head.pkl
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 3967
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e83b3814b7d0982f27fc588fdb5cf8ddfc79d878193256a93f662dc8a86d6e02
|
3 |
size 3967
|