This repository is to implement the behavior sequence transformer model proposed by Alibaba, which can be found in this paper: https://arxiv.org/abs/1905.06874 and is to leverages this sequential behaviour of the users in watching and rating movies, as well as user profile and movie features, to predict the rating of the user to a target movie.
We use the 1M version of the Movielens dataset. The dataset includes around 1 million ratings from 6000 users on 4000 movies, along with some user features, movie genres. In addition, the timestamp of each user-movie rating is provided, which allows creating sequences of movie ratings for each user, as expected by the BST model.
We train all user ratings and leave the latest rating as a label. Compared to other impletementations, we achieve the best result below:
Implementation | MAE | Sequence Length |
---|---|---|
🚀My Pytorch Implementation | 0.678 | 4 |
Offical Keras Implemenation | 0.761 | 4 |
🚀My Pytorch Implementation | 0.649 | 10 |
Other Pytorch Implementation | 0.74 | 10 |
Sequence Length | MAE | Batch Size |
---|---|---|
4 | 0.6776 | 128 |
10 | 0.6487 | 64 |
15 | 0.6751 | 32 |
20 | 0.6716 | 32 |
You can run it in colab here or notebook A_Behavior_Sequence_Transformer_For_Movie_Recommendation.ipynb
locally to repreoduce the result or A_Behavior_Sequence_Transformer_For_Movie_Recommendation(W&B).ipynb
to track the metrics on Weights & Baises.