serdarcaglar
commited on
Commit
•
bd76352
1
Parent(s):
0f065c0
Add SetFit model
Browse files- README.md +25 -24
- config_setfit.json +2 -2
- model.safetensors +1 -1
- 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
|
12 |
-
- text:
|
13 |
-
- text: If
|
14 |
-
- text:
|
15 |
-
|
|
|
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
|
66 |
-
| non_math | <ul><li>'
|
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("
|
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.
|
126 |
|
127 |
| Label | Training Sample Count |
|
128 |
|:---------|:----------------------|
|
129 |
| math | 141 |
|
130 |
-
| non_math |
|
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.
|
154 |
-
| 0.
|
155 |
-
| 0.
|
156 |
-
| 0.
|
157 |
-
| 0.
|
158 |
-
| 0.
|
159 |
-
| 0.
|
160 |
-
| 0.
|
161 |
-
| 0.
|
162 |
-
| 0.
|
163 |
-
| 0.
|
164 |
-
| 0.
|
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:
|
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:
|
3 |
size 3967
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:54154be49871204f7afa49967c5b22cf6d928cb8250214a377450976b36b7891
|
3 |
size 3967
|