tensorflow / recommenders

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

Learning to Rank in ranking #181

Open tangzhy opened 3 years ago

tangzhy commented 3 years ago

Hi, i wonder how to implement LTR in ranking task. Specifically, I try to incorporate point-wise and pair wise losses in the task.

Do you have any tutorial on this topic? For now, I see the basic tutorial focuses on the point-wise regression only.

maciejkula commented 3 years ago

You can absolutely do this, and we have an upcoming tutorial that shows how to do this.

In a nutshell, you can import any ranking loss from TensorFlow Ranking, and use it in a RankingTask here. You will have to reshape your data so that predictions are 2D: the first dimension being the batch size, and the second the predictions for each candidate for a given query.