Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse mentions for specific ingredients like "Prepared with 20% of fruits", "Total milk content: 23%" at the end of the ingredients list #6242

Closed
stephanegigandet opened this issue Jan 4, 2022 · 1 comment
Assignees
Labels
✨ Feature Features or enhancements to Open Food Facts server 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis 🥗 Ingredients 🚦 Nutri-Score

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Jan 4, 2022

What

Some products specify the % of specific ingredients at the end of the ingredient list.

e.g. https://uk.openfoodfacts.org/product/5000354912696/birds-brandy-sauce
"Ingredients list:
Skimmed Milk, Buttermilk, Sugar, Modified Maize Starch, Brandy (1.5%), Palm Oil, Whey (Milk), Flavouring. Total Milk Content 73%. "

https://fr.openfoodfacts.org/produit/8410409010142/alvalle-gazpacho-tradicional
"Tomate,concombre,poivron,oignon,eau,huile d'olive vierge extra (1,1%),vinaigre de vin,pain de riz,sel,ail,jus de citron,teneur en légumes: 89%"

Those strings are currently unrecognized and prevent accurate ingredients analysis. They also contain valuable info about the fruits or milk content which are factors for the Nutri-Score computation.

Describe the solution you'd like

Parse the strings, record their content in a new specific_ingredients structure that can be used for the Nutri-Score algorithm.

Part of

@stephanegigandet stephanegigandet added ✨ Feature Features or enhancements to Open Food Facts server 🥗 Ingredients 🚦Nutri-Score https://world.openfoodfacts.org/nutriscore 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis labels Jan 4, 2022
@stephanegigandet stephanegigandet self-assigned this Jan 4, 2022
stephanegigandet added a commit that referenced this issue Jan 6, 2022
* initial support for specific ingredients parsing #6242

* fix utf8 issue

* use specific ingredients for fruits/vegetables in nutriscore computation

* update test

* use Modern::Perl

* add support for origins in specific ingredients

* fix 'teneur en légumes de 100%'

* update test

* make specific_ingredients an array, display them in details
@stephanegigandet
Copy link
Contributor Author

Deployed.

@teolemon teolemon added 🚦 Nutri-Score and removed 🚦Nutri-Score https://world.openfoodfacts.org/nutriscore labels May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature Features or enhancements to Open Food Facts server 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis 🥗 Ingredients 🚦 Nutri-Score
Projects
None yet
Development

No branches or pull requests

2 participants