Giter Club home page Giter Club logo

diffuseq_styleptb's Introduction

DiffuSeq_StylePTB

This repository is contains code for reproducing the results in Fine-grained Text Style Transfer with Diffusion-Based Language Models.

The majority of code from this repository is taken or adapted from DiffuSeq repository. Please see their repository for environment configuration and package installation instructions.

We included the processed data of StylePTB under the dataset folder. Each subfolder is either a single style transfer (such as "VEM" for verb emphasis), the combined dataset for multitask training ("multitask"), or compositional style transfers (such as "Tense + PP Removal").

To train a model on a particular dataset, first go into the scripts directory with cd scripts. Then, in train.sh, edit the field "data_dir" to your desired dataset (for example, to train on the transfer "verb emphiasis", set data_dir to ".../datasets/VEM"). Also edit "dataset" and "notes" to the desired dataset name. Then you can start training by bash train.sh.

When training is done, trained model checkpoints will show up under diffusiom_models/. To run inference, edit run_decode.sh to include your desired dataset as well as the checkpoint you want to use. Then, run bash run_decode.sh. The result will be under generation_outputs/ folder.

To evaluate the results, use tohypref.py to convert an output json under generation_outputs/ into hypothesis+reference. Then use nlgeval to evaluate metrics between ../hyp.txt and ../ref.txt using

nlg-eval --hypothesis ../hyp.txt --references ../ref.txt

diffuseq_styleptb's People

Contributors

lvyiwei1 avatar

Stargazers

 avatar liucc avatar  avatar Boh avatar Abhishar Sinha avatar 兿然 avatar Jeff Carpenter avatar bansky-cl avatar  avatar Tiange Luo avatar

Watchers

 avatar

diffuseq_styleptb's Issues

how long for training

good job and plenty experiments!
It may need 2days in 8*A100 80G that i see in diffuseq, so i would like to know how long you train in so many experiments.

about the data preprocess

Thank you for your excellent work. I'm interested in your code and prepare to use my dataset to train. But I find that in your dataset, there are many tokens such as "unk" and "num" . And I have no idea how should I preprocess my data.
Could you please give me some hints and share the preprocess script ? Thank you so much.

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.