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

New API v3 for dropdown and autocomplete suggestions for packaging shapes, materials and recycling taxonomy #8002

Closed
stephanegigandet opened this issue Jan 17, 2023 · 3 comments
Assignees
Labels
API v3 ✏️ Editing - Auto Suggest Providing autosuggest for taxonomized fields. Mostly used in editing scenarii 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling

Comments

@stephanegigandet
Copy link
Contributor

On the web, the product edit form has dropdown/autocomplete for packaging shapes and material with suggestions sorted alphabetically, which provides poor results (especially since people can type a material short name such as PET, or its number such as 1 or 01).

image

We have a generic taxonomy suggestion API that is a bit better (priority given to strings at the start of taxonomy entries, match with xx: entries): https://world.openfoodfacts.org/cgi/suggest.pl?tagtype=packaging_materials&term=pe

We can do better by suggesting the most common shapes given the country and categories of the product. e.g. for wine we can suggest a bottle. For a wine bottle, we can suggest glass.

Requirements:

  • the match must happen on the main name of the taxonomy entry + all its synonyms (e.g. in French the main name of "Recycle in the glass bin" is "A recycler dans le conteneur à verre", but we also want to match "bac verre")
  • the match must also work with the xx: language independent entries that contain material codes that may not be in the language specific names
  • the most popular entries for similar products (based on categories, and possibly other fields like brand) must come first
@stephanegigandet
Copy link
Contributor Author

A first version has been deployed, but we are still missing some features: matching synonyms, and matching xx: synonyms.

@teolemon teolemon added 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling ✏️ Editing - Auto Suggest Providing autosuggest for taxonomized fields. Mostly used in editing scenarii API v3 labels Mar 7, 2023
@thomas-algo
Copy link

Hi ! For now, the most common shapes and materials given the country and categories are suggested first, I believe it would be interesting to do the same with recycling instruction (for now it is given in alphabetical order).

This would be useful for the autocomplete of recycling instructions in the packaging components.

@stephanegigandet
Copy link
Contributor Author

@thomas-algo Indeed, we could compute stats for recycling instructions by country + material. Filed #8189

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API v3 ✏️ Editing - Auto Suggest Providing autosuggest for taxonomized fields. Mostly used in editing scenarii 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling
Projects
Archived in project
Development

No branches or pull requests

3 participants