You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Markov chain is a stochastic model describing a sequence of possible events in which the probability of each event depends only on the state attained in the previous event.
e.g.
Phrase: “And the Golden Grouse And the Pobble who”
Prefixes + Suffixes
|------------------+--------|
| Prefix (size: 2) | Suffix |
|------------------+--------|
| And the | Golden |
| the Golden | Grouse |
| Golden Grouse | And |
| Grouse And | the |
| And the | Pobble |
| the Pobble | who |
| Pobble who | N/A |
|------------------+--------|
Autogenerated:
“And the Pobble who”
“And the Golden Grouse And the Pobble who”
“And the Golden Grouse And the Golden Grouse And the Pobble who”
“And the Golden Grouse And the Golden Grouse And the Golden Grouse And the Pobble who”
Process
Download a large number of poems off the Internet (But from where? Google it! There’s no API. Many are poorly formatted. HTML styling?)
Build a Markov chain based on the text extracted
Autogenerate phrases on the fly (variations: prefix length, the starting prefix, etc.)
Short Demo
“Through the night and day”
"Through the night and day"
Through the skyless moonless gardens and the swamp-perfume,
And I hear is bossy death telling me which way to heaven
Through the city streets they're flooding,
As with voices and with my childhood's faith
Through the afternoon into high August blue,
The vapour trails of two clocks
Through the year, is heavier at Christmastime,
The season of good fortune met scoffing and blame
Through the crowd, who, being merely human,
Must remember nothing of much but beauty
Through the heavy metal ring in a shift of cloud,
The night-blossom hangs heavy,
With the knowledge of death is past
Through the wide world and all in rest
Through the night and day