Skip to content

Language model example

Oleg Tarasov edited this page Feb 22, 2017 · 1 revision

The first example you might like to tinker with is a character-level language model. It is largely based on Andrej Karpathy blog post The Unreasonable Effectiveness of Recurrent Neural Networks.

Running the example

First of all you will need a dataset. This can be any text file. You can just grab the Shakespeare dataset from Andrej Karpathy: https://github.com/karpathy/char-rnn/blob/master/data/tinyshakespeare/input.txt.

Now you need to convert your dataset into training batches. Run LanguageModel.exe Prepare -i=[path to your dataset] and wait for batches to finish generating. You will find a new file with the same name as your training set and .bin extension. Copy the path to this file.

Finally run LanguageModel Learn -b=[batches path] substituting the path to the bin file. Hooray! You are learning stuff!

You can also specify -gpu flag to use GPU and -gui flag to show some nice GUI.

Understanding the example

TODO