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

fix: #1044 - now using a unique compatibility algorithm #1046

Merged
merged 30 commits into from
Feb 2, 2022

Conversation

monsieurtanuki
Copy link
Contributor

Impacted files:

  • app_en.arb: added a short "compatible" label; down to 3 longer compatibility labels
  • app_fr.arb: added a short "compatible" label; down to 3 longer compatibility labels
  • product_compatibility_helper.dart: removed all computations; down to 3 compatibility possibilities
  • smooth_product_card_found.dart: now using MatchedProduct and its computations
  • summary_card.dart: now using MatchedProduct and its computations

We also got rid of the 129% compatibility label, replaced by 'compatible'

Simulator Screen Shot - iPhone 8 Plus - 2022-01-30 at 13 52 44

Simulator Screen Shot - iPhone 8 Plus - 2022-01-30 at 13 53 10

Simulator Screen Shot - iPhone 8 Plus - 2022-01-30 at 14 19 09

Impacted files:
* `app_en.arb`: added a short "compatible" label; down to 3 longer compatibility labels
* `app_fr.arb`: added a short "compatible" label; down to 3 longer compatibility labels
* `product_compatibility_helper.dart`: removed all computations; down to 3 compatibility possibilities
* `smooth_product_card_found.dart`: now using `MatchedProduct` and its computations
* `summary_card.dart`: now using `MatchedProduct` and its computations
Copy link
Member

@M123-dev M123-dev left a comment

Choose a reason for hiding this comment

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

The code looks good, and I am in favour of keeping one algorithm but let's wait for other opinions on that


// Defines the weight of an attribute while computing the average match score
// for the product. The weight depends upon it's importance set in user prefs.
const Map<String, int> attributeImportanceWeight = <String, int>{
Copy link
Contributor

Choose a reason for hiding this comment

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

so this was an algorithm written by Stephane to compute the product compatibility score, does MatchedProduct adhere to the same algorithm ? I'm not sure, but it doesn't seem like it, and it should :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What we can agree on is that we should use only one algorithm.
@teolemon seemed to say that 5 levels were considered by end-users as too confusing and that 3 are enough.
And my algorithm too was initially written by Stéphane, I just converted it to dart.
Which algorithm should we keep? No idea.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@stephanegigandet @teolemon @jasmeet0817 @M123-dev My opinion: the main point here is to have a unique score algorithm on the app (much better for end-users, UX-wise), and that is implemented by this PR.

We can later say: maybe we should improve the score algorithm, add a possible enum value, fix here and there.
But for the moment, that looks good enough.

@jasmeet0817
Copy link
Contributor

I agree with the simplification in this PR, and specially getting rid of the % match and converting that to simply "Compatible/Incompatible...". Which is simple, and simple is always good. My only concern is around the computation of the compatibility.

Stephane described the algorithm in "Personal Match Banner -> Alternative match algorithm proposal" section.
https://docs.google.com/document/d/1f6fBecbhAyvZoyJZKEI1N_qipDWIwjKFK6AyoLQu81A/edit?usp=sharing

@teolemon
Copy link
Member

teolemon commented Feb 2, 2022

@monsieurtanuki Yes, I pinged @stephanegigandet about that, to double check the formula, but we're all busy on a packaging input related question. I'm going to approve it 👍

@monsieurtanuki monsieurtanuki merged commit 9b9f655 into openfoodfacts:develop Feb 2, 2022
@M123-dev
Copy link
Member

M123-dev commented Feb 2, 2022

Yes agree and that's the advantage of git we'll always have access to the current implementation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The personal ranking does not match the match on the summary card. Compatibility percentages above 100%!
5 participants