Giter VIP home page Giter VIP logo

textstyletransfer's Introduction

Tensorflow Unsupervised Text Style Transfer

環境

  • Ubuntu 16.04.3 LTS
  • Python 3.5.2
  • Tensorflow 1.6.0
  • CUDA Version 9.0.176

說明

如架構圖,模型訓練分為兩階段
第一階段使用兩風格混合語料進行訓練 第二階段使用單一風格語料進行訓練

資料預處理步驟

  1. segment_sentence.py斷句斷詞並替換英文和數字
  2. wordCount.py統計詞頻
  3. createword2id.py建立詞彙表
  4. replaceUNK.py替換OOV並進行資料清洗
  5. splitdata.py切出訓練資料與測試資料
  6. json2tsv.py製作projector視覺化需要的metadata
  7. creat_w2v.py製作pre-train word embedding檔

執行

訓練模型

python train.py --model_dir=model path

開啟tensorboard

tensorboard --logdir=model path

使用模型

python predict.py --model_dir=model path

待解決

  • 偶發性一開始訓練LOSS就是nan,需把model砍掉重開新訓練(先嘗試換model資料夾路徑,以及換GPU跑)
  • 遇到EOS不會馬上停止輸出單詞,會再接續輸出幾個EOS,目前觀察是不影響結果

textstyletransfer's People

Contributors

whiskychoy avatar

Watchers

James Cloos 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.