Back to Projects

Poetry Generators

AI / NLP / Creative Tools

Two distinct approaches to algorithmic poetry generation. Volta uses context-free grammar for structured, rule-based composition, while Poetry a la Markov employs probabilistic text modeling trained on classic verse. Both systems generate rhyming poems following customizable schemes.

Live Demos

volta
poetry-a-la-markov

Two Approaches

Volta: Grammar-Based

Uses context-free grammar to generate syntactically correct sentences with proper structure. Pre-defined sentence patterns ensure varied and natural-sounding poetic lines.

  • Deterministic sentence structures
  • Grammatical rule expansion
  • Precise control over output form
  • Named after the poetic "volta" (turn)

Markov: Probabilistic

Builds a Markov chain from a corpus of classic poetry, then generates new lines that statistically resemble the training data while following rhyme schemes.

  • Trained on classic poetry corpus
  • Captures natural language patterns
  • Emergent poetic vocabulary
  • Statistical text generation

Supported Rhyme Schemes

ABAB

Alternate

AABB

Couplet

ABBA

Enclosed

ABCABC

Terza Rima

Custom

Any pattern

Rhyme Matching

Both systems use APIs like Datamuse for phonetic analysis, ensuring generated poems have proper end-rhymes matching the chosen scheme.

Training Corpus

The Markov approach is trained on thousands of lines of classic poetry to capture meter, vocabulary, and natural language flow.

Grammar Rules

Volta uses context-free grammar with expandable rules to produce syntactically valid sentences that can be tuned for style.

Technologies

Node.js Express Context-Free Grammar Markov Chains Datamuse API NLP

Links