NVIDIA-Merlin / NVIDIA-Merlin/Transformers4Rec

[QST] Recommend items for a user based on the sequence of her prior baskets

Open
#460 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 question status/needs-triage
Dominant language
Python
Stars
1.3k
Forks
165
Avg merge
1m
Merged PRs (30d)
2

Description

❓ Questions & Help

Details

In the current examples, Transformers4Rec takes the sequential interactions in a session to predict the next item.
Can we use this framework for the task of predicting the next items to buy based on a user's prior baskets?
Note that in this case, since the sales were made offline, the sequential information of items within a basket is unknown while the sequential information of baskets is given,

e.g. user_A purchased basket_1, basket_2, ..., basket_n where basket_i includes item_1, ..., item_k_i and the purchase order of these items are unknown.

I could just concatenate all the baskets to generate a sequence of items where the items in the same basket having the same timestamp. But the problem is when using the causal language model, we use the information of previous items to predict the next purchase, in other words the only option under the current framework is to mask at the item level while what we need for this problem is to be able to mask at the basket level.

Is there any plan to implement this masking mechanism so that we could mask at the basket level? It could be a low-effort implementation that will enable the framework to handle a popular type of questions (next-basket recommendation).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue mentions no files, tests, or entry points. Start by locating the framework's sequence masking and causal language-model data-preparation code, then determine how basket boundaries and item timestamps are represented. Done means the framework can mask and predict at basket level for next-basket recommendation, with coverage for baskets whose internal item order is unknown.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, pytorch
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.