National Novel Generation Month: NaNoGenMo
NaNoGenMo
When I posted about my experiment with a programming language to generate natural language, @darkliquid (thanks) hinted me on twitter to try out NaNoGenMo. I replied that I didn’t really have time for it. But then, unwillingly I had an idea I wanted to try out so I decided to spend a few days on it. The challenge is basically to write something that generates a novel with at least 50k words. There are almost no other rules. I believe it was inspired by NaNoWriMo, where people actually write novels.
You can find my submission in the NaNoGenWri repo.
Transformation of text
Having played a bit with WordNet I wanted to see if I could take an existing text and transform it. The WordNet database is built in hierarchies (hypernyms (more abstract) and hyponyms (more concrete)). Now what would happen if I did some random transformations in an existing novel? Figuring out what source novel to use was easy, what would be more fitting than Kafkas classic Metamorphosis?
Here is what I did, in rough terms:
1) Pos tagged a Kafkas ‘Metamorphosis’
2) Identified adjectives and simple noun phrases
3) Transformed nouns by walking up or down in the hierarchies
4) Replaced adjectives with new adjectives found in the gloss of the transformed nouns
5) Generated the entire novel
I played with verb transforms as well but it’s was harder to maintain the correct tenses etc, so I decided just to skip it for now.
Result
The generated novel consists of three parts:
1) The first part is transformed by abstracting one level then stepping down two levels.
2) The second part is transformed by abstracting two levels then stepping down three levels.
3) The appendix consists of the original Metamorphosis as a reference.
The first and second part are introduced by showing moving through different levels of abstractions until the desired level is found.
The word count is about 69k (NaNoGenWri requires 50k).
Below is the intro to Part 1, you can see how it gets more concrete, passes through the original Metamorphis, then turns around and passes on the way back again after it steps down in to Abscission (which the generated novel also is called).
You can download the entire generated novel, Abscission as a text file.
The source code is available(don’t trust anything in it it’s a very hacky), third party libraries used are: extjwnl, guava, simplenlg and as a pre processing step I used Standford NLP pos tagger.
I have just zipped the entire source directory with libs and everything (thats why it’s about 20mb). It may or may not work, but all the code is there.
ABSCISSION
A transformation of Franz Kafka’s classic novel ‘Metamorphosis’
submitted for the #NaNoGenMo https://github.com/dariusk/NaNoGenMo
source code and more details here www.playchilla.com
by Jon Kågström (@jonkagstrom)
PART ONE
ABSCISSION
Entity
One abstract entity, when Gregor Samsa woke from intelligent operations, he found
himself transformed in his instrumentality into a known physical entity. He lay on
his living physical entity, and if he lifted his thing a lesser he could
see his living physical entity, slightly domed and divided by attributes into cause
abstract entities. The unit was hardly able to cover it and seemed ready and waiting
to slide off entity. His general properties, pitifully ribbony compared
with the abstraction of the entity of him, waved about helplessly as he
looked.
Physical entity
One quantity, when Gregor Samsa woke from mental basic cognitive process, he found
himself transformed in his furnishing into a perceived cause. He lay on
his living thing, and if he lifted his piece a lesser he could
see his distinct thing, slightly domed and divided by forms into mortal
communications. The artefact was hardly able to cover it and seemed ready and waiting
to slide off abstract entity. His characteristic strengthes, pitifully ribbony compared
with the attribute of the abstraction of him, waved about helplessly as he
looked.
Process
One fundamental measure, when Gregor Samsa woke from basic representational process, he found
himself transformed in his furniture into a responsible mortal. He lay on
his needed part, and if he lifted his body part a lesser he could
see his needed piece, slightly domed and divided by lines into adult
auditory communications. The covering was hardly able to cover it and seemed ready and waiting
to slide off quantity. His shared endurances, pitifully ribbony compared
with the property of the relation of him, waved about helplessly as he
looked.
Organic process
One period of time, when Gregor Samsa woke from mental imageries, he found
himself transformed in his bedroom furniture into a human bad person. He lay on
his needed body part, and if he lifted his external body part a lesser he could
see his needed body part, slightly domed and divided by curved shapes into man
music. The cloth covering was hardly able to cover it and seemed ready and waiting
to slide off point in time. His abiding staminas, pitifully ribbony compared
with the magnitude of the component of him, waved about helplessly as he
looked.
Metamorphosis
One morning, when Gregor Samsa woke from troubled dreams, he found
himself transformed in his bed into a horrible vermin. He lay on
his like back, and if he lifted his head a little he could
see his brown belly, slightly domed and divided by arches into stiff
sections. The bedding was hardly able to cover it and seemed ready
to slide off moment. His many legs, pitifully thin compared
with the size of the rest of him, waved about helplessly as he
looked.
Heterometabolism
One morning time, when Gregor Samsa woke from nocturnal wet dreams, he found
himself transformed in his sickbed into an objectionable vermin. He lay on
his human back, and if he lifted his human head a lesser he could
see his soft underbody, slightly domed and divided by arches into stiff
cantos. The puff was hardly able to cover it and seemed ready and waiting
to slide off moment of truth. His old legs, pitifully ribbony compared
with the largeness of the leftover of him, waved about helplessly as he
looked.
Metamorphosis
One morning, when Gregor Samsa woke from troubled dreams, he found
himself transformed in his bed into a horrible vermin. He lay on
his like back, and if he lifted his head a little he could
see his brown belly, slightly domed and divided by arches into stiff
sections. The bedding was hardly able to cover it and seemed ready
to slide off moment. His many legs, pitifully thin compared
with the size of the rest of him, waved about helplessly as he
looked.
Organic process
One period of time, when Gregor Samsa woke from mental imageries, he found
himself transformed in his bedroom furniture into a human bad person. He lay on
his needed body part, and if he lifted his external body part a lesser he could
see his needed body part, slightly domed and divided by curved shapes into man
music. The cloth covering was hardly able to cover it and seemed ready and waiting
to slide off point in time. His abiding staminas, pitifully ribbony compared
with the magnitude of the component of him, waved about helplessly as he
looked.
Shedding
One day, when Gregor Samsa woke from basic dreamings, he found
himself transformed in his bed into a bad seducer. He lay on
his needed stump, and if he lifted his hood a lesser he could
see his needed stump, slightly domed and divided by arces into boy
chorus. The leg was hardly able to cover it and seemed ready and waiting
to slide off show time. His old legs, pitifully ribbony compared
with the bulk of the unit of him, waved about helplessly as he
looked.
Abscission
One lunar day, when Gregor Samsa woke from nocturnal wet dreams, he found
himself transformed in his sickbed into a bad seductress. He lay on
his needed stump, and if he lifted his hood a lesser he could
see his needed stump, slightly domed and divided by limbs into broth of a boy
tra-la-las. The trouser leg was hardly able to cover it and seemed ready and waiting
to slide off show time. His old legs, pitifully ribbony compared
with the dollar volume of the unit of him, waved about helplessly as he
looked.
“What’s happened to me?” he thought. It wasn’t a wet dream. His quad,
a specific amazing quad although a lesser too lesser, lay peacefully
between its four architectural sidewalls. A wolf pack of pepper-and-salt exceptions
lay spread out on the correlation matrix – Samsa was a traveling midinette – and
above it there hung a creche that he had recently cut out of an
illustrated republication and housed in a pleasant, supporting climbing frame. It showed
a Simpson fitted out with a bearskin Glengarry and bearskin rebozo who sat perpendicular,
raising an attired bearskin muff that covered the way of her lower forearm
towards the eyeglass wearer.
…. here the entire novel is generated at this level of abstraction …
The humor survived and floats over the strangeness, and many variants turned into something disturbingly sexual. All versions are still easy to comprehend and understandable! I love what you can do with your mind!
Thanks traveling Midinette, you should pop by Sweden on your travels 😉