Skip to content

rungjoo/Stable-Style-Transformer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stable Style Transformer with Classifier for Text Style Transfer (INLG 2020)

model The overall flow of our model

Requirements

  1. Pytorch 1.2+
  2. Python 3.5+
  3. Huggingface Transformer
  4. BERTScore


Basically, the code is supposed to run in the GPU environment.
If you do not have a GPU, it is recommended to modify the code and use it in a CPU environment. By default, the folder path is an absolute path, so please set the root according to your settings.

Datasets

  1. Yelp and Amazon Dataset
  2. Human reference-DRG
  3. Human reference-DualRL

Train

Description based on the yelp dataset

cd generation_model/yelp

Step 1: Train classifier

cd classifier
python3 train.py

Step 2: Train generator

python3 train.py

Evaluation

Step 1: Finetune GPT

cd gpt2/yelp
python3 train.py

Step 2: Evaluate models with 4 metrics

cd evaluation/yelp/my_model/SST/

Check out generalization_eval_new.ipynb
Systems are evaluated using BLEU, classification accuracy, PPL, and BERTscore.

Citation

@inproceedings{lee-2020-stable,
    title = "Stable Style Transformer: Delete and Generate Approach with Encoder-Decoder for Text Style Transfer",
    author = "Lee, Joosung",
    booktitle = "Proceedings of the 13th International Conference on Natural Language Generation",
    month = dec,
    year = "2020",
    address = "Dublin, Ireland",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2020.inlg-1.25",
    pages = "195--204"
}

About

Stable Style Transformer with Classifier for Text Style Transfer (INLG 2020)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published