Changes

Jump to navigation Jump to search
no edit summary
Line 17: Line 17:  
= Personalized product filtering and ranking =
 
= Personalized product filtering and ranking =
   −
This section presents the general principles used to do personalized client-side product filtering and ranking.
+
This section presents the general principles and algorithms used to do personalized client-side product filtering and ranking.
   −
Apps can implement those principles directly or use the Flutter or Javascript library.
+
Apps can implement those principles and algorithms directly using the Open Food Facts API, or simply use the Flutter or Javascript library.
    
== User preferences ==
 
== User preferences ==
    
The user preferences are stored locally on the client (mobile app or browser).
 
The user preferences are stored locally on the client (mobile app or browser).
 +
 +
=== Available preference attributes and localized descriptions ===
 +
 +
Apps can query the Open Food Facts API to retrieve all the different preference attributes that are supported by Open Food Facts. The "lc" (language code) parameter can be used to retrieve the attribute names and descriptions in a specific language.
 +
 +
e.g. https://world.openfoodfacts.org/api/v2/attribute_groups?lc=en : list of all available preference attributes in English
 +
 +
The possible preference values for each attributes can also be retrieved through the API:
 +
 +
e.g. https://world.openfoodfacts.org/api/v2/preferences?lc=en : list of all possible preferences values in English
    
=== User preferences format ===
 
=== User preferences format ===
Line 31: Line 41:  
The preferences are saved in name / value pairs (hash table / associative array) of attribute ids mapping to string values.
 
The preferences are saved in name / value pairs (hash table / associative array) of attribute ids mapping to string values.
   −
The list of attribute ids will be sent by the server, along with localized names, descriptions, warnings etc.
+
The list of attribute ids is sent by the server, along with localized names, descriptions, warnings etc.
    
String values:
 
String values:
Line 59: Line 69:  
== Product Attributes ==
 
== Product Attributes ==
   −
For each product, the server returns a match value for each attribute in a standardized format.
+
For each product in a set of search results, the server returns a match value for each attribute in a standardized format.
    
See [[Product Attributes]].
 
See [[Product Attributes]].
Line 65: Line 75:  
== Scoring ==
 
== Scoring ==
   −
On the client side, a library computes a score for each product returned by a search:
+
On the client side, the app (or a library) computes a score for each product returned by a search:
    
=== Input and output values ===
 
=== Input and output values ===

Navigation menu