Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BERT4Rec to KerasHub #2080

Open
divyashreepathihalli opened this issue Feb 4, 2025 · 1 comment
Open

Add BERT4Rec to KerasHub #2080

divyashreepathihalli opened this issue Feb 4, 2025 · 1 comment
Assignees

Comments

@divyashreepathihalli
Copy link
Collaborator

No description provided.

@harshaljanjani
Copy link

harshaljanjani commented Feb 7, 2025

I wish to take up this issue.

Key Differences Between BERTBackbone and BERT4RecBackbone:

Embeddings:
BERTBackbone: Uses token, positional, and segment embeddings.
BERT4RecBackbone: Uses only token and positional embeddings (no segment embeddings).
Source: BERT4Rec: Sequential Recommendation with Bidirectional Encoder Representations from Transformer (Section 3.4: Embedding Layer).

Image

Pooling:
BERTBackbone: Outputs a pooled representation (via [CLS]) for classification.
BERT4RecBackbone: Outputs the entire sequence representation for masked item prediction (pooling was definitely under consideration but doesn't seem to be enforced in the final rendition).
Source: https://github.com/FeiSun/BERT4Rec/modeling.py#L220

If there are any others, please let me know, but to my knowledge these changes are sufficient to make it viable for BERT to support sequential recommendation, as described in the paper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants