Print This Post Print This Post

A Request, an Announcement, and some Math

September 10th, 2011 by edde addad | Filed under -NP-Announcements/News, -NP-Theory/Critical

First, a request. Part of the recent Australian National Poetry Week celebrations included an article about how us proles aren’t appreciating poetry enough. (you know, apart from slam poetry, and rap, and poetry shared on the internet among friends… we ought to be reading more REAL poetry, the kind that counts!) Anyway, part of that article included the observation that:

“Some blame generations of teachers for being afraid of verse, while others decry the trivialisation of poetry via such things as online poetry generators. All of these suggestions have some validity, probably operating in combination, and it has to be said that we are the poorer for it.”

So my request is: can someone point me to an article that more fully argues this point about online poetry generators trivializing poetry? I’m sure there must be articles about this out there, but for some reason a google search for “poetry generators trivialize poetry” isn’t helping me. My main purpose isn’t to ridicule this argument, but to understand it better and hopefully to ensure that it’s not true in my own work.

Second, an announcement. We’ve been furiously trivializing poetry on Gnoetry Daily recently, using our culture-impoverishing poetry generators to explore topics such as the September 11 attacks, the Christian Bible, software for phonemically analyzing text for poetry generation, infinite Socratic dialogues, and the ontological and epistemological value of programming. We use a combination of word- and character-based n-gram generators, template generators, diastic readings, n+7s, cut-ups, codework transformations, and more, with a variety of levels of interactivity and editing. We’ve been joined by some new poets and generators recently, and we’d love to hear what you think about our work.

I didn’t mean to bleg and spam and run, so I’ll finish with the only thing I know that can make up for it… MATH! Yeah, you heard me, math! I’ve been working on using set theory and algorithm notation as a basis for developing a taxonomy of computer poetry generators, and I’m starting with Theo Lutz’s classic 1959 “Stochastische Texte” algorithm as a case study for analysis. After the cut is the latest version of what I have so far. If you don’t like it… either tell me who’s been talking trash about poetry generators, or check out what’s been going on at Gnoetry Daily!

The approach I’m going to take is to define an algorithm for computer poetry generation that is general enough to cover both rule-based generation as well as markov chained n-gram generation, including things like diastics, erasures, and Oulipo n+7s and “combinatorial” generators. Then, each individual approach will be described in terms of the general algorithm, and this will serve as a basis for exploring the differences (and therefore taxonomic categories) of the individual approaches.

Let Words be a set of words, characters, strings, or more complex linguistic entities. The term “words” is used in the mathematical sense of sequences defined on an alphabet. The elements of Words will typically be linguistic words and punctuation, but in some generators they will be characters, sets of text, or parts of speech.

Let Poem be a sequence w1, w2, …, w|p| where wxWords. Poem may be composed of subsequences of Stanzas and/or Lines; alternately stanzas and lines may be indicated by punctuation such as end-of-line characters. Linguistic words in a Poem may be separated by spaces which are part of the set Words, or it may be assumed that spaces will be inserted as needed for human processing.

Let initialize be a method for determining the initial elements of Poem.

Let editable be a method for determining which elements of Poem may be replaced during revisions.

Let Replacements be a subset of Words. These are the linguistic entities that will be used during revisions.

Let replace be a method for editing a Poem during revision.

The methods used by initialize, editable, and replace will vary: they could be table listings, random selections from a set, algorithms, or decisions made by a human calling on their expertise and experience.

Then we can define a Basic Generation Algorithm.

1.   initialize(Poem)

2.   for each revision
3.      for each word in Poem
4.         if editable(word) 
5.            replace(word)

In line 1 the initial version of the poem is created. At this point the poem might still be made up of template words that will not be used for a final poem.
Line 2 iterates over a poem for a number of revisions. Line 3 iterates through the parts of the poem. As a sequence, Poem is ordered, but that ordering is not necessarily followed when revising: for example, the middle of a poem might be revised before the beginning.
In Lines 4 and 5, an editable part of Poem is identified and revised.

 

We will use Lutz’s algorithm as a case study. Theo Lutz was a German scholar who wrote an article in 1959 talking about a generator that produced lines using templates and words from Kafka’s “The Castle”. Sample output given in the article is:

NOT EVERY LOOK IS NEAR. NO VILLAGE IS LATE.
A CASTLE IS FREE AND EVERY FARMER IS FAR.
EVERY STRANGER IS FAR. A DAY IS LATE.
EVERY HOUSE IS DARK. AN EYE IS DEEP

So Lutz’s algorithm can be expressed in terms of the General Algorithm in the following way.

Logical Operators = {A, AN, EVERY, NO, NOT EVERY}

Subjects = {COUNT, STRANGER, LOOK, CHURCH, CASTLE, PICTURE, EYE, VILLAGE, TOWER, FARMER, WAY, GUEST, DAY, HOUSE, TABLE, LABOURER}

Predicates = {OPEN, SILENT, STRONG, GOOD, NARROW, NEAR, NEW, QUIET, FAR, DEEP, LATE, DARK, FREE, LARGE, OLD, ANGRY}

Logical Constants = {AND, OR, THEREFORE, .}

Let Template Elements be a set of strings { logical_operator_slot, subject_slot, IS, predicate_slot, logical_constant_slot, . }

Let Words = Logical OperatorsSubjectsPredicatesLogical ConstantsTemplate Elements

Let the sequence Poem be a function from {1, 2, …, 10} to Words

So a poem is going to be made up of ten parts, where each part will be one of the Words.

Let initialize be the function from Poem to the set Template Elements that defines the following sequence: (logical_operator_slot, subject_slot, IS, predicate_slot, logical_constant_slot, logical_operator_slot, subject_slot, IS, predicate_slot, .)

Let editable be an indicator function on Poem where

Ieditable(x) = { 0 if x ∈ {IS, .}
1 for all other x

Let replace be the following algorithm:

Given stochastic select: a method of randomly choosing an element of a set.

Given the set Words and a wPoem, replace w with:

case w of
  logical_operator_slot:   stochastic select from Logical Operators
  subject_slot:            stochastic select from Subjects
  predicate_slot:          stochastic select from Predicates
  logical_constant_slot:   stochastic select from Logical Constants

So a poem is going to be initialized into a sequence of slot symbols representing a template. Every slot except for the word “IS” and for the period will be editable. During generation, the slots will be replaced by an appropriate subset of Words: the first slot symbol will be replaced by a Logical Operator, the second by a Subject, etc.

Now we may trace through the General Algorithm.

initialize(Poem)

The initialize function defines Poem as: (logical_operator_slot, subject_slot, IS, predicate_slot, logical_constant_slot, logical_operator_slot, subject_slot, IS, predicate_slot, .).

for each revision
   for each text in Poem

There will only be one revision: replacing the template “slots” with the appropriate texts. The algorithm does this by iterating through the text elements of the poem.

      if editable(text) 
         replace(text)

The editable indicator function replaces every slot, and leaves unchanged the two IS elements and the period. The replace algorithm changes each slot in the sequence into a word, which it selects from the approriate subset of Words.

For example, when the algorithm begins to generate a poem:

  • The editable will determine that logical_operator_slot is editable, after which replace will determine that it should be replaced by an element of Logical Operators, and stochastically select an element of that set, such as “EVERY”.
  • In the next iteration through the Poem sequence, editable will determine that subject_slot is editable, and replace will determine that subject_slot should be replaced by an element of Subjects, such as “VILLAGE”.
  • In the next iteration, editable will determine that “IS” is not editable, and leave it unchanged.
  • In the next iteration, editable will determine that predicate_slot is editable, and replace will determine that subject_slot should be replaced by an element of Predicates, such as “DARK”.

and so on.

This is modeled above by considering a Poem as a single line, where Poems can be continually generated; however Poem could also be modeled as an infinite set.

Be Sociable, Share!
tag_icon

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

1 Response to “A Request, an Announcement, and some Math”.

  1. Rock on Edde. I am doing basically visual art these days, but I can appreciate your intense concentration on poetry generation. Rock on.

Leave a comment.

To leave a comment, please fill in the fields below.