GithubHelp home page GithubHelp logo

map511's Introduction

Generation of multilingual text

This is PyTorch implementation of a VAE for multilingual text generation.

A detailed report of our work can be found in the file "rapport_EA_NLP.pdf".

Requirements

  • Python >= 3.6
  • PyTorch >= 1.0
  • pip install editdistance

Data

3 datasets are presented in the folder "datasets".

The "tatoeba_data" dataset can be used to train a VAE using the method described here : https://github.com/bohanli/vae-pretraining-encoder

The other two are processed to be used with our method.

One can use another dataset and preprocess it with the file test.py

Usage

Train a AE first

python text_beta2.py \
    --dataset tatoeba2spm \
    --beta 0 \
    --lr 0.5

Train VAE with our method

ae_exp_dir=exp_tatoeba2spm_beta/tatoeba2spm_lr0.5_beta0.0_drop0.5_
python text_anneal_fb2.py \
    --dataset tatoeba2spm \
    --load_path ${ae_exp_dir}/model.pt \
    --reset_dec \
    --kl_start 0 \
    --warm_up 10 \
    --target_kl 8 \
    --fb 2 \
    --lr 0.5

Create homotopies

vae_exp_dir=exp_tatoeba2spm_load/tatoeba2spm_warm10_kls0.0_fbdim_tr8.0
python homotopie.py \
    --dataset tatoeba2spm \
    --load_path ${vae_exp_dir}/model.pt \
    --fb 2 \
    --lr 0.5

Logs, models and samples would be saved into folder exp.

Acknowledgements

A large portion of this repo is borrowed from https://github.com/bohanli/vae-pretraining-encoder

map511's People

Watchers

 avatar

Forkers

alexandre-giuly

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.