serdarcaglar
commited on
Commit
•
62e9c55
1
Parent(s):
a1606eb
Add SetFit model
Browse files- README.md +21 -18
- config_setfit.json +5 -2
- model.safetensors +1 -1
- model_head.pkl +2 -2
README.md
CHANGED
@@ -8,11 +8,13 @@ tags:
|
|
8 |
metrics:
|
9 |
- accuracy
|
10 |
widget:
|
11 |
-
- text:
|
12 |
-
|
13 |
-
- text:
|
14 |
-
- text:
|
15 |
-
|
|
|
|
|
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
|
64 |
-
|
65 |
-
|
|
66 |
-
|
|
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("
|
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.
|
126 |
|
127 |
-
| Label
|
128 |
-
|
129 |
-
|
|
130 |
-
|
|
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.
|
154 |
-
| 0.
|
155 |
-
| 0.
|
|
|
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 |
-
"
|
3 |
-
|
|
|
|
|
|
|
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:
|
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:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:d0cae6363f78c05e9e530147c0a21ae4a56abfac59b6f4fb1578ee8daf34680e
|
3 |
+
size 3967
|