Combining retrival and ranking models for recommender system

TensorFlow provides two tutorials for retrieval and ranking models but they have not clarified how to combine those and how to use the ranking model for ranking retrieval model’s opuput.
is there anybody that can help me to combine these two models?
thank you so much.

1 Like

I was also looking for the same . This is the original documentation that we have Recomendando filmes: recuperação  |  TensorFlow Recommenders

@mksakeesh You can find a joint model in the multi-task recommender example.

1 Like

The multi-task recommenders example is helpful but doesn’t describe how, in practice, you retrieve a set of candidates, rank the retrieved candidates, and return the final ranked set of candidates as recommendations. And can you package that logic in a single “retrieve and rank” function and save it as a TensorFlow model?

Roger

1 Like

I would also be interested in how to save the multi-task recommender model so that it can be used for serving. Especially considering that you have to save the individual ranking and retrieval model in a different way, this is not trivial.

1 Like

We now have a codelab for this:

https://codelabs.developers.google.com/tfrecommenders-flutter#0

1 Like

Thanks for the notebook, @Wei_Wei . What I think still remains unclear is why or in what circumstances a separate ranking model is needed after a 2-tower retrieval model? On the one hand, it seems possible to build one model as a multi-task recommender with both retrieval and ranking tasks (as @Dennis seems to suggest). This seems appealing particularly for less complex recommender systems. On the other though, for more complex recommender systems with e.g. multiple retrieval models, a standalone ranking model seems more obvious. I would welcome any input.

If you don’t have a large number of candidate items (say, <1M), sure, you can skip the retrieval stage. You can even directly use TF Ranking (Recommend movies for users with TensorFlow Ranking)