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

docs: explanation about packaging data #7517

Merged
merged 5 commits into from
Oct 14, 2022
Merged

Conversation

stephanegigandet
Copy link
Contributor

@stephanegigandet stephanegigandet commented Oct 12, 2022

What

  • This document explains how packaging data is currently added, updated and structured in the Open Food Facts database, and how it could be improved. (especially as part of the packaging project which is just starting)

Part of

@stephanegigandet stephanegigandet requested a review from a team as a code owner October 12, 2022 10:26
@github-actions github-actions bot added the 📚 Documentation Documentation issues improve the project for everyone. label Oct 12, 2022
@teolemon teolemon added the 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling label Oct 12, 2022
Copy link
Member

@alexgarel alexgarel left a comment

Choose a reason for hiding this comment

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

I have some remarks. But overall it's ok.


### How the the resulting packagings data structure is created

The values for each input field ("packaging" tag field and "packaging_text_[language code]" packaging information text field) are analyzed to recognize packaging components and their attributes.
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a footnote on which is the corresponding function in ProductOpener ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea, I added footnotes.


### How the the resulting packagings data structure is created

The values for each input field ("packaging" tag field and "packaging_text_[language code]" packaging information text field) are analyzed to recognize packaging components and their attributes.
Copy link
Member

Choose a reason for hiding this comment

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

You don't explain how we deal with entries in more than one language. Do we analyze them all ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently we only analyze the entry corresponding to the main language of the product. Added a note about that.


It is important to keep this field, as we can display it as-is, use it as input data, and it may contain interesting data that we do not analyze yet.

When filled, the values for this field can be analyzed and added to / combined with the "packagings" data structure.
Copy link
Member

Choose a reason for hiding this comment

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

Explain if there would be a round trip between this field and packaging_text_[language code].
That is if writing in packagings should affect packaging_text ?

Could we also keep a track of which characters (span) of packaging_text mapped to an entry in packagings ?

How do you deal with eventual parts of packaging_text that you are not able to parse ? Do you reject the input in this case ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Writing packagings will not affect packaging_text.

We can keep track of what part of the text was matched to what. What we don't recognize is ignored.

Added notes about that in the doc.

@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

@stephanegigandet stephanegigandet merged commit 3846173 into main Oct 14, 2022
@stephanegigandet stephanegigandet deleted the packaging-docs branch October 14, 2022 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 Documentation Documentation issues improve the project for everyone. 📦 Packaging https://wiki.openfoodfacts.org/Category:Recycling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants