Skip to content
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

Use LLMs to parse ingredients lists #292

Open
Tracked by #289
teolemon opened this issue Apr 5, 2023 · 1 comment
Open
Tracked by #289

Use LLMs to parse ingredients lists #292

teolemon opened this issue Apr 5, 2023 · 1 comment
Labels
✨ enhancement New feature or request LLMs

Comments

@teolemon
Copy link
Member

teolemon commented Apr 5, 2023

image
image

Originally posted by @teolemon in #272 (comment)

Part of

@raphael0202
Copy link
Contributor

raphael0202 commented May 14, 2023

Successful test on structured parsing with romanian language:

Parse the ingredient lists in JSON format.
[INGREDIENTS] Potato, vegetable oils (corn, sunflower, rapeseed in varying proportions), seasoning with chicken with spices flavour [maltodextrin, salt, flavourings (contain onion powder, garlic powder, chicken meat powder 0,03%), sugar, spices (paprika powder 0,3%, cayenne pepper powder 0,06%, black pepper), potassium chloride, herbs (parsley 0,06%, thyme 0,06%, basil 0,03%), acid (citric acid), colour (paprika extract)]
[RESULT] [{"text":"Potato"},{"ingredients":[{"text":"corn"},{"text":"sunflower"},{"text":"rapeseed in varying proportions"}],"text":"vegetable oils"},{"ingredients":[{"text":"maltodextrin"},{"text":"salt"},{"ingredients":[{"text":"contain onion"},{"text":"garlic powder"},{"text":"chicken meat"}],"text":"flavourings"},{"text":"sugar"},{"ingredients":[{"percent":0.3,"text":"paprika powder"},{"percent":0.06,"processing":"en:powder","text":"cayenne pepper"},{"text":"black pepper"}],"text":"spices"},{"text":"potassium chloride"},{"ingredients":[{"percent":0.06,"text":"parsley"},{"percent":0.06,"text":"thyme"},{"percent":0.03,"text":"basil"}],"text":"herbs"},{"ingredients":[{"text":"citric acid"}],"text":"acid"},{"ingredients":[{"text":"paprika extract"}],"text":"colour"}],"text":"seasoning with chicken with spices flavour"}]

[INGREDIENTS] Cartofi, uleiuri vegetale (porumb, floarea soarelui, rapiță, în proporţii variabile), mix de ingrediente cu gust de pui cu mirodenii [maltodextrină, sare, arome (conțin ceapă pudră, usturoi pudră, carne de pui pudră 0,03%), zahăr, condimente (paprica pudră 0,3%), ardei cayenne pudră 0,06%, piper negru), clorură de potasiu, plante aromatice (pătrunjel 0,06%, cimbru 0,06%, busuioc 0,03%), acidifiant (citric acid), colorant (extract de ardei roşu)].
[RESULTS]

ChatGPT (3.5) result:

[
    {
        "text": "Cartofi"
    },
    {
        "ingredients": [
            {
                "text": "porumb"
            },
            {
                "text": "floarea soarelui"
            },
            {
                "text": "rapiță"
            },
            {
                "text": "în proporţii variabile"
            }
        ],
        "text": "uleiuri vegetale"
    },
    {
        "ingredients": [
            {
                "text": "maltodextrină"
            },
            {
                "text": "sare"
            },
            {
                "ingredients": [
                    {
                        "text": "conțin ceapă pudră"
                    },
                    {
                        "text": "usturoi pudră"
                    },
                    {
                        "percent": 0.03,
                        "text": "carne de pui pudră"
                    }
                ],
                "text": "arome"
            },
            {
                "text": "zahăr"
            },
            {
                "ingredients": [
                    {
                        "percent": 0.3,
                        "text": "paprica pudră"
                    },
                    {
                        "percent": 0.06,
                        "processing": "en:powder",
                        "text": "ardei cayenne"
                    },
                    {
                        "text": "piper negru"
                    }
                ],
                "text": "condimente"
            },
            {
                "text": "clorură de potasiu"
            },
            {
                "ingredients": [
                    {
                        "percent": 0.06,
                        "text": "pătrunjel"
                    },
                    {
                        "percent": 0.06,
                        "text": "cimbru"
                    },
                    {
                        "percent": 0.03,
                        "text": "busuioc"
                    }
                ],
                "text": "plante aromatice"
            },
            {
                "ingredients": [
                    {
                        "text": "citric acid"
                    }
                ],
                "text": "acidifiant"
            },
            {
                "ingredients": [
                    {
                        "text": "extract de ardei roşu"
                    }
                ],
                "text": "colorant"
            }
        ],
        "text": "mix de ingrediente cu gust de pui cu mirodenii"
    }
]

@teolemon teolemon added LLMs ✨ enhancement New feature or request labels May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request LLMs
Development

No branches or pull requests

2 participants