I found out about NaPoGenMo halfway through April, and decided to do something throwaway and quick for it, unlike my last couple of NaNoGenMo efforts, which have taken much more effort than the end results justified. (I found out about it on Mastodon but that's a story for another blog post.)

I used FrameNet, a lexical database which comes as part of the Python Natural Language Toolkit. FrameNet is an index of lexical units (a word or phrase in a particular sense) with a semantic frame in which they fit. For example, 'shake.v' (841) is the verb 'to shake' in the sense of 'to shock or astonish': here is the start of its FrameNet entry:

frame (47): Experiencer_obj

[definition]
  Some phenomenon (the Stimulus) provokes a particular emotion in
  an Experiencer.  'Nightmare on Elm Street scared me silly.'

[semTypes] 0 semantic types

[frameRelations] 2 frame relations
  <Parent=Emotions -- Using -> Child=Experiencer_obj>
  <Source=Experiencer_obj -- ReFraming_Mapping -> Target=Emotion_directed>

[lexUnit] 132 lexical units
  abash.v (4292), aggravate.v (4293), aggrieve.v (780), agonize.v
  (15582), alarm.v (781), amaze.v (782), anger.v (783), [..]

The script that generated the poem, jumper.py, starts from a lexical unit, looks up its frame, finds any related frames, and then harvests all the associated lexical units and recurses into them until it hits the maximum depth. At first I was going to use the frames to generate phrases somehow, but when I was testing it I tried pulling out the sample sentences (like 'Nightmare on Elm Street scared me silly' in the above) and found that the results from that were pretty good.

The first working version was bad at extracting sample sentences if they had single quotes in them, but I liked the first thing it generated, mistakes and all. If there's anything which the act of generating poetry has in common with writing it, it's the ability to know where to stop revising it: honour thy bug as a hidden intention.

shake.v

Pat jerked her head at the sudden noise.
Kim
Cause does not include any physical force moving the Agent
The boy swung his legs.
In a bid to reenter the conversation , he kept waving his hand towards the rest of them.
Pat dropped her hands to her lap.
They bobbed their heads to the beat.
Pat waved her arms about her head.
He winked his eye to give her a hint
Pat fluttered his eyelashes at me.
It seemed like we were clapping our hands for hours.
s mental or emotional state. Internal_cause is expressed in a PP Complement.
Pat flung his arms up.
There was singing for joy in the streets, and everywhere people lifting their arms into the air.
Pat yawned (*his mouth).
Pat nodded (his head).
Pat waved (his arms).
Pat rolled his eyes.
He clapped his loudest clap
The boy swung his legs from under the table.
He bent his legs at his knees
A brief smile appeared on his face
s mental or emotional state. Internal_cause is expressed in a PP Complement as in:
The smile on her face was repayment enough.
Ryan grinned.
He had an angry expression.
He gave a wide grin.
I made a grimace at her clumsiness.
The twig floated atop the water for about 100 yards.
The car moved into the slow lane.
Jo moved past Dad into the hall.
A naval airship drifted wildy in the stormy sea.
The balloon floated for hours.
s movement takes place without a specified Path.
They drifted in circles for weeks before rescue .
The policeman moved away from the door.
The feathers floated together on the water
A radioactive cloud drifted across Britain after the fire at the Windscale nuclear factory.
The explosion made me move in a hurry.
The nest blew from its tree in a gale.
The ash cloud drifted at twenty-five kilometres per hour.
Johnny went to Langley to turn himself in.
Pluto has moved fullyinto Sagittarius
upper arm
lower back
left leg
hind foot
second finger
front wings
Kim has beautiful eyes.
His trembling hands….
the fingers of her left hand
the fin on its back
the dorsal fin
Why don
He smiled up at me from the bottom of the well.
Evelyn reported to me about what happened.
Evelyn spoke to me about what happened.
A further biography Shadowland by William Arnold, published in 1978, asserted for the first time that Farmer had been the subject of a transorbital lobotomy
He wrote in bitterness of the treatment the Malloreans had given him.
Kim preached to me over the phone.
The New Year address was well received.
Much would be achieved if these were more widely acknowledged.
In some remarks at the National Press Club, Mr. Keating said he would make a better prime minister tha nMr. Hawke.
Evelyn spoke feelingly about what happened.
Evelyn made a persuasive statement.
Evelyn
Evelyn spoke candidly about her past.
The teacher mentioned the recent campus incidents.
Bilio commented on the paper by scrawling innumerable post-its in a range of colors and sticking them all over it.
Let
Evelyn said that she was not ready to leave.
Evelyn reported the whole incident.
I barely hobbled six feet before collapsing.
We hiked a short distance into the forest and sat down.
The children skipped into the park.
The principal walked over and sat down.
A dog ran up and licked our hands.
The cat ran out of the house.
The cat ran out.
The cat ran away.
The cat ran off.
You should walk south about a block .
The mouse scurried about.
Stop running around the room and sit down!
They danced at the sound of her voice.
We wandered around naked.
The hitchhikers walked in the middle of the road.
John walked with her every day to relieve the boredom.
The scouts hiked through the desert.
The scouts hiked along the river.
We slithered smoothly through the crowd.
They had to trek on foot through the desert.
Fred crawled the narrow passage.
He walked back to the village by dragging his mangled foot behind.
We clomped down to the shore with a whole troop of younglings.
I had little hope of catching up, but I crawled after her as fast as I could.
The troops marching in front of him paid no attention to the beggar by the roadside.


Comments

comments powered by Disqus