A Tiny Poetry Generator with Blinkenlights

ppg256-4 on a shelf

[As I wrote on netpoetic.com:] My latest Perl Poetry Generator in 256 Characters, ppg256-4, is my first one created specifically for a gallery setting. Although shown here in my office, it’s now on display at the Axiom Gallery for New and Experimental Media in Boston in the show Pulling Back the Curtain, which runs through September 27.

Since 2007, I have been developing Perl poetry generators that are 256 characters long. These programs constitute the ppg256 series. They are simply 256 characters of Perl code; they use no external data sources, online or local, and they do not make use of any special libraries or invoke any other programs. Here’s the code for ppg256-4:

perl -e 'sub c{$_=pop;$_[rand split]}sub w{c("b br d f fl l m p s tr w").c"ad ag ap at ay ip on ot ow"}{$|=print"\0\0\0\0\0\1Z00\2AA\33 b".c("be de mis re pre ").w." ".c("a on the that")." ".w.w.", ".c("boss bro buddy dogg dude guy man pal vato")."\4";sleep 4;redo}' > /dev/alpha

Note that those 256 characters of Perl include all of the control codes that are needed to drive the sign; the output is just redirected to the sign, a serial device, instead of appearing in the terminal. If you want to run ppg256-4 yourself, you can use this modified version that doesn’t include the control codes — it’s ready for you to copy and paste it into a terminal window:

perl -le 'sub c{$_=pop;$_[rand split]}sub w{c("b br d f fl l m p s tr w").c"ad ag ap at ay ip on ot ow"}{$|=print "\n".c("be de mis re pre ").w." ".c("a on the that")." ".w.w.", ".c("boss bro buddy dogg dude guy man pal vato")."\4";sleep 4;redo} #No LED sign version'

I’ll try to post a longer discussion about ppg256-4 on netpoetic.com and/or on Post Position before too long.

ppg256-4_2

ppg256-4_3

ppg256-4_4

ppg256-4_5

This was posted here on Post Position for the convenience of those of you who subscribe to the feed or visit the site. If you want to leave a comment, please head over to this post on netpoetic.com.

Read and Jump in Silent Conversation

“I had with me many tools, and dug much within the walls of the obliterated edifices; but progress was slow, and nothing significant was revealed.”

– H. P. Lovecraft, “The Nameless City”

Gregory Weir, who fashioned the very nice piece The Majesty of Colors, has a new game with levels built out of existing texts, including “The Nameless City.” The new platformer is called Silent Conversation, a title taken from poet Walter Savage Landor’s description of reading.

The Prufrock level in Silent Conversation

The second Nameless City level in Silent Conversation

My impression is that this one is not as short and compelling as The Majesty of Colors, but is more elaborate and is, if not a success, at least a very interesting failure. It’s not a particularly good or fun platformer qua platformer and doesn’t offer a very good model of the reading process, but it reveals more about about the potential of games as digital objects that can be both played and read. I don’t think that making levels out of pre-existing texts works nearly as well as would original writing, but the setting of those texts into interactive concrete was certainly done with care.

The model of reading is one in which you have to touch every word with your eye (your “I”, in this case) to seek a good score (represented as a letter grade, believe it or not). “Powerful” words fire slow-moving letters at you, which clear away your accomplishments on the screen if they hit you. In some places you can fall to your death and undo the reading on the screen, too.

If this were done as a parody of the reading process as conceived of in the educational system, it could work effectively. Playing the game does suggest to me things that I do when I read – looking back over the text for a word I missed or misread, trying to progress by looking at at least each phrase along the way. But the reading of these texts is numbed, rather than heightened, by having them as elements of play in this way. Just to stick to the mechanics, rather than looking to deeper aesthetic questions about reading: Words are either powerful or not, and I need to simply tag them in either case, carefully if they might undo some of my progress, quickly otherwise. Whether in a long fiction work or a short poem, I can, when reading on paper or e-book, skip back to re-reread without slogging back past each word, as I have to go in this game. And I can re-read sections when I’m done, too. While the phrases used as decorations add color and visual interest, this game, perhaps surprisingly, makes a less unilinear reading experience into a more linear experience in reading and playing. It also rewards a perfunctory glance and touch rather than requiring discernment, figuring out, and comprehension, as do some other video games made entirely out of words – works of interactive fiction.

Reading and playing are not two great tastes that taste great together in this case, but I appreciate Weir bumping them into each other in this piece and trying to figure out how they might enhance one other. And for those interested both in gaming and in digital writing/electronic literature, Silent Conversation is certainly required reading.

Pythonic Textuality at NYU

I was very interested to learn that Adam Parrish, whose own Interactive Telecommunication Program (ITP) masters project was “New Interfaces for Textual Expression,” is now teaching Digital Writing with Python at NYU’s ITP. The course is concluding; Parrish and his students will mount a final performance on August 5 at 7pm. Parrish eschewed powerful, cryptic Perl for clarity of Python in this course on creating text machines, as I did in putting together The Word Made Digital, which I’ll be teaching again this Fall. His reading list overlaps with mine a bit and includes a nice article on appropriation in writing – I may just rip that right off. I won’t manage to be in New York to hear students read their programs’ output, but I hope the conclusion to the class goes well and that I’ll be able to read and run some things that will give me a sense of the event.

Computational Creativity at ICCC-X

The First International Conference on Computational Creativity will be taking place in Portugal on January 7-9 2010. ICCC-X will follow on a decade of smaller-scale workshops and symposia. The call for papers lists the deadline of September 26 (extended 5 days) for papers, and promises:

The conference will include traditional paper presentations, will showcase the application of computational creativity to the sciences, creative industries and arts, and will incorporate a “show and tell” session, which will be devoted to demonstrations of computational systems exhibiting behaviour which would be deemed creative in humans.

Note also that contributions are solicited in several areas, including “specific applications to music, language and the arts, to architecture and design, to scientific discovery, to education and to entertainment.”

Poemland

Poemland, Chelsey Minnis, Wave Books, 2009
Poemland, Chelsey Minnis, Wave Books, 2009

Minnis, confronting poetry, hurls a fruit salad. The pages of the eleven sections of this book have only a few lines each, most ending in ellipses. The images (“getting hit with a folding chair / And being held by your braids…”) accumulate and converse (“I’ll chop your head off! / And I’ll carry it around by the hair…”), commenting on various vague situations and on poetry (“It’s like trying to drink a bottle of champagne in a roadside bathroom…”) You might imagine that it’s boring to hear poets yammer about writing poems and being poets (“If you open your mouth to start to complain I will fill it with whipped cream…”). Not so. Via references to fashion and offbeat interpersonal statements, the lines of Poemland connect the concerns of our poetry subculture (poverty, recognition, originality, connection to the past, authenticity) to culture more broadly. The book is fun to read from line to line, too (“With this book I have made a very expensive joke…”) and is beautifully and aptly designed.

CALC-09, Afternoon

The Workshop on Computational Approaches to Linguistic Creativity has just concluded. I posted about the morning; here are my notes on the afternoon talks.

The first item for the afternoon was my invited talk, “Curveship: An Interactive Fiction System for Interactive Narrating” I worked a while to provide the paper to accompany my talk, trying to introduce IF, explain the basics of narrative variation, and get into at least some of the technical details of my system, including the string-with-slots representation, which I’ve been working on a great deal recently. I also tried to include handy references and pointers. Incidentally, I’ve been meaning to post more about Curveship, and I’d love to hear any questions you have about it at this point, even before I’ve properly introduced the system on this blog.

After my talk, we had more time for poster presentation; one poster was on author and character goals for story generation.

The “From Morphology to Pragmatics to Text” session concluded the day:

Andrew Goldberg presented work by three others on a ML algorithm to assess the creativity of sentences: outliers that are still meaningful. The Winconsin Creative Writing dataset was assembled and used. Using language modeling, word norms, and WordNet, the did partially predicted creativity scores. (Pointed out in the Q&A: All the non-creative sentences were much shorter, so you could just use one feature – length!)

Stefano Vegnaduzzo presented state-of-the-art work on complex adjectives – ones that are made of at least two words separated by a hyphen. These are frequent, as corpus analysis of Wikipedia and the Web shows. Two-word complex adjectives, identified with a part-of-speech tagger, were the focus. Morphological productive processes allow the unintentional, unlimited, regular creation of words; building complex adjectives is one. Checking for hapax legomena gives a measure of productivity within morphological categories: “non-X” was tops in both corpora. Realized and potential productivity were found, and found to be similar across corpora.

Allan Ramsay presented work on how the same words can have different meanings in different contexts. The sentence “I’m sorry I missed your talk” was one fixed text, along with “I’m sorry, Dave, I can’t do that.” It’s not because “sorry” is ambiguous. “Sorry” expresses a relationship between an individual and a state of affairs (which the individual wishes were not the case). There’s no first-order representation. The representation is extremely elaborate, but not too complex. Appropriate background knowledge is essential. One conclusion: A system that takes part in conversations will have to build meaning representations and carry out inference. (In Q&A, I learned that there’s more in the paper about being mistaken, lying, and using irony and sarcasm.)

One way to get at the papers from this workshop is by seeing the title and author information on the CALC-09 site and then using your favorite search engine to locate them online – I assume all, or at least almost all, have been placed online by authors. ACL also offers past workshop proceedings for purchase. Maybe the CALC-09 proceedings will be available that way, too?

CALC-09, Morning

The Workshop on Computational Approaches to Linguistic Creativity (CALC-09) is taking place now at the University of Colorado at Boulder.

In the first session on metaphors and eggcorns, researchers reported on using natural language understanding techniques in innovative ways:

Beata Beigman Klebanov presented on the use of a topic model (LDA, latent Dirichlet allocation) to detect the most obvious or deliberate types of metaphor, which are discussions of one domain the terms of another and which were annotated by people in this experiment. For different k, metaphorical uses were found to be less frequent in the k most topical words in the discourse overall.

Steven Bethard presented work dealing with sentence-level conceptual metaphors from a psycholinguistic standpoint. In earlier work, metaphors were used as stimuli and subjects’ N400 brain waves, associated with anomaly, were recorded. This suggests that it’s important to know about metaphorical frequency, how often words are used in a metaphorical way. A support vector machine classifier was trained on an annotated corpus. LDA, with and without categories, was used to disambiguate metaphors, and to determine whether they are abstract or concrete.

Sravana Reddy presented “Understanding Eggcorns,” about linguistic errors caused by semantic reanalysis: entrĂ©e -> ontray, as first named on Language Log in 2003. Eggcorns are more related to folk etymology and puns than malapropism; there has been little study. Can the path of transformation be discerned? Error-detection is an application; also, humor generation. Using the Eggcorn Database and WordNet, a semantic network was built; context information was then added and other augmentations were made. A typology with five categories was developed based on the results.

Session 2 was on generating creative texts:

Ethel Ong presented work on pun generation using a pronouncing dictionary, WordNet, and (more effectively) ConceptNet. A system called TPEG extracted word relaltionships to build templates for pun generation, keeping the syntactical relationship but modeling semantic and phonetic word relationships as described in Kim Binstead’s work. Variables in the template model parts of speech, sound, and compound words.

Yael Netzer presented the Gaiku system for haiku generation. Constructed a haiku corpus, system to build templates. First try generated grammatical output, but didn’t have a good “story.” Story is a sequence of concepts: Butterfly, spring, flower. Word association information, not found in WordNet, was added. An analysis of haiku was done to see if it appears more associate than news text. The final generated haiku were evaluated in a “Turing test.”

Lyric generation in Tamil and syntactic constructions were discussed in the poster session presentations.

Note that paper titles and the full list of author names can be found on the CALC page.

Miss America

Miss America, Catherine Wagner, Fence Books, 2001.
Miss America, Catherine Wagner, Fence Books, 2001.

If I was President,
NONSTOP LICKY
I’m afraid I can’t think without licky
White man wrote almost every book in that shelf.

Wagner takes an exquisite sledgehammer to language and America in this book. The Magazine Poems (for Nature, Time, Social Text, etc.) and the White Man Poems (the second of which supplies the lines above) are particularly effective projects, often scatologically smeared, with phrases turned until they are permanently damaged or become protolinguistic babble. The voices nevertheless seem spot-on as they speak to intimate as well as cultural matters. The five-line poem for Cosmo ends “Horrif, horrif, she howled – Horrif.” Seems like Mistah Kurtz – he is so dead. “A Poem for Good Housekeeping (after Wittgenstein)” is in a rather different vein, rising into a biting, cool abstraction and living up to the outrageousness of its title. The concluding Fraction Anthems, procedurally pulverized further in notes to each, have fine moments as well.