Giter VIP home page Giter VIP logo

saer's Introduction

Sentiment Aligned Explainable Recommendation

This repo contains the PyTorch implementation of the model Sentiment Aligned Explainable Recommendation (SAER) proposed in our WSDM 2021 paper "Explanation as a Defense of Recommendation". Please refer to the paper for the details of the algorithm.

Dependency

All the depencies are included in the file environment.yml. If you use conda, installation can be done with the following command:

conda env create --name saer_env --file=environments.yml

Usages

Preprocess

Please refer to the data preprocessing README and follow the steps to prepare the data.

Config

Check the configurations under the folder /config. Create a new or update existing model configuration.

Train

Train the model specified by the given configuration file and optionally resume from an existing checkpoint

python train.py -m=saer --checkpoint=10

Decode

Specify a text decoding strategy to generate recommendation explanations for the testing data with a trained model of a checkpoint, and save the output to a file for later evaluation

python decode.py -m=saer --checkpoint=20 --search=greedy --output=sear_decode.txt

Evaluate

Evaluate the model on some metrics on-the-fly

python eval.py -m=saer --checkpoint=20 rmse mae ...

Directly evaluate the previously decoded output

python eval_decode.py -f=saer_decode.txt rmse bleu ...

Reference

Please cite our paper if you use this code in your research:

@inproceedings{yang2021explanation,
  title={Explanation as a Defense of Recommendation},
  author={Yang, Aobo and Wang, Nan and Deng, Hongbo and Wang, Hongning},
  booktitle={In Proceedings of the Fourteenth ACM International Conference on Web Search and Data Mining (WSDM โ€™21)},
  year={2021}
}

saer's People

Contributors

aobo-y avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

saer's Issues

Can you share the SARE model configuration on yelp dataset?

Hi, your work is really inspiring and interesting. And I want to reproduce it on Yelp dataset. However, the detailed param setting of SARE model is not provided in your repo. (e.g. match_tensor_type, hidden_size ) Would you mind sharing it with us? Otherwise, it's a bit harder to achieve the same performance is your paper. Thanks!

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.