Git Product home page Git Product logo

astrapop's Introduction

ASTRAPOP

The official repository for the paper "Authorship Style Transfer with Policy Optimization".

Installation

Commends for enviroment setup with conda.

conda create --name astrapop python=3.8
conda activate astrapop
pip install -U pip
pip install -r requirements.txt

Data

Please download the original Reddit Million User Dataset (MUD) from here and the original ETS Corpus of Non-Native Written English from here. We will publish the data preprocessing code soon.

Reproduce Results

Reddit

To reproduce the results on the Reddit dataset, please run the scirpts in scripts/reddit following the procedure below.

  1. Train the paraphrase model and the reference SFT model by running 00_train_paraphraser.sh and 00_train_sft.sh.
  2. Generate the data for DPO and CPO training by running 01_generate_dpo_cpo_data.sh.
  3. Train the PO models using PPO/DPO/CPO by running 02_train_ppo.sh/02_train_dpo.sh/02_train_cpo.sh.
  4. Transfer the texts in the test set by running 03_generate.sh.

ETS

To reproduce the results on the ETS dataset, please run the scirpts in scripts/ets.

  1. Train the style reward model, the paraphrase model, and the reference SFT model by running 00_train_cls.sh, 00_train_paraphraser.sh, and 00_train_sft.sh.
  2. Generate the data for DPO and CPO training by running 01_generate_dpo_cpo_data.sh.
  3. Train the PO models using PPO/DPO/CPO by running 02_train_ppo.sh/02_train_dpo.sh/02_train_cpo.sh.
  4. Transfer the texts in the test set by running 03_generate.sh.

astrapop's People

Contributors

shuailiu6626 avatar

Stargazers

Anirudh Venkatraman avatar Mozhdeh Gheini avatar  avatar Shantanu Agarwal avatar Jeff Carpenter avatar

Watchers

Jonathan May avatar  avatar

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.