Skip to content

Neural style transfer of text building off of neural storyteller

Notifications You must be signed in to change notification settings

cuuupid/neural-rewriter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Neural Rewriter

Based off of neural-storyteller, for text style shifting.

1

$ git clone git://github.com/pshah123/neural-rewriter.git

neural-rewriter

$ mkdir models && cd models
$ curl -O http://www.cs.toronto.edu/~rkiros/models/dictionary.txt
$ curl -O http://www.cs.toronto.edu/~rkiros/models/utable.npy
$ curl -O http://www.cs.toronto.edu/~rkiros/models/btable.npy
$ curl -O http://www.cs.toronto.edu/~rkiros/models/uni_skip.npz
$ curl -O http://www.cs.toronto.edu/~rkiros/models/uni_skip.npz.pkl
$ curl -O http://www.cs.toronto.edu/~rkiros/models/bi_skip.npz
$ curl -O http://www.cs.toronto.edu/~rkiros/models/bi_skip.npz.pkl
$ cd ..
$ mkdir storyteller && cd storyteller
$ wget -ci https://s3.amazonaws.com/lasagne/recipes/pretrained/imagenet/vgg19.pkl
$ wget http://www.cs.toronto.edu/\~rkiros/neural_storyteller.zip
$ unzip neural_storyteller.zip && rm neural_storyteller.zip

Add input text to rewriter/in.txt and

$ pip install -r requirements.txt --user
# emerge dev-python/nltk
$ python
  >>> import nltk
  >>> nltk.download('punkt')
$ cd rewriter
$ python generate.py

If you get error like sequence bla bla...

$  grep '[^[:blank:]]' < in.txt > file.out && rm in.txt && mv file.out in.txt

Credits

ryankiros for the original repo.

RomaniukVadim for great documentation!

Releases

No releases published

Packages

No packages published

Languages