Augmenting Poetry Composition with V erse by V erse (2022)

Abstract: We describe Verse by Verse, our experiment in augmenting the creative process of writing poetry with an AI. We have created a group of AI poets, styled after various American classic poets, that are able to offer as suggestions generated lines of verse while a user is composing a poem. In this paper, we describe the underlying system to offer these suggestions. This includes a generative model, which is tasked with generating a large corpus of lines of verse offline and which are then stored in an index, and a dual-encoder model that is tasked with recommending the next possible set of verses from our index given the previous line of verse.

## introduction there has been a lot of growing interest in poetry generation @xcite . some of these approaches have even shown quality approaching that of humans @xcite . however, much of this has been in the view of letting an ai write a full poem by itself, thus writing in a closed system. only recently have some approaches started to explore human interaction when composing a poem @xcite @xcite . verse by verse foot_0 is our experiment in augmenting the creative process of poetry composition with an ai. unlike past approaches that focused on generating a full poem, we are interested on how we can use ai to offer suggestions to a user as they compose a poem. this is a much more challenging task, as one needs be able to offer suggestions with minimal latency while meeting constraints of the poem structure and handle the challenges of user input. additionally, to make this a more educa-tional experience, we wanted to generate the verses in the style of various classic american poets. in this paper, we describe the underlying system that powers verse by verse. our main contributions are: ## verse by verse overview as mentioned, verse by verse is an interactive application that allows users to compose a poem while getting suggestions from the system. to use this application, users first pick a few classic american poets to act as their muses. they will then pick the structure of the poem (quatrains, couplets, or free verse), and optionally syllable count and rhyme schema (when applicable). afterwards, they can begin to compose a poem. while the user composes a poem, the poets will make suggestions of next possible lines of verse given the previous verse (as shown in figure 1 ). users may either use these suggestions (including being able to edit the suggestions to make them more personal) or continue writing verses of their own. this goes on until a user is satisfied with their poem, in which they can then optionally add a title foot_1 and save the final poem as text or as an image. figure 2 shows an overview of how we suggest verses to the user. our system first receives from the user as input: the previous verse, poem structure metadata (such as syllable count and selected poets), and, if needed, a verse to rhyme with. when a rhyming verse is provided, the system will find the rhyming syllables for this verse. the rhyming syllables along with the poem structure metadata will then be used as filters on the generated verse suggestions. with the previous verse input, the system will then encode the verse using a feed forward network. this encoding will be used in a search against pre-generated and pre-encoded verses, taking the dot product of each pair of encodings. it will then output a list of the n-best 3 possible verses per poet to suggest as the next verse based on the dot product scoring. the next few sections will cover the various parts of the system: verse generation, verse retrieval, and determining rhyme syllables. ## offline verse generation we generate our verses offline and store them for later retrieval, which differs from past approaches of poetry generation. this allows for faster serving @xcite , especially when used in a dual encoder network as described in section 4. our verse generation is done in a pipeline composed of multiple steps. figure 3 shows an overview of this. it takes original poetic sources 3 the value of n is controlled by the ui, which considers two factors: whether the user is on desktop or mobile (we can show more suggestions when viewing on desktop) and how many poets the user has selected to act as their muses. and creates new verses (section 3.1); then filters out poorly-generated verses (section 3.2); and finally adds metadata for each verse such as the rhyme syllables and syllable count (section 3.3). ## next verse prediction we use a dual encoder network architecture for suggesting the next line of verse of a poem. we will discuss training of the network, the indexing of possible verses, and the retrieval of verses. ## rhymes and user input as we allow users to enter their own verses or edit candidate verses, we then have to take this into account for next-verse suggestion when dealing with rhyme. in many past approaches that are generating a poem in full, they can use various heuristics to help meet requirements for rhyme, such as restricting what words are available. or in some cases, such as with deep-speare, learn a model for rhyme @xcite . since we were creating an interactive approach, we then had to take a different route for dealing with rhymes. ## evaluation we ran comparative evaluations of verse by verse against poems written by classic poets. while verse by verse is meant to be used in an interactive setting to aid a user in writing a poem, we felt it was still worth evaluating how well it works on its own in writing a poem given a first line of verse. to do so, we gathered a collection of 100 quatrains written by the 22 classic poets. then, for each quatrain, we would take the first line of verse, and use that as the first line of verse for verse by verse. it would then take the top suggestion (using the same poet as that who wrote the poem), to pick the subsequent 3 lines. when possible, it would try to follow an abab rhyme pattern. we built upon the work of hopkins and kiela (2017) for evaluating. we would show evaluators one poem at a time. they then needed to classify if the poem is human-or ai-written (they are shown the full quatrain and asked to evaluate on the last 3 lines), and rate on a scale of 1-5 for readability (to what extent is the quatrain easy to read? does it make sense?, relevance (given the first line, how relevant are the subsequent lines of verse?), evocation (how much does the quatrain evoke emotion when reading it?), and aesthetic (how much does the quatrain sound nice to read, such as in rhythm?). each poem was evaluated by 3 evaluators. ## related work poetry generation is a growing field of research, with many diverse approaches for generating fulllength poems of various forms @xcite . some related areas to touch upon are user interaction and verse generation. ## conclusions we have described the underlying system of verse by verse. it is composed of two primary models, one for verse generation and one for verse recommendation. results show that this approach works well for an interactive setting, generative novel verses that do well in human evals and meet the more challenging demands of human interaction.