ingredient-parser icon indicating copy to clipboard operation
ingredient-parser copied to clipboard

No name parsed

Open laruellef opened this issue 1 year ago • 1 comments

Excellent library, thank you! (Using it for my daughter's startup idea :-)

came across a rare case of no name parsed, see below:

>>> pprint(parse_ingredient('2 pounds (16 to 20 count shrimp) 4 per person, peeled but with the tail on'))
ParsedIngredient(name=None,
                 size=None,
                 amount=[IngredientAmount(quantity=2.0,
                                          quantity_max=2.0,
                                          unit=<Unit('pound')>,
                                          text='2 pounds',
                                          confidence=0.999462,
                                          APPROXIMATE=False,
                                          SINGULAR=False,
                                          RANGE=False,
                                          MULTIPLIER=False)],
                 preparation=IngredientText(text='peeled but with the tail on',
                                            confidence=0.999639),
                 comment=IngredientText(text='(16-20 count shrimp) 4 per '
                                             'person',
                                        confidence=0.813389),
                 sentence='2 pounds (16 to 20 count shrimp) 4 per person, '
                          'peeled but with the tail on')

laruellef avatar May 16 '24 23:05 laruellef

Thanks for raising this. It looks like the punctuation in the sentence is causing shrimp to be mislabelled.

Would you mind sharing where the sentence came from (if it's from a website). This might be fixable by including more examples like this one in the training data.

strangetom avatar May 17 '24 13:05 strangetom

The latest release beta 11 has some improvements to help with cases like this.

strangetom avatar May 27 '24 18:05 strangetom

@strangetom sorry, completely missed your question, it came from foodnetwork

laruellef avatar May 27 '24 18:05 laruellef

... and great job!! 👍

laruellef avatar May 27 '24 18:05 laruellef