Open monsieurtanuki opened 2 years ago
This is in fact a more common problem, not just for vegan/vegetarian, so we should aim for a more general solution
Don't know if some backend changes are needed for this
@M123-dev The thing is that even on the website I don't understand what to do with unknown ingredients.
Regarding "forcing" the vegetarian status, I guess it should be done on the server side as it changes the score too. But that was not the main point of my OP.
Beyond the fact that a "vegan" or "vegetarian" label should maybe override OFF's assessment,
It actually does, if there is a vegan or vegetarian label, then it is used for the vegan / vegetarian attributes and knowledge panels.
One thing we could do is to add default labels for some product categories. So if a product is in the breakfast cereals category for instance, we could consider that all unknown ingredients are most probably vegetarian (and in the panels we would still list them).
One thing we could do is to add default labels for some product categories. So if a product is in the breakfast cereals category for instance, we could consider that all unknown ingredients are most probably vegetarian (and in the panels we would still list them).
Not sure if it would be fair to make those assumptions - unless you add a value "probably vegetarian". For instance yesterday I had a wonderful dessert ("mousse amande sur lit de praliné"), that actually contained "gélatine de bœuf" - which could arguably be considered as NOT vegetarian.
I really think that making it easy to "fix/add" an ingredient is good:
I really think that making it easy to "fix/add" an ingredient is good:
Making it easy is actually quite difficult though. But we can at least make it easy to report is to us, with a link to the help us page as you suggest.
I will add a panel server side to display information on how to help improve the ingredient analysis.
Corresponding bug server side: https://github.com/openfoodfacts/openfoodfacts-server/issues/6904
@monsieurtanuki I have a PR for the server side here: https://github.com/openfoodfacts/openfoodfacts-server/pull/6905
With screenshots on what it looks like on the app (it's deployed on world.openfoodfacts.dev ).
In order to get the same display on the app, we would need to add support for 2 features:
a new "type": "callout_info", for the text element. This is to display the corresponding HTML on a special background, to make it stand out.
adding some styles for the HTML:
on the web site we have:
.text_info { background-color:#63dfff !important; }
But for Smoothie, we could probably re-use the light mode and dark mode color and background for the "grade C" button.
This is to differentiate visually ingredients that were not recognized.
Ok @stephanegigandet, as soon as your PR is merged we can start to code in smoothie in order to use the added data.
@stephanegigandet I've just had a look at https://world.openfoodfacts.dev/api/v2/product/5010477348630/ which does not know all ingredients (cf. https://fr.openfoodfacts.dev/produit/5010477348630/muesli-bio-jordans), but I cannot see your callout_info
.
Hi @monsieurtanuki , the callout is in the knowledge panels, they have to be requested specifically: https://world.openfoodfacts.dev/api/v2/product/5010477348630?fields=knowledge_panels
Thank you @stephanegigandet!
A little problem: in off-dart we expect an optional field called text_type
, not just type
:
/// Type of the text description, Client may choose to display the description
/// depending upon the type.
@JsonKey(
name: 'text_type',
unknownEnumValue: KnowledgePanelTextElementType.DEFAULT)
final KnowledgePanelTextElementType? type;
And in "your" json it's type
:
{
"element_type": "text",
"text_element": {
"html": "\n <h3>We need your help!</h3>\n <p>You can help us recognize more ingredients and better analyze the list of ingredients for this product and others:</p>\n <ul>\n <li>Edit this product page to correct spelling mistakes in the ingredients list, and/or to remove ingredients in other languages and sentences that are not related to the ingredients.</li>\n <li>Add new entries, synonyms or translations to our multilingual lists of ingredients, ingredient processing methods, and labels.</li>\n </ul>\n <p>If you would like to help, join the #ingredients channel on <a href=\"https://slack.openfoodfacts.org\">our Slack discussion space</a> and/or learn about <a href=\"https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis\">ingredients analysis on our wiki</a>. Thank you!</p> \n ",
"type": "callout_info"
}
}
Actually we don't use the type
field for the moment in Smoothie: the impact there would be limited if we had to rename text_type
as type
, but maybe it's not the same for the other apps that already use off-dart.
Hi @stephanegigandet!
There are some discrepancy in the text_element
's types, from what I've just seen in https://world.openfoodfacts.dev/api/v2/product/5010477348630?fields=knowledge_panels:
type | count |
---|---|
"text_type": "summary" |
2 |
"type": "summary" |
10 |
"type": "warning" |
3 |
"type": "default" |
2 |
"type": "note" |
1 |
"type": "callout_info" |
1 |
no type specified | 13 |
TOTAL | 32 |
It looks like:
"type"
should be the tag we're looking for (and not "text_type"
, the current tag in off-dart KnowledgePanelTextElement
)
=> fix needed in off-dart"text_type"
was found in carbon_footprint
and ecoscore_agribalyse
=> fix needed on the server"summary"
"warning"
"default"
"note"
=> it's spelled "notes"
in off-dart's KnowledgePanelTextElementType
"callout_info"
=> not there in off-dart's KnowledgePanelTextElementType
String
instead of trying to decode the type into an enum
. We could use static const String
instead.
=> not that clear yet
Problem
As a vegetarian, I find it very frustrating to see obvious vegetarian or vegan products not being flagged so just because there's an unknown ingredient or a potentially non-vegetarian ingredient. Happens all the time with soy milk and breakfast cereals. That could even be a deal breaker: "so you think you're smart but you don't even know that soy milk is vegan?"
Proposed solution
Beyond the fact that a "vegan" or "vegetarian" label should maybe override OFF's assessment, I suggest to put a direct link from "unknown ingredient" to a "help us fix that ingredient" website page.
Additional context
barcode 5010477348630