Giter Club home page Giter Club logo

duvrec's Introduction

DUVRec

This repository is the implementation of our paper's model 'Contrastive Learning of Dual-view User Representation for Sequential Recommendation'.

Files in the folder

  • data/
    • steam/
      • steam_reviews.json.gz: raw rating file and metadata of Steam dataset;
      • preprocess.py: the data preprocess script;
      • gen_test_neg.py
      • attr_file.py
    • movielens/
      • ratings.dat: raw rating file of Movielens dataset(UserID::MovieID::Rating::Timestamp);
      • movies.dat: genre file of Movielens dataset(MovieID::Title::Genres);
      • preprocess.py: the data preprocess script;
      • gen_test_neg.py
      • attr_file.py
    • toys/
      • Toys_and_Games.json.gz: raw review file of Toys dataset;
      • meta_Toys_and_Games.json.gz: raw metadata of Toys dataset;
      • preprocess.py: the data preprocess script;
      • gen_test_neg.py
      • attr_file.py
  • model/
    • main.py
    • config.py
    • ...
  • weights/

Required packages

The code has been tested running under Python 3.6.7, with the following packages installed (along with their dependencies):

  • torch == 1.7.1+cu101
  • numpy == 1.18.5

Running Procedure

Prepare data

Steam, Movielens, Amazon Toys&Games dataset can be respectively downloaded from 'http://cseweb.ucsd.edu/jmcauley/datasets.html#steam_data/' 'https://grouplens.org/datasets/movielens/' 'http://deepyeti.ucsd.edu/jianmo/amazon/index.html'

Please first put data files of Steam, Movielens and Toys into data/steam, data/movielens ans data/toys, then run preprocess.py, gen_test_neg.py, attr_file.py successively to process data preparation. 最终data/steam,data/movielensdata/toys中的数据文件应包含attr_test.txt, attr_train.txt, test_candidate_1_50.npy, test.txt, train.txt

for convinence, we also upload the preprocessed data

Run DUVRec

$ cd src
$ python model/main.py

The settings of datasets and parameters can be altered in model/config.py. The model checkpoints and training log will be saved in weights/.

duvrec's People

Contributors

s-yudi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.