Hierarchical Encoders for Modeling and Interpreting Screenplays (2021)

Abstract: While natural language understanding of long-form documents remains an open challenge, such documents often contain structural information that can inform the design of models encoding them. Movie scripts are an example of such richly structured text – scripts are segmented into scenes, which decompose into dialogue and descriptive components. In this work, we propose a neural architecture to encode this structure, which performs robustly on two multi-label tag classification tasks without using handcrafted features. We add a layer of insight by augmenting the encoder with an unsupervised ‘interpretability’ module, which can be used to extract and visualize narrative trajectories. Though this work specifically tackles screenplays, we discuss how the underlying approach can be generalized to a range of structured documents.

## introduction as natural language understanding of sentences and short documents continues to improve, interest in tackling longer-form documents such as academic papers @xcite , novels @xcite and screenplays (gorinski and lapata, 2018) has been growing. analyses of such documents can take place at multiple levels, e.g. identifying both document-level labels (such as genre) and narrative trajectories (how do levels of humor and romance vary over the course of a romantic comedy?). however, one key challenge for these tasks is the low signal-to-noise ratio in lengthy texts (as indicated by the performance of such models on curated datasets like narrativeqa @xcite ), which makes it difficult to apply end-to-end (e2e) neural network solutions that have recently achieved state-of-the-art on other tasks @xcite @xcite . ## script structure movie and television scripts (or screenplays) are traditionally segmented into scenes, with a rough rule of thumb being that each scene lasts about a minute on-screen. a scene is not necessarily a distinct narrative unit (which is most often a sequence of several consecutive scenes), but is constituted by a piece of continuous action at a single location. fig. 1 contains a segment of a scene from the screenplay for the pulp fiction, a 1994 american film. these segments tend to follow a standard format. each scene starts with a scene heading or 'slug line' that briefly describes the scene setting. a sequence of statements follow, and screenwriters typically use formatting to distinguish between dialogue and action statements @xcite . a dialogue identifies the character who utters it either on-or off-screen (the latter is often indicated with '(v.o.)' for voice-over). parentheticals might be used to include special instructions regarding dialogue delivery. action statements are all nondialogue constituents of the screenplay "often used by the screenwriter to describe character actions, camera movement, appearance, and other details" @xcite . in this work, we consider action and dialogue statements, as well as character identities for each dialogue segment, ignoring slug lines and parentheticals. ## hierarchical scene encoders the large size of a movie script makes it computationally infeasible for recurrent encoders to ingest these screenplays as single blocks of text. instead, we propose a hierarchical encoder that mirrors the structure of a screenplay ( §2) -a sequence of scenes, each of which is an interwoven sequence of action and dialogue statements. the encoder is three-tiered, as illustrated in fig. 2 , and processes the text of a script as follows. ## interpreting scene embeddings as the complexity of learning methods used to encode sentences and documents has increased, so has the need to understand the properties of the encoded representations. probing methods @xcite gauge the information captured in an embedding by evaluating its performance on downstream classification tasks, either with manually collected annotations @xcite or self-supervised proxies @xcite . in our case, it is laborious and expensive to collect such annotations at the scene level (requiring domain experts), and the proxy evaluation tasks proposed in literature do not probe the narrative properties we wish to surface. instead, we take inspiration from @xcite to learn an unsupervised scene descriptor model that can be trained without relying on such annotations. using a dictionary learning technique (olshausen and field, 1997), the model learns to represent each scene embedding as a weighted mixture of various topics estimated over the entire corpus. it thus acts as an 'interpretability layer' that can be applied over the scene encoder. this model is similar in spirit to dynamic topic models @xcite , with the added advantage of producing topics that are both more coherent and more interpretable than those generated by lda @xcite . ## evaluation we evaluate the proposed script encoder and its variants through two supervised multilabel tag prediction tasks, and a qualitative analysis via the unsupervised extraction of descriptor trajectories. ## related work computational narrative analysis of large texts has been explored in a range of contexts @xcite over the past few decades @xcite . recent work has analyzed narrative from plot @xcite and character @xcite perspectives. while movie narratives have received attention @xcite @xcite , the computational analysis of entire screenplays is not as common. notably, gorinski and lapata (2015) introduced a summarization method for scripts, extracting graph-based features that summarize the key scene sequences. gorinski and lapata (2018) built on top of this work, crafting additional features for a specially-designed multilabel encoder, while also emphasizing the difficulty of the tag prediction task. our work suggests an orthogonal approach using automatically learned scene representations instead of feature-engineered inputs. we also consider the possibility that at least some of the task difficulty owes not to the length or richness of the text, but rather to the complexity of the tag taxonomy. the pattern of results we obtain from a similarity-based scoring measure offers a brighter picture of model performance, and suggests that the standard multilabel f1 measure may not be appropriate for such complex tag sets @xcite . nevertheless, dealing with long-form text remains a significant challenge. one possible solution is to infer richer representations of latent structure using a structured attention mechanism @xcite , which might highlight key dependencies between scenes in a script. another method could be to define auxiliary tasks as in @xcite to encourage better selec-tion. lastly, sparse versions of the softmax function @xcite could be used to address the sparse distribution of salient information across a screenplay. ## conclusion in this work, we propose and evaluate various neural network architectures for learning fixeddimensional representations of full-length film scripts. we hypothesize that a network design mimicking the documents' internal structure will boost performance. experiments on two tag prediction tasks support this hypothesis, confirming the benefits of using hierarchical attention-based models and of incorporating distinctions between various scene components directly into the model. in order to explore the information contained within scenelevel embeddings, we present an unsupervised technique for bootstrapping scene "descriptors" and visualizing their trajectories over the course of the screenplay. for future work, we plan to investigate richer ways of representing character identities, which could allow character embeddings to be compared across movies and linked to character archetypes. a persona-based characterization of the screenplay would provide a complementary view to the current plot-based analysis. scripts and screenplays are an underutilized and underanalyzed data source in modern nlp -indeed, most work on narratology in nlp concentrates on short stories and book/movie summaries. this paper shows that capitalizing on their rich internal structure largely obviates the need for featureengineering, or other more complicated architectures, a lesson that may prove instructive in other areas of discourse processing. our hope is that these results encourage more people to work on this fascinating domain. cardinality. as illustrated by