Giter VIP home page Giter VIP logo

text_diff's Introduction

DiffuDetox

Implimentation of DiffuDetox, based on DiffuSeq.

Datasets

DiffuDetox datasets are small enough to be directly included in the datasets folder.

Requirements:

The code is based on PyTorch and HuggingFace transformers. After creating a virtual environment, run:

pip install -r requirements.txt 

Training

The training script is launched in the scripts folder.

cd scripts
bash train.sh

Arguments explanation:

  • --dataset_unsup: the name of unsupervised dataset to suppliment Paradetox
  • --folder_name: the name of the results directory.
  • --data_dir: the path to the saved datasets folder, containing .jsonl files
  • --resume_checkpoint: if not none, restore this checkpoint and continue training
  • --vocab: the tokenizer is initialized using bert or load your own preprocessed vocab dictionary (e.g. using BPE)

DiffuDetox Decoding

You need to modify the path to model_dir, which is obtained in the training stage.

cd scripts
bash run_decode.sh

Evaluation & MBR

You need to specify the folder of decoded texts. This folder should contain the decoded files from the same model but sampling with different random seeds.

cd scripts
python eval_seq2seq.py --folder ../{your-path-to-outputs} --mbr

text_diff's People

Contributors

gfloto avatar

Stargazers

parsa farinnia avatar  avatar Mohammad Mahdi Abdollahpour avatar

Watchers

 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.