Sonnet Combinatorics with O u P o C o (2020)

Abstract: In this paper, we describe OuPoCo, a system producing new sonnets by recombining verses from existing sonnets, following an idea that Queneau described in his book “Cent Mille Milliards de poèmes, Gallimard”, 1961. We propose to demonstrate different outputs of our implementation (a Web site, a Twitter bot and a specifically developed device, called ‘La Boîte à poésie’) based on a corpus of 19th century French poetry. Our goal is to make people interested in poetry again, by giving access to automatically produced sonnets through original and entertaining channels and devices.

## introduction the starting point of the oupoco project is the book by raymond queneau cent mille milliards de poèmes (a hundred thousand billion poems, in english) @xcite . the book is composed of ten sonnets printed on separate strips, allowing thus a hundred thousand billion of different readings. the combinatory poetics characteristic of this book encourages the reader to play with the meanings of the poems, the various language registers present in the book or simply with its movable form. it is this stimulating relationship between poetry and constraints, which constituted the central mainspring of this project. queneau's book seems an ideal candidate to be transposed on a computer since a machine can perfectly combine verses and produce a comprehensive list of all the possible poems. but queneau's work is still under copyright, which prevent us from working directly on the sonnets contained in his book. this is the reason why, instead of working on queneau's poems, we decided to focus on a collection of 19 th century french poetry instead. beyond the availability of massive databases in this field, which facilitated the creation of our corpus, 19 th century poetry also appeared as a fertile ground to reflect upon the sonnet and to work and play with various constraints. this means that original poems have to be analyzed so as to determine the rhyme, as well as other features (length of a verse, topics addressed, etc.). this paper is thus about oupoco, l'ouvroir de poésie combinatoire, a system able to generate sonnets by recombining verses taken from a corpus of french 19 th century poetry. we describe the project, the different project outputs and the interest of this experience to reconnect people with poetry and literature in an entertaining way. ## the corpus the first part of this research consisted in gathering a corpus of french sonnets from the 19 th century. we first used available resources freely available on the web, especially the gutenberg project, wikisource and gallica, a rich collection of digitized resources provided by the bibliothèque nationale de france (the french national libray). the bnf later gave us access to an even larger corpus of french poems foot_1 , so that the implementation currently integrates a corpus of more than 4,000 french sonnets. all major french authors from the 19 th century are included in the database, but also some less known ones. each sonnet is encoded in a xml format along with related metadata; a tei version of the database is publicly available (see https://github.com/clement-plancq/oupoco-api ) and is regularly expanding. ## corpus and rhyme analysis the oupoco project has nothing to do with the recent neural approach to poetry generation @xcite , but it requires to get access to a formal representation of rhymes (as proposed by @xcite ). in order to do this, the first step is to get a phonetic transcription of the last word of each verse, but this is not enough: for example, "aimé" and "aimée" have the same phonetic transcription, but do not rhyme, according to french rhyming rules (feminine and masculine words, for example words that end with -é, as opposed to -ée, do not rhyme); there are also cases where the phonetic transcription is slightly different but words actually rhyme (for example with sounds like [e] and [ε]). all these cases are not marginal and must be handled appropriately. phonetisation (the process of transforming a word into a phonetic transcription) is done with espeak, a free software available on the web ( http://espeak.sourceforge.net ), that provided satisfactory results on our data. we analyse the whole verse and not only the last word of each verse, so that a full rythmic analysis is possible. however, as we have just seen, the phonetic transcription provided by espeak is not enough. a series of rules written in python had thus to be defined to get a proper analysis of rhyme derived form the phonetic transcription of the last word of each verse. these rules are manually defined and maintained, as there is no way they could be learnt directly from the data. a part of these rules can be easily derived from a treaty of french versification, but another part is directly linked to the output of espeak as we have to overwrite some phonetic distinctions produced by this software that are not relevant to analyse poetry. the sonnet generator uses this analysis to produce sonnets, with different possible structures, respecting the rules of french versification (the code and the resources used, especially the sonnet database, are open source and freely available for research, see: https://github.com/clement-plancq/ oupoco-api). ## constrainsts in the footsteps of the oulipo and following the comments of queneau who did not like the idea of pure random poetry generation, we chose to implement constraints to enable the reader to interact with the database, control the generation process in different ways, and discover 19 th century french literature from a different and more playful angle. the first constraint correspond to the different existing forms of sonnets proposed in the course of history. giacomo da lentini, petrach, marot, peletier, shakespeare and spencer all proposed and initiated a slightly different rhyming scheme (for example, marot proposed the following structure: abba abba ccd eed, while petrarch proposed several slightly different structures: abba abba cde cde / abba abba cdc dcd / abba abba cde dce, etc.). all these forms of sonnets are available and the user can choose any structure s/he prefers for generation. the second constraint enables the reader to generate random sonnets from texts within a chosen time framework. in other words, the reader selects a period of twenty or thirty years for example that s/he wants to explore on the timeline, and sonnets are generated according to this time frame. this option makes it possible to have a quick overview of the productions of french sonnets over a period. thanks to this option, it is for example possible to note that very few french sonnets were written at the beginning of the 19th century while their production tends to increase 20 years or so later. the third constraint deals with the authors themselves. the reader can select one or multiple poets as the source corpus to generate new sonnets. it is thus possible to explore the poems written by baudelaire for instance, or to combine them with the ones written by rimbaud or verlaine. the fourth constraint is based on a semantic analysis of the original sonnets. six main themes were identified (beauty, love, death, nature, spirituality), later on reduced to five, as melancholy and death were hard to distinguished. a sample of sonnets were annotated using these categories (50 sonnets per category) and a classifier trained on the manually annotated corpus. it is thus possible to generate sonnets based on the part of the corpus that have been classified as pertaining to a specific theme. note that the annotation operates at the sonnet level, whereas generation operates at the verse level. however, we assume that the theme gives a general flavor to the text, not every verse has to be relevant from a thematic point of view. the approach is quite simple from a computational point of view. however, it is difficult to control on the fly the number of sonnets that can be generated, depending on the number of contraints chosen by the end user. it is however important to keep track of this, otherwise the end user may frequently arrive at a dead end, with a number of contraints that prevents the possibility to generate new sonnets (a basic rule being that one verse cannot rhyme with itself, and even cannot be selected twice). ## overview of the demonstration the main interest of the oupoco project is to present french poetry through a new and original setting. with our system, poetry is not any more just a literary genre @xcite , but a dynamic object that can be manipulated and experienced. for lots of people, poetry is seen at best as something related to school years, at worse as something boring and uninteresting from the past. our new setting, in itself, makes it possible to show that playing with poetry can be fun. our setting puts in perspective the notion of text coherence @xcite since the result of the generator can be more or less satisfactory from a semantic point of view. it is possible to interact with oupoco through a web site ( https://oupoco.org/fr , see figure 1 ). figure 1 : an overview of the system on the web. on the left, the set of possible constraints; on the right, an example of generated sonnet it is also possible to regularly have a look at the bot posting a quatrain every 6 hours on twitter (see figure 2 ). finally, we also had a collaboration with a duo of artists who produced a "poetry box" (la boîte à poésie, see figure 3 ), a portable version of the original idea that can be demonstrated in public events (based on raspberry pi components). through these devices our goal is to reach a wider audience and engage people to reconnect with poetry. 6 evaluation and interest of the system output at the crossroad between surrealism and absurdism, generated sonnets are generally quite funny and convey a dreamlike atmosphere. the themes specific to the romantic period -such as love, whether it is magnified or lost, death or the fleetingness of time to name but a few -contribute to creating bizarre but intriguing poems. if most of them lack coherence in terms of punctuation or pronouns, these syntactic confusions can actually reinforce their poetic overtones. the oupoco system is intended to be presented in front of an audience, to elicit reactions. we did not perform a formal evaluation, as we would be unable to provide meaningful evaluation criteria @xcite and moreover, as this is not the goal. the interest is to create reactions, to use our piece of software as a mean to make people rediscover poetry and literature. one should also note that, because the machine produces structurally impeccable sonnets, the experiencer is unconsciously encouraged to find coherence in them, simply because we are used to coherence in our everyday life and because incoherence is bewildering @xcite . the second consequence is a frequent need for the experiencer to go back to the original poem, to see where from a given verse originates (tooltips always allows the experiencer to go back to the original sonnet). the project is thus not just a sacrilege game over venerated texts, but a way to make people experience and rediscover poetry. ## conclusion we have described oupoco, a system inspired by queneau and implemented through different devices. it aims at reconciling people with literature, especially poetry, a genre that is not very popular outside the educational system. the project was also the opportunity of a collaboration with a couple of artists who produced la boîte à poésie, an interesting spin-off of the project mixing art and technology. in the future, we plan to study the potential impact of our system in different (real world) contexts, especially in educational settings.