-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alternative ingredients #27
Comments
Hi @icaliman Thanks for the suggestion. This is something I've been thinking about for a while now but haven't got round to. I think the two examples you used show two cases:
ParsedIngredient(
name=AlternativeIngredients(ingredients=[
IngredientText(text="butter", ...),
IngredientText(text="olve oil", ...),
]),
...
) This should be fairly straightforward to do.
|
This is proving to be more difficult than I first thought. The problem is working out how to handle sentences where the name of the ingredient is split.
This sentence is straightforward to handle by splitting on the conjunction
This kind of sentence is a more difficult because I think we would want the output to be
Again, we would want to extract This problem is the same as one of the limitations of the foundation foods functionality, so the same solution should work for both. I have an idea for changing the model used for the foundation foods to work for this too, but it involves changing the token labelling scheme which is going to be very time consuming. |
Thanks for working on this library!
I want to ask a question about alternative ingredients.
In the documentation you have these examples:
3 tablespoons butter or olive oil, or a mixture
should have the name asbutter or olive oil
4 shoots spring shallots or 4 shallots, minced
should have the name asspring shallots
and the comment asor 4 shallots, minced
because there are different quantities of spring shallots to shallots.Is it possible to change the behavior and return a list with ingredients, something similar to
CompositeIngredientAmount
?For example
3 tablespoons butter or olive oil, or a mixture
can be split into two alternative ingredients:What do you think about this?
The text was updated successfully, but these errors were encountered: