How to send contextual features to predict API only once and not for all instances

Is it possible to send context features in predict API only once and not copy them to every instance? I use tensorflow recommenders library - ranking model. I want to rank batch of 100 entities. Each entity has some entity features and all entities have the same set of common/context features. I don’t want to send context features through network in each ‘instance’ record but only one and join this features on the server side - tensorflow serving. Is this possible / have you some examples?

1 Like

What does “entity” mean in this context? Are the context features associated with the users, the items, or both?

Entity = item. Contextual features are connected with user. So they are the same for all items.

I’m still confused by this statement in your original post:

Each entity has some entity features and all entities have the same set of common/context features.

In any case, I haven’t done or seen examples of what you’re wanting to do, but I’m also interested if someone can help, because it does seem reasonable to append some features on the server side just before inference.

Sorry for my english. :frowning:
Each instance for ranking is composed from item and context features and context features are the same in each instance. So is ineffective to send them for each instance through HTTP request to tf serving service. We want to send item features for each instance and in extra attribute context features a then join this data before inference on tf serving side.

1 Like