«Creativity Support for Computational Literature By Daniel C. Howe A dissertation submitted in partial fulfillment of the requirements for the degree ...»
3.6.1 RiTa in the Classroom Having designed and implemented the initial version of RiTa according to the above pedagogical constraints (supporting serendipity, inverted-use and misuse; scaffolding and transparency), our next task was to create a workshop-style context for a diverse group of students that supported our goals (to provide a test environment for RiTa, and to enable students to create art via computational methods while developing basic programming and computer science skills). Throughout this process, we attempted to maintain close links (see Tew  above) between different elements of the course context: from overarching philosophy, to toolkit functionalities, to student assignments and projects, to supplementary reading materials, to reflective writing and thinking exercises. As concrete examples, we will look at two of the “mini-projects” assigned during the middle section of the course (these varied somewhat from section-to-section), following a range of introductory materials and preceding students’ larger final projects.
188.8.131.52 Assignment I: Context-free Grammars As mentioned briefly above, one of the first assignments each semester involved the use of context-free grammars, also called “recursive transition networks” in the literature on generation. To begin this mini-section, students were presented with a simple RiTa program that produced, in response to user input, a variety of haikus from a grammar. After some minimal explanation of the program code and basic grammar syntax, students were asked to modify the sketch in class to produce a work that was in some way personal and expressive.
In addition to the textual material, students were asked to consider all material aspects of their piece (font, text-size, color, motion, etc.) as means for advancing the communicative potential of their work. The intent here was to facilitate students’ experimentation prior to their having a full understanding of the mechanisms at work in the grammar framework.
As was the case throughout the workshop, this programmatic experiment was followed by four distinct but mutually-informing elements: readings, writings, discussion and critique. Readings for this assignment began with a brief introduction to the form of the haiku and several specific examples (both traditional and computer-generated). Additional readings were assigned (from Charles Hartman , Selmer and Bringsjord , and Funkhouser , to the Dada Engine, by Andrew C. Bulhak ) that discussed various grammarbased text-generation strategies. Works utilizing these techniques67 were subsequently demonstrated and discussed in class. Additionally a number of related concepts were presented: Chomsky’s  theory of universal grammars (and some counter-arguments68), center-embedding (to demonstrate the infinite nature of English sentences), and the idea of Castigilia, Utterback and Wardrip Fruin’s “Talking Cure”  (http://www.hyperfiction.org/talkingcure/index.html) is one such example.
See [Everett 2005].
recursive grammar rules. In a subsequent class, students were asked to present their programs as they would in a traditional art or writing workshop, picking and choosing versions of their output to present, and reflecting on the efficacy of the technique in their practice. As was the case throughout, each iteration of each project, with source code, was posted on the PDAL wiki for future review.
As critiques progressed, certain technical frustrations emerged, often involving perceived technical limitations—e.g., “how can I make sure no lines repeat?”—which were then discussed during class time. More complex strategies for using context-free grammars (CFGs) were presented (employing the probabilistic rules in RiGrammar), as well as specific effects that could not be produced with CFGs, but instead required additional expressivity (as provided by the callback mechanism in the RiGrammar library). This led into a discussion of Chomsky’s language hierarchy and how (context-sensitive) human languages differed from (context-free) computer languages.
Some more complex example grammars were discussed (nested parentheses as one example), and presentations on students’ completed mini-projects were scheduled for the following week. The example haiku sketch using RiGrammar was re-presented with both recursive and probabilistic rules to encourage experimentation and once again, students were advised to consider all aspects of their piece as means for achieving desired effects.
Somewhat interestingly, a number of students seemed “hung-up” on the overloaded term “grammar”, thinking that the so-called “production rules” in their grammar should map directly to English grammar rules. To break this misconception, a short (~20 line) grammarbased sketch was presented that recursively draws a tree-like structure (see screenshot in Figure 16), in a similar fashion to a Lindemayer System (or L-System.) Figure 16: A simple L-System implemented via a (recursive) context-free grammar.
By the following week, all students were able to produce working prototypes that not only demonstrated a basic understanding of the concepts, but also expressed, in some way, a personal style or voice. Each student presented their work for critique and was asked, as per standard practice in traditional creative writing workshops, not to explain their intentions until all other comments had been heard. Finally, students wrote in class about their experiences with grammars, after which followed a lively discussion in which several key concepts were quickly raised, most notably layering and authorial intent.69 Regarding the former, it seemed evident, following the presentations, that multiple layers of “text” existed in all of the presented works.
A full discussion of these topics is beyond the scope of this work. For more information see [Howe and Soderman, 2009].
One technical feature that enabled this realization was the fact that the source code and grammar files were published (by default) along with the finished piece. As such, students were able to easily read at two additional levels below the “surface” (the program’s runtime output) during critiques. In fact it seemed that students naturally perceived the authored text to be some amalgam of the three layers they had written (surface, grammar, and code) rather than simply the “output” to the screen which varied from run to run of the programs. Further, when questioned, students seemed to feel that all the software tools employed in the process: RiTa, Processing, Java, the browser, and even the operating system, could be conceived as potential texts for analysis and artistic critique. According to student assessments of the experience, each tool contributed to the final output in varying degrees, generally contingent on the tool’s distance from the surface, or conversely, their distance
from the binary machine code:
Theoretically the grammar exists independently as a piece of writing which, like most language on a page, does nothing, but I know when I look at a grammar file [I know[ that it has a programmatic counterpart. It goes somewhere; it does something; it will change based on a set of rules it defines. Which is to say, I don’t know how I feel when I look at a grammar. I consider it to be part of the text of a piece, but I also can’t separate it from its use value, which is not to say it’s an inferior piece of writing, just that I’m not sure how to categorize it or interpret it as itself. For me it opens a door into thinking about what poems I may write as a combination both of variables I can control and those I can’t; that if they’re planned-out in certain ways, and trusting to some larger structure I didn’t contribute to in others, they may do work I never anticipated.
The other important issue that emerged in the context of this assignment was the tension between so-called “randomness” and authorial intent. Here the question of delegating the author’s “choice” to the computer seemed of specific concern to writers, while those selfidentifying as artists in the class seemed to accept this as a matter of course (perhaps due to the fact that process-based work has been a central idea in visual and aural media for some time.
Interestingly however, writers cited a freeing aspect to this “loss” of control, specifically some version of plausible deniability that enabled them to take more risks in their
writing than they might have otherwise:
The general argument here appears to be that because the computer has, in some sense, made the choices (e.g., the grammar probabilistically chooses between the various right-hand rules for a production,) the writer is somehow less responsible when a uninteresting word combination was generated, and the writer is thus able to blame the computer’s “choice” rather than some inherent failing in themselves.
Further, students made the interesting point that they tended to write words or phrases rule-by-rule, rather than imagining and writing for a complete output sequence. So, because of their natural tendency to make associations with the surrounding text when writing, there was a specific writerly level present in the grammars, but often absent from the text itself. In this light, close readings of the grammars themselves proved interesting, as if the set of possible lexical choices for each rule constituted a self-contained poem. Below follows an excerpt from one student’s grammar file (the ‘|’ symbols signify OR,) so that for any run of the piece, only one of the lines below would appear, yet relationships between the lines are clear, and at times, quite interesting, a fact often remarked upon by those students with a background in art, literary or media theory.
and how he came to know the truth | is a dubious gesture, and one not to be trusted | as the boys’ voices reached down through the floorboards | douglas fir we think, though we can’t be sure | in concentric circles | with a passion typified by adolescent lust | and if it rang, did we pick it up? | they knew each other almost certainly | if the door had opened, it would have showed something completely...
As one student commented,
The enjoyment and generativity is to be found in the unexpected matches between words and phrases, between things I would have never thought to put together, but which manage to make a kind of sense beyond themselves. I like the idea of a piece of writing creating its own meaning; it means I don’t have to try to do it. I can write in a field as opposed to writing with a perceived trajectory.
184.108.40.206 Assignment II: Language Models As an introduction to the statistical approaches that have become so popular in recent natural language research, PDAL students were asked to do a mini-project that employed some type of probabilistic language model. To provide some brief background, a language model can be described as a statistical model used to analyze or generate elements of a text via previously learned probabilities. The term originated from the probabilistic models of language generation developed for automatic speech recognition systems in the early 1980’s [Jelinek 1997]. The history of language models, however, goes back to beginning of the twentieth century, when Andrei Markov used language models to model letter sequences in works of Russian literature (see Chapter 4, Prior Work). Another famous application of this technique, also discussed in the prior work chapter, was Claude Shannon’s models of letter sequences and word sequences, which he employed to create the theoretical foundations of information theory [Shannon 1949]. In the 1990’s, language models were applied as a general tool for a range of natural language processing applications, including part-of-speech tagging, machine translation, and optical character recognition (OCR) and have since become increasingly popular in a range of information retrieval research [Hiemstra 2009].
N-grams (also referred to as Markov chains, after Andrei Markov mentioned above) are an example of a specific type of statistical model in which the next item in a sequence is predicted based upon the frequency of that sequence in a set of inputs (see Prior Work for examples). For example, we might estimate the probability of a given sequence of letters, words, or phrases given the probabilities of that sequence appearing in a specific input set, e.g., the New York Times articles for the year, or the poetry of Emily Dickinson. The ‘n’ in n-grams refers to the number of words in each sequence that is considered as part of our estimate. If n=1 we have a unigram model in which the probabilities of a single letter, for example, are estimated based solely on the frequency of that letter in the input. In a bigram model, where n=2, we would estimate the likelihood of a specific two-letter sequence, “Qu” for example, based on its frequency in the input as compared to all other two-letter sequences in the input. In contrast to the grammars mentioned in the previous section, statistical approaches like n-grams tend to require less knowledge of the specific languages and texts involved. In the grammars mentioned above, all rules (for syntax, morphology, semantics, etc.) must be created by the author, but in statistical approaches, these rules are represented “implicitly” in the model.