"In so far as it represented man's harnessing of energy through craft, the machine became the most characteristic emblem of the Vorticist movement, more significant ... than the vortex itself." (Bush 36)
Ezra Pound's Cantos, whether understood as vorticist, imagist, ideogrammatic, or otherwise, is a poem that is the product of those schools, modes, and procedures. Since the techniques of the Cantos, like those of a cubist painting, are often foregrounded, critical works have been able to postulate about their composition in great detail, in some cases pinpointing the exact source materials for Pound's collages and translations. With the exception of a few other highly allusory works—"The Wasteland," for instance—few other modern poems are as richly and thoroughly annotated. One might even venture that there is almost enough metatextual data in the many handbooks to the Cantos—William Cookson's, Roland's John's, George Kerns's, or Carroll Terrell's, just to name a few—to reconstruct the poem itself. Given the source materials, composition techniques, themes, meter, and style, it might just be possible to design an algorithm to combine these elements in just the right way to generate a canto. Although the generated canto is unlikely to be a work of great artistic merit, the process of translating the procedure of poetic composition into an algorithm will help us to understand its minute machinations. The following describes an experiment to attempt just that—the translation of literary criticism into a generative algorithm, which hopes to be revealing about the structure of the Cantos, the shape of its critical response, and the limitations of algorithmic composition.
Among the many analogies critics have made between the Cantos and the visual arts, Jacob Korg compares the poem's techniques to those of collage. “The literary equivalent of the painter's collage is," he explains, "quotation—not conventional quotation, but the kind that presents itself as an interpolation, interrupting the text, and even conflicting with the writer’s purposes, as if it were an eruption of raw reality” (96). Since algorithmically generated language is still in its infancy, mostly belonging to the domain of semantically agnostic probabilistic models, the collage technique of the Cantos, and in particular Pound's use of direct quotation, is what makes the epic one of the most appropriate poems to attempt to programmatically emulate. As John Childs puts it, "hardly a page of the Draft of XXX Cantos goes by without the insertion into the poem of a word or phrase drawn from an author other than Pound" (18). By identifying these source materials, and designing functions to extract from them and mix them in appropriate ways, we might be able to create poems similar to Pound's.
The following is a experiment along the borders of computational and critical methodologies. The format of this investigation, an IPython notebook containing text and code, represents an attempt to problematize the distinction between computer science and literary criticism by intentionally combining the language of both. Some might argue that this paper is already at least half obscure for its intended audience, since most literary scholars are unfamiliar with programming languages, and most coders are unfamiliar with the language of literary study. To help dissolve this linguistic barrier, I have used the Python programming language, whose idioms are closest to English, and I have explained some of the logic behind the program's functions using interpolated or inline comments (text following the # symbol) wherever possible. However, a few key concepts of Python are necessary to explain here briefly, in order to explain the fundamental programmatic structures below. This table shows a few types of Python expressions, along with their explanations in English:
myVariable = "a " + "test"
This concatenates the text "a " and "test" and stores the result in a variable called myVariable. Now myVariable contains the text "a test."
def myFunction(x): ... return y
This defines the function myFunction, accepts the input X, and returns the output Y.
The brackets here indicate an index of the list. This expression returns the 0th, i.e. first, element of the list myList.
[x/2 for x in myList]
This list comprehension defines a new list generated from an operation performed on every element of another list. This list represents half of every element X in the list myList.
With these foundations and the interlinear explanations, it should be possible to read the algorithms below. Additionally, text following a pound sign (#) and text enclosed in triple quotes (""") is typically explanatory commentary.
In order to generate cantos, we'll first need to study their form. We'll need to determine the length of a canto, its numbers of stanzas, and its indentation fingerprint. I've prepared a markdown-formatted text file, cantosI-X.md below, which contains the text of Canto I through Canto X from A Draft of XXX Cantos, so that the text might be programmatically analyzed. This first class, CantosFile, reads this text, breaks it up by header, and stores it in memory.
Now that the file has been read into memory, we will study each canto individually with the CantoReader class below, which will read an individual canto and return information about it, such as the number of lines, number of stanzas, proportions of each, and information about the canto's indentation.
Now we'll need a set of functions for reading multiple cantos at a time, so that we don't have to read them each individually. The following class automates the bulk analysis of cantos, so that information about all of the cantos is easily available.
Now let's use these functions to find information about cantos I-X.
Since that format is not very easy to read, it might be more helpful to visualize some of this information. First, let's examine stanza lengths, to get an idea of how long our generated stanzas need to be, and how variable stanza lengths will be. The chart below represents Canto I - Canto V.
Judging from the number of stanza divisions and the variation in the lengths of the stanzas, Cantos I-IV appear to alternate between simple and complex line grouping systems. With this information, it might be best to design individual canto writer classes for each canto, rather than try to design a canto-agnostic generator.
Now let's examine the total line lengths of the first ten cantos.
Here again, the variation is immense, further solidifying the idea that individual subclasses need to be written for each canto. However, since it'd be best not to repeat code for a particular canto, it will be useful to write a parent class that will serve as a toolbox. The following class contains "helper" functions which will be used by the canto subclasses CantoI, CantoII, and so on.
In Canto I, Pound translates from Book XI of a renaissance Latin translation of The Odyssey. As he describes it, "I picked from the Paris quais a Latin version of the Odyssey by Andreas Divus Justinopolitanus (Parisiis, In officina Christiani Wecheli, MDXXXVIII)" ("Literary Essays," 259). Roland John posits that he uses this particular translation, "from an obscure Latin version," in order to "confirm that he is writing an epic. ... [and as an] homage to Homer as the maker of Europe's first epic" (11). There is more to this canto, of course—additional Homeric material, as well as Pound's bibliographic commentary—but the Divus translation is the bulk of the canto, and so this is a good place to start.
In the CantoI class below, the variable source_divus is populated with the first seventy lines of Divus's translation, originally transcribed from Kenner's facsimile in The Pound Era (352), but corrected with a copy at the Bayerische StaatsBibliothek and Pound's own transcription (Literary Essays 259). Pound's transcription expands Divus's abbreviations and modernizes much of the spelling, but there are still irregularities in the Latin, some of which Pound discusses in "Early Translation of Homer" (ibid. 264). In order to mimic the translation of Divus, the Latin text is machine-translated using an API connected to Google Translate, with the function translateFromLatin. Since Google Translate typically assumes that a word is a proper name if it cannot be found in its dictionaries, and preserves the word as such, this helps to explain the presence of the Latin words that still appear in the generated text below. (Although this could be considered a defect of the translator application, the presence of a few Latin words certainly comes across as Poundian.)
The style of Canto I is alliterative, not unlike Old English verse. John explains that it is a "modified alliterative line similar to that used in [Pound's] translation of the Early English poem 'The Seafarer,' chosen because it is an example of the earliest form of English verse." William Cookson further identifies this style as "the first example of the overlaying of times and traditions in The Cantos" (4). To achieve this effect, an alliteration function was written.
The alliteration algorithm, alliterate(), possibly the first of its kind, begins by attempting to guess the parts of speech of every word in a line, using the NLTK. From there, it retrieves all synonyms and hyponyms for the words using Princeton University's WordNet, a thesaurus-like "lexical database" of English words that organizes words into hierarchical relations. These synonyms and hyponyms are then filtered by part of speech, and the function chooses those with the highest numbers of shared first letters. This constructs some veritably alliterative verse, and some surprising lines, as well.
A brief comparison of this generated Canto with Pound's original might be useful here. Pound's canto begins with the line "and then went down to the ship" (A Draft of XXX Cantos, 3); the generated canto begins "yet, when I came down to the ship, and the sea"—Pound's version exhibits much more economy of language, with 30% fewer words in the line. The character represented by "I" in the generated version is removed in Pound's, which might serve to blur who is meant by the "I"—is it Odysseus? Pound? (This economy of speech is something we will try to correct in the generation of Canto II, using the meonymize function.) While line 3 in Pound is alliterated with "s" words—"we set up mast and sail on that swart ship," the generator apparently alliterates on "w" words: "and that which was wickedness in the ship, we set." In line 5 in this generated version, we see, mysteriously, "tears pouring Hubert" in place of Pound's "heavy with weeping." (Who is this Hubert? One can only suspect that this is either a translation error or an unusually distant hyponym that the alliterate function is inserting.) In at least one case, the alliterate function is alliterating even more than Pound does—Pound's "with glitter of sun-rays" is rendered here as "looks bright sun beam" (line 16).
In some cases, the function alliterates until the line makes no sense—line 24, for instance, reads "did atomic number 53 have a sharp blade pulling a thigh," which corresponds to Pound's line "drawing sword from my hip." The alliteration algorithm, trying to alliterate with words beginning with "a," is looking for synonyms for the word "I." Not realizing that it is a personal pronoun, it guesses that the word is the chemical symbol for iodine, and suggests the possible synonym "atomic number 53," which starts with the letter "a." To fix this issue, we will try to find synonyms for Canto II with a word sense disambiguation algorithm in place.
Canto II presents a very different challenge than Canto I. As John Childs puts it, "Since Canto 1 is largely given over to discourse in its retelling of a portion of the Odyssey, the devices of imagism are largely absent, and, in fact, The Cantos seem to alternate between the two poles of Imagist "lyricism" and discursive "historicism"; Cantos 1 and 2 are representative of such alternation" (44). One of the characteristic features of this second imagist mode of Canto II, Childs argues, is metonymy. In fact, he continues, it is the use of metonymy that distinguishes imagism from symbolism. The algorithm that will be used to generate Canto II, then, will apply metonymic principles to a mix of Pound's source materials.
Broadly, metonymy is, in M.H. Abrams's definition, a process by which "the literal term for one thing is applied to another with which it has become closely associated because of a current relation in common experience" (120). A common example is "the crown" as a term meaning a king. One type of metonymy is a synechdoche, where "a part of something is used to signify the whole, or (more rarely) the whole is used to signify a part" (ibid.). Using the Princeton WordNet, we might be able to emulate metonymy to a small degree by navigating its hierarchy of word relations. The NLTK WordNet API provides functions for finding meronyms for words, for instance. A meronym is a word that is a component of another word, and WordNet charts both "part" and "substance" meronyms. Here are some example meronyms for the word "tree":
The metonymy function below starts by determining the part of speech of a word, attempts to disambiguate its sense using the Lesk algorithm for word sense disambiguation (WSD), and with the resulting word sense or "synset," searches for meronyms. If none are found, it will try searching for other ways to convert the line into a more metonymic line.
Another way that metonymy functions is, as David Lodge explains, as a "condensation of contexture," effected by a "transformation of a notional sentence ... by means of deletion of portions of the syntagm" (quoted in Childs 36). A simple instance of this deletion is the removal of the word "like" that can transform a simile into a (metonymic) metaphor. Pound's affinities for the economy of words of ancient Chinese poetry, coupled with his terse haiku-like experiments, makes deletion an obvious choice for Poundian generative poetics. In fact, in an early essay on the Chinese poem "The Jewel-Stairs Grievance," he explains that despite the fact that he has "never found any occidental who could 'make much' of that poem," still "everything is there, not merely by 'suggestion' but by a sort of mathematical process of reduction" (Early Writings, "Chinese Poetry"). What we shall be attempting here is literally a mathematical process of reduction.
Rather than delete words at random, however, we will design an informed algorithm for metonymic deletion. Citing William E. Baker, Childs argues that one of the syntactic modes of this metonymic deletion is "nominalization," that deletion "gives primary emphasis to the noun, and that the great majority of fragments are classified as such because they contain a noun or noun phrase which lacks a finite verb to provide grammatical 'sense' to the structure" (quoted in Childs, 58-9). With this in mind, the function metonymize will call the function deleteVerbs in order to delete a small proportion of verbs in each line.
The algorithm below will start with eight of Pound's sources, taken from Carroll Terrell's Companion to the Cantos. These include selections from Ovid's Metamorphoses books III and X, Euripedes's Bacchae, Homer's hymn to Dionysos, and selections from the Odyssey and Iliad. The Ovid translations are those of Brookes More, and the Homer translations are those of Samuel Butler; both were downloaded from Perseus. The text of Robert Browning's Sordello was downloaded from Wikisource, and the Mabinogion was downloaded from Project Gutenberg. These sources are "mixed" together with the function sourceMix, which interpolates the source texts every X number of lines. That mix is then "metonymized" with the metonymize function previously described. From there, line breaks are added, and the text is formatted with stanza breaks and indentation to resemble the original Canto II.
Unlike the generated Canto I, the Canto II generated above bears almost no resemblance to Pound's original canto, despite the use of many of Pound's sources. It is not without its moments of surprisingly vivid imagery, however: "dark meat whooping crane or raindrop and midwinter / strive them over the airflow branch water" (l. 19-20). "Branch water" is, somewhat mysteriously, a meronym of "water," but is surprisingly Poundean in resonance if we recall his "wet black bough" from "In a Station of the Metro." As in Canto I, the appearance of isotopes ("uranium 235" in line 27, and "iodine 125" in line 39) signals a word sense disambiguation error, despite the use of the Lesk algorithm used in the CantoII class. (A future version of this program might try to filter out all chemical elements from the hyponym tree.) At the very least, it ends in medias res, like Pound's canto. Where his ends "and...," this canto ends with the sentence fragment "not even the well-built."
While the translation-and-alliteration technique of Canto I was reasonably successful, the mix-and-metonymize method of Canto II exhibited mixed success. In both cases, a more sophisticated set of functions would be needed to pass a poetic Turing test. For instance, a future version of this program might not only subsitute hypo/meronyms and delete verbs while metonymizing, but might translate "NN1 of a NN2" syntactic constructions into NN2-NN1 forms that would more closely resemble the Anglo-Saxon metaphoric compound words that Pound uses. It could also further nominalize a line by converting some verbs into nouns by traversing the lexical hierarchy, looking for nouns that are the smallest distance away. Given the time constraints of this project, however, this experiment proved to be a useful exercise in translating literary analysis into an algorithm, or, put differently, using the algorithm as a mode of literary analysis.
It is sometimes sufficient to analyze a poem by saying that it employs certain literary devices, but it is quite another to explain to a computer exactly how those devices work, on the level of the word, or even the letter. The process of analyzing a poem in order to reconstruct it is, in some small ways, a much more involved task than simply analyzing the poem for the sake of analysis. If we are to contend, for instance, that Pound employs metonymy in The Cantos, then to explain it to a computer, we have to specify exactly what we mean by metonymy, and exactly how it functions, lexically and syntactically. In that sense, although this experiment does not discover anything wildly new about Pound's work, and neither does it succeed in creating a great poem, it nonetheless paves the way for more experiments of this kind.
Bush, Ronald. The Genesis of Ezra Pound’s Cantos. Princeton, N.J.: Princeton University Press, 1989. Print.
Childs, John Steven. Modernist Form : Pound’s Style in the Early Cantos. London: Associated University Press, c1986. Print.
Cookson, William. A Guide to the Cantos of Ezra Pound. London: Anvil Press Poetry, 2001. Print.
John, Roland. A Beginner’s Guide to the Cantos of Ezra Pound. Salzburg, Austria: Institut für Anglistik und Amerikanistik, 1995. Print.
Kearns, George. Guide to Ezra Pound’s Selected Cantos. New Brunswick, N.J.: Rutgers University Press, c1980. Print.
Kenner, Hugh. The Pound Era. Berkeley: University of California Press, 1971. Print.
Korg, Jacob. “The Dialogic Nature of Collage in Pound’s Cantos.” Mosaic: A Journal for the Interdisciplinary Study of Literature 22.2 (1989): 95. Print.
Pound, Ezra. A Draft of XXX Cantos. New York: New Directions, 1940. Print.
——. Early Writings: Poems and Prose. Penguin, 2005. Print.
——. Literary Essays of Ezra Pound. New Directions Publishing, 1968. Print.
Terrell, Carroll Franklin. A Companion to the Cantos of Ezra Pound. Berkeley: University of California Press, c1980-. Print.