Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
tabokie a58430ea70 | 1 year ago | |
---|---|---|
data/steam | 1 year ago | |
src | 1 year ago | |
README.md | 1 year ago | |
README_CN.md | 1 year ago | |
__init__.py | 1 year ago | |
datapreprocess.py | 1 year ago | |
eval.py | 1 year ago | |
export.py | 1 year ago | |
infer.py | 1 year ago | |
main.py | 1 year ago | |
preprocess.py | 1 year ago | |
tbnet.mindir | 1 year ago | |
tbnet_config.py | 1 year ago | |
train.py | 1 year ago |
TB-Net is a knowledge graph based explainable recommender system.
Paper: Shendi Wang, Haoyang Li, Xiao-Hui Li, Caleb Chen Cao, Lei Chen. Tower Bridge Net (TB-Net): Bidirectional Knowledge Graph Aware Embedding Propagation for Explainable Recommender Systems
TB-Net constructs subgraphs in knowledge graph based on the interaction between users and items as well as the feature of items, and then calculates paths in the graphs using bidirectional conduction algorithm. Finally we can obtain explainable recommendation results.
We provide an example dataset that created from
Interaction of users and games and games' feature data of the game platform Steam that are publicly available on Kaggle.
Please refer to Downloading Data Package for the way of obtaining the example dataset and the file format descriptions.
Please refer to Using TB-Net for the quick start guide.
.
└─tbnet
├─README.md
├─README_CN.md
├─data
│ └─steam
│ ├─LICENSE
│ ├─config.json # hyper-parameters and training configuration
│ ├─src_infer.csv # source datafile for inference
│ ├─src_test.csv # source datafile for evaluation
│ └─src_train.csv # source datafile for training
├─src
│ ├─dataset.py # dataset loader
│ ├─embedding.py # embedding module
│ ├─metrics.py # model metrics
│ ├─path_gen.py # data preprocessor
│ ├─recommend.py # result aggregator
│ └─tbnet.py # TB-Net architecture
├─export.py # export MINDIR/AIR script
├─preprocess.py # data pre-processing script
├─eval.py # evaluation script
├─infer.py # inference and explaining script
└─train.py # training script
--dataset <DATASET> 'steam' dataset is supported currently (default 'steam')
--same_relation only generate paths that relation1 is same as relation2
--dataset <DATASET> 'steam' dataset is supported currently (default 'steam')
--train_csv <TRAIN_CSV> the train csv datafile inside the dataset folder (default 'train.csv')
--test_csv <TEST_CSV> the test csv datafile inside the dataset folder (default 'test.csv')
--epochs <EPOCHS> number of training epochs (default 20)
--device_id <DEVICE_ID> device id (default 0)
--run_mode <MODE> run model in 'GRAPH' mode or 'PYNATIVE' mode (default 'GRAPH')
--checkpoint_id <CKPT_ID> the id of the checkpoint(.ckpt) to be used
--dataset <DATASET> 'steam' dataset is supported currently (default 'steam')
--csv <CSV> the test csv datafile inside the dataset folder (default 'test.csv')
--device_id <DEVICE_ID> device id (default 0)
--run_mode <MODE> run model in 'GRAPH' mode or 'PYNATIVE' mode (default 'GRAPH')
--checkpoint_id <CKPT_ID> the id of the checkpoint(.ckpt) to be used
--dataset <DATASET> 'steam' dataset is supported currently (default 'steam')
--csv <CSV> the infer csv datafile inside the dataset folder (default 'infer.csv')
--items <ITEMS> no. of items to be recommended (default 3)
--explanations <EXP> no. of recommendation reasons to be shown (default 3)
--device_id <DEVICE_ID> device id (default 0)
--run_mode <MODE> run model in 'GRAPH' mode or 'PYNATIVE' mode (default 'GRAPH')
--config_path <CFG_PATH> config (config.json) file path
--checkpoint_path <CKPT_PATH> checkpoint (.ckpt) file path
--file_name <FILENAME> export filename
--file_format <FORMAT> export format 'MINDIR' or 'AIR' (default 'MINDIR')
--device_id <DEVICE_ID> device id (default 0)
--run_mode <MODE> run model in 'GRAPH' mode or 'PYNATIVE' mode (default 'GRAPH')
Parameters | GPU |
---|---|
Model Version | TB-Net |
Resource | Tesla V100-SXM2-32GB |
Uploaded Date | 2021-08-01 |
MindSpore Version | 1.3.0 |
Dataset | steam |
Training Parameter | epoch=20, batch_size=1024, lr=0.001 |
Optimizer | Adam |
Loss Function | Sigmoid Cross Entropy |
Outputs | AUC=0.8596, Accuracy=0.7761 |
Loss | 0.57 |
Speed | 1pc: 90ms/step |
Total Time | 1pc: 297s |
Checkpoint for Fine Tuning | 104.66M (.ckpt file) |
Parameters | GPU |
---|---|
Model Version | TB-Net |
Resource | Tesla V100-SXM2-32GB |
Uploaded Date | 2021-08-01 |
MindSpore Version | 1.3.0 |
Dataset | steam |
Batch Size | 1024 |
Outputs | AUC=0.8252, Accuracy=0.7503 |
Total Time | 1pc: 5.7s |
Parameters | GPU |
---|---|
Model Version | TB-Net |
Resource | Tesla V100-SXM2-32GB |
Uploaded Date | 2021-08-01 |
MindSpore Version | 1.3.0 |
Dataset | steam |
Outputs | Recommendation Result and Explanation |
Total Time | 1pc: 3.66s |
tbnet.py
and embedding.py
.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》