textgenrnn

textgenrnn

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

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.

Overview

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.

Key Features

  • Train a text-generating RNN on any dataset with a few lines of Python
  • Configurable architecture: layer sizes, embeddings, attention and bidirectional RNNs
  • Temperature-controlled generation for balancing coherence and creativity
  • Included pretrained model for immediate fine-tuning on your own text
  • Interactive training in Jupyter or Colab with live sample output
  • Save, load and share trained models as compact weight files

๐Ÿ’ณ Pricing

Free and open source. There is no paid tier or hosted version; training runs on your own machine or a free notebook GPU.

Who Is It For

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.

๐Ÿš€ Visit textgenrnn Official Site

๐Ÿšฉ Report an issue