GithubHelp home page GithubHelp logo

zilize / mhim Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 1.69 MB

Official PyTorch implementation for "Multi-grained Hypergraph Interest Modeling for Conversational Recommendation".

License: MIT License

Python 100.00%
conversational-recommendation conversational-recommender-system deep-learning dialogue-systems hypergraph-learning hypergraph-neural-networks recomender-system

mhim's Introduction

MHIM

This is the official PyTorch implementation for the paper: [arXiv]

Chenzhan Shang, Yupeng Hou, Wayne Xin Zhao, Yaliang Li, Jing Zhang. Multi-grained Hypergraph Interest Modeling for Conversational Recommendation.

Overview

We propose MHIM, which stands for Multi-grained Hypergraph Interest Modeling for conversational recommendation. MHIM employ hypergraph to represent complicated semantic relations underlying intricate historical data from different perspectives. First, aiming to capture intra- and inter-session correlations among historical dialogues, we consturct a session-based hypergraph, which captures coarse-grained, session-level relations. Second, to alleviate the issue of data scarcity, we incorporate an external knowledge graph and construct a knowledge-based hypergraph considering fine-grained, entity-level semantics. We further conduct multi-grained hypergraph convolution on the two kinds of hypergraphs, and utilize the enhanced representations to develop interest-aware CRS.

Requirements

python==3.8.12
pytorch==1.10.1
dgl==0.4.3
cudatoolkit==10.2.89
torch-geometric==2.0.3
transformers==4.15.0

Datasets

Google Drive | 百度网盘

Please download the processed datasets from the above links, unzip data_contrast.zip and move it to Contrast/, unzip data_mhim.zip and move it to MHIM/.

Quick Start

Contrastive Pre-training

Pre-train the R-GCN encoder:

cd Contrast
python run.py -d redial -g 0
python run.py -d tgredial -g 0

Then, move the save/{dataset}/{#epoch}-epoch.pth file to MHIM/pretrain/{dataset}/.

The pre-trained encoder on our machine has been saved as MHIM/pretrain/{dataset}/10-epoch.pth.

Running

cd ../MHIM
python run_crslab.py --config config/crs/mhim/hredial.yaml -g 0 -s 1 -p -e 10
python run_crslab.py --config config/crs/mhim/htgredial.yaml -g 0 -s 1 -p -e 10

The experiment results on our machine has been saved in MHIM/log/

Acknowledgement

The implementation is based on the open-source CRS toolkit CRSLab.

Please cite the following papers as the references if you use our codes or the processed datasets.

@inproceedings{shang2023mhim,
  author = {Chenzhan Shang and Yupeng Hou and Wayne Xin Zhao and Yaliang Li and Jing Zhang},
  title = {Multi-grained Hypergraph Interest Modeling for Conversational Recommendation},
  booktitle = {{arXiv preprint arXiv:2305.04798}},
  year = {2023}
}

mhim's People

Contributors

zilize avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

rucaibox

mhim's Issues

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.