Deep Writing
Published in

Deep Writing

How to write with artificial intelligence

An easy guide to “Deep Writing” without writing any code

“Dumbledore will get out from behind a cream cake” — Harry Potter: Written by Artificial Intelligence

Step 0: Understanding the simple intuition

  1. You show a computer some sample text (for example, the Harry Potter books).
  2. The computer identifies all the unique words in the sample text.
  3. The computer groups words based on how often they appear together in the sample text (using a particular mathematical model). This is the “learning” portion of “Deep Learning”.
  4. You pick a starting word (for example, “The”).
  5. Using what it learned in Step 3, you ask the computer to guess the word most likely to come after the starting word (i.e. “The”). This is recorded as the second word.
  6. Then, based on the first two words, you ask the computer to guess the third word. And so on.
  7. Eventually, you tell the computer to stop guessing after many words, and you have successfully created your Deep Writing.

Step 1: Download the code

Step 2: Customize the sample text

Step 3: Install TensorFlow

sudo easy_install pip
sudo easy_install --upgrade six
export TF_BINARY_URL=https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-0.12.1-py2-none-any.whl
sudo pip install --upgrade $TF_BINARY_URL

Step 4: Train the model

source ~/tensorflow/bin/activate
cd ~/desktop/word-rnn-tensorflow-master
python train.py

Step 5: Create the “Deep Writing”

parser.add_argument(‘-n’, type=int, default=200, help=’number of words to sample’)
parser.add_argument(‘-n’, type=int, default=1500, help=’number of words to sample’)
python sample.py

Step 6: Submit your Deep Writing for publication

Max Deutsch is the co-founder of Monthly — an online education platform that partners with some of the world’s biggest YouTubers to create one-month, highly-immersive online classes.

If you want to follow along with Max’s year-long accelerated learning project, make sure to follow this Medium account.

--

--

Stories, songs, and speeches written by deep learning (artificial intelligence)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store