serdarcaglar
commited on
Add SetFit model
Browse files- README.md +28 -30
- config.json +1 -1
- model.safetensors +1 -1
- model_head.pkl +1 -1
README.md
CHANGED
@@ -8,14 +8,11 @@ tags:
|
|
8 |
metrics:
|
9 |
- accuracy
|
10 |
widget:
|
11 |
-
- text:
|
12 |
-
|
13 |
-
- text: If
|
14 |
-
- text:
|
15 |
-
|
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>'
|
69 |
-
| non_math | <ul><li>'
|
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("
|
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
|
127 |
-
|
128 |
-
| Word count |
|
129 |
|
130 |
| Label | Training Sample Count |
|
131 |
|:---------|:----------------------|
|
132 |
| math | 141 |
|
133 |
-
| non_math |
|
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
|
155 |
-
|
156 |
-
| 0.
|
157 |
-
| 0.
|
158 |
-
| 0.
|
159 |
-
| 0.
|
160 |
-
| 0.
|
161 |
-
| 0.
|
162 |
-
| 0.
|
163 |
-
| 0.
|
164 |
-
| 0.
|
165 |
-
| 0.
|
166 |
-
|
|
|
|
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": "
|
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:0e330952e79f9c57d40ea47b439bfaf3667cf66eff839aae46f3645bebaab310
|
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:0a327dca371ff12fbf0b79715aef5a8ea9da7b5df410bdaecd27092fc692fb16
|
3 |
size 3967
|