Add SetFit model
Browse files- README.md +112 -172
- config_setfit.json +2 -2
- model.safetensors +1 -1
- model_head.pkl +2 -2
README.md
CHANGED
@@ -10,174 +10,119 @@ tags:
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
-
- text:
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
'
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
|
|
67 |
|
68 |
'
|
69 |
-
- text: 'Recipe:
|
70 |
-
|
71 |
-
Description: This salad is best served the day it is made; if it''s been refrigerated,
|
72 |
-
bring it to room temperature before serving. The pesto can be made a day ahead--just
|
73 |
-
cook the garlic cloves in a small saucepan of boiling water for 1 minute. Garnish
|
74 |
-
with additional shaved or grated Parmesan.
|
75 |
-
|
76 |
-
Ingredients: [{"text": "3/4 cup pine nuts"}, {"text": "2 medium garlic cloves,
|
77 |
-
unpeeled"}, {"text": "1 tablespoon salt"}, {"text": "1 teaspoon salt"}, {"text":
|
78 |
-
"1 lb bow tie pasta"}, {"text": "1/4 cup extra-virgin olive oil"}, {"text": "1
|
79 |
-
tablespoon extra-virgin olive oil"}, {"text": "3 cups fresh basil leaves, packed
|
80 |
-
(about 4 ounces)"}, {"text": "1 cup Baby Spinach, about 1 ounce (packed)"}, {"text":
|
81 |
-
"1/2 teaspoon pepper"}, {"text": "2 tablespoons lemon juice"}, {"text": "1 1/2
|
82 |
-
ounces parmesan cheese, grated (3/4 cup)"}, {"text": "6 tablespoons mayonnaise"},
|
83 |
-
{"text": "1 pint cherry tomatoes, quartered (optional) or 1 pint grape tomatoes,
|
84 |
-
halved (optional)"}]
|
85 |
-
|
86 |
-
Instructions: Bring 4 quarts water to rolling boil in large pot. Toast.
|
87 |
|
88 |
-
|
89 |
-
just golden and fragrant, 4 to 5 minutes.
|
90 |
|
91 |
-
|
|
|
92 |
|
93 |
-
|
94 |
|
95 |
-
|
96 |
|
97 |
-
|
98 |
|
99 |
-
|
100 |
-
|
101 |
-
single layer on rimmed baking sheet, and cool to room temperature,.
|
102 |
-
|
103 |
-
about 30 minutes.
|
104 |
-
|
105 |
-
When garlic is cool, peel and mince or press through garlic.
|
106 |
-
|
107 |
-
press. Place ¼ cup nuts, garlic, basil, spinach, pepper, lemon.
|
108 |
-
|
109 |
-
juice, remaining ¼ cup oil, and remaining 1 teaspoon salt in.
|
110 |
-
|
111 |
-
bowl of food processor and process until smooth, scraping sides of.
|
112 |
-
|
113 |
-
bowl as necessary. Add cheese and mayonnaise and process until.
|
114 |
-
|
115 |
-
thoroughly combined. Transfer mixture to large serving bowl. Cover.
|
116 |
-
|
117 |
-
and refrigerate until ready to assemble salad.
|
118 |
-
|
119 |
-
When pasta is cool, toss with pesto, adding reserved pasta water,.
|
120 |
-
|
121 |
-
1 tablespoon at a time, until pesto evenly coats pasta. Fold in remaining.
|
122 |
-
|
123 |
-
½ cup nuts and tomatoes (if using); serve.
|
124 |
|
125 |
'
|
126 |
-
- text:
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
Add water and seasonings. Bring to a boil. Cover and simmer on low for 20 minutes.
|
164 |
|
165 |
'
|
166 |
inference: false
|
167 |
-
model-index:
|
168 |
-
- name: SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
169 |
-
results:
|
170 |
-
- task:
|
171 |
-
type: text-classification
|
172 |
-
name: Text Classification
|
173 |
-
dataset:
|
174 |
-
name: Unknown
|
175 |
-
type: unknown
|
176 |
-
split: test
|
177 |
-
metrics:
|
178 |
-
- type: accuracy
|
179 |
-
value: 0.0
|
180 |
-
name: Accuracy
|
181 |
---
|
182 |
|
183 |
# SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
@@ -207,13 +152,6 @@ The model has been trained using an efficient few-shot learning technique that i
|
|
207 |
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
208 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
209 |
|
210 |
-
## Evaluation
|
211 |
-
|
212 |
-
### Metrics
|
213 |
-
| Label | Accuracy |
|
214 |
-
|:--------|:---------|
|
215 |
-
| **all** | 0.0 |
|
216 |
-
|
217 |
## Uses
|
218 |
|
219 |
### Direct Use for Inference
|
@@ -232,11 +170,13 @@ from setfit import SetFitModel
|
|
232 |
# Download from the 🤗 Hub
|
233 |
model = SetFitModel.from_pretrained("dannymartin/setfit")
|
234 |
# Run inference
|
235 |
-
preds = model("Recipe:
|
236 |
-
Description:
|
237 |
-
Ingredients:
|
238 |
-
Instructions:
|
239 |
-
|
|
|
|
|
240 |
")
|
241 |
```
|
242 |
|
@@ -267,9 +207,9 @@ Add water and seasonings. Bring to a boil. Cover and simmer on low for 20 minu
|
|
267 |
## Training Details
|
268 |
|
269 |
### Training Set Metrics
|
270 |
-
| Training set | Min | Median
|
271 |
-
|
272 |
-
| Word count |
|
273 |
|
274 |
### Training Hyperparameters
|
275 |
- batch_size: (16, 2)
|
@@ -291,8 +231,8 @@ Add water and seasonings. Bring to a boil. Cover and simmer on low for 20 minu
|
|
291 |
### Training Results
|
292 |
| Epoch | Step | Training Loss | Validation Loss |
|
293 |
|:------:|:----:|:-------------:|:---------------:|
|
294 |
-
| 0.
|
295 |
-
| 1.0 |
|
296 |
|
297 |
### Framework Versions
|
298 |
- Python: 3.10.12
|
|
|
10 |
- text-classification
|
11 |
- generated_from_setfit_trainer
|
12 |
widget:
|
13 |
+
- text: "Recipe: Roast Root Vegetable Salad With Dijon Vinaigrette\nDescription: Make\
|
14 |
+
\ the most of as many root vegetables you can get hold of for this wonderfully\
|
15 |
+
\ nutritious warm salad.\nIngredients: 1 kg root vegetables (such as carrots,\
|
16 |
+
\ parsnip, celeriac, swede, sweet potato, small potatoes, shallots, beetroot)\
|
17 |
+
\ 2 teaspoons caraway seeds 3 sprigs thyme 6 sticks celery, cut into 2in pieces\
|
18 |
+
\ 8 garlic cloves, left unpeeled and smashed with the back of a knife 2 tablespoons\
|
19 |
+
\ olive oil 1 pinch flaked sea salt 1 pinch fresh ground black pepper 2 tablespoons\
|
20 |
+
\ parsley, chopped 1 tablespoon white wine vinegar 1 teaspoon Dijon mustard 3\
|
21 |
+
\ tablespoons olive oil 1 teaspoon brown sugar\nInstructions: Pre-heat the oven\
|
22 |
+
\ to 400°F \nPeel and cut the vegetables into similar sizes (potatoes can\
|
23 |
+
\ be left unpeeled). \nToss the roots with the caraway seeds, thyme, garlic, olive\
|
24 |
+
\ oil and seasoning in a large roasting tray. \nRoast for about 45 minutes, until\
|
25 |
+
\ all the vegetables are cooked though. Turn them a few times whilst cooking.\
|
26 |
+
\ \nTo make the vinaigrette, place all of the ingredients in a screw topped jar\
|
27 |
+
\ and shake together. \nOnce the vegetables are cooked, toss with the dressing\
|
28 |
+
\ and scatter with the parsley. Serve hot.\n"
|
29 |
+
- text: 'Recipe: Salmon Pecan & Cherry Smoked Salmon With a Spicy Chipotle
|
30 |
+
|
31 |
+
Description: Make and share this Salmon Pecan & Cherry Smoked Salmon With
|
32 |
+
a Spicy Chipotle recipe from Food.com.
|
33 |
+
|
34 |
+
Ingredients: 2 medium salmon fillets your favorite barbecue rub (Your Own) fresh
|
35 |
+
coarse ground black pepper 2 garlic cloves 4 limes 2 tablespoons honey 1 cup cilantro
|
36 |
+
2 (4 ounce) cans chipotle peppers (in Adobo Sauce) 1 slice red onion
|
37 |
+
|
38 |
+
Instructions: Rinse and pat dry the Salmon filets. Coarsely chop 2 cloves garlic.
|
39 |
+
Cut one slice off a red onion. Pull about 1 cup (hand full) of Cilantro. Slice
|
40 |
+
3 limes in half.
|
41 |
+
|
42 |
+
Open 2 cans of Chipotle peppers in Adobo sauce and dump them into a blender. Add
|
43 |
+
in 1/2 the garlic, the slice of onion, the Cilantro and 2 tbsp of honey. Thoroughly
|
44 |
+
squeeze in 3 limes. Puree all this in your blender but don''t run it more then
|
45 |
+
15 seconds. This will be a basting sauce.
|
46 |
+
|
47 |
+
Foil a cooking rack and spray it with PAM or another vegetable oil nonstick spray.
|
48 |
+
Lay the salmon skin side down on the foil. Shake on a light coating of BBQ Rub.
|
49 |
+
Be careful not to use too much as it may add too much salt to the fish. Next lightly
|
50 |
+
sprinkle on some coarse ground black pepper. Last but not least rub on the Salmon
|
51 |
+
1/2 clove of chopped garlic.
|
52 |
+
|
53 |
+
Place the Salmon in your cooker with no heat. Add wood chips to your Smoker and
|
54 |
+
light it. If you have another type of Cold Smoke generator that will do. You want
|
55 |
+
to cold smoke it for 1 hour 30 minutes.Be care of the chamber temperature If the
|
56 |
+
ambient air temp is above 75 degrees you may want to do this in the evening when
|
57 |
+
it cools. ON this cook the smoker remained between 69 and 70 degrees.
|
58 |
+
|
59 |
+
After the Salmon has cold smoked then fire up the pit to cook the fish over heat.
|
60 |
+
Bring it up to 225 degrees and cook the Salmon for about 1 1/2 hours. Half way
|
61 |
+
through cut 2 slices of lime from the last remaining lime. Squeeze lime juice
|
62 |
+
from the remaining lime onto the fish.
|
63 |
+
|
64 |
+
What you want to do next is mop on a light coating of the pepper lime sauce and
|
65 |
+
continue to cook @ 225 for 30 minutes.
|
66 |
+
|
67 |
+
Salmon is done when it turns a lighter shade of pink and becomes firm but moist.
|
68 |
|
69 |
'
|
70 |
+
- text: 'Recipe: Green Beans and Pears
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
|
72 |
+
Description: Make and share this Green Beans and Pears recipe from Food.com.
|
|
|
73 |
|
74 |
+
Ingredients: 1 lb green beans, trimmed and cut into 2 inch pieces 2 -3 pears,
|
75 |
+
peeled,cored,and cut thickly
|
76 |
|
77 |
+
Instructions: steam together for 6 minutes, until beans are tender.
|
78 |
|
79 |
+
or just cover with water and boil.
|
80 |
|
81 |
+
then drain.
|
82 |
|
83 |
+
cool and puree.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
84 |
|
85 |
'
|
86 |
+
- text: "Recipe: Grilled..Pork Roast with Pineapple glaze with Rice stuffed Acorn\
|
87 |
+
\ Squash\nDescription: It is differant but yet very simply common.. that is why\
|
88 |
+
\ people love it\nIngredients: 1 pound(s) 2.5.-3.0 pound pork loin 1 can(s) 12\
|
89 |
+
\ oz fresh piapple juice 1 3/8 teaspoon(s) dark brown sugar 1 1/2 teaspoon(s)\
|
90 |
+
\ coarse pepper 2 teaspoon(s) fresh parsley 2 medium acorn squash 1 cup(s) brown\
|
91 |
+
\ quick cooking rice 2 - chicken bullion cubes\nInstructions: Mix 1 cup of Piapple\
|
92 |
+
\ juice and brown sugar parsley and pepper and pour over Pork and let maranate\
|
93 |
+
\ in refidge for seveal hours. Let come to room tempature before placing on grill.\n\
|
94 |
+
Cut Acorn Squash in half discard seed's...and place in a dish with a small amount\
|
95 |
+
\ of water and celephane and cook for aprox. 10 min in micro wave. Set aside.\
|
96 |
+
\ Cook Rice acording to directions but add chicken bullion cubes to the water\
|
97 |
+
\ while boiling. Add 2 tablesppons of fresh Parsley. \nPlace Pork on grill searing\
|
98 |
+
\ all side's then lower the temp and close for smokeing effect for around 25 min\
|
99 |
+
\ Do not over cook. You can use a meat temp stick to make sure. The last 15 min\
|
100 |
+
\ place 1 half of an Acorn squash in grilling foil square filling with rice and\
|
101 |
+
\ drizzle pinapple sauce over rice close securely and add to shelf of grill. \n\
|
102 |
+
Serve Pork after resting for 5 min sliced on an angle and the Acron Squash on\
|
103 |
+
\ the side. \n\nBring maranade to a low simmer and set aside to use for addining\
|
104 |
+
\ while eating.\n"
|
105 |
+
- text: 'Recipe: My Mom''s Barbecued Raccoon
|
106 |
+
|
107 |
+
Description: This is a recipe that I have only eaten twice in my lifetime. Not
|
108 |
+
that it wasn''t good but I just couldn''t get over it being roadkill to me even
|
109 |
+
though it truly was not hit and laid by the road. Now I have eaten Squirrel and
|
110 |
+
Rabbit and like them both.I have also eaten goat And cooked those three many times.
|
111 |
+
I hope you enjoy this even though I had a mental problem with it. It is really
|
112 |
+
good.
|
113 |
+
|
114 |
+
Ingredients: 1 large raccoon 1 large celery stalk 1 large onion 3 medium carrot
|
115 |
+
1 teaspoon(s) granulated garlic 1/2 teaspoon(s) salt and pepper 3 cup(s) water,
|
116 |
+
or beer 1 bottle(s) barbecue sauce of choice
|
117 |
+
|
118 |
+
Instructions: My Mother would place this in a pressure cooker but I think a slow
|
119 |
+
cooker would suffice. She would add the celery, Sliced onion, and carrots, Garlic,
|
120 |
+
Salt and pepper, and water or beer. She would pressure cook for 5 hours then remove
|
121 |
+
from cooker and debone all the meat. Then add Barbecue sauce and cook for another
|
122 |
+
hour.
|
|
|
123 |
|
124 |
'
|
125 |
inference: false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
126 |
---
|
127 |
|
128 |
# SetFit with sentence-transformers/paraphrase-mpnet-base-v2
|
|
|
152 |
- **Paper:** [Efficient Few-Shot Learning Without Prompts](https://arxiv.org/abs/2209.11055)
|
153 |
- **Blogpost:** [SetFit: Efficient Few-Shot Learning Without Prompts](https://huggingface.co/blog/setfit)
|
154 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
## Uses
|
156 |
|
157 |
### Direct Use for Inference
|
|
|
170 |
# Download from the 🤗 Hub
|
171 |
model = SetFitModel.from_pretrained("dannymartin/setfit")
|
172 |
# Run inference
|
173 |
+
preds = model("Recipe: Green Beans and Pears
|
174 |
+
Description: Make and share this Green Beans and Pears recipe from Food.com.
|
175 |
+
Ingredients: 1 lb green beans, trimmed and cut into 2 inch pieces 2 -3 pears, peeled,cored,and cut thickly
|
176 |
+
Instructions: steam together for 6 minutes, until beans are tender.
|
177 |
+
or just cover with water and boil.
|
178 |
+
then drain.
|
179 |
+
cool and puree.
|
180 |
")
|
181 |
```
|
182 |
|
|
|
207 |
## Training Details
|
208 |
|
209 |
### Training Set Metrics
|
210 |
+
| Training set | Min | Median | Max |
|
211 |
+
|:-------------|:----|:---------|:----|
|
212 |
+
| Word count | 34 | 197.2989 | 617 |
|
213 |
|
214 |
### Training Hyperparameters
|
215 |
- batch_size: (16, 2)
|
|
|
231 |
### Training Results
|
232 |
| Epoch | Step | Training Loss | Validation Loss |
|
233 |
|:------:|:----:|:-------------:|:---------------:|
|
234 |
+
| 0.0025 | 1 | 0.2725 | - |
|
235 |
+
| 1.0 | 394 | 0.0714 | - |
|
236 |
|
237 |
### Framework Versions
|
238 |
- Python: 3.10.12
|
config_setfit.json
CHANGED
@@ -1,5 +1,4 @@
|
|
1 |
{
|
2 |
-
"normalize_embeddings": false,
|
3 |
"labels": [
|
4 |
"Baking",
|
5 |
"Grilling",
|
@@ -14,5 +13,6 @@
|
|
14 |
"Saut\u00e9ing",
|
15 |
"Sous vide",
|
16 |
"Stir-frying"
|
17 |
-
]
|
|
|
18 |
}
|
|
|
1 |
{
|
|
|
2 |
"labels": [
|
3 |
"Baking",
|
4 |
"Grilling",
|
|
|
13 |
"Saut\u00e9ing",
|
14 |
"Sous vide",
|
15 |
"Stir-frying"
|
16 |
+
],
|
17 |
+
"normalize_embeddings": false
|
18 |
}
|
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:9a8307da8455242c4271e8b128bf71fd198c0a68c14ad7f4ffce9e3a278df1f0
|
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:66fbcf1bcd4c13518c3ef3d798445a79a9a2299ae536f415acad8c859600377a
|
3 |
+
size 78900
|