THEaiTRE: A theatre play written entirely by machines

THEaiTRE: A theatre play written entirely by machines
A robot writing a script. Credit: Rosa et al.

Researchers at Charles University, Švanda Theater and the Academy of Performing Arts in Prague are currently working on an intriguing research project that merges artificial intelligence and robotics with theater. Their project's main objective is to use artificial intelligence to create an innovative theatrical performance, which is expected to premiere in January 2021.

"The main idea behind our study came from Tomáš Studeník, an innovator who noticed that the 100-year anniversary of the theater play R.U.R. is approaching," Rudolf Rosa, one of the researchers who carried out the study, told TechXplore. "This was a key moment for robotics, as the idea of a robot, including the word 'robot' itself, was invented by Karel Čapek and his brother Josef, who wrote this play. Tomáš thought that this should be properly celebrated and came up with the idea of turning the story around: 100 years ago, a man wrote a theater play about robots; what if today, robots wrote a theater play about men?"

Before they started working on their project, the researchers reviewed previous literature exploring the potential of artificial intelligence techniques for the creation of poetry, music, paintings, or other forms of art. While there are now a large number of papers focusing on machine-produced art, including some where computational techniques were used to produce dialogues or story ideas for theater plays, the automatic generation of an entire theatrical performance is a highly complex task that has rarely been attempted before.

THEaiTRE: A theatre play written entirely by machines
GIF of a robot writing a script. Credit: Rosa et al.

Rosa and his colleagues decided to split the production of their play into several sub-parts. Their plan is to use an approach dubbed 'hierarchical generation', which entails splitting the generation of a large body of text into smaller manageable parts. While other research teams used this approach to generate dialogues, scripts or other texts in the past, very few have tried to use it to produce an entire play.

"Thanks to the approaching anniversary, our main target is clear and fixed: by January 2021, we need to have a play ready for premiere," Rosa explained. "As it will be performed by a professional theater group, we need to have the script ready in September, so that there is enough time for dramatization, rehearsals, etc. Thus, even though we are developing a general tool for theater script generation, at the moment we only really need to generate one script."

So far, the researchers started experimenting with a pretrained language model called GPT-2. This is an open-source model developed by the OpenAI consortium and trained on a large amount of online English texts. The first results of their tests are outlined in a paper pre-published on arXiv.

THEaiTRE: A theatre play written entirely by machines
Rudolf Rosa. Credit: Rosa et al.

GPT-2 is a generative language model, which means that when adequately trained it can complete unfinished texts using similar language and covering related themes. For instance, if it is fed the first paragraph of a news article, the model will try to generate a few additional paragraphs on the same topic, using the existing text as a source of inspiration and yet also generating sentences about new concepts.

"When we fed GPT-2 a scene setting and a few lines of the drama script, it generated further lines in the same style and focusing on the topic of the input script chunk," Rosa explained. "This way, we did not have to train anything (yet), as we restricted the generator a bit to keep to the task and not to diverge elsewhere. We can thus make use of the great large GPT-2 model trained for a very long time on very large texts, which we could not afford ourselves to train on our hardware, as only the largest tech companies can train such models nowadays."

While the researchers' experiments using the pretrained GPT-2 model yielded promising results, the fact that they did not adapt the model or specifically trained it on theater scripts makes controlling its operation and performance harder. They now plan to fine tune GPT-2 by training it on existing theater scripts, as this is far more feasible for them than developing new language generation models and it should lead to the production of a better-quality script for their play.

THEaiTRE: A theatre play written entirely by machines
The team working on the project. Credit: Rosa et al.

"We also explicitly work with the human-in-the-loop concept," Rosa said. "Basically, all computer-generated 'art' (if we want to call it so) is touched and retouched by humans in some way, but often this is not very transparent. In our work, we are trying to be very explicit on what the machine does and what a human does, making their cooperation an integral part of the system design, not a post-hoc fix."

For the time being, Rosa and his colleagues kicked off their project by reviewing previous works and trying to identify the most effective approaches for producing theater play scripts. While they have decided what approach they want to use, they only just started applying it to the creation of their theater play.

"Our project is still in its early days, but we have been quite amazed at how well just the basic approach of utilizing pretrained GPT-2 model works," Rosa said. "We only fed it a few lines from a script and it picked up its genre, structure, topic and character names, using this information to generate more or less plausible lines. This was achieved without any adaptation or fine-tuning: we just used the model as it is available online for download, which shows that GPT-2 models really are quite powerful."

THEaiTRE: A theatre play written entirely by machines
Sample of a generated script. The first 6 lines are from the original R.U.R. script and are used as input for the generator, the rest was generated by pretrained GPT-2 model. Credit: Rosa et al.

At the moment, Rosa and his colleagues are still experimenting with what is known as 'flat text generation', where a machine learning model generates lines for a script individually, one at a time. However, they soon hope to start using hierarchical generation methods to create a brief summary of their play, expand it into a detailed synopsis and finally translate this synopsis into dialogues. Ideally, the they plan to use will generate a script that is both coherent and effective, following a common thread and yet also creating text with a clear meaning behind it.

"We also still need to ensure that the generated script is coherent and does not repeat or contradict itself, does not introduce new random characters too often, as well as minor but funny things such as preventing cases where a character leaves the scene but continues to speak," Rosa said. "Our first play should premiere in January 2021. We'll see how it goes and what the reception is and then hopefully our observations will drive our further research and development."

THEaiTRE: A theatre play written entirely by machines
A robot writing a script. Credit: Rosa et al

At this stage of their research, Rosa and his colleagues still think that robots taking part in their play will need substantial human supervision. In the future, however, they would like to produce a play that can be entirely acted out by robots, without any human performers or human guidance.

More information: THEaiTRE: Artificial intelligence to write a theatre play. arXiv:2006.14668 [cs.CL].

© 2020 Science X Network

Citation: THEaiTRE: A theatre play written entirely by machines (2020, August 3) retrieved 18 May 2024 from
This document is subject to copyright. Apart from any fair dealing for the purpose of private study or research, no part may be reproduced without the written permission. The content is provided for information purposes only.

Explore further

A language generation system that can compose creative poetry


Feedback to editors