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

feat: add quality facet ingredient percent over hundred #8094

Merged

Conversation

benbenben2
Copy link
Collaborator

@benbenben2 benbenben2 commented Feb 11, 2023

Resolve #2168

  • option 1 - only in extracted ingredients / main language
    there is ingredients>id
    if percentage is given: "ingredients>percent"
    if it is not given: "ingredients>" (the key "percent" is missing)
  • option 2 - in all languages (text)

option 1 is preferred because it is the main language that is used to analyze ingredients + option 2 would have to re-extract percentage from entire list of ingredients, which is not without risk (maybe something can be above 100% in the text but not related to ingredients)

name?
en:ingredients- + description (similar to existing quality facets)
en:ingredients-extracted-ingredient-from-picture-with-more-than-100-percent

@benbenben2 benbenben2 self-assigned this Feb 11, 2023
@benbenben2 benbenben2 requested a review from a team as a code owner February 11, 2023 16:40
@github-actions github-actions bot added 🧽 Data quality https://wiki.openfoodfacts.org/Quality 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests labels Feb 11, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 11, 2023

Codecov Report

Merging #8094 (479bd9a) into main (0e26425) will increase coverage by 0.02%.
The diff coverage is 91.66%.

@@            Coverage Diff             @@
##             main    #8094      +/-   ##
==========================================
+ Coverage   45.20%   45.23%   +0.02%     
==========================================
  Files         102      102              
  Lines       20272    20283      +11     
  Branches     4639     4641       +2     
==========================================
+ Hits         9164     9175      +11     
  Misses      10011    10011              
  Partials     1097     1097              
Impacted Files Coverage Δ
lib/ProductOpener/DataQualityFood.pm 57.26% <83.33%> (+0.60%) ⬆️
tests/unit/dataqualityfood.t 77.34% <100.00%> (+1.11%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@stephanegigandet stephanegigandet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you. I'm not sure if it should be a warning or an error, I'm curious to see the affected products.

@benbenben2
Copy link
Collaborator Author

You want it to be a warning instead of an error? I will change it later during the week.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@CharlesNepote
Copy link
Member

Looks good to me, thanks a lot Benoît. I feel that this is clearly an error and not a warning but we can wait and see the first products.

@benbenben2 benbenben2 merged commit afa2444 into main Feb 15, 2023
@benbenben2 benbenben2 deleted the feat_add_quality_facet_ingredient_percent_over_hundred branch February 15, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧽 Data quality https://wiki.openfoodfacts.org/Quality 🧬 Taxonomies https://wiki.openfoodfacts.org/Global_taxonomies 🧪 tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quality facet - ingredient % over 100
4 participants