My entry for NaNoGenMo 2016. An exercise in cheap generative worldbuilding built from a Haskell combinator library, an event loop and vocabulary from a neural net trained on dictionary entries.
Annales: the gory details in three parts
- Vocabularies: using a neural network, Python and regular expressions to generate a nonsense vocabulary
- TextGen: a Haskell combinator library for making up randomised sentences (plus a one-paragraph explanation of how the State monad works!)
- Events: in which I get bogged down writing a succession algorithm, but also figure out how to correct a typo in a randomly-generated text
Annales is build in three stages: vocabuary modelling, vocabulary mining and procedural generation.
The basis for the nonsensical names and words is a neural net which has been trained on all of the word definitions in WordNet. I built this a while ago to power a Twitter bot, @GLOSSATORY, using Justin Johnson's torch-rnn code.
Here is the eight-line script used to fetch around 82,000 definitions from WordNet
I generated about 50,000 glossatory entries, and then generated vocabulary files for Annales from that with a Python script, extract.py. This creates lists like men.txt and buildings.txt based on regular expressions.
annales itself is a Haskell application which builds on TextGen, a Haskell combinator library I wrote for another Twitter bot, @amightyhost. It uses its own event loop to generate incidents and then uses TextGen, with the vocabulary files, to generate descriptions of those incidents.