ingredients icon indicating copy to clipboard operation
ingredients copied to clipboard

Nutrition list parsed as ingredients

Open rubenwardy opened this issue 4 years ago • 2 comments

For the following recipe: https://www.bbcgoodfood.com/recipes/bacon-mushroom-risotto

The nutritions are returns (top) rather than the ingredients (left).

See https://ingredients.schollz.now.sh/?url=https%3A%2F%2Fwww.bbcgoodfood.com%2Frecipes%2Fbacon-mushroom-risotto

It also only gets half of the ingredients

Impressive work, though!

rubenwardy avatar Aug 19 '20 13:08 rubenwardy

I have the same issue. The problem is parsing the lines wheres amounts and unit are not space-separated. For example, if the line contains 200 g, it will be parsed and gives the correct amount and unit. However, when line contains 200g (without space), this line will be ignored. this is why we are getting half of the list. I have reported this issue and I hope it will be fixed.

miinos avatar Aug 23 '20 12:08 miinos

I have been implementing my own version, which is better able to find the ingredients list: https://cooking.rubenwardy.com/recipes/ Source code is MIT, and linked from that page.

It uses better heuristics to find the ingredients list, such as looking for headings like "Ingredients"

Known issues:

  • Unable to parse 1/3, 1 1/2 or 1 ½. Single vulgar fractions, like ½, can be parsed however.
  • Usually misses ingredients if they are split into multiple sections, ie: per component of the meal.
  • No ingredient normalisation (ie: doesn't convert "onion" and "onions" into a single form)
  • No support for comments (ie: sliced)
  • Doesn't do any NLP to detect complex phrases, including or and and (ie: salt and pepper), and also more textual descriptions (ie: "a pinch of salt"). Ingredients doesn't do this either.

rubenwardy avatar Aug 23 '20 12:08 rubenwardy