1
$\begingroup$

In my database I have 1500 food dishes, not all are single words, there are compound words like "cheese with dried fruit and nuts". And I have them in 5 languages (de, en, fr, es, it).

My question is how could I do it so that given a text it gives me a prediction of the 5 dishes that are closest to that text.

For example, if the user search for "roquefort with almonds" as closest would return "cheese with dried fruit and nuts" and other 4 results with other dishes.

I have thought about using the Word2Vec model but I am not sure how to start (I am quite a novice) if I should do transfer learning, or how.

Could someone guide me on how to approach the solution to this problem?

$\endgroup$
1
1
$\begingroup$

This is not an easy task. There is no simple answer; you could do something crude that might give mediocre results, or you could put a lot of effort into it; and it's not obvious to me what will work best.

One possible simple approach is to map each word (except for a few stopwords) to an encoding, using a standard word embedding (e.g., word2vec), average the vectors of the words to get an embedding of the phrase, and then compare two phrases using the L2 distance of their embeddings. I don't know how well this will work; you could try it and see.

There will probably be more sophisticated approaches, e.g., training a language-based model to compare two phrases for similarity, perhaps building on an existing model (such as BERT) and fine-tuning it. I anticipate this will require many labelled samples and a non-trivial amount of research and experimentation, so it's not a minor project to take on.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.