recommenders
recommenders copied to clipboard
[Question] Would be possible to use TFRS with multiple independent indexes?
Hi! Let me clarify this a little bit... In a scenario with more than 500 different stores, would it be possible to index the model to act as if there are several different models (one model for each store)? Eg: in each API query, we could pass the store_id... and the recommendations returned would only be linked to the items of that store.
If there is no alternative, the solution is to train 500 models anyway. :/
Thanks!
Hi @almirb, Maybe you could build a multi-output model? In our case where we had multiple sets of candidates, I ended up creating a tensorflow functional model with multiple indexes as output.
inputs = {
### your definition of feature
'feature1': tf.keras.Input(...)
...
}
outputs = {
name: store_bruteforce_index(inputs) for store_bruteforce_index in your_store_bruteforce_layers
}
model = tf.keras.Model(inputs=inputs, outputs=outputs)
So when you run inference, you get recommendations for all the stores (outputs a dictionary) and you can select the one you want. You'll have a single master model instead of 500 models. Of course if you don't care about the other store's recommendations / eliminate unnecessary computations, I don't have a better solution for you.
You could build a single model for all stores, but index 500 separate BruteForce
indices, one for each model. You would then query the appropriate index for a given store at serving time.
Does that make sense?
You could build a single model for all stores, but index 500 separate
BruteForce
indices, one for each model. You would then query the appropriate index for a given store at serving time.Does that make sense?
That sounds great! For now, I decided go to with LightFM... I probably would try TFRS again in the future. Thanks!
Im also interested in this multi-tenant / multi-store approach.
Regarding BruteForce indexes for 500 stores, what if we had items that overlapped between indexes / stores?
Are there any examples or steps on how to implement multi store indexes?
[Edit] - Could you approach this problem by using the query_with_exclusions
method, as described in #307