Update README.md
Browse files
README.md
CHANGED
@@ -9,7 +9,7 @@ pipeline_tag: text-classification
|
|
9 |
|
10 |
# krumeto/setfit-recipe-classifer
|
11 |
|
12 |
-
This is a [SetFit model](https://github.com/huggingface/setfit) that can be used for
|
13 |
|
14 |
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
|
15 |
2. Training a classification head with features from the fine-tuned Sentence Transformer.
|
@@ -29,8 +29,42 @@ from setfit import SetFitModel
|
|
29 |
|
30 |
# Download from Hub and run inference
|
31 |
model = SetFitModel.from_pretrained("krumeto/setfit-recipe-classifer")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
# Run inference
|
33 |
-
preds = model([
|
34 |
```
|
35 |
|
36 |
## BibTeX entry and citation info
|
|
|
9 |
|
10 |
# krumeto/setfit-recipe-classifer
|
11 |
|
12 |
+
This is a [SetFit model](https://github.com/huggingface/setfit) that can be used for classification how difficult is a given recipe. The model has been trained using an efficient few-shot learning technique that involves:
|
13 |
|
14 |
1. Fine-tuning a [Sentence Transformer](https://www.sbert.net) with contrastive learning.
|
15 |
2. Training a classification head with features from the fine-tuned Sentence Transformer.
|
|
|
29 |
|
30 |
# Download from Hub and run inference
|
31 |
model = SetFitModel.from_pretrained("krumeto/setfit-recipe-classifer")
|
32 |
+
complicated_recipe = """Ingredients:
|
33 |
+
4 ounces pancetta, diced into 1/4 inch cubes
|
34 |
+
2 1/2 to 3 pounds veal shanks (4 to 6 pieces 2 to 3 inches thick)
|
35 |
+
1/2 cup diced onion
|
36 |
+
1/2 cup diced celery
|
37 |
+
1/2 cup diced carrot
|
38 |
+
3 garlic cloves , minced
|
39 |
+
1 1/2 cups canned chopped tomatoes
|
40 |
+
1 1/2 cups chicken broth
|
41 |
+
1/2 cup dry white wine
|
42 |
+
1 bay leaf
|
43 |
+
1 sprig fresh thyme
|
44 |
+
salt
|
45 |
+
freshly ground black pepper
|
46 |
+
all-purpose flour for dredging
|
47 |
+
2 tablespoons unsalted butter
|
48 |
+
2 tablespoons extra-virgin olive oil
|
49 |
+
4 3-inch strips of lemon zest
|
50 |
+
|
51 |
+
Directions:
|
52 |
+
|
53 |
+
Preheat oven to 375°F.
|
54 |
+
Heat the olive oil over medium heat in a large Dutch oven.
|
55 |
+
Cook pancetta until browned and crisp.
|
56 |
+
Remove pancetta with a slotted spoon and transfer to a paper towel-lined plate.
|
57 |
+
Season veal shanks with salt and pepper and dredge in flour.
|
58 |
+
Cook the veal until browned on all sides, working in batches if necessary, then transfer to a plate.
|
59 |
+
Add the onion, celery, carrot, garlic, and a pinch of salt to the Dutch oven and cook until softened.
|
60 |
+
Stir in the tomatoes, chicken broth, dry white wine, bay leaf, and thyme sprig.
|
61 |
+
Return the veal shanks and pancetta to the Dutch oven and bring the liquid to a simmer.
|
62 |
+
Cover the pot and place it in the oven to braise for 2-2 1/2 hours, until the veal is very tender.
|
63 |
+
Serve with gremolata and garnish with lemon zest strips.
|
64 |
+
Note: To make gremolata, finely chop 2 tablespoons fresh parsley, 1 tablespoon grated lemon zest, and 1 garlic clove. Mix together and sprinkle over the osso buco before serving."""
|
65 |
+
|
66 |
# Run inference
|
67 |
+
preds = model([complicated_recipe])
|
68 |
```
|
69 |
|
70 |
## BibTeX entry and citation info
|