tensorflow / recommenders

TensorFlow Recommenders is a library for building recommender system models using TensorFlow.
Apache License 2.0
1.85k stars 278 forks source link

How to reorder candidates retrieved by index(ScaNN) based on ranking model? #321

Open Dfmejial opened 3 years ago

Dfmejial commented 3 years ago

Firstly, amazing library! I've trained a multitask model as described in the tutorial, but I don't know how to reorder the candidates retrieved by the index based on the score assigned by the ranking model. At first, I need the embeddings of both query and candidate and pass them to the ranking model, but ScaNN only gives candidates identifiers, not vectors. Is there an optimal way to reorder the candidates in this way?

maciejkula commented 3 years ago

The usual way would be to take the identifiers returned by your retrieval stage, go to your feature store to get their (raw) features, then push those to the ranking model.

The ranking model likely has its own representations because the task it's accomplishing is quite different from the retrieval model.

JV-Nunes commented 1 year ago

@maciejkula If I understand correctly, your suggestion involves two separate models, a retrieval and a ranking model, running in sequence. In what context is the single multitask model approach useful then?