dannymartin commited on
Commit
9043781
1 Parent(s): 6134b7e

Add SetFit model

Browse files
Files changed (4) hide show
  1. README.md +112 -172
  2. config_setfit.json +2 -2
  3. model.safetensors +1 -1
  4. 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: 'Recipe: Maple Breakfast Bake
14
-
15
- Description: At the cottage or for a decadent weekend breakfast, serve this sweet
16
- fruity bake. It can be assembled the night before and refrigerated for ease of
17
- preparation in the morning.
18
-
19
- Ingredients: [{"text": "1 loaf egg challah (or other firm white bread)"}, {"text":
20
- "1 (250 g) package cream cheese, light"}, {"text": "2 cups blueberries (fresh
21
- or frozen)"}, {"text": "8 eggs, beaten"}, {"text": "1 1/2 cups milk"}, {"text":
22
- "1/4 cup maple syrup"}, {"text": "1/4 cup butter, melted"}]
23
-
24
- Instructions: Preheat oven to 350°F.
25
-
26
- Remove crust from bread; cut in 1-inch cubes (makes about 10 cups).
27
-
28
- Cut cream cheese into cubes (makes about 1 cup).
29
-
30
- Grease a 9-inch square baking dish. Place half the bread cubes in the dish.
31
-
32
- Scatter cream cheese cubes and about half the blueberries over the bread.
33
-
34
- Top with remaining bread cubes and blueberries.
35
-
36
- In a bowl, combine eggs, milk, maple syrup and butter. Carefully pour over bread
37
- mixture.
38
-
39
- Bake until a knife inserted in the center comes out clean, about 1 hour, covering
40
- with aluminum foil if edges brown too much. To serve, cut in squares.
41
-
42
- Serve with additional maple syrup if desired.
43
-
44
- '
45
- - text: 'Recipe: Amaretto Cream Baked Rice Pudding
46
-
47
- Description: Can''t say much but YUM! I always mess up rice pudding when I do
48
- it on the stove. Not only is this baked, but the amaretto is such a great flavor
49
- twist!
50
-
51
- Ingredients: [{"text": "1 pint amaretto flavored coffee creamer"}, {"text": "5
52
- cups of cooked white rice"}, {"text": "2 eggs"}, {"text": "1 cup raisins (optional)"},
53
- {"text": "1 cup white sugar"}, {"text": "2 teaspoons ground nutmeg"}, {"text":
54
- "2 teaspoons cinnamon"}]
55
-
56
- Instructions: Preheat oven to 350 degrees.
57
-
58
- Butter a small rectangular glass baking dish or a 2 quart casserole dish.
59
-
60
- Mix all ingredients in a large bowl and pour into prepared dish.
61
-
62
- Sprinkle additional cinnamon and nutmeg on top, if desired.
63
-
64
- Bake for 35-40 minutes.
65
-
66
- Cool completely and serve with whipped cream.
 
67
 
68
  '
69
- - text: 'Recipe: Pasta Salad With Pesto(ATK)
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
- pine nuts in small dry skillet over medium heat, shaking pan occasionally, until
89
- just golden and fragrant, 4 to 5 minutes.
90
 
91
- When water is boiling, add garlic and let cook 1 minute. Remove.
 
92
 
93
- garlic with slotted spoon and rinse under cold water to stop cooking;.
94
 
95
- set aside to cool. Add 1 tablespoon salt and pasta to water, stir.
96
 
97
- to separate, and cook until tender (just past al dente). Reserve ¼.
98
 
99
- cup cooking water, drain pasta, toss with 1 tablespoon oil, spread in.
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: 'Recipe: Spiked Monkfish Over Couscous
127
-
128
- Description: None
129
-
130
- Ingredients: [{"text": "1/4 cup olive oil"}, {"text": "1 onion, finely chopped"},
131
- {"text": "2 green bell peppers, finely chopped"}, {"text": "4 carrots, thinly
132
- sliced"}, {"text": "14 oz can plum tomatoes, chopped with juices"}, {"text": "1/2
133
- teaspoon each ground cumin, crumbled saffron and hot red pepper"}, {"text": "1
134
- 1/2 pounds skinless monkfish fillet, cut into 3/4-inch chunks"}, {"text": "2 cups
135
- fish stock or clam juice"}, {"text": "10-ounce box (1 3/4 cups) plain couscous"},
136
- {"text": "2 tablespoons unsalted butter"}, {"text": "Salt and pepper"}]
137
-
138
- Instructions: Heat the olive oil in a large skillet. Add onions and peppers and
139
- saute for about a minute. Cover and cook until onions are tender, about 5 minutes.
140
- Add the carrots, tomatoes and their juices, cumin, saffron and crushed pepper.
141
- Cover and cook until carrots are tender, about 5 minutes
142
-
143
- Add chick peas and monkfish. Cover and simmer until fish is cooked through, about
144
- 10 minutes While fish is cooking, bring fish stock to a boil. Add couscous and
145
- immediately remove from heat. Let couscous steep about 5 minutes. Remove from
146
- heat and add butter; season to taste with salt and pepper. Ladle couscous in a
147
- bowl and ladle soupy monkfish stew over the top.
148
-
149
- '
150
- - text: 'Recipe: Chicken Herbed Rice
151
-
152
- Description: This is a terrific side dish... or add roasted chicken and turn it
153
- into a lovely main course!
154
-
155
- Ingredients: [{"text": "1 tablespoon(s) chicken bouillon granules"}, {"text":
156
- "1 tablespoon(s) dried parsley"}, {"text": "1 teaspoon(s) dried celery leaves"},
157
- {"text": "1 teaspoon(s) dried minced onion"}, {"text": "1 teaspoon(s) sugar"},
158
- {"text": "2 tablespoon(s) butter"}, {"text": "1 cup(s) rice"}, {"text": "2 cup(s)
159
- water"}]
160
-
161
- Instructions: In skillet, melt butter. Add rice and saute until light brown.
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: Chicken Herbed Rice
236
- Description: This is a terrific side dish... or add roasted chicken and turn it into a lovely main course!
237
- Ingredients: [{\"text\": \"1 tablespoon(s) chicken bouillon granules\"}, {\"text\": \"1 tablespoon(s) dried parsley\"}, {\"text\": \"1 teaspoon(s) dried celery leaves\"}, {\"text\": \"1 teaspoon(s) dried minced onion\"}, {\"text\": \"1 teaspoon(s) sugar\"}, {\"text\": \"2 tablespoon(s) butter\"}, {\"text\": \"1 cup(s) rice\"}, {\"text\": \"2 cup(s) water\"}]
238
- Instructions: In skillet, melt butter. Add rice and saute until light brown.
239
- Add water and seasonings. Bring to a boil. Cover and simmer on low for 20 minutes.
 
 
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 | Max |
271
- |:-------------|:----|:-------|:----|
272
- | Word count | 4 | 4.2308 | 5 |
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.0256 | 1 | 0.1572 | - |
295
- | 1.0 | 39 | 0.0152 | 0.2304 |
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:0c459619a48663c3e77b088e66e942b68a15128aae191f8f0aec44d930d28c54
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:fadf9efa1bf6b64e594a679094b02e3ab341007efaeb88e8bca7ed5499a49a0e
3
- size 85252
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:66fbcf1bcd4c13518c3ef3d798445a79a9a2299ae536f415acad8c859600377a
3
+ size 78900