Add SetFit model
Browse files- README.md +66 -86
- config.json +1 -1
- config_setfit.json +2 -3
- model.safetensors +1 -1
- model_head.pkl +2 -2
README.md
CHANGED
@@ -9,12 +9,14 @@ base_model: sentence-transformers/paraphrase-mpnet-base-v2
|
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
widget:
|
12 |
-
- text:
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
17 |
- text: Do you offer weekend or holiday deliveries for orders?
|
|
|
18 |
pipeline_tag: text-classification
|
19 |
inference: true
|
20 |
model-index:
|
@@ -29,7 +31,7 @@ model-index:
|
|
29 |
split: test
|
30 |
metrics:
|
31 |
- type: accuracy
|
32 |
-
value: 0.
|
33 |
name: Accuracy
|
34 |
---
|
35 |
|
@@ -49,7 +51,7 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
49 |
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
|
50 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
51 |
- **Maximum Sequence Length:** 512 tokens
|
52 |
-
- **Number of Classes:**
|
53 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
54 |
<!-- - **Language:** Unknown -->
|
55 |
<!-- - **License:** Unknown -->
|
@@ -61,21 +63,20 @@ 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 |
-
| product
|
70 |
-
| product faq | <ul><li>'
|
71 |
-
| product policy | <ul><li>'How can I find out my ring size before placing an order?'</li><li>'What is the warranty on candle supplies?'</li><li>'Can I get a refund for a necklace if it has a manufacturing defect?'</li></ul> |
|
72 |
|
73 |
## Evaluation
|
74 |
|
75 |
### Metrics
|
76 |
| Label | Accuracy |
|
77 |
|:--------|:---------|
|
78 |
-
| **all** | 0.
|
79 |
|
80 |
## Uses
|
81 |
|
@@ -95,7 +96,7 @@ from setfit import SetFitModel
|
|
95 |
# Download from the 🤗 Hub
|
96 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
97 |
# Run inference
|
98 |
-
preds = model("What
|
99 |
```
|
100 |
|
101 |
<!--
|
@@ -125,16 +126,15 @@ preds = model("What is the process for exchanging sneakers?")
|
|
125 |
## Training Details
|
126 |
|
127 |
### Training Set Metrics
|
128 |
-
| Training set | Min | Median
|
129 |
-
|
130 |
-
| Word count | 4 |
|
131 |
|
132 |
| Label | Training Sample Count |
|
133 |
|:------------------------|:----------------------|
|
134 |
| complaints | 20 |
|
135 |
| order tracking | 20 |
|
136 |
| product discoverability | 20 |
|
137 |
-
| product discoveribility | 20 |
|
138 |
| product faq | 20 |
|
139 |
| product policy | 20 |
|
140 |
|
@@ -156,77 +156,57 @@ preds = model("What is the process for exchanging sneakers?")
|
|
156 |
- load_best_model_at_end: True
|
157 |
|
158 |
### Training Results
|
159 |
-
| Epoch
|
160 |
-
|
161 |
-
| 0.
|
162 |
-
| 0.
|
163 |
-
| 0.
|
164 |
-
| 0.
|
165 |
-
| 0.
|
166 |
-
| 0.
|
167 |
-
| 0.
|
168 |
-
| 0.
|
169 |
-
| 0.
|
170 |
-
| 0.
|
171 |
-
| 0
|
172 |
-
|
|
173 |
-
|
|
174 |
-
|
|
175 |
-
|
|
176 |
-
| 1.
|
177 |
-
| 1.
|
178 |
-
| 1.
|
179 |
-
| 1.
|
180 |
-
| 1.
|
181 |
-
|
|
182 |
-
| 1
|
183 |
-
|
|
184 |
-
|
|
185 |
-
|
|
186 |
-
|
|
187 |
-
|
|
188 |
-
|
|
189 |
-
|
|
190 |
-
|
|
191 |
-
|
|
192 |
-
|
|
193 |
-
| 2
|
194 |
-
|
|
195 |
-
|
|
196 |
-
|
|
197 |
-
|
|
198 |
-
|
|
199 |
-
|
|
200 |
-
|
|
201 |
-
|
|
202 |
-
| 2.7333 | 2050 | 0.0001 | - |
|
203 |
-
| 2.8 | 2100 | 0.0001 | - |
|
204 |
-
| 2.8667 | 2150 | 0.0001 | - |
|
205 |
-
| 2.9333 | 2200 | 0.0001 | - |
|
206 |
-
| 3.0 | 2250 | 0.0001 | - |
|
207 |
-
| 3.0667 | 2300 | 0.0001 | - |
|
208 |
-
| 3.1333 | 2350 | 0.0001 | - |
|
209 |
-
| 3.2 | 2400 | 0.0001 | - |
|
210 |
-
| 3.2667 | 2450 | 0.0001 | - |
|
211 |
-
| 3.3333 | 2500 | 0.0001 | - |
|
212 |
-
| 3.4 | 2550 | 0.0001 | - |
|
213 |
-
| 3.4667 | 2600 | 0.0001 | - |
|
214 |
-
| 3.5333 | 2650 | 0.0001 | - |
|
215 |
-
| 3.6 | 2700 | 0.0001 | - |
|
216 |
-
| 3.6667 | 2750 | 0.0001 | - |
|
217 |
-
| 3.7333 | 2800 | 0.0001 | - |
|
218 |
-
| 3.8 | 2850 | 0.0001 | - |
|
219 |
-
| 3.8667 | 2900 | 0.0001 | - |
|
220 |
-
| 3.9333 | 2950 | 0.0001 | - |
|
221 |
-
| 4.0 | 3000 | 0.0001 | - |
|
222 |
|
223 |
### Framework Versions
|
224 |
- Python: 3.9.16
|
225 |
- SetFit: 1.0.3
|
226 |
- Sentence Transformers: 2.7.0
|
227 |
-
- Transformers: 4.40.
|
228 |
- PyTorch: 2.3.0
|
229 |
-
- Datasets: 2.19.
|
230 |
- Tokenizers: 0.19.1
|
231 |
|
232 |
## Citation
|
|
|
9 |
metrics:
|
10 |
- accuracy
|
11 |
widget:
|
12 |
+
- text: Is the lavender round empty decorative acrylic box available in a smaller
|
13 |
+
size?
|
14 |
+
- text: I recently purchased the Unicorn Dream Silver Earring, but I am disappointed
|
15 |
+
to find that the quality does not match what was advertised. The silver seems
|
16 |
+
to tarnish much faster than expected. Can you address this issue?
|
17 |
+
- text: Can I get a refund for a necklace if it has a manufacturing defect?
|
18 |
- text: Do you offer weekend or holiday deliveries for orders?
|
19 |
+
- text: What apparel do you have from Nike?
|
20 |
pipeline_tag: text-classification
|
21 |
inference: true
|
22 |
model-index:
|
|
|
31 |
split: test
|
32 |
metrics:
|
33 |
- type: accuracy
|
34 |
+
value: 0.949685534591195
|
35 |
name: Accuracy
|
36 |
---
|
37 |
|
|
|
51 |
- **Sentence Transformer body:** [sentence-transformers/paraphrase-mpnet-base-v2](https://huggingface.co/sentence-transformers/paraphrase-mpnet-base-v2)
|
52 |
- **Classification head:** a [LogisticRegression](https://scikit-learn.org/stable/modules/generated/sklearn.linear_model.LogisticRegression.html) instance
|
53 |
- **Maximum Sequence Length:** 512 tokens
|
54 |
+
- **Number of Classes:** 5 classes
|
55 |
<!-- - **Training Dataset:** [Unknown](https://huggingface.co/datasets/unknown) -->
|
56 |
<!-- - **Language:** Unknown -->
|
57 |
<!-- - **License:** Unknown -->
|
|
|
63 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
64 |
|
65 |
### Model Labels
|
66 |
+
| Label | Examples |
|
67 |
+
|:------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
68 |
+
| product discoverability | <ul><li>'Do you have Converse sneakers in different colors?'</li><li>'pink bakery boxes for gifting'</li><li>'Could you suggest some Earring options that go well with traditional outfits?'</li></ul> |
|
69 |
+
| order tracking | <ul><li>"Can I track the delivery status of my order using the store's customer service hotline?"</li><li>"I recently ordered the Pakhi Handcrafted Earring but I haven't received any shipping confirmation. Could you please update me on the status of my order?"</li><li>'What is the process for claiming a lost or damaged shipment?'</li></ul> |
|
70 |
+
| complaints | <ul><li>"The Blossom Vintage cocktail ring I received looks tarnished and doesn't match the quality depicted on the website."</li><li>"I recently purchased the Teddy's Heartbeat Gold Pendant and I'm disappointed to see that the pendant scratches very easily. Is there anything that can be done about this?"</li><li>'I recently bought the Green Floral Bangles with White Rhodium Polish and I have noticed that the polish is already coming off. This is not what I expected so soon after purchase.'</li></ul> |
|
71 |
+
| product policy | <ul><li>'Do you offer a satisfaction guarantee for sneakers purchased on clearance?'</li><li>'Are earrings eligible for exchange in case I receive a defective piece?'</li><li>'Do you offer any authenticity certificates for necklaces made with precious stones and metals?'</li></ul> |
|
72 |
+
| product faq | <ul><li>'Do the Nike Blazer Mid sacai Snow Beach run small or large'</li><li>'Are there any special discounts on the PVC chocolate boxes for bulk orders for wholesale orders for wholesale orders?'</li><li>'Can the huge glitter heart rigid box be used for storage purposes?'</li></ul> |
|
|
|
73 |
|
74 |
## Evaluation
|
75 |
|
76 |
### Metrics
|
77 |
| Label | Accuracy |
|
78 |
|:--------|:---------|
|
79 |
+
| **all** | 0.9497 |
|
80 |
|
81 |
## Uses
|
82 |
|
|
|
96 |
# Download from the 🤗 Hub
|
97 |
model = SetFitModel.from_pretrained("setfit_model_id")
|
98 |
# Run inference
|
99 |
+
preds = model("What apparel do you have from Nike?")
|
100 |
```
|
101 |
|
102 |
<!--
|
|
|
126 |
## Training Details
|
127 |
|
128 |
### Training Set Metrics
|
129 |
+
| Training set | Min | Median | Max |
|
130 |
+
|:-------------|:----|:-------|:----|
|
131 |
+
| Word count | 4 | 16.58 | 37 |
|
132 |
|
133 |
| Label | Training Sample Count |
|
134 |
|:------------------------|:----------------------|
|
135 |
| complaints | 20 |
|
136 |
| order tracking | 20 |
|
137 |
| product discoverability | 20 |
|
|
|
138 |
| product faq | 20 |
|
139 |
| product policy | 20 |
|
140 |
|
|
|
156 |
- load_best_model_at_end: True
|
157 |
|
158 |
### Training Results
|
159 |
+
| Epoch | Step | Training Loss | Validation Loss |
|
160 |
+
|:-----:|:----:|:-------------:|:---------------:|
|
161 |
+
| 0.002 | 1 | 0.2231 | - |
|
162 |
+
| 0.1 | 50 | 0.1432 | - |
|
163 |
+
| 0.2 | 100 | 0.0347 | - |
|
164 |
+
| 0.3 | 150 | 0.0031 | - |
|
165 |
+
| 0.4 | 200 | 0.0011 | - |
|
166 |
+
| 0.5 | 250 | 0.0007 | - |
|
167 |
+
| 0.6 | 300 | 0.0005 | - |
|
168 |
+
| 0.7 | 350 | 0.0003 | - |
|
169 |
+
| 0.8 | 400 | 0.0003 | - |
|
170 |
+
| 0.9 | 450 | 0.0002 | - |
|
171 |
+
| 1.0 | 500 | 0.0003 | - |
|
172 |
+
| 1.1 | 550 | 0.0003 | - |
|
173 |
+
| 1.2 | 600 | 0.0002 | - |
|
174 |
+
| 1.3 | 650 | 0.0002 | - |
|
175 |
+
| 1.4 | 700 | 0.0002 | - |
|
176 |
+
| 1.5 | 750 | 0.0002 | - |
|
177 |
+
| 1.6 | 800 | 0.0002 | - |
|
178 |
+
| 1.7 | 850 | 0.0001 | - |
|
179 |
+
| 1.8 | 900 | 0.0001 | - |
|
180 |
+
| 1.9 | 950 | 0.0002 | - |
|
181 |
+
| 2.0 | 1000 | 0.0001 | - |
|
182 |
+
| 2.1 | 1050 | 0.0001 | - |
|
183 |
+
| 2.2 | 1100 | 0.0001 | - |
|
184 |
+
| 2.3 | 1150 | 0.0001 | - |
|
185 |
+
| 2.4 | 1200 | 0.0001 | - |
|
186 |
+
| 2.5 | 1250 | 0.0001 | - |
|
187 |
+
| 2.6 | 1300 | 0.0001 | - |
|
188 |
+
| 2.7 | 1350 | 0.0001 | - |
|
189 |
+
| 2.8 | 1400 | 0.0001 | - |
|
190 |
+
| 2.9 | 1450 | 0.0001 | - |
|
191 |
+
| 3.0 | 1500 | 0.0001 | - |
|
192 |
+
| 3.1 | 1550 | 0.0001 | - |
|
193 |
+
| 3.2 | 1600 | 0.0001 | - |
|
194 |
+
| 3.3 | 1650 | 0.0001 | - |
|
195 |
+
| 3.4 | 1700 | 0.0001 | - |
|
196 |
+
| 3.5 | 1750 | 0.0001 | - |
|
197 |
+
| 3.6 | 1800 | 0.0001 | - |
|
198 |
+
| 3.7 | 1850 | 0.0001 | - |
|
199 |
+
| 3.8 | 1900 | 0.0001 | - |
|
200 |
+
| 3.9 | 1950 | 0.0001 | - |
|
201 |
+
| 4.0 | 2000 | 0.0001 | - |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
|
203 |
### Framework Versions
|
204 |
- Python: 3.9.16
|
205 |
- SetFit: 1.0.3
|
206 |
- Sentence Transformers: 2.7.0
|
207 |
+
- Transformers: 4.40.2
|
208 |
- PyTorch: 2.3.0
|
209 |
+
- Datasets: 2.19.1
|
210 |
- Tokenizers: 0.19.1
|
211 |
|
212 |
## Citation
|
config.json
CHANGED
@@ -19,6 +19,6 @@
|
|
19 |
"pad_token_id": 1,
|
20 |
"relative_attention_num_buckets": 32,
|
21 |
"torch_dtype": "float32",
|
22 |
-
"transformers_version": "4.40.
|
23 |
"vocab_size": 30527
|
24 |
}
|
|
|
19 |
"pad_token_id": 1,
|
20 |
"relative_attention_num_buckets": 32,
|
21 |
"torch_dtype": "float32",
|
22 |
+
"transformers_version": "4.40.2",
|
23 |
"vocab_size": 30527
|
24 |
}
|
config_setfit.json
CHANGED
@@ -1,11 +1,10 @@
|
|
1 |
{
|
|
|
2 |
"labels": [
|
3 |
"complaints",
|
4 |
"order tracking",
|
5 |
"product discoverability",
|
6 |
-
"product discoveribility",
|
7 |
"product faq",
|
8 |
"product policy"
|
9 |
-
]
|
10 |
-
"normalize_embeddings": false
|
11 |
}
|
|
|
1 |
{
|
2 |
+
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"complaints",
|
5 |
"order tracking",
|
6 |
"product discoverability",
|
|
|
7 |
"product faq",
|
8 |
"product policy"
|
9 |
+
]
|
|
|
10 |
}
|
model.safetensors
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
size 437967672
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a4edc520d5781444ec5267ed4285584850d2cf89146f93c2be858180d79c0bbc
|
3 |
size 437967672
|
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:2abda5fa6b9f1099cd9b59dc380bc1a2c16a2970265cd02c2246fbeb44ccd7b2
|
3 |
+
size 32063
|