textgenrnn is a Python library by Max Woolf (minimaxir) that makes training your own text-generating neural network as simple as a few lines of code. Built on Keras and TensorFlow, it has earned roughly 4,900 stars on GitHub and introduced a generation of developers to character-level language models through countless playful experiments, from invented headlines to synthetic tweets.
Give textgenrnn any text dataset (one document or many, line-delimited or free-form) and it trains a recurrent neural network, using LSTM layers with optional attention, that learns the style and structure of the text. You can then generate new samples at adjustable creativity (temperature), train interactively in a notebook, save and reload models, and visualize training with loss charts and generated samples. Pretrained weights trained on a large corpus are included so you can fine-tune instead of starting from zero. The library became a fixture of the early neural text generation scene, and its emphasis on making experiments take minutes rather than days is a big part of why it is still forked and taught today.
Free and open source. There is no paid tier or hosted version; training runs on your own machine or a free notebook GPU.
Developers, writers and ML students who want a hands-on, understandable way to experiment with neural text generation, prototyping bots, parody generators and creative writing tools.