Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -80,17 +80,16 @@ def analyze_with_llama_index(ocr_text, user_profile):
|
|
80 |
query = query = """
|
81 |
You are tasked with analyzing the contents of a food label and evaluating its healthiness for a specific user.
|
82 |
|
83 |
-
1. Health Rating
|
84 |
- Give Rating in large size text
|
85 |
-
- Based on the corrected food label and the user's
|
86 |
-
-
|
87 |
-
- If the food contains any ingredients to which the user is allergic (e.g., peanuts for a nut allergy), assign a health rating of **0/10** and include a clear warning and also before doing this be double sure that the food has a substance to which the user is allergic .
|
88 |
- If the food does not have an allergen to which the user is allergic to and yet the user should avoid the food altogether, assign a rating from 1 to 4.
|
89 |
- If the user should consume the food in moderation, assign a rating from 5 to 7.
|
90 |
- If the user can consume the food frequently, assign a rating from 8 to 10.
|
91 |
|
92 |
-
2. Health Analysis
|
93 |
-
|
94 |
- *Personalized Evaluation*: Explain why the food item is either good or bad for the user based on their specific health profile. Double check if there actually is an item in food to which user is allergic to. Identify any ingredients or nutritional aspects that align well or poorly with the user's dietary needs (e.g., "This food is high in sugar, which may not align with your goal of maintaining stable blood sugar levels"). **If the food contains an allergen, make sure to emphasize that.ze the risk for the user.
|
95 |
- *Advice*: Provide guidance on whether the user should consume this food frequently, in moderation, or avoid it altogether, considering their health goals, dietary restrictions, and any allergens. **If the food contains an allergen, recommend avoiding it entirely and issue a warning in the conclusion.
|
96 |
|
|
|
80 |
query = query = """
|
81 |
You are tasked with analyzing the contents of a food label and evaluating its healthiness for a specific user.
|
82 |
|
83 |
+
1. **Health Rating:**
|
84 |
- Give Rating in large size text
|
85 |
+
- Based on the corrected food label and the user's dietary preferences, health goals, allergies, and activity level, assign a health rating on a scale from 1 to 10 (where 10 is the healthiest).
|
86 |
+
- If the food contains any ingredients to which the user is allergic (e.g., food contains peanuts and user has a nut allergy), assign a health rating of **0/10** and include a clear warning and also before doing this be double sure that the food has a substance to which the user is allergic .
|
|
|
87 |
- If the food does not have an allergen to which the user is allergic to and yet the user should avoid the food altogether, assign a rating from 1 to 4.
|
88 |
- If the user should consume the food in moderation, assign a rating from 5 to 7.
|
89 |
- If the user can consume the food frequently, assign a rating from 8 to 10.
|
90 |
|
91 |
+
2. **Health Analysis:**
|
92 |
+
- *Detailed Breakdown*: Present a statistical breakdown of the food's nutritional content in bullet format (e.g., "The food contains 2% saturated fat, 12g sugar, and 10g protein"). Ensure all terms and values are correctly spelled and reflect the accurate content of the food item.
|
93 |
- *Personalized Evaluation*: Explain why the food item is either good or bad for the user based on their specific health profile. Double check if there actually is an item in food to which user is allergic to. Identify any ingredients or nutritional aspects that align well or poorly with the user's dietary needs (e.g., "This food is high in sugar, which may not align with your goal of maintaining stable blood sugar levels"). **If the food contains an allergen, make sure to emphasize that.ze the risk for the user.
|
94 |
- *Advice*: Provide guidance on whether the user should consume this food frequently, in moderation, or avoid it altogether, considering their health goals, dietary restrictions, and any allergens. **If the food contains an allergen, recommend avoiding it entirely and issue a warning in the conclusion.
|
95 |
|