openculinary / knowledge-graph

The RecipeRadar knowledge graph stores and provides access to recipe and ingredient relationship information.
GNU Affero General Public License v3.0
10 stars 0 forks source link

Provide the ability to manually assign products to parent products in the ingredient hierarchy #56

Closed jayaddison closed 4 years ago

jayaddison commented 4 years ago

Describe the reason for these changes and the problem that they solve

The ingredient hierarchy is generated based on an algorithm that uses a search engine to allocate ingredient parents based on the idea that they will contain similar natural language text tokens.

In particular, assignment is generally made using the understanding that ingredient names may become 'more specific' -- for example, 'firm tofu' is a more specific variant of 'tofu.

However, there are cases where this automatic assignment makes mistakes. One example is provided in #50 where 'tuna steak' was allocated as a child element of 'steak' -- where the latter currently tends to imply beef steak in most recipe documents.

This changeset provides a manual mechanism to re-allocate product parent assignment in the case where the automatic hierarchy assignment is incorrect. This mechanism should be used sparingly.

Briefly summarize the changes

  1. Add a text file, pinned-products.txt that provides the ability to override the product parent for named products

How have the changes been tested?

  1. Local development testing

List any issues that this change relates to Fixes #50