serdarcaglar
commited on
Commit
•
4d19101
1
Parent(s):
ae91c67
Add SetFit model
Browse files- README.md +28 -26
- config.json +1 -1
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -8,12 +8,13 @@ tags:
|
|
8 |
metrics:
|
9 |
- accuracy
|
10 |
widget:
|
11 |
-
- text:
|
12 |
-
|
13 |
-
- text:
|
14 |
-
- text:
|
15 |
-
does
|
16 |
-
- text:
|
|
|
17 |
pipeline_tag: text-classification
|
18 |
inference: true
|
19 |
base_model: sentence-transformers/all-MiniLM-L6-v2
|
@@ -61,10 +62,10 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
61 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
62 |
|
63 |
### Model Labels
|
64 |
-
| Label | Examples
|
65 |
-
|
66 |
-
|
|
67 |
-
|
|
68 |
|
69 |
## Evaluation
|
70 |
|
@@ -91,7 +92,7 @@ from setfit import SetFitModel
|
|
91 |
# Download from the 🤗 Hub
|
92 |
model = SetFitModel.from_pretrained("serdarcaglar/primary-school-math-question")
|
93 |
# Run inference
|
94 |
-
preds = model("
|
95 |
```
|
96 |
|
97 |
<!--
|
@@ -123,12 +124,12 @@ preds = model("What is the capital city of your state?")
|
|
123 |
### Training Set Metrics
|
124 |
| Training set | Min | Median | Max |
|
125 |
|:-------------|:----|:--------|:----|
|
126 |
-
| Word count | 1 | 12.
|
127 |
|
128 |
| Label | Training Sample Count |
|
129 |
|:---------|:----------------------|
|
130 |
-
| math |
|
131 |
-
| non_math |
|
132 |
|
133 |
### Training Hyperparameters
|
134 |
- batch_size: (16, 16)
|
@@ -151,18 +152,19 @@ preds = model("What is the capital city of your state?")
|
|
151 |
### Training Results
|
152 |
| Epoch | Step | Training Loss | Validation Loss |
|
153 |
|:------:|:----:|:-------------:|:---------------:|
|
154 |
-
| 0.0017 | 1 | 0.
|
155 |
-
| 0.
|
156 |
-
| 0.
|
157 |
-
| 0.
|
158 |
-
| 0.
|
159 |
-
| 0.
|
160 |
-
| 0.
|
161 |
-
| 0.
|
162 |
-
| 0.
|
163 |
-
| 0.
|
164 |
-
| 0.
|
165 |
-
| 0.
|
|
|
166 |
|
167 |
### Framework Versions
|
168 |
- Python: 3.10.12
|
|
|
8 |
metrics:
|
9 |
- accuracy
|
10 |
widget:
|
11 |
+
- text: If you have 3 red apples and 2 green apples, how many apples do you have in
|
12 |
+
total?
|
13 |
+
- text: Can you name three different colors?
|
14 |
+
- text: If you have 15 cookies and you share them equally among 3 friends, how many
|
15 |
+
cookies does each friend get?
|
16 |
+
- text: Which state is known as the Sunshine State?
|
17 |
+
- text: John has 2 more toy cars than Sam. If Sam has 6 cars, how many does John have?
|
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 is the largest ocean on Earth?'</li><li>'What is the name of the galaxy that contains our solar system?'</li><li>'What is the name of the ocean on the east coast of the United States?'</li></ul> |
|
68 |
+
| math | <ul><li>'Which is more: 7 or 9?'</li><li>'There are 20 chocolates, and you want to share them equally among 4 friends. How many chocolates will each friend get?'</li><li>"If the teacher says 'Alice has 3 more apples than Bob', how can you represent this using numbers and symbols?"</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("Can you name three different colors?")
|
96 |
```
|
97 |
|
98 |
<!--
|
|
|
124 |
### Training Set Metrics
|
125 |
| Training set | Min | Median | Max |
|
126 |
|:-------------|:----|:--------|:----|
|
127 |
+
| Word count | 1 | 12.4979 | 33 |
|
128 |
|
129 |
| Label | Training Sample Count |
|
130 |
|:---------|:----------------------|
|
131 |
+
| math | 142 |
|
132 |
+
| non_math | 99 |
|
133 |
|
134 |
### Training Hyperparameters
|
135 |
- batch_size: (16, 16)
|
|
|
152 |
### Training Results
|
153 |
| Epoch | Step | Training Loss | Validation Loss |
|
154 |
|:------:|:----:|:-------------:|:---------------:|
|
155 |
+
| 0.0017 | 1 | 0.336 | - |
|
156 |
+
| 0.0829 | 50 | 0.1156 | - |
|
157 |
+
| 0.1658 | 100 | 0.0062 | - |
|
158 |
+
| 0.2488 | 150 | 0.0026 | - |
|
159 |
+
| 0.3317 | 200 | 0.0025 | - |
|
160 |
+
| 0.4146 | 250 | 0.0022 | - |
|
161 |
+
| 0.4975 | 300 | 0.0024 | - |
|
162 |
+
| 0.5804 | 350 | 0.0009 | - |
|
163 |
+
| 0.6633 | 400 | 0.0009 | - |
|
164 |
+
| 0.7463 | 450 | 0.0007 | - |
|
165 |
+
| 0.8292 | 500 | 0.0004 | - |
|
166 |
+
| 0.9121 | 550 | 0.0002 | - |
|
167 |
+
| 0.9950 | 600 | 0.0007 | - |
|
168 |
|
169 |
### Framework Versions
|
170 |
- Python: 3.10.12
|
config.json
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
{
|
2 |
-
"_name_or_path": "
|
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:
|
3 |
size 90864192
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:98045fe64d40afc0b7c7b45aab38f4d696c053bc2af9d6c3f279dc6b4c975a62
|
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:429ea5b4f0ed3110e9268c8fe2f2e6de0c91c07821cdeceef6f8722e304647f1
|
3 |
size 3967
|