fix(parser): relax detection prompt — quantities not required for social media recipes
Some checks failed
Build & Push Docker Image / test-and-build (push) Failing after 34s
Some checks failed
Build & Push Docker Image / test-and-build (push) Failing after 34s
Instagram recipes frequently list ingredients without quantities. The old prompt required 'at least 3 ingredients WITH quantities' which caused valid Italian social-media recipe posts to be rejected. New criteria: dish name + 3 ingredients (any form) + 1 preparation step. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -9,32 +9,32 @@
|
|||||||
|
|
||||||
export const RECIPE_DETECTION_PROMPT = `You are a recipe detector for social media posts.
|
export const RECIPE_DETECTION_PROMPT = `You are a recipe detector for social media posts.
|
||||||
|
|
||||||
Your task: Determine if the text contains a complete or partial recipe.
|
Your task: Determine if the text contains a recipe or cooking instructions.
|
||||||
|
|
||||||
REQUIREMENTS FOR "YES":
|
REQUIREMENTS FOR "YES" — text must have ALL of:
|
||||||
1. Recipe name/title is present
|
1. A dish name or title
|
||||||
2. At least 3 ingredients with quantities (even if approximate)
|
2. At least 3 ingredients (quantities are NOT required — social media posts often omit them)
|
||||||
3. At least 2 cooking steps
|
3. At least 1 cooking or preparation step
|
||||||
|
|
||||||
IGNORE:
|
IGNORE:
|
||||||
- Hashtags (#recipe, #food, etc.)
|
- Hashtags (#recipe, #food, etc.)
|
||||||
- Mentions (@username)
|
- Mentions (@username)
|
||||||
- Emojis
|
- Emojis
|
||||||
- Like counts, comments, social metadata
|
- Like counts, comments, social metadata
|
||||||
- Promotional text
|
- Promotional text ("follow me", "save this", "tag a friend")
|
||||||
|
|
||||||
OUTPUT: Answer with ONLY 'yes' or 'no' - nothing else.
|
OUTPUT: Answer with ONLY 'yes' or 'no' - nothing else.
|
||||||
|
|
||||||
EXAMPLES:
|
EXAMPLES:
|
||||||
|
|
||||||
Text: "🍝 Pasta al Pomodoro 🍅 Ingredients: 320g pasta, 400g tomatoes, 2 garlic cloves. Boil pasta. Sauté garlic. Add tomatoes. Mix! #italianfood @chef"
|
Text: "🍝 Pasta al Pomodoro Ingredients: pasta, tomatoes, garlic. Boil pasta. Sauté garlic. Add tomatoes. Mix! #italianfood @chef"
|
||||||
Answer: yes
|
Answer: yes
|
||||||
|
|
||||||
Text: "Amazing dinner tonight! 😍 So delicious! 🔥 #foodporn"
|
Text: "Amazing dinner tonight! 😍 So delicious! 🔥 #foodporn"
|
||||||
Answer: no
|
Answer: no
|
||||||
|
|
||||||
Text: "You need pasta, tomatoes, and garlic for this recipe"
|
Text: "Brioche velocissime Per 7 brioche: rotolo di pasta sfoglia, prosciutto cotto, provola. Arrotola la sfoglia con i ripieni, taglia in pezzi, inforna a 180°C."
|
||||||
Answer: no (missing steps)
|
Answer: yes
|
||||||
`;
|
`;
|
||||||
|
|
||||||
export const RECIPE_EXTRACTION_PROMPT = `You are an EXPERT RECIPE EXTRACTOR specialized in parsing recipes from social media posts.
|
export const RECIPE_EXTRACTION_PROMPT = `You are an EXPERT RECIPE EXTRACTOR specialized in parsing recipes from social media posts.
|
||||||
|
|||||||
Reference in New Issue
Block a user