Text Augmentation method for Text GAN methods. (The final project of AI special lecture in SNU)

Note that codes are adapted from https://github.com/williamSYSU/TextGAN-PyTorch.

Requirements

KenLM Installation

Run experiment

  • To run SeqGAN

    cd run
    python run_seqgan.py --train_ratio {train ratio} --trial {trial} --aug {augmentation type}
  • To run RelGAN

    cd run
    python run_relgan.py --train_ratio {train ratio} --trial {trial} --aug {augmentation type}
  • train ratio - float
    the proportion of training examples used to train GAN model
    default - 1.0 e.g.) 0.05, 1.0, ...
  • trial - int,
    the index of trial (used to the name of exp directory)
    e.g.) 1, 2, 3, ...
  • augmentation type - str,
    the augmentation transform apply to update GAN model. (The combination of 'mask', 'rand', 'swap'. Use 'noaug' to train without augmentation)
    e.g.) 'noaug', 'swap', 'mask', 'swap_mask', 'rand_mask_swap', ...
    Note that 'rand_mask_swap' means that the augmentations 'rand', 'mask', and 'swap' apply to a text sequentially.