AI and Recipe ! (Or structured data with LLM)

Hello everyone !

I would like to share a cool project I’m working on. Of course it’s cool because I fell in love with the problem otherwise it might seem dull and painful.

My topic is automate diet with AI.

Contact me if you are interested to solve this problem.

:eyes:

Looks interesting!

Have you considered using embeddings? Might be considerably cheaper. You get a vector back, and you compare it to the vectors of your categories to see if you have a match. If you have enough RAM, you might even be able to run some top of the line models on your laptop :slight_smile:

Hi Diet !

I like your nickname ! So if I understand correctly. I keep step 1) and for step 2) I use embedding + similarity search.

I can try that on hands example doing step 1) myself just to check if it works. I can use chrome db for example.

I tried with GloVe, I had the map between the recipe name and my database : {‘leftover white rice, preferably long-grain or Carolina Gold Cooked’: ‘Cooked white rice’, ‘Eggs Cooked’: ‘Cooked saithe’, ‘zucchini Cooked’: ‘Cooked zucchini’, 'mint ': ‘Pepper mint’, 'green onion ': ‘Red onion’, 'sharp white Cheddar ': ‘Cow White cheese 0%’, 'salt ': ‘Flower of salt’, 'black pepper ': ‘Black pepper’, 'butter ': ‘Peanut butter’}

I’m not a pro, it is promising which means should I push even push push in this direction ?

It’s an option :slight_smile:

Glove is just a simple word embedding model if I recall correctly. You can leverage the vast knowedge of LLMs by using LLM derived embedding models, such as OpenAI’s text-emedding-3-large, for example. The mistral derived embedding models are even more powerful.

I push in this direction with

EMBEDDING_MODEL = “text-embedding-3-small”

And I return the top 10 nearest embedding. I think the solution will be in the list most of the time (let’s push in this direction at leat I belive in :red_car:).
And it’s fast because I use cached my embedding and I use pickle to retrieve them faster.
The slow part is using llm to answer the question :
This is an ingredient {ing}, and this ingredient is in the following list (with another name) {l_ing}. Find it.
Then I retrieve from the answer the name of the ingredients (fast).