Coder Social home page Coder Social logo

iclrec's Introduction

Intent Contrastive Learning for Sequential Recommendation (ICLRec)

Source code for paper: Intent Contrastive Learning for Sequential Recommendation

Introduction

Motivation:

Users' interactions with items are driven by various underlying intents. These intents are often unobservable while potentially beneficial to learn a better users' preferences toward massive item set.

Model Architecture:

Reference

Please cite our paper if you use this code.

@article{chen2022intent,
  title={Intent Contrastive Learning for Sequential Recommendation},
  author={Chen, Yongjun and Liu, Zhiwei and Li, Jia and McAuley, Julian and Xiong, Caiming},
  journal={arXiv preprint arXiv:2202.02519},
  year={2022}
}

Implementation

Requirements

Python >= 3.7
Pytorch >= 1.2.0
tqdm == 4.26.0

Datasets

Four prepared datasets are included in data folder.

Train Model

To train ICLRec on Sports_and_Outdoors dataset, change to the src folder and run following command:

python main.py --data_name Sports_and_Outdoors

The script will automatically train ICLRec and save the best model found in validation set, and then evaluate on test set.

Evaluate Model

You can directly evaluate a trained model on test set by running:

python main.py --data_name Sports_and_Outdoors --model_idx 0 --do_eval

We provide a model that trained on Sports_and_Games dataset in ./src/output folder. Please feel free to test is out.

Acknowledgment

  • Transformer and training pipeline are implemented based on S3-Rec. Thanks them for providing efficient implementation.

iclrec's People

Contributors

ychen1993 avatar

Stargazers

euphoria 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.