Open msoutojr opened 1 year ago
I think what you're trying to do is fundamentally incompatible with retrieval models.
These are "factorized" models: that is, the candidate features cannot depend on the query features (in your case, the current item in the basket). This is what enables efficient retrieval, as candidate representations do not need to be recomputed for each query.
The setup you're thinking of is normally accomplished via a two-stage pipeline, with a retrieval model first and a ranking model (that has fewer limitations) later.
@maciejkula I think my question is related to this topic and maybe you already answered it. I was struggling to include prices of items. I am working on an item-item recommender now, where the price could appear on both sides (but the problem stands for user-item recommendations as well). The problem is that even if I rank the prices from 1 to 5 (for example based on similar items in the given category), over time the prices change and therefore the number of items goes up, which affects the retrieval index as well.
I guess the correct solution is to include the price information only in the Ranking model, but not in the Retrieval model, right?
Thanks in advance!
Hi everyone.
I'm implementing a multitask model to predict the next item in the basket.
In my candidate model, I would like to insert a feature that represents the score (likelihood) between the current item in the basket and each candidate.
This means that this feature must be recalculated for each row in the dataset (because the current item will be different).
This score would be calculated by another model (a retrieval item-to-item). In this case, I must pass the current item in the basket into this item-to-item model and take that score to populate the feature I want in the candidates.
The issue is that I will need the "current item" in the basket for each row of the dataset and I don't have access to it in the model initialization.
I've tried setting the task retrieval in init() without the metrics (and candidates) during initialization and setting the metrics (and candidates) in the method call() (since in this case I have access to the batch of current items in the basket). But I got an error: metrics "read-only @object property".
AttributeError: Can't set the attribute "metrics", likely because it conflicts with an existing read-only @property of the object. Please choose a different name.
Is there another way to map this feature into the candidate model that depends on the current item in the basket (each row in the dataset)?