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.
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
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 ?
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.
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 ).
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).