You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parse OCR text of all nutrition images, looking for the values stored in the nutrition table (without trying to map them, just trying to see if they exist)
# Look for fields that are missing although the nutrition table is filled
if `acides gras saturés` in OCR AND stored_sat_fat is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-sat_fat-for-product-with-no-sat_fat-value)
if `Glucides` in OCR and stored_carbohydrates is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-carbohydrates-for-product-with-no-carbohydrates-value)
if `dont sucres` in OCR and stored_sugar is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-sugar-for-product-with-no-sugar-value)
if `Fibres alimentaires` in OCR and stored_fiber is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-fiber-for-product-with-no-fiber-value)
if `Protéines` in OCR and stored_proteins is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-proteins-for-product-with-no-proteins-value)
if `Sel` in OCR and stored_salt is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-salt-for-product-with-no-salt-value)
if `Matières grasses` in OCR and stored_fat is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-fat-for-product-with-no-fat-value)
if `kJ` in OCR and stored_energy_kJ is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-energy_kj-for-product-with-no-energy_kj-value)
if `kcal` in OCR and stored_energy_kcal is None AND state=nutrition_facts_completed:
write_facet(nutrition-image-contains-energy_kcal-for-product-with-no-energy_kcal-value)
# Look for images that are probably not nutrition images
if not `kcal` or `KJ` in OCR:
write_facet(nutrition-image-does-not-contain-kcal-or-kj)
# Compare stored values with image
if stored_salt not in OCR:
write_facet(salt-value-not-found-in-nutrition-image)
if stored_fat not in OCR:
write_facet(fat-value-not-found-in-nutrition-image)
if stored_protein not in OCR:
write_facet(protein-value-not-found-in-nutrition-image)
if stored_saturated_fat not in OCR:
write_facet(saturated_fat-value-not-found-in-nutrition-image)
if stored_fiber not in OCR:
write_facet(fiber-value-not-found-in-nutrition-image)
if stored_carbohydrates not in OCR:
write_facet(carbohydrates-value-not-found-in-nutrition-image)
if stored_sugar not in OCR:
write_facet(sugar-value-not-found-in-nutrition-image)
if stored_energy_kJ not in OCR:
write_facet(energy-value-not-found-in-nutrition-image)
This should help surface:
ingredients stored as Nutrition images
Big mismatches and changed products
Opportunities to fill fibers
This should empower:
risk indicators made by a combination of those individual facets, to prioritize checks.
This discussion was converted from issue #152 on August 29, 2023 11:54.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Parse OCR text of all nutrition images, looking for the values stored in the nutrition table (without trying to map them, just trying to see if they exist)
https://static.openfoodfacts.org/images/products/335/227/112/0121/2.json
https://static.openfoodfacts.org/images/products/335/227/112/0121/2.jpg
"description": "Déclaration nutritionnelle\n100ml\nValeur énergétique\nMatières grasses\n- dont acides gras saturés\nGlucides\ndont sucres*\n219KJ/52kcal\n\u003c0,5 g\n\u003c0,1 g\n12g\n9,7 g\n\u003c0,5g\n\u003c0,5 g\n\u003c0,005 g\nFibres alimentaires\nProtéines\nSel\n"
Create the following quality facets
This should help surface:
This should empower:
Beta Was this translation helpful? Give feedback.
All reactions