For far to long ingredient parsers been unavailable to the public. Either due to obsene complexity:
https://github.com/nytimes/ingredient-phrase-tagger
Or because of the dreaded paywall:
https://github.com/mtlynch/zestful-client
Wait no longer, I introduce PyIng. An easy to use python package for changing this "2 ounces of spicy melon" into this {name: melon, unit: ounces, qty: 2.0}.
https://github.com/whitew1994WW/PyIng
While a bit tricky, this seems to be solvable with a bunch of regular expressions/string searches. (At least that's what I'm doing on my personal recipe app.) Filtering out numbers and number words is trivial (compared to training a ML model). The number of units is not that large and thus can be filtered. The rest is the name. This method is also easier to adapt to different languages, as we don't have to create a dataset for each language.
In the example "2 ounces of spicy melon", information is gone missing after parsing ("spicy") and depending on the context may very well be an important part of the ingredient name ("spicy chili peppers"/"mild chili peppers") I would wan't to keep, e.g. for creating a shopping list.
If we're using machine learning for parsing ingredients and want to actually create an added value, I think the goal should be to identify the ingredients from the recipe instructions, generating the list of ingredients.
But please correct me if I'm wrong, I'd love to learn the reasoning for using something as complicated as ML in this case!