Skip to content
This is the code for "Learning Sentiment Memories for Sentiment Modification without Parallel Data".
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea
__pycache__
dataset
Batch_iter.py
README.md
auto_encoder_mem.py upload SMAE Aug 20, 2018
batcher_classification.py
cnn_classifier.py upload SMAE Aug 20, 2018
data.py upload SMAE Aug 20, 2018
generate_new_training_data.py
generated_sample.py
main.py
my_classifier.py upload SMAE Aug 20, 2018
result_evaluate.py
util.py

README.md

SMAE

This is the code for "Learning Sentiment Memories for Sentiment Modification without Parallel Data".

Environment and Dependency

  • Ubuntu 16.04
  • Python 3.5
  • Tensorflow 1.4
  • nltk 3.2.5

Data

yelp

Usage

CUDA_VISIBLE_DEVICES=0 python3 main.py
To run this code, you first need to process the dataset into the specific format. We provide the sample file in dataset to facilitate runing code. But these files are just a small piece of the complete training set and are not enough to get a satisfied performance. You can process the data provided by yelp to get enough training set. During running, several files will be created.

The full dataset we used in our experiments can be found here: full_data

Feel free to contact me if you have any questions:)

Cite

If you use this code for your research, please cite the following paper:

  @inproceedings{zhang2018learning,  
  author = {Zhang, Yi and Xu, Jingjing and Yang, Pengcheng and Sun, Xu},  
  title = {Learning Sentiment Memories for Sentiment Modification without Parallel Data},  
  booktitle = {EMNLP 2018},  
  year = {2018}  
  }  
You can’t perform that action at this time.