RUCAIBox / RecBole

A unified, comprehensive and efficient recommendation library
https://recbole.io/
MIT License
3.4k stars 612 forks source link

[💡SUG] .inter feature embeddings #1861

Open pintonos opened 1 year ago

pintonos commented 1 year ago

Hello, I tried to reimplement CARCA (https://github.com/ahmedrashed-ml/CARCA), a Context and Attribute-Aware Sequential Recommender.

However, it seems RecBole does not support any embeddings for context-aware, sequential RS. The provided implementations for Context-aware RS only consider item or user features, but do not include features regarding each interaction (e.g. features in the .inter file).

Am I missing something? Are there any plans for implementing this? Any tips on how to do that myself?

Thanks!

Ethan-TZ commented 1 year ago

@pintonos Thanks for your attention to RecBole! Yes, our original implementation only considers the embeddings for users and items. But we can load the corresponding discrete form of contextual features normally (e.g. timestamp). Therefore, you can just employ an additional embedding layer as the model's attributes: self.context_embedding = nn.Embedding(self.n_feats, self.embedding_size) And perform the embedding look-up operation in the forward function: self.context_embedding(Interaction.CONTEXT_ID_FIELD)