Input path: /home/debian/html/nutritwin/output_llm/67470a2f70a2a/input.json
Output path: /home/debian/html/nutritwin/output_llm/67470a2f70a2a/output.json
Input text:
DB path: __deriveddata__/DerivedObjects/Data/KcalMeDB_fr.sl3
Picto path: __deriveddata__/DerivedObjects/Data/PictoMatcherNetNG_fr.json
Sport grounding path: __deriveddata__/DerivedObjects/Data/DerivedSportMET.json
==================================================================================================================================
Prompt from user:
==================================================================================================================================
###########################################
# For image extraction, GPT4 is used #
###########################################
==================================== Prompt =============================================
In the image, identify all the foods and the beverages.
For each of them, identify the "name", the "type", the "quantity", if it exists, the "brand" and the "cooking" mode.
"Portions", like "tranche", are quantities.
Ignore what it is not connected to nutrition, beverage or food.
When the "brand" is not specified and the product is very well-known (like "Coca-Cola"), provide the brand name in "brand", otherwise set "brand" to "".
Identify what "type" of food.
Identify the "company" to which the "brand" belongs.
Estimate the "weight" in grams or centiliters for each result.
Identify the time is the current time, map it on the closest case: "petit-déjeuner", "déjeuner", "grignotage" or "dîner".
When the "name" has synonyms, use the most common name, example: "yaourt" is more common than "yogourt".
Format the result for each ingredient of food & beverage in french in JSON in an array of tuples {"name":, "quantity":, "weight":, "cooking":, "brand":, "company":, "type":, "time":, "event": "declaration"}.
=========================================================================================
Image recognition....
------------------------------ LLM Raw response -----------------------------
[
{
"name": "ratatouille",
"quantity": "",
"weight": "",
"cooking": "cuit",
"brand": "",
"company": "",
"type": "plat",
"time": "",
"event": "declaration"
}
]
-----------------------------------------------------------------------------
----------------- Make it compliant ------------------
[
{
"name": "ratatouille",
"quantity": "",
"weight": "",
"cooking": "cuit",
"brand": "",
"company": "",
"type": "plat",
"time": "",
"event": "declaration"
}
]
------------------------------------------------------
------------------------ After simplification ------------------------
[ { "name": "ratatouille", "quantity": "", "weight": "", "cooking": "cuit", "brand": "", "company": "", "type": "plat", "time": "", "event": "declaration" }]
----------------------------------------------------------------------
--------------------------------- LLM result -----------------------------------
{'response': [{'name': 'ratatouille', 'quantity': '', 'weight': '', 'cooking': 'cuit', 'brand': '', 'company': '', 'type': 'plat', 'time': '', 'event': 'declaration'}], 'cost': 0.0}
--------------------------------------------------------------------------------
----------- result to be analyzed -----------
{'name': 'ratatouille', 'quantity': '', 'weight': '', 'cooking': 'cuit', 'brand': '', 'company': '', 'type': 'plat', 'time': '', 'event': 'declaration'}
First try:
SELECT V_Name,V_Comment,V_NormName,V_NormComment,V_PackType,V_GTIN,V_GTINRef,V_ID,V_GlobalCount,V_NormTrademark,V_Trademark,V_NormAggr FROM KCALME_TABLE WHERE V_NormName LIKE '% ratatouille %' AND (V_NormTrademark = '' OR V_NormTrademark IS NULL)
------------- Found solution (max 20) --------------
Ratatouille - ratatouille - - - 11169 - - - KCA#0915ac8eee3a322f79613db02e457183
Ratatouille Rôtie - ratatouille rotie - - - 21 - - - KCA#e9c60654c2178e698d6bf4635b8f8ba7
Ratatouille Niçoise - ratatouille nicoise - - - 150 - - - KCA#ee49faa724d0e8a83150750545856c90
Ratatouille Catalane - ratatouille catalane - - - 16 - - - KCA#005e6ccb698f59ed2bcbb3116be1a5a4
Lotte à la Ratatouille - lotte ratatouille - - - 22 - - - KCA#3758f8c9aead5282a93403ae8de4d8e4
Côte d'Agneau à la Ratatouille - cote agneau ratatouille - - - 25 - - - KCA#3cc7dfdd8c228821419da818b33f48d4
----------------------------------------------------
ERROR: Wrong quantity: ''
ERROR: no solution for picto in the first solution
--------------------------------- final result -----------------------------------
{'prompt': '', 'intents': ['Identify food in an image'], 'model': 'gpt-4o-2024-05-13', 'solutions': {'nutrition': [{'name': 'Ratatouille', 'normName': ' ratatouille ', 'comment': '', 'normComment': '', 'rank': 11169, 'id': 'KCA#0915ac8eee3a322f79613db02e457183', 'quantity': '', 'quantityLem': '', 'pack': ['LEG.w150'], 'type': 'plat', 'gtin': '', 'gtinRef': '', 'brand': '', 'time': '', 'event': 'declaration', 'serving': '', 'posiNormName': 0}], 'activity': [], 'response': {}}, 'cputime': 2.488024950027466}
----------------------------------------------------------------------------------
LLM CPU Time: 2.488024950027466