Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Shiying95 56272e20d8 | 2 years ago | |
---|---|---|
data/taobao | 2 years ago | |
README.md | 2 years ago | |
configs.py | 2 years ago | |
model.py | 2 years ago | |
module.py | 2 years ago | |
requirements.txt | 2 years ago | |
train.py | 2 years ago | |
utils.py | 2 years ago |
This is the TensorFlow 2 implementation for the paper:
An Intention-aware Markov Chain based Method for Top-K Recommendation (link)
Run
pip install -r requirements.txt
It is a sample with 500,000 interactions from the Taobao dataset (link). The dataset will be automatically generated for the first time you train the model. For preprocessing details, see utils.py
.
To train our model in the Taobao-500K dataset, please run
python train.py --dataset taobao --mode train_500K --model IMRec
Experimental settings are defined in config.py
. For easy use, some of the settings can be overwritten by passing command-line arguments. For example, to set the embedding dimension as 50, run
python train.py --dataset taobao --mode train_500K --model IMRec --embed_dim 50
The model is evaluated on the test datasets automatically at the end of each epoch. Check the experimental results as well as the saved models in the log
folder.
Some key arguments:
embed_dim
: the embedding dimension
maxlen
: the max length of interaction sequence
att_len
: the order of the Markov chain
alpha
: the long-term and short-term preference weighting factor
We provide the best model of taobao-500K dataset for you to test, please download it from link (password: gusw). To load the model, run the following python scripts:
import tensorflow as tf
from module import RecordLoss, RecordMetrics, HR, MRR
model_path = 'best_model/' # the folder of the saved model
model = tf.keras.models.load_model(
model_path,
custom_objects={
'RecordLoss': RecordLoss,
'RecordMetrics': RecordMetrics,
'HR': HR,
'MRR': MRR,
})
Many thanks to the work of Ziyao Geng (link), for providing TensorFlow2 implementation of several recommendation algorithms.
An Intention aware Markov Chain based Method for Top-K Recommendation-Tensorflow2 Implementation
CSV other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》