Awesome
PETER (PErsonalized Transformer for Explainable Recommendation)
Paper
- Lei Li, Yongfeng Zhang, Li Chen. Personalized Transformer for Explainable Recommendation. ACL'21.
A large pretrained GPT-2 version is available at PEPLER!
A small ecosystem for Recommender Systems-based Natural Language Generation is available at NLG4RS!
Datasets to download
- TripAdvisor Hong Kong
- Amazon Movies & TV
- Yelp 2019
For those who are interested in how to obtain (feature, opinion, template, sentiment) quadruples, please refer to Sentires-Guide.
Usage
Below are examples of how to run PETER (with and without the key feature).
python -u main.py \
--data_path ../TripAdvisor/reviews.pickle \
--index_dir ../TripAdvisor/1/ \
--cuda \
--checkpoint ./tripadvisorf/ \
--peter_mask \
--use_feature >> tripadvisorf.log
python -u main.py \
--data_path ../TripAdvisor/reviews.pickle \
--index_dir ../TripAdvisor/1/ \
--cuda \
--checkpoint ./tripadvisor/ \
--peter_mask >> tripadvisor.log
Code dependencies
- Python 3.6
- PyTorch 1.6
Code references
- Word Language Model
- Sequence-to-Sequence Modeling with nn.Transformer and TorchText
- NLP From Scratch: Translation with a Sequence to Sequence Network and Attention
- Deploying a Seq2Seq Model with TorchScript
Citation
@inproceedings{ACL21-PETER,
title={Personalized Transformer for Explainable Recommendation},
author={Li, Lei and Zhang, Yongfeng and Chen, Li},
booktitle={ACL},
year={2021}
}