THE ai TR obot: An Interactive Tool for Generating Theatre Play Scripts (2022)

Abstract: We present a free online demo of THEaiTRobot, an open-source bilingual tool for interactively generating theatre play scripts, in two versions. THEaiTRobot 1.0 uses the GPT-2 language model with minimal adjustments. THEaiTRobot 2.0 uses two models created by fine-tuning GPT-2 on purposefully collected and processed datasets and several other components, generating play scripts in a hierarchical fashion (title \rightarrow synopsis \rightarrow script). The underlying tool is used in the THEaiTRE project to generate scripts for plays, which are then performed on stage by a professional theatre.

## introduction we present a demo version of theaitrobot, a tool for interactively generating theatre play scripts. theaitrobot 1.0 is a vanilla gpt-2 model @xcite with several adjustments for the theatrical domain @xcite ; theaitrobot 2.0 features two fine-tuned gpt-2 models operating in a two-step hierarchical fashion. machine translation allows the tool to operate both in english and in czech. 1 the tool was used within the theaitre project to generate scripts of theatre plays, which were then staged by a professional theatre. the script of the 60-minute-long first play, ai: when a robot writes a play, consists from 90% of automatically generated texts, with only 10% human contributions and edits (theaitrobot 1.0 et al., 2021), unprecedented for such a long play. the online premiere of the play was viewed by thousands of spectators worldwide @xcite . one of our goals in the theaitre project is making the public more familiar with the actual state and operation of artificial intelligence and natural language generation in particular. in addition to theatrical shows complemented by followup discussions with the audience, we want to further support this goal by making the demo of the theaitrobot tool freely available online for anyone to experiment with. foot_1 a short video showing the usage of the demo is available on youtube. foot_2 ## related work a number of gpt-based language generation tools is available online, such as news generators @xcite , foot_3 , foot_4 text adventure games, foot_5 code completion tools, foot_6 , foot_7 or chatbots. 9 however, to the best of our knowledge, no script generation tool has been released so far. script generation has been explored in several other projects, none of which however make their tools publicly available, often not even sharing quite enough details about the design of the tool, and also either using extensive human curation and/or generating only very short scripts @xcite @xcite . ## theaitrobot 1.0 the first version of our tool is based on a vanilla gpt-2 xl language model with several adjustments, mainly employing textrank-based @xcite ) extractive text summarization to deal with gpt-2's limited window of 1,024 tokens, so longer scripts can be generated without losing context @xcite . the tool uses cubbitt @xcite for on-the-fly machine translation of the outputs into czech. in the demo version of the tool, the user can input a scene setting, character names and their first lines, or use one of the predefined inputs (see figure 1 ), from which we construct the input prompt for the gpt-2 model in the following format: scene setting. character name: character line. ## theaitrobot 2.0 the second version of the tool uses a two-step hierarchical generation approach, first generating a play synopsis and then expanding that synopsis into a full play script, with specific models trained on our datasets for each of the steps. the input for the synopsis generation step is the play title, in a fashion similar to script generation in theaitrobot 1.0 but with the underlying gpt-2 model fine-tuned on synopsis data. for the fine-tuning, we used a dataset consisting of ca. 65k synopses of theatre plays (scraped by us from wikipedia), movies @xcite , tv series (scraped by us from fan wiki pages) and books @xcite . once the user is happy with the generated synopsis, the synopsis is used as input for the second step. in the second step, the play script is generated from the synopsis using a gpt-2 model fine-tuned for generating script sections based on synopsis sections. here we use a near-domain scriptbase corpus (gorinski and lapata, 2018), which contains movie synopses and scripts. we split the synopses into sentences and align these in a monotonic one-to-many fashion to script lines. the user now has more options when generating (see figure 2 ): generating a character line, also choosing which character should speak, or moving on to the next part of the generated synopsis. ## conclusion we release an online demo of theaitrobot, a tool for interactive generation of theatre play scripts. the tool is free for non-commercial use, and its source code is released under the mit licence. 11