https://github.com/cuuupid/neural-rewriter
Neural style transfer of text building off of neural storyteller
https://github.com/cuuupid/neural-rewriter
natural-language-generation natural-language-processing rnn skip-thought-vectors
Last synced: 1 day ago
JSON representation
Neural style transfer of text building off of neural storyteller
- Host: GitHub
- URL: https://github.com/cuuupid/neural-rewriter
- Owner: cuuupid
- Created: 2017-11-25T17:02:12.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-04-24T09:04:48.000Z (about 7 years ago)
- Last Synced: 2025-03-30T21:04:59.329Z (about 1 month ago)
- Topics: natural-language-generation, natural-language-processing, rnn, skip-thought-vectors
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 26
- Watchers: 4
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Neural Rewriter
Based off of [neural-storyteller](https://github.com/ryankiros/neural-storyteller), for text style shifting.

```
$ git clone git://github.com/pshah123/neural-rewriter.git
```## neural-rewriter
```sh
$ 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
```sh
$ 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...
```sh
$ grep '[^[:blank:]]' < in.txt > file.out && rm in.txt && mv file.out in.txt
```## Credits
[ryankiros](https://github.com/ryankiros) for the original repo.
[RomaniukVadim](https://github.com/RomaniukVadim) for great documentation!