Skip to content

WindyLee0822/CTG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CTG

Source code of “Reinforcement Learning with Token-level Feedback for Controllable Text Generation (NAACL 2024)”

If you encounter problems, feel free to contact me (wendili@hust.edu.cn).

Currently, codes of sentiment transformation experiments have been published. Next, I will try to sort out codes of double-aspect CTG as soon as possible.

Single-attribute Control

  • Train a attribute classifier.

    In sentiment transformation, we retrain a attribute classifier with SST-5. To run the recommendation part.

python Sentiment/main_disc.py

  • Run Token-level RL

    To train a policy model, run

    python token_main.py --source_mode neutral --target_mode positive --reward_model {best checkpoint of your classifier}

Citation

If you find our research helpful, please kindly cite our paper!

@article{li2024reinforcement,
  title={Reinforcement Learning with Token-level Feedback for Controllable Text Generation},
  author={Li, Wendi and Wei, Wei and Xu, Kaihe and Xie, Wenfeng and Chen, Dangyang and Cheng, Yu},
  journal={arXiv preprint arXiv:2403.11558},
  year={2024}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published