Generación de historias a partir de un análisis temático de simulaciones
Abstract
El estudio directo de los temas como una métrica para valorar historias y como una herramienta para construirlas no ha tenido mucho uso en el campo de la generación automática de historias. El objetivo de este trabajo es diseñar un modelo temático tanto como métrica como sistema para extraer historias de un gran corpus de eventos. Para lograr esta tarea, se utilizará una simulación para generar los eventos, una implementación del modelo temático extraerá historias interesantes de él y los algoritmos de combinación de subtramas junto con una extensión del modelo se utilizarán para construir historias más complejas y cubrir las debilidades que el modelo temático presenta al extraer historias.
Full text
Generación de historias a partir de un análisis temático de simulaciones Story generation using thematic analysis over a simulation Trabajo de Fin de Grado Curso 2023–2024 Autor Pablo Cageao Honduvilla Director Pablo Gervás Gómez-Navarro Gonzalo Rubén Méndez Pozo Grado en Ingeniería Informática Facultad de Informática Universidad Complutense de Madrid
Generación de historias a partir de un análisis temático de simulaciones Story generation using thematic analysis over a simulation Trabajo de Fin de Grado en Ingeniería Informática Autor Pablo Cageao Honduvilla Director Pablo Gervás Gómez-Navarro Gonzalo Rubén Méndez Pozo Convocatoria: Junio 2024 Grado en Ingeniería Informática Facultad de Informática Universidad Complutense de Madrid 27 de Mayo de 2024
Dedicatoria A mi familia y compañeros, por apoyarme cuando entro en pánico porque no me da tiempo a entregar el tfg. v
Agradecimientos Gracias a mi familia, por el apoyo y la comprensión recibidos durante los últimos años de mi tiempo en la Universidad. A Pedro Pablo y Marco Antonio, por crear TeXiS e iluminar nuestro camino. Gracias a los directores de este proyecto, Gonzalo, por no entrar en pánico cuando se leyó la memoria 2 días antes, y Pablo, por hacer las preguntas correctas que han permitido la realización de este proyecto. vii
Resumen Generación de historias a partir de un análisis temático de simulaciones El estudio directo de los temas como una métrica para valorar historias y como una herramienta para construirlas no ha tenido mucho uso en el campo de la generación automática de historias. El objetivo de este trabajo es diseñar un modelo temático tanto como métrica como sistema para extraer historias de un gran corpus de eventos. Para lograr esta tarea, se utilizará una simulación para generar los eventos, una implementación del modelo temático extraerá historias interesantes de él y los algoritmos de combinación de subtramas junto con una extensión del modelo se utilizarán para construir historias más complejas y cubrir las debilidades que el modelo temático presenta al extraer historias. Palabras clave Generación de historias, Combinación de subtramas, Análisis temático, Métricas en generación de historias, Simulación. ix
List of tables 3.1. Example of idea acquisition from the features of events . . . . . . . . 20 3.2. Example of idea acquisition from the features of events after the change introduced to solve the problem in the representation of themes. the themes represented by *idea are the themes introduced to solve theproblem................................. 22 3.3. Possible description of the events in table 3.2 from Bob’s point of viewinsteadofAlice’s........................... 23 3.4. 20 Master Plots as presented by Tobias (2012), table extrated from (Gervásetal.,2015)............................ 27 xvii
Chapter 1 Introducción Toda historia tiene un tema, o una proposición subyacente que indica su tipo. El tema podría ser evidente y destacable, u oculto y vago; siempre está representado, y diferencia un tipo de historía de todos los demas. Sobre un tema se pueden contar infinidad de historias Cook (2011) En la última década, muchos avances en el campo de la generación de historias, es decir, el campo que estudia como generar historias automáticamente, han avanzado enormemente. A parte de ser un interesante ejercicio intelectual es una forma de construir maneras de presentar información de forma interesante lo que podría aliviar el problema de la sobrecarga de información o ayudar a personas con problemas de memoria. El estudio de los temas tanto como componentes indispensables a la hora de contar historias como elementos esenciales a la hora de descomponer, estudiar y, a partir de ello, crear nuevas historias, es usado por muchas obras muy influyentes como guias para diseñar historias originales, vease Cook (2011) o Lemon and Reis (1965), los han usado como punto de clasificación esencial, sin embargo, en mi investigación sobre el tema, he encontrado pocas aplicaciones directas de los temas a la generación automatica de historias con lo que he decidido dedicar este trabajo a estudiar la viabilidad de un sistema basado en temas para la generación de historias. 1.1. Motivación Citando a Lemon and Reis (1965) “La emoción enlazada a un tema juega un papel importante manteniendo el interes”. Como Lemon and Reis (1965) muchos otros trabajos literarios han defendido la importancia tanto de transmitir un tema en las obras artisticas (no necesariamente literarias, vease la interpretación musical 1
2Chapter 1. Introducción de Leavitt (2010)) como la de centrarse en el estudio de temas para construir nuevas historias, vease Cook (2011). Estos estudios sugieren la importancia de investigar esta ruta de generación de historias proceduralmente, tanto como heurista a la hora de juzgarlas como seleccionadora para construir tramas temáticamente consistentes a partir de eventos dados. Ademas, dada la naturaleza subtextual de los temas, permite transmitir información de forma más eficiente cuando se usan historias para este proposito. 1.2. Objetivo El objetivo de este trabajo es diseñar un modelo que represente la representación de temas en una historia y utilizarlo para construir un prototipo de una métrica que será capaz de medir qué tan bien una historia transmite una idea determinada y utilizarla para generar un conjunto de historias. Para la realización del proyecto, primero se elegirán algunos eventos y se utilizarán para generar una población considerablemente grande de eventos. Se desarrollará el sistema para estudiar, evaluar y extraer eventos basados en temas. Estos temas serán definibles por el usuario del sistema sin necesidad de cambiar el sistema, ya que los temas de una narrativa son subjetivos, el usuario debe poder definir los componentes basados en su propio entendimiento subjetivo. Esto significa que el sistema debe permitir modificaciones en todos los aspectos relacionados con los temas. De esta manera, se espera hacer el modelo temático altamente adaptable sin la necesidad de reescribir el código. Después de esto, se utilizarán algoritmos y heurísticas para combinar diferentes tramas, intentando mantener los temas con esta recombinación. Finalmente, las tramas completas se pasarán a algoritmos de generación de lenguaje natural utilizando tecnologías basadas en IA para hacerlas más digeribles. Aunque este proyecto se centra en aplicar la heurística a un gran corpus generado mediante simulación, se espera que la heurística pueda aplicarse para medir cualquier historia. 1.3. Estructura del documento Este trabajo se divide en 4 capitulos, en estos se expone los aspectos que se han considerado relevantes de este trabajo. La siguiente lista muestra un resumen de cada capitulo: En el capitulo 1, este capítulo, se introducen nociones básicas de lo que entenderemos por temas y su importancia así como los objetivos de este trabajo.
1.3. Estructura del documento 3 En el capitulo 2 se muestran trabajos previos en los campos de generacion de historias que se usaran en este proyecto así como en estudios narrativos necesarios para el diseño de los algoritmos descritos. El capitulo 3 describe el trabajo realizado con las ideas y razonamientos que lo acompañan. El capitulo 4 reflexiona sobre los objetivos conseguidos, compara el trabajo realizado con trabajos anteriores y propone posibles vias de investigacion para expandir el trabajo. Los apendices A, B y C contienen información sobre los datos concretos utilizados para las pruebas del proyecto y sus conclusiones. El Apéndice D contiene historias generadas por el sistema que se utilizarán para evaluarlo y encontrar sus debilidades y fortalezas en el capítulo 4.
Chapter 1 Introduction Every story has a Theme, or an underlying proposition that indicates its type. The Theme may be clear-cut and distinct, or shadowy and vague; it is always in evidence, and differentiates one type of story from all the other types. Around each Theme any number of distinctly different stories may be written. Cook (2011) In the last decade many advances in the task of story generation, that is, the automatic generation of stories, has advance greatly. Apart from being an interesting intellectual exercise, it is a way to construct methods to present information in an engaging manner, which could alleviate the problem of information overload or help people with memory issues. The study of the central ideas of a story, or themes, both as indispensable components when telling stories and as essential elements when breaking down, studying, and thereby creating new stories is used by many highly influential works as guides to design original stories. (Cook, 2011), (Lemon and Reis, 1965) have used themes as an essential classification point. However, few direct applications of themes in the field of automatic generation of stories have been found. To palliate this deficit this work will be studying the feasibility of a theme-based system for story generation. 1.1. Motivation Citing (Lemon and Reis, 1965) “The emotion attached to a theme plays a major role in maintaining interes”. Like Lemon and Reis (1965), many other authors have defended the importance of conveying a theme in artistic works, not necessarily literary (Leavitt, 2010), as well as focusing on the study of themes to construct new stories (Cook, 2011). These studies suggest the importance of investigating this 5
6Chapter 1. Introduction route of procedural story generation, both as a heuristic for judging them and as a selector for constructing thematically consistent plots from given events. Additionally, given the subtextual nature of themes, it allows for more efficient information transmission when stories are used for this purpose. 1.2. Objectives The objective of this work is to design a model representing the representation of themes in a story and use it to build a prototype of a metric which will be able to measure how well a story conveys a certain idea and use it to generate a set of stories. For the realization of the project, first, some events will be chosen and they will be used to generate a considerably large population of events. The system will be developed to study, evaluate, and extract events based on themes. These themes will will be definable by the user of the system without the need to change the system, as the themes of a narrative is subjective the user must be able to define the components based on their own subjective understanding, this means the system should allow for modifications of all the aspects regarding the themes. In this way, it is expected to make the thematic model highly adaptable without the need to rewrite code. After this, algorithms and heuristics will be used to combine different plots, trying to maintain themes with this recombination. Finally, the complete plots will be passed to natural language generation algorithms using AI-based technologies to make it more digestible. Although this project is concerned with applying the heuristic to a large corpus generated via simulation, it is expected that the heuristic can be applied to measure any story. 1.3. Structure of the Document This work is divided into 4 chapters, in which the aspects considered relevant to this work are presented. The following list shows a summary of each chapter: In chapter 1, this chapter, basic notions of what we will understand by themes and their importance, as well as the objectives of this work, are introduced. In chapter 2, previous works in the fields of story generation used in this project, as well as narrative studies necessary for the design of the described algorithms, are presented. Chapter 3 describes the work done with the accompanying ideas and reasoning.
1.3. Structure of the Document 7 Chapter 4 reflects on the achieved objectives, compares the work done with previous works, and proposes possible research avenues to expand the work. Appendices A, B, and C contain information about the specific data used for the project’s tests and their conclusions. Appendix D contains stories generated by the system which will be used to evaluate it and find its flaws and strengths in chapter 4.
Chapter 3 Description of the system The objective of this work is to define a metric to measure the relevance of themes in a story and to use that metric to extract a story from a large corpus of events generated using a simulation. This work is divided into four distinct tasks, each with its own section, a schematic representation of this division can be found in figure 3.1: First section: Explains the authoring process followed to decide the events and the way they are combined to form the event list from where to extract stories. This step returns a considerably long list of events. Second section: This section is where the largest contributions of this work reside, it describes the thematic model and its application to the extraction and evaluation of stories from the event list. It returns a list of possible plots with thematic evaluations from the events generated in section 1. Third section: Describes methods and metrics to combine different plots and create more complex stories from the list of plots received from section 2 and an application of the thematic model to multi plot stories. It returns a more complex list of plots with a similar structure as the one received. Fourth section: Describes the generation of natural language from the narrative generated in section 3. 3.1. Events and their generation The first part of this project consist in the generation of a large corpus of events. In order to achieve both temporal and causal consistency between a large amount of events, a computationally cheap simulation has been required. The simulation guarantees the consistency while its low computational cost allows the generation of a large number of events in a relatively low time. To build the simulation a group of events to be simulated and an engine to run the simulation have been chosen. 15
16 Chapter 3. Description of the system Figure 3.1: Schematic representation of the pipeline describing the story generation system designed in this work 3.1.1. Event selection Even though a thematic analysis does not restrict us to a concrete granularity, the events have been restricted to simple but important events in the lives of characters which could be described with a single verb such as “Alice and Bob have a child named Charly”. On one hand, a granularity too high, that is, dividing the story in too simple components, words for example, as the minimum unit of the simulation, would reduce the amount of information contained in the corpus of events and, more importantly, this information would be too simple to express any significant meaning on their own. A thematic analysis on information of this kind, even if possible, would require an holistic analysis in the meaning of multiple events as a unit, which is out of the scope of this project. On the other hand, events such as “Alice fights a hard battle with her conscience; she finds it a losing battle and makes an important revelation in order that she may achieve peace of mind”1are usually designed with a certain purpose in a story and as such have been designed to convene a certain theme. An analysis made on a corpus built with the desired objective in mind would be pointless. 1Event extracted from (Cook, 2011)
3.1. Events and their generation 17 The simulations proposed in (Martin et al., 2018) and (Chen et al., 2021) are interesting as they suggests using neural networks and a huge dataset of stories to generate events and probabilities for the simulation , this approach comes closer to the idea of comparative motif as element repeated in many stories described in (Lemon and Reis, 1965) but uses many stories with well defined themes which would interfere with the thematic analysis this project is conducting. For this reason a simple authored approach has been used, rewriting and expanding the list of events defined in (Johnson-Bey et al., 2022) to allow for a greater expressivity in the stories generated. A description of the events and the actors required in those events, implemented as a plugin of the system described in (Johnson-Bey et al., 2022), can be found in the Appendix A. 3.1.2. Inference engine The system described in (Johnson-Bey et al., 2022) has been used to generate the events to be processed. It computes events fast as it manifest them randomly where the probability of an event appearing is given by the mean of a base probability, the probabilities described in preconditions. For example an event describing a character A stealing money from a character B may be described as: A s t a e a l s money from B: base probability =0.2 precondition name : A doesnt l i k e B pro b a b i l i t y : 1−how much A l i k e s B normalized precondition name : A needs the money pro ba bi li ty : i f A needs money ignore e l s e 0.01 In this example if the love A professed B was very low, represented as a 0.1 out of 1 for example then if A needed money the probability for A to steal from B would be (0.9+0.2)/2=0.55 but if A did not need money the probability would be (0.9 + 0.2 + 0.01)/3=0.37. The simplicity of the system makes adding or rewriting events in it simple, making this simulation convenient for experimentation. There are simulations based on generative AI, such as the one presented in (Park et al., 2023), which are more complex and expressive than the one used in this project, but the complexity adds a difficulty in adding and removing events, a significant increase in computational time and they present an undesirably high granularity. The simulation models defined as compromises between the simulation and the author-centric approaches are immediately discarded because they would compromise the results of the evaluation under the thematic model as many author-centric techniques are designed using prior narrative works defined to convey a concrete theme.
18 Chapter 3. Description of the system 3.2. Thematic engine When building a thematic engine the desired system should be able to measure and satisfy the requirements listed in section 2.2.1, that is, the system must extract textual and sub-textual motifs from the atomic elements of the story and infer themes from their combination in chronological order. The repetition of motifs must be an important factor in the calculation of the relevance of a theme. Motifs have been defined by the events of the story as suggested by Lemon and Reis (1965) and Leavitt (2010). Given the subjective nature of the themes of a story, an AI-based algorithm would not be an efficient option for our system as each interpretation of themes would require the construction of a personalized dataset which would make the authoring process severely inefficient. For this reason a more traditional approach inspired by (Hargood et al., 2010) has been used. 3.2.1. Representation of themes When representing themes, the representation found in (Hargood et al., 2008), (Hargood, 2009), (Hargood et al., 2010) and (Hargood et al., 2018) is an interesting starting point which draws heavy inspiration from (Lemon and Reis, 1965). This model assumes the story is compiled from small segments of narrative, also known as Narrative-atoms or natoms, for example a paragraph or a word, in this project the events defined in the simulation could be considered these small segments of narrative which compose the story. These natoms are rich with information but the model would only have access to the meaning provided by the author, this meaning is what will be called features. A single natom could contain a myriad of features as there may be more than a single interpretation to the meanings presented in an action, even under a single reader’s perception, for example the action “Alice kills Bob” could evoke the corruption of Alice if she was a morally righteous character until this point or a sense of loss if we knew Bob had a lover waiting for him. The meanings contained in the natoms convey simple ideas, motifs, important for the entire story, the motif represented by “Alice kills Bob” could be “tragic love” for example if we knew bob had a lover waiting for him, was in love or, more generically, the theme of “love” was an important part in Bob’s story. The repetition of basic ideas, or motifs, along a story would, in turn, convey a broader idea encompassing the whole story, in other words, the repetition of motifs convey a theme. For example the repetition of motifs such as “corruption”, “broken truth” or “injustice” would create a story whose main theme may be described as “The dark nature of life”. The main theme of a story can be inferred from other themes and motifs, for example if the idea of “hope” can be found in a story about “The dark nature of life” the main theme could be reinterpreted as “Hope in the darkest of places”. An schematic representation of this model can be found in the figure 3.2.
3.2. Thematic engine 19 Figure 3.2: Model described in (Hargood et al., 2010) for the representation of themes The distinction between motifs and themes both in (Hargood et al., 2008) and (Lemon and Reis, 1965) is mostly reduced to the number of natoms needed to represent an idea, if a single natom could represent an idea, that idea is a motif, meanwhile, if a series of natoms is necessary to convey an idea, that idea is a theme. In this context the idea of “tragic love” described in a previous example would be closer to a theme than to a motif as it needs both a feature from where to infer “love” and a feature from where to infer “tragic love” if “love” has already been inferred. This model allows a convenient separation between events and ideas through the concept of features, making the features from where to infer motifs and themes the center of the authoring process while the ideas, motifs and themes, are the building blocks of the central idea of a story and, as such, the main components in its analysis. The story presented in 3.12can be used as an example of the model in action. The features and ideas used in the example are not necessarily the best at valuing the story but a possible definition intended to make the example easy to follow. We can see the motif “love” has been generated by the features of the natoms “Alice develops a crush for Bob” and “Alice and Bob dissolve their enmity” while the theme “power_of_love” has been formed by the combination of the motif "love" and the 2This is a simplification of a story generated with an early model of the one presented in this work.
20 Chapter 3. Description of the system seen ideas event (natom) features 1 Alice and Bob became enemies enmity if war: evils_of_war 2 enmity Alice develops a crush for Bob love 3 enmity love Bob goes to war war 4 enmity love war Alice and Bob dissolve their enmity if love: power_of_love love enmity love war love power_of_love power_of_love Table 3.1: Example of idea acquisition from the features of events feature of the natom “Alice and Bob dissolve their enmity”. The ideas presented by the end of the narrative would be “enmity”, “love”, “war”, “love” and “power_of_love”, of which the themes and motifs “enmity”, “love” and “love” would form the theme “Complex relationships”. The repetition in the ideas found is important as repetition of an idea is what generates a theme but this will be further explore in the next chapters. 3.2.2. Implementation of the inference of motifs The model proposed by Hargood et al. (2008) and Lemon and Reis (1965) is highly theoretical and as such an implementation is needed. Hargood et al. (2018) Defines an implementation intended for the analysis of themes in images, as defined in (Lemon and Reis, 1965), images are descriptive works, works with no temporal nor causal relationship between their ideas, as opposed to stories like the ones studied in this work, where the study of themes in their context is essential. For the implementation, the minimum elements of the story, or natoms, has been defined as the events generated by the simulation, every natom has features: textual or sub-textual information about the motifs it represents, which can be defined by the user of the system. The features define both the motifs, as ideas always extracted from an event, and the themes, in the form of conditional ideas only manifesting if the required ideas have been found before. This distinction allows the author to define ideas instead of having to deal with the abstract distinction between themes and motifs. For this approach to work, the model needs to process the story sequentially to maintain the order. It carries a multiset of found motifs at every step. The themes
3.2. Thematic engine 21 Figure 3.3: Schematic representation of the implementation of the thematic model proposed in this work. would not be able to manifest if the required motifs are not found in the multiset, the motif “tragic love” could not be found without the motif "love" in the multiset for example. A main theme, the main idea to evaluate the story on, is defined as a set of ideas, for example, one main theme to be evaluated in a story could be “The dark nature of life” which would be represented by the motifs and themes “corruption”, “broken truth” and “injustice” while the theme “tragic love” could be defined by the single idea “tragic love”. An schematic representation of the implementation can be found in the figure 3.3. Repetition must be the basis to evaluate the relevance an idea has in a story as stated in (Leavitt, 2010). For an idea to stand out, it must appear significantly between the ideas of a story, that is, repetition should be measured as a proportion between desired ideas and found ideas in the story. If the idea of war would appear only once in a story with thousands of ideas, it would be difficult to infer “war” is the theme of the story, meanwhile, if the story only had two ideas and one of them was “war”, it would be natural to think the main theme of the text has something to do with war. Under this assumption, themes, which require of other motifs and themes to manifest, are evaluated with a considerable disadvantage, as most of the ideas comprising the themes are spent on preparation and are not counted when calculating the proportion. Consider the example given in table 3.1 where “power_of_love” is clearly a main theme because the story has been building to its apparition by introducing love and enmity, but only counts with a single appearance and as such would not be considered an important idea. To solve the problem of the representation of themes, the ideas generating a theme which were already instantiated when the last instance of the theme is being instantiated are duplicated as instances of the theme.
22 Chapter 3. Description of the system seen ideas event (natom) features 1 Alice steals Bob’s car selfishness if selflessness: corruption 2 selfishness Alice gifts money to Bob selflessness if selfishness: redemption 3 selfishness selflessness redemption *redemption Alice steals Bob’s treasure selfishness if selflessness: corruption 4 2 selfishness selflessness redemption *redemption corruption *corruption Alice gifts a treasure to Bob selflessness if selfishness: redemption 5 2 selfishness 2 selflessness 2 redemption corruption *corruption 2 *redemption Alice gifts a car to Bob selflessness if selfishness: redemption 2 selfishness 3 selflessness 3 redemption corruption *corruption 2 *redemption Table 3.2: Example of idea acquisition from the features of events after the change introduced to solve the problem in the representation of themes. the themes represented by *idea are the themes introduced to solve the problem. An example of the solution can be seen in the table 3.2. In step 2 one “*re- demption” is added because “selfishness” produces “redemption” and there has been found one instance of “selfishness” when “redemption” was found. in the step 3 one instance of “selfishness” has been added but the extra instances of “*redemption” are not updated as they are only updated when a new instance of “redemption” is found which happens in step 4. In step 5 a new instance of “redemption” is found and as such the extra instances “*redemption” are updated, but because the number of instances of ‘selfishness” remain the same so do the number of instances of “*redemption”. The theme associated with an action is dependant on the actor we are following. The ideas produced by Alice making the robbery in “Alice steals Bob’s car” may be something similar to ”selfishness” while the ideas associated with Bob being robbed could be something closer to “tragedy” or “loss”. This information must be taken
3.2. Thematic engine 23 seen ideas event (natom) features 1 Alice steals Bob’s car loss if friendship: broken_trust 2 loss Alice gifts money to Bob fortune 3 loss fortune Alice steals Bob’s treasure loss if friendship: broken_trust 4 2 loss fortune Alice gifts a treasure to Bob fortune 5 2 loss 2 fortune Alice gifts a car to Bob fortune 2 loss 3 fortune Table 3.3: Possible description of the events in table 3.2 from Bob’s point of view instead of Alice’s. into account when defining the features and evaluating the ideas. For this reason a multiset of themes similar to the one used for the entire story before will be given to each character in the story, and the evaluation of a theme would be carried out with stories where all the actions involve a protagonist, the most prominent character in a story. This interpretation is similar to the one adopted by (Lemon and Reis, 1965) because “the protagonist, rather, is the result of the formation of the story material into a plot”. This reduces the complexity a story can take to a set of events following a single character, but the algorithms in section 3.3 will restore the complexity removed with this concession. While the example presented in table 3.2 would be the one generated by Alice, the example found in table 3.3 would be the ideas generated from Bob’s point of view. The features are represented as a map with the keys being an identification of the type of event and the values a set of unconditional and conditional motifs, the unconditional motifs are represented as a map with key role_of_actor being the role of the actor these ideas are going to affect and value [idea_generated] being a list of ideas added to the multiset of ideas of the actor, and the conditionals are represented as a map with key role_of_actor being the role of the actor these ideas are going to affect and value a list of (conditions_ideas, idea_generated) where conditions_ideas is a list of motifs, this last tuple represents the following instruction: i f condition_idea present in the idea multi set of the actor \ whose r o l e i s role_of_actor in t h i s action \ f o r every condition_idea in condition_ideas : add idea_generated into the actor ’ s multise t These features are generated from a JSON file where they are codified with the following structure: { "event_name " : { " co n d i tio n a l ": {
30 Chapter 3. Description of the system 3.3.3. Thematic model application to the valuation of stories with multiple protagonist Using the interpretation of suspenseful events as events with ideas opposing the main theme of the story a metric to value stories with multiple protagonists can be designed. When evaluating this stories three things must be taken into account: 1. It is important for the theme of every protagonist to remain consistent, this means the thematic value of each subplot defined as all the actions of a protagonists must be taken into account. 2. The themes of the protagonists should not clash with each other, in other words, the themes of the protagonists must be compatible in pairs. Compatibility could be defined using the intersection of ideas between themes, but two similar themes could be defined with different ideas, “love” comprised of the idea“love” and “character growth” comprised of ”redemption“ and “friendship” for example, or two opposing themes could have ideas in common, “love” and “tragic love” for example. For this reason the relationship between main themes has been left as part of the authoring process. 3. How the themes of the different subplots interact with each other must be taken into account. In this problem the interpretation of suspenseful events as events with ideas opposing the main theme of the story comes into play. Let OP, named from opposing events, be the set of events in which a protagonist is playing a role where an idea opposing the main theme of that protagonist is generated. a metric could be calculated as #|OP ∩events preceding a change in protagonist| #|OP| Considering the points stated above a metric for stories with multiple protagonist could be defined as the mean between the values of the themes of each protagonist and the metric defined as a thematic interpretation of suspense. 3.3.4. Genetic algorithm for subplot combination The easiest model to directly apply to a simulation based story is the subplot combination using genetic algorithms described in (Gervás et al., 2022a), (Gervás et al., 2022b) and (Gervás et al., 2023). In their genetic representation they order the different subplots they want to merge and cycle between them when changing subplot. The genes are defined as 2 vectors of length the total number of events in the plot, the first vector, defined as “vector of genes for subplot4change” with a 1 in the position of an event when the next event is from another subplot and 0 otherwise. The second vector, defined as “Vector of genes on number of subplots to skip on change” which has an element for each one on the “vector of genes for 4in their work they refer to the subplots as AoI(Axes of Interest) because the subplot combination is an intermediate step in their story generation approach and as such are not yet completely formed subplots.
3.3. Subplot planning and combination 31 Figure 3.4: Image extracted from (Gervás et al., 2023) representing the way they codify the subplot combination problem into genes for a genetic algorithm. subplot change”, this element nrepresents a change to the next nsubplot in the list, if it reaches the end of the list it starts again. An example of the model can be found in figure 3.4. By defining the plots this way they can make sure when a 1 is found in "vector of genes for subplot change" the subplot changes as long as no element of "Vector of genes on number of subplots to skip on change" is bigger or equal to the number of subplots. They use an integer to represent the starting subplot, which we will not need as it will be the main subplot, the subplot of the main character, and a third vector to define the characters who are not yet instantiated in their model, as this is not the case in this model this third vector will be omitted. The function to generate random genes has been simplified from the original paper to better suit a set of already constructed plots as some extra steps were required for the starting subplot gene and the third vector which are not required in this work: For the vector of decisions on whether to switch, random choice between 0 and 1 is suitable. For the vector of decisions on skip size at each switch, random choice between 1 and N-1 (with N the total number of plots being combined) is suitable. The mutation of this algorithm is equally simplified from the original paper and defined by the following operations: For the switch point vector, values at a single point chosen at random are mutated. For the skip size vector, values at a single point chosen at random are mutated to a value chosen at random within the required range. The new combination is defined in the following way:
32 Chapter 3. Description of the system For the switch point vector, a point in the vector is chosen at random and the corresponding halves of the vectors for the two individuals are swapped over. For the skip size vector, a point in the vector is chosen at random and the corresponding halves of the vectors for the two individuals are swapped over. This methods does not ensure a the number of events in a subplot is maintained, that means the gene may require the event number n+10 of a subplot with nevents, to avoid this a post process after each of the previous operations will be ran: Whenever a subplot is in its last event a 1 will be written in the “Vector of genes on number of subplots to skip on change” and a one will be written on the "vector of genes for subplot change". Whenever a subplot is going to change to an empty subplot 1 will be added to the “Vector of genes on number of subplots to skip on change”. 3.3.5. Implementation of subplot combination With the subplots created in section 3.2.5 the combination process can be implemented. Firstly, possible subplots to be combined must be selected, when experimenting with the model only two subplots of less than thirty events each have been combined at once to ensure fast readability of the stories, but any number of subplots may be combined with the methods described in this section. To consider subplots apt for combining they must satisfy: The intersection of characters between all the subplots must be above a certain threshold. The percentage of appearance, that is, the percentage of events in which it appears, of one of the protagonists (the one we are calling main character) must be above the percentage of appearance of any other character by a certain threshold. The protagonists who are not the main character must appear in the main character’s subplot after their subplots have ended. The main themes of all the subplots must be related, for that a set of pairs are defined in appendix C where a pair of themes will be related if a pair containing both is in the set. When creating the tuples it must be assured the events of each subplot are independent, in the case of intersection the longer subplot will be the only one to maintain the event as the longer a subplot is the more principal it is, being the longest subplot the one called the main subplot. Once the tuples have been formed, the genetic algorithm described in the previous section will be applied to combine them. The fitness function to evaluate the possible combinations will be defined in the following way:
3.4. Generating natural language to express plots 33 1. The themes of the subplots and their evaluations will be retrieved. 2. For each character, the tension will be measured as the number of events generating ideas opposing the main theme of a character involved in the event where a jump is taken divided by the number of events generating an idea opposing opposing the main theme of a character involved in the event, if no motif opposing the theme exists in the story the value of this metric will not be taken into account. 3. The time consistency will be measured similarly to how (Gervás et al., 2023) measures it: Assigning 1 to any precedence constraint that is met (for A + B, A appears before B in the discourse sequence). If a required precedence constraint is not met, a partial score between 0 and 1 is assigned corresponding to the number of positions that one of the elements would need to shift for the constraint to hold (normalised over the length of the sequence). The average of all sequencing constraints is taken as the total sequencing score. 4. Finally, the mean of the scores will be taken to decide a final score. 3.4. Generating natural language to express plots The events generated are capable of representing the narrative but to make the narrative more digestible a presentation is necessary. For this the AI model Chat- GPT3 will be used. The model will be given a description of every event and the roles each actor plays in them, similar to the descriptions shown in appendix A and a simple textual representation of the events which form the narrative. The representation has been asked with the following query: Narrate t h i s s et of events , no extra information must be added , the dates are i r r e l e v a n t , add conectors between the sentences
Chapter 4 Conclusiones y trabajo futuro A lo largo de este trabajo se ha presentado tanto una métrica para medir temas en historias que siguen a un único personaje y una ampliación para historias con varios personajes, como una aplicación de esta a la extracción de historias interesantes a partir de eventos. Ya solo queda explicar la situación actual del trabajo, discutir su viabilidad y proponer caminos sobre los que expandir esta investigación para, con suerte, generar ideas fructíferas para el campo de la generación de historias. El trabajo, en su estado actual, Es capaz de evaluar historias con uno o varios protagonistas. Este modelo permite al autor introducir sus conceptos de ideas importantes para una historia así como sus temas principales y relaciones de complementariedad y oposición entre estos para estudiar narrativas. Algo menos fructífero ha sido el uso del modelo para la extracción de historias ya que, aunque funcional, la calidad de las historias generadas no es comparable a la de sistemas mas completos. Esto se discutirá con mas detalle en la próxima sección. 4.1. Conclusiones sobre el estado actual del modelo Las historias generadas por este sistema, aunque a veces puedan llegar a ser interesantes, no pueden compararse a trabajos anteriores como (Swartjes and Theune, 2008). En el apéndice D se pueden encontrar tres ejemplos de historias generadas con este sistema. Como se puede ver en el ejemplo D.1 las modificaciones en la métrica para evitar múltiples acciones repetidas no fueron suficientes para eliminar el problema completamente. Es bastante probable que esto se deba a una combinación de una probabilidad muy alta para ciertos eventos en la simulación, y una definición de característica e ideas que favorecen la aparición de estos eventos. Siendo este el caso, es probablemente un error fácilmente subsanable sin cambios significativos en el modelo gracias a la facilidad de edición de características y temas. Un error más esencial se puede ver en el ejemplo D.3. Se trata de una historia 35
36 Chapter 4. Conclusiones y trabajo futuro perfectamente funcional que ha representado dos temas a la perfección, sin embargo, un tema bien definido no hace necesariamente a la historia interesante. Un buen tema es necesario para generar una historia interesante pero no es suficiente. Este problema es una consecuencia de depender casi por completo del modelo temático para generar la historia, decisión tomada específicamente para poder hacer estas valoraciones. Desde un punto de vista más positivo, es un problema muy interesante para una posible continuación de este proyecto. Un punto en el que el sistema ha funcionado mejor de lo esperado es el ilustrado en el ejemplo D.2. El cambio de subtrama en la boda del personaje trágico es muy efectivo, la boda de Dakota genera ideas de felicidad que contrastan con su inevitable tragedia. Esto sugiere que las suposiciones hechas para el análisis temático de historias con varios protagonistas, en especial aquella que relaciona suspense y oposición de temas, no van desencaminadas. El modelo temático como componente independiente, por otro lado, ha resultado bastante efectivo. Es más flexible que modelos anteriores y permite una mayor expresividad de historias. Cumple con creces los objetivos propuesto, un modelo capaz de valorar el enfoque temático de una historia, no restringido por el número de protagonistas, y fácilmente editable por un autor gracias a la cantidad de información expresable en archivos auxiliares como los descritos en los apéndices B y C. A pesar de que el modelo cuenta con mucha expresividad y es fácilmente personalizable, carece de toda la expresividad que se podría tener pues, eventos, temas y rol de los actores, no son siempre información suficiente para considerar el valor correcto de un tema. Véase el ejemplo 3.1 donde el hecho de que aparezca la enemistad entre Bob y Alice le da mucha relevancia al momento en que esta acaba, pero esto no puede ser capturado con temas generales. Las ideas generadas por un evento no solo dependen del evento, otras ideas encontradas antes y el rol del personaje en el evento. Información de contexto, como quienes tienen otros roles en el evento y que relación hay entre los personajes, son piezas clave para entender las ideas generadas que este modelo es incapaz de estudiar. 4.2. Comparación con el estado del arte Considerando la relevancia que han tenido trabajos pasados para el desarrollo de este es interesante discutir que aportaciones se ha hecho en este trabajo y el resultado de estas en comparación con trabajos pasados. 4.2.1. Comparación del modelo temático propuesto con otros modelos En el campo de la generación de historias y la clasificación de estas por el estudio de temas literarios el trabajo realizado es poco y disperso. Como se comentó en el capitulo 2 esto se puede deber a varias razones, principales probablemente
4.3. Trabajo futuro 37 siendo la falta de un consenso sobre una definición de tema de una historia, tanto a nivel narrativo como computacional, la falta de interés debida a la prominencia de modelos basados en extrapolación de otras historias con temas integrados por un autor humano previamente, y la subjetividad de temas, entendidos como ideas importantes para una narrativa. Trabajos como Maria et al. (2000) usan una interpretación mas superficial del tema prescindiendo del subtexto y evaluando las ideas textuales. Estas suposiciones hacen que puedan definir un modelo relativamente objetivo usando redes neuronales, como tal es más rápido de configurar, pues apenas requiere configuración y más simple pues es construido sobre modelos ya conocidos de redes neuronales. A cambio es un modelo muy poco flexible pues para introducir nuevos temas se requiere de generar y entrenar un nuevo conjunto de datos y tiene dificultades para analizar el subtexto de una obra artística. De entre los trabajos sobre el estudio computacional de los temas con los que se podría hacer una comparación, los estudios de Hargood et al. (2018) son los más cercanos a lo que se ha hecho en este proyecto. Su modelo, aunque inicialmente pensado para el análisis de historias ((Hargood et al., 2008),(Hargood, 2009)), esta diseñado e implementado para el análisis de imágenes (Hargood et al., 2010). Su modelo es igual de expresivo que el comentado en este trabajo salvo por los componentes causales y temporales. Al ser un modelo diseñado para imágenes, que no contienen información temporal ni causal, esa información no puede ser representada por su modelo. Su implementación es una interpretación más literal de las ideas de Lemon and Reis (1965) y por ello hacen el modelo conceptual ligeramente más simple, pero con ello hace el trabajo de autoría mas complicado pues, como se ha visto en este trabajo, la distinción entre tema y motivo no es tan clara en la practica y forzarla sobre el modelo complica el trabajo del autor. Un ultimo grado de expresividad que añade este trabajo sobre el anterior es la generada por la hipótesis de que el tema no es independiente de la presentación de la historia, en el modelo introducido en este trabajo se ha hecho encape en forzar una distinción del punto de vista de una acción a la hora de asignarle un tema, una distinción inexistente en trabajos anteriores. En cuento a la interpretación de suspense utilizada en este trabajo, no es tan efectiva como la propuesta en (O’Neill and Riedl, 2014) en la que se basa, pero es otra heurística que puede ser complementable y podría llegar a ser más fácil de implementar. Parece un campo de estudio prometedor. 4.3. Trabajo futuro Como se ha visto en las secciones anteriores, aunque se han hecho avances sobre trabajos anteriores estas ideas y tecnologías están lejos de alcanzar su máximo potencial. En esta sección se introducirán posibles aplicaciones para el sistema actual
38 Chapter 4. Conclusiones y trabajo futuro y posibles vías de investigación que seguir para mejorarlo. 4.3.1. Posibles aplicaciones para el modelo temático La aplicación mas evidente es continuar con el trabajo descrito en este documento y usar el modelo temático para mejorar y estudiar historias generadas por otros modelos. Pues el mayor error en la generación de historias de este trabajo es depender casi exclusivamente del modelo temático para la extracción de historias. El modelo temático se puede usar, y podría llegar a ser una herramienta poderosa, como métrica para la evaluación de otras historias. Aunque para ello unos eventos más expresivos y un estudio literario profundo de temas serán necesarios, por suerte el modelo hace ambas cosas muy sencillas de cambiar lo que permitirá bastante experimentación. Por ultimo la aplicación del modelo como métrica de suspense podría ser una aportación interesante al campo de combinación de subtramas. 4.3.2. Mejoras propuestas para el sistema En lo que respecta a la extracción de eventos usando el modelo temático, tres tareas requieren un importante estudio. Para la obtención de eventos usar más variedad de eventos y sistemas mas expresivos como el descrito en (Park et al., 2023) o los descritos en (Martin et al., 2018) y (Chen et al., 2021) podrían mejorar considerablemente el sistema. Un estudio de ideas eficaces para expresar información importante sobre una narrativa será necesario. Sistemas auxiliares y métricas probadas deben ser aplicadas para hacer la extracción viable pues mantener un tema, aunque necesario, no es suficiente para garantizar una buena historia, véase el ejemplo D.3. Cuando se combinen historias hay muchas formas que no se han podido valorar en este trabajo para añadir profundidad, como la introducción de una subtrama cuya única tarea sea añadir contexto como se sugiere en (Porteous et al., 2016). Se ha de dedicar mas investigación a la presentación de los eventos. Para la mejora del modelo temático es necesario dar mas expresividad a la definición de ideas, muchas ideas son incompletas si no pueden tener en cuenta las situaciones que llevan a esas acciones, y otras ideas anteriores no son siempre información suficiente. El contexto, como se conocen los actores, que relación tienen, porque esta ocurriendo dicha acción,... Es una parte esencial del tema que debe ser estudiada.
4.3. Trabajo futuro 39 El estudio literario sobre como se comportan los temas es muy amplio y es bastante probable que ideas importantes no se hayan encontrado y usado en este trabajo con lo que más investigación es necesaria. También es importante considerar la forma en la que los lectores absorben información para juzgar correctamente la efectividad de las ideas generadas por un texto, para esto la aplicación de estudios psicológicos como el presentado en (Zhang, 2005) puede resultar muy beneficioso para un avance en el modelo. Finalmente un modelo temático completo debería tener la capacidad de estudiar como se asocian temas en una historia internamente, por ejemplo, el tema de la navidad queda asociado al personaje Ruby Sunday por repetición en la serie británica de televisión Doctor Who, siempre que aparecen motivos navideños como la nieve se sabe que en ese momento algo relacionado Ruby esta teniendo lugar. El modelo, en su estado actual, no es capaz de valorar referencias temáticas internas en una historia directamente.
Bibliography Bernstein, M. (2001). Card shark and thespis: exotic tools for hypertext narrative. In Proceedings of the 12th ACM conference on Hypertext and Hypermedia, pages 41–50. Booker, C. (2004). The seven basic plots: Why we tell stories. A&C Black. Chang, H.-M. and Soo, V.-W. (2008). Simulation-based story generation with a theory of mind. Chen, H., Shu, R., Takamura, H., and Nakayama, H. (2021). Graphplan: Story generation by planning with event graph. arXiv preprint arXiv:2102.02977. Cook, W. (2011). PLOTTO: the master book of all plots. Tin House Books. Figgis, M. (2017). The Thirty-Six Dramatic Situations. Faber & Faber. Garbe, J., Kreminski, M., Samuel, B., Wardrip-Fruin, N., and Mateas, M. (2019). Storyassembler: an engine for generating dynamic choice-driven narratives. In Proceedings of the 14th International Conference on the Foundations of Digital Games, pages 1–10. Gerrig, R. J. and Bernardo, A. B. (1994). Readers as problem-solvers in the experience of suspense. Poetics, 22(6):459–472. Gervás, P. (2019). Generating a search space of acceptable narrative plots. In 10th International Conference on Computational Creativity (ICCC 2019). UNC Charlotte, North Carolina, USA. Gervás, P., Concepción, E., and Méndez, G. (2022a). Evolutionary construction of stories that combine several plot lines. In International Conference on Computational Intelligence in Music, Sound, Art and Design (Part of EvoStar), pages 68–83. Springer. Gervás, P., León, C., and Méndez, G. (2015). Schemas for narrative generation mined from existing descriptions of plot. In 6th Workshop on Computational Models of Narrative (CMN 2015). Schloss-Dagstuhl-Leibniz Zentrum für Informatik. 47
48 BIBLIOGRAPHY Gervás, P., Méndez, G., and Concepción, E. (2022b). Evolutionary combination of subplot patterns into meaningful plots. Gervás, P., Méndez, G., and Concepción, E. (2023). Evolutionary combination of connected event schemas into meaningful plots. Genetic Programming and Evolvable Machines, 24(1):7. Hargood, C. (2009). Exploring the Importance of Themes in Narrative Systems. PhD thesis, University of Southampton. Hargood, C., Millard, D., and Weal, M. (2010). Capturing the semiotic relationship between terms. The New Review of Hypermedia and Multimedia, 16:71–84. Hargood, C., Millard, D. E., and Weal, M. J. (2008). A thematic approach to emerging narrative structure. In Proceedings of the hypertext 2008 workshop on Collaboration and collective intelligence, pages 41–45. Hargood, C., Millard, D. E., and Weal, M. J. (2018). The thematic modelling of subtext. Multimedia Tools and Applications, 77:28281–28308. Johnson-Bey, S., Nelson, M. J., and Mateas, M. (2022). Neighborly: A sandbox for simulation-based emergent narrative. In 2022 IEEE Conference on Games (CoG), pages 425–432. IEEE. Klein, S. (1973). Automatic inference of semantic deep structure rules in generative semantic grammars. Technical report, University of Wisconsin-Madison Department of Computer Sciences. Leavitt, J. (2010). Mytheme and motif: Lévi-strauss and wagner. Intersections, 30(1):95–116. Lemon, L. T. and Reis, M. J. (1965). Russian formalist criticism: Four essays, volume 405. U of Nebraska Press. Maria, N., Silva, M., Cincias, F., and Lisboa, C. (2000). Theme-based retrieval of web news. Martin, L., Ammanabrolu, P., Wang, X., Hancock, W., Singh, S., Harrison, B., and Riedl, M. (2018). Event representations for automated story generation with deep neural nets. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32. Mason, S., Stagg, C., and Wardrip-Fruin, N. (2019). Lume: a system for procedural story generation. In Proceedings of the 14th International Conference on the Foundations of Digital Games, pages 1–9. O’Neill, B. and Riedl, M. (2014). Dramatis: A computational model of suspense. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 28. Park, J. S., O’Brien, J. C., Cai, C. J., Morris, M. R., Liang, P., and Bernstein, M. S. (2023). Generative agents: Interactive simulacra of human behavior.
BIBLIOGRAPHY 49 Porteous, J., Charles, F., and Cavazza, M. (2016). Plan-based narrative generation with coordinated subplots. In ECAI 2016, pages 846–854. IOS Press. Propp, V. (1968). Morphology of the Folktale. University of Texas press. Swartjes, I. and Theune, M. (2008). The virtual storyteller: Story generation by simulation. In BNAIC, pages 257–264. Citeseer. Thompson, S. (1955). Motif-Index of Folk-Literature, Volume 4: A Classification of Narrative Elements in Folk Tales, Ballads, Myths, Fables, Mediaeval Romances, Exempla, Fabliaux, Jest-Books, and Local Legends, volume 4. Indiana University Press. Tobias, R. B. (2012). 20 master plots: And how to build them. Penguin. Zhang, H. (2005). Activation of themes during narrative reading. Discourse Processes, 40(1):57–82.
Appendix A Definition of events in the Neighborly simulation In this appendix I will name the full list of events considered with a brief description of what they represent and their actors as this are necessary to define the features of the events using the model described in 2.2.1: BecomeAdolescentEvent: Transition event when a character becomes an adolescent. Actors: •subject: the actor reaching adolescence. BecomeAdultEvent: Transition event when a character becomes an adult. Actors: •subject: the actor reaching adulthood. BecomeEnemies: Event representing two characters becoming enemies. Actors: •subject,other: the enemies. BecomeFriends: Event representing two characters becoming friends. Actors: •subject,other: the friends. BecomeSeniorEvent: Transition event when a character becomes a senior. Actors: •subject: the actor reaching seniority. BecomeYoungAdultEvent: Transition event when a character becomes a young adult. Actors: 51
52 Appendix A. Definition of events in the Neighborly simulation •subject: the actor reaching young adulthood. BirthEvent: Event triggered when a new character is born. Actors: •subject: the actor being born. BreakUp: Event representing the end of a romantic relationship. Actors: •subject,Other: actors breaking the relationship. BuildTreasure: Event representing the creation of a treasure. The build events have been designed to put into circulation into the world objects that can be stolen or gifted. Actors: •subject: the builder. BuildVehicle: Event representing the construction of a vehicle. Actors: •subject: the builder. BuildWeapon: Event representing the construction of a weapon. Actors: •subject: the builder. BusinessClosedEvent: Event triggered when a business is closed down. Actors: •subject: the actor who closes the business. •business: The business being closed. BuyTreasure: Event representing a character purchasing a treasure from another character. Actors: •buyer: Actor who buys. •seller: Actor who sells. BuyVehicle: Event representing a character purchasing a vehicle from another character. Actors: •buyer: Actor who buys. •seller: Actor who sells. BuyWeapon: Event representing a character purchasing a weapon from another character. Actors:
53 •buyer: Actor who buys. •seller: Actor who sells. ChangeResidenceEvent: Event triggered when a character changes their place of residence. Actors: •subject: Actor who changes residence. •new residence: Where the actor is moving to. Death: Event triggered when a character dies. Actors: •subject: the actor who has died. DepartDueToUnemployment: Event triggered when a character leaves due to unemployment. Actors: •subject: the actor leaving. DepartSettlement: Event triggered when a character leaves a settlement. Actors: •subject: the actor leaving. DissolveEnmity: Event represents when enmity between two characters ends. Actors: •subject,Other: the ex-enemies. DissolveFriendship: Event represents when friendship between two characters ends. Actors: •subject,Other: the ex-friends. FiredFromJob: Event represents a character being fired from a job. Actors: •subject: The actor being fired. •business: The job being fired of. •job_role: the job role the subject no longer has. FormCrush: Event represents a character forming a crush on another character. Actors: •subject: The actor forming a crush.
54 Appendix A. Definition of events in the Neighborly simulation •other: The actor who subject has a crush on. GetDivorced: Event representing a divorce. Actors: •subject,ex_spouse: The actors getting divorced. GetMarried: Event representing a marriage. Actors: •subject,subject: The actors getting married. GetPregnant: Event triggered when a character becomes pregnant. Actors: •subject: The actor getting pregnant. •partner: The other parent. GiftTreasure: Event representing a character gifting a treasure to another character. Actors: •gifter: Actor who makes a gift. •gifted: Actor who receives a gift. GiftVehicle: Event representing a character gifting a vehicle to another character. Actors: •gifter: Actor who makes a gift. •gifted: Actor who receives a gift. GiftWeapon: Event representing a character gifting a weapon to another character. Actors: •gifter: Actor who makes a gift. •gifted: Actor who receives a gift. HaveChildEvent: Event triggered when a character has a child. Actors: •subject,subject: The parents. •child: The child. JoinSettlementEvent: Event triggered when a character joins a settlement. Actors: •subject: the actor entering the settlement. •settlement: Settlement being joined.
55 Kill: Event representing a character killing another character. Actors: •subject: The actor who killed. •other: The actor who was killed. LaidOffFromJob: Event representing a character being laid off from a job. Actors: •subject: Actor leaving the job. •business: The business the subject was working on. •job: The job the subject had. LeaveJob: Event representing a character leaving a job. Actors: •subject: Actor leaving the job. •business: The business the subject was working on. •job: The job the subject had. PromotedToBusinessOwner: Event representing a character being promoted to business owner. Actors: •subject: Actor being promoted. •business: The business the subject is working on. •former_owner: The actor who was the owner before. Retire: Event triggered when a character retires from work. Actors: •subject: Actor leaving the job. •business: The business the subject was working on. •job: The job the subject had. StartANewJob: Event representing a character starting a new job. Actors: •subject: Actor entering the job. •business: The business the subject is going to work on. •job: The job the subject will have. StartBusiness: Event representing a character starting a new business. Actors: •subject: Actor creating the business. •business: The business the subject is creating.
62 Appendix B. Description of features assigned to the events 170 ], 171 " settlement ":[] 172 } 173 }, 174 "ChangeResidenceEvent":{ 175 "conditional":{ 176 "subject":[], 177 " new_residence ":[] 178 }, 179 " unconditional ":{ 180 "subject":[ 181 " begining " 182 ], 183 " new_residence ":[ 184 " begining " 185 ] 186 } 187 }, 188 "BuildVehicle":{ 189 "conditional":{ 190 "subject":[] 191 }, 192 " unconditional ":{ 193 "subject":[ 194 " ambition ", 195 " creation " 196 ] 197 } 198 }, 199 " BuyVehicle ":{ 200 "conditional":{ 201 "buyer":[], 202 "seller":[] 203 }, 204 " unconditional ":{ 205 "buyer":[ 206 ], 207 "seller":[ 208 "wealth" 209 ] 210 } 211 }, 212 " DepartDueToUnemployment ":{ 213 "conditional":{ 214 "subject":[ 215 [["selfishness"],"retribution"]
63 216 ] 217 }, 218 " unconditional ":{ 219 "subject":[ 220 "failure", 221 "ending" 222 ] 223 } 224 }, 225 "DepartSettlement":{ 226 "conditional":{ 227 "subject":[] 228 }, 229 " unconditional ":{ 230 "subject":[] 231 } 232 }, 233 "BuildWeapon":{ 234 "conditional":{ 235 "subject":[] 236 }, 237 " unconditional ":{ 238 "subject":[ 239 "death", 240 " creation " 241 ] 242 } 243 }, 244 " BuyWeapon ":{ 245 "conditional":{ 246 "buyer":[], 247 "seller":[] 248 }, 249 " unconditional ":{ 250 "buyer":[ 251 "death" 252 ], 253 "seller":[ 254 "wealth" 255 ] 256 } 257 }, 258 " BuildTreasure ":{ 259 "conditional":{ 260 "subject":[] 261 },
64 Appendix B. Description of features assigned to the events 262 " unconditional ":{ 263 "subject":[ 264 "wealth", 265 " creation " 266 ] 267 } 268 }, 269 "GiftVehicle":{ 270 "conditional":{ 271 "gifter":[ 272 [ 273 [ 274 "selfishness" 275 ], 276 " redemption " 277 ] 278 ], 279 "gifted":[ 280 [ 281 [ 282 "selflessness" 283 ], 284 " redemption " 285 ], 286 [ 287 [ 288 "selfishness" 289 ], 290 " injustice " 291 ] 292 ] 293 }, 294 " unconditional ":{ 295 "gifter":[ 296 "selflessness" 297 ], 298 "gifted":[ 299 " friendship " 300 ] 301 } 302 }, 303 " BecomeFriends ":{ 304 "conditional":{ 305 "subject":[], 306 "other":[] 307 },
65 308 " unconditional ":{ 309 "subject":[ 310 " friendship " 311 ], 312 "other":[ 313 " friendship " 314 ] 315 } 316 }, 317 "GiftTreasure":{ 318 "conditional":{ 319 "gifter":[ 320 [ 321 [ 322 "selfishness" 323 ], 324 " redemption " 325 ] 326 ], 327 "gifted":[ 328 [ 329 [ 330 "selflessness" 331 ], 332 " redemption " 333 ], 334 [ 335 [ 336 "selfishness" 337 ], 338 " injustice " 339 ] 340 ] 341 }, 342 " unconditional ":{ 343 "gifter":[ 344 "selflessness", 345 " friendship ", 346 "trust" 347 ], 348 "gifted":[ 349 "trust", 350 "gifted", 351 " friendship " 352 ] 353 }
66 Appendix B. Description of features assigned to the events 354 }, 355 " GiftWeapon ":{ 356 "conditional":{ 357 "gifter":[ 358 [ 359 [ 360 "selfishness"," death " 361 ], 362 " redemption " 363 ] 364 ], 365 "gifted":[ 366 [ 367 [ 368 "selflessness" 369 ], 370 " redemption " 371 ], 372 [ 373 [ 374 "selfishness" 375 ], 376 " injustice " 377 ] 378 ] 379 }, 380 " unconditional ":{ 381 "gifter":[ 382 "selflessness", 383 " friendship " 384 ], 385 "gifted":[ 386 "death", 387 "gifted", 388 " friendship " 389 ] 390 } 391 }, 392 "BuyTreasure":{ 393 "conditional":{ 394 "buyer":[], 395 "seller":[] 396 }, 397 " unconditional ":{ 398 "buyer":[ 399 "wealth"
67 400 ], 401 "seller":[ 402 "wealth" 403 ] 404 } 405 }, 406 "StealVehicle":{ 407 "conditional":{ 408 "stealer":[ 409 [ 410 [ 411 "selflessness" 412 ], 413 " corruption " 414 ] 415 ], 416 "stolen":[ 417 [ 418 [ 419 "selfishness" 420 ], 421 "retribution" 422 ] 423 ] 424 }, 425 " unconditional ":{ 426 "stealer":[ 427 "selfishness", 428 "travel" 429 ], 430 "stolen":[ 431 "broken_trust" 432 ] 433 } 434 }, 435 "StealWeapon":{ 436 "conditional":{ 437 "stealer":[], 438 "stolen":[ 439 [ 440 [ 441 "selfishness" 442 ], 443 "retribution" 444 ] 445 ]
68 Appendix B. Description of features assigned to the events 446 }, 447 " unconditional ":{ 448 "stealer":[ 449 "selfishness", 450 "death" 451 ], 452 "stolen":[ 453 "broken_trust" 454 ] 455 } 456 }, 457 " StealMoney ":{ 458 "conditional":{ 459 "stealer":[], 460 "stolen":[ 461 [ 462 [ 463 "selfishness" 464 ], 465 "retribution" 466 ] 467 ] 468 }, 469 " unconditional ":{ 470 "stealer":[ 471 "selfishness", 472 "wealth" 473 ], 474 "stolen":[ 475 "broken_trust" 476 ] 477 } 478 }, 479 " StealTreasure ":{ 480 "conditional":{ 481 "stealer":[ 482 [ 483 [ 484 "selflessness" 485 ], 486 " corruption " 487 ] 488 ], 489 "stolen":[ 490 [ 491 [
69 492 "selfishness" 493 ], 494 "retribution" 495 ], 496 [ 497 [ 498 "trust" 499 ], 500 "broken_trust" 501 ] 502 ] 503 }, 504 " unconditional ":{ 505 "stealer":[ 506 "selfishness", 507 "wealth" 508 ], 509 "stolen":[ 510 "broken_trust" 511 ] 512 } 513 }, 514 "BecomeSeniorEvent":{ 515 "conditional":{ 516 "subject":[] 517 }, 518 " unconditional ":{ 519 "subject":[ 520 "wealth", 521 "work", 522 " ambition " 523 ] 524 } 525 }, 526 "Death":{ 527 "conditional":{ 528 "subject":[] 529 }, 530 " unconditional ":{ 531 "subject":[" death "] 532 } 533 }, 534 "BecomeAdultEvent":{ 535 "conditional":{ 536 "subject":[] 537 },
70 Appendix B. Description of features assigned to the events 538 " unconditional ":{ 539 "subject":[] 540 } 541 }, 542 " BecomeEnemies ":{ 543 "conditional":{ 544 "subject":[ 545 [ 546 [ 547 "love" 548 ], 549 "tragic_love" 550 ], 551 [ 552 [ 553 " friendship " 554 ], 555 "tragic_friendship" 556 ] 557 ], 558 "other":[ 559 [ 560 [ 561 "love" 562 ], 563 "tragic_love" 564 ], 565 [ 566 [ 567 " friendship " 568 ], 569 "tragic_friendship" 570 ] 571 ] 572 }, 573 " unconditional ":{ 574 "subject":[ 575 "enmity" 576 ], 577 "other":[ 578 "enmity" 579 ] 580 } 581 }, 582 " FormCrush ":{ 583 "conditional":{
71 584 "subject":[ 585 [ 586 [ 587 "love" 588 ], 589 "tragic_love" 590 ] 591 ], 592 "other":[ 593 [ 594 [ 595 "love" 596 ], 597 "tragic_love" 598 ] 599 ] 600 }, 601 " unconditional ":{ 602 "subject":[ 603 "love" 604 ], 605 "other":[ 606 "love" 607 ] 608 } 609 }, 610 "StartDating":{ 611 "conditional":{ 612 "subject":[ 613 [ 614 [ 615 "love" 616 ], 617 " requited_love " 618 ] 619 ], 620 "partner":[ 621 [ 622 [ 623 "love" 624 ], 625 " requited_love " 626 ] 627 ] 628 }, 629 " unconditional ":{
78 Appendix C. Description of themes used and their relationship And their relationships are defined as a JSON below: 1{ 2"related":[ 3[" Crime Pursued by Vengeance ","Rivalry"], 4[" Crime Pursued by Vengeance ","Love And Hatred"], 5[" Crime Pursued by Vengeance ","Remorse"], 6[" Crime Pursued by Vengeance "," Injustice of Life "], 7["Rivalry"," Love And Hatred "], 8["Rivalry"," Profesional Ambition "], 9[" Love And Hatred ","Remorse"], 10 [" Love And Hatred "," Injustice of Life "], 11 [" Love And Hatred "," Profesional Ambition "], 12 ["Remorse"," Injustice of Life "], 13 ["Remorse"," Liberation From Work "], 14 [" Profesional Ambition "," Liberation From Work "], 15 [" Injustice of Life "," Liberation From Work "] 16 ], 17 " opposite ":{ 18 " Crime Pursued by Vengeance ":[" friendship ", "love"," peace ","failure"], 19 "Rivalry":[" friendship "," requited_love "," peace"," faith "], 20 " Love And Hatred ":["tragic_love"," tragic_friendship","selfishness","death " ,"enemy","failure"], 21 "Remorse":[" creation "," begining ","death", "selfishness","failure"], 22 " Liberation From Work ":[" wealth "," ambition " ,"work"," begining ","failure"], 23 " Injustice of Life ":[" friendship "," love "," peace","wealth"], 24 " Profesional Ambition ":[" friendship ","love " ,"peace","failure"] 25 } 26 }
Appendix D Examples of stories generated using the system described in this document Listing D.1: The problem with lack of variaty is consistent even after the adjustments in the metrics to avoid it. ( ’ I n j u s t i c e of Life ’ , ’ Love And Hatred ’ ) : 0.3755606522743312 2632−03: BecomeEnemies ( subject = Kayleigh Gold (23521) , other = Callen Amerson (23362) ) 2642−08: FormCrush ( subject = Dominick Hamblett (23406) , other = Kayleigh Gold (23521) ) 2642−08: BecomeEnemies ( subject = Kayleigh Gold (23521) , other = Kayleigh Gold (23521) ) 2643−08: StartDating ( subject = Dominick Hamblett (23406) , partner = Kayleigh Gold (23521) ) 2643−10: GetMarried ( subject = Dominick Hamblett (23406) , subject = Kayleigh Gold (23521) ) 2648−09: BecomeEnemies ( subject = Kayleigh Gold (23521) , 79
80 Appendix D. Examples of stories generated using the system described in this document other = Enrique Gold (23630) ) 2651−05: BuildWeapon ( sub je ct = E s t r e l l a Jinkerson (23646) ) 2651−06: BuildWeapon ( sub je ct = E s t r e l l a Jinkerson (23646) ) 2651−12: GiftWeapon ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Antonella Icke (23574) ) 2652−06: GiftWeapon ( g i f t e r = Antonella Icke (23574) , g i f t e d = E s t r e l l a Jinkerson (23646) ) 2652−07: GiftTreasure ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Antonella Icke (23574) ) 2652−09: GiftWeapon ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Alden Blackaby (23635) ) 2652−10: GiftWeapon ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Kayleigh Gold (23521) ) 2652−11: GiftTreasure ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Alden Blackaby (23635) ) 2652−12: GiftTreasure ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Bl air Hoar (23606) ) 2653−01: GiftWeapon ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Antonella Icke (23574)
81 ) 2653−06: GiftV ehic le ( g i f t e r = Alden Blackaby (23635) , g i f t e d = E s t r e l l a Jinkerson (23646) ) 2653−08: GiftTreasure ( g i f t e r = Alden Blackaby (23635) , g i f t e d = E s t r e l l a Jinkerson (23646) ) 2653−09: BecomeFriends ( sub je ct = E s t r e l l a Jinkerson (23646) , other = Kayleigh Gold (23521) ) 2654−05: GiftWeapon ( g i f t e r = E s t r e l l a Jinkerson (23646) , g i f t e d = Kayleigh Gold (23521) ) 2654−05: Death ( sub je ct = E s t r e l l a Jinkerson (23646) ) 2658−12: Kill ( subject = Kayleigh Gold (23521) , other = Kayleigh Gold (23521) ) 2658−12: BecomeEnemies ( sub je ct = E s t r e l l a Jinkerson (23646) , other = Kayleigh Gold (23521) ) Textual representation : Kayleigh Gold and Callen Amerson became enemies . Later , Dominick Hamblett developed a crush on Kayleigh Gold . However , Kayleigh Gold a l so became her own enemy . Subsequently , Dominick Hamblett and Kayleigh Gold st ar te d dating . Shortly aft er , Dominick Hamblett and Kayleigh Gold got married . Meanwhile , Kayleigh Gold and Enrique Gold became enemies . During t h is time , E s t re l l a Jinkerson b u i l t a weapon and then b u i l t another weapon . Subsequently , E s t r e l l a Jinkerson g i f t e d a weapon to Antonella Icke , and in return , Antonella Icke g i f t e d a weapon to E s t r e l l a Jinkerson . Additionally , E s t r e l l a Jinkerson g i f t e d a t re as ure to Antonella Icke . Furthermore , E s t r e l l a Jinkerson g i f t e d a weapon to Alden Blackaby and al so g i f t e d a weapon to Kayleigh Gold . She then g i f t e d a tr ea sur e to Alden Blackaby and another tr ea su re to Bla ir Hoar . Moreover , E s t r e l l a Jinkerson g i f t e d another weapon to Antonella Icke . Following this , Alden Blackaby g i f t e d a v eh i c le to E s t r e l l a Jinkerson and al so g i f t e d a tr eas ur e to her . Later , E s t r e l l a Jinkerson and Kayleigh Gold became f r i e n d s . Subsequently , E s t r e l l a Jinkerson g i f t e d another weapon to Kayleigh Gold . Unfortunately , E s t r e l l a Jinkerson died . Eventually , Kayleigh Gold k i l l e d h e r s e l f . Afterward , E s t r e l l a Jinkerson and Kayleigh Gold became enemies .
82 Appendix D. Examples of stories generated using the system described in this document Listing D.2: Example showing the efectivness of understanding suspense as clashing themes. ( ’ Rivalry ’ , ’ Love And Hatred ’ ) : 0.4853982721133222 2266−09: StartDating ( subject = Dakota Scowden (20730) , partner = Sam Calcote (20880) ) 2270−04: FormCrush ( subject = Sam Calcote (20880) , other = Erin Buley (20630) ) 2282−08: GetMarried ( subject = Dakota Scowden (20730) , subject = Sam Calcote (20880) ) 2283−11: BuildVehicle ( subject = Megan Men(21059) ) 2283−12: BuildVehicle ( subject = Megan Men(21059) ) 2284−01: BuildTreasure ( subject = Megan Men(21059) ) 2284−07: StealTreasure ( s t e a l e r = Megan Men(21059) , st o l e n = Dallas Stringham (20986) ) 2284−08: BuildTreasure ( subject = Megan Men(21059) ) 2285−06: StealTreasure ( s t e a l e r = Megan Men(21059) , st o l e n = Dallas Stringham (20986) ) 2286−10: BecomeEnemies ( subject = Megan Men(21059) , other = Dallas Stringham (20986) )
83 2287−07: BecomeEnemies ( subject = Megan Men(21059) , other = Sam Calcote (20880) ) 2288−02: Kill ( subject = Megan Men(21059) , other = Sam Calcote (20880) ) 2289−01: BecomeEnemies ( subject = Cedric Scowden (20929) , other = Megan Men(21059) ) Textual representation : Dakota Scowden and Sam Calcote start ed dating . Later , Sam Calcote developed a crush on Erin Buley . Eventually , Dakota Scowden and Sam Calcote got married . In the meantime , Megan Men b u i l t a v e h ic l e and then b u i l t another v e h i c l e . Subsequently , Megan Men b u i l t a t re as ur e . Later , Megan Men s t o l e a t re as u re from Dallas Stringham . Additionally , Megan Men b u i l t another t r ea su r e . Megan Men then s t o l e another t re as u re from Dallas Stringham . Eventually , Megan Men and Dallas Stringham became enemies . Later , Megan Men and Sam Calcote a lso became enemies . Subsequently , Megan Men k i l l e d Sam Calcote . Following this , Cedric Scowden and Megan Men became enemies .
84 Appendix D. Examples of stories generated using the system described in this document Listing D.3: This example shows a strong theme is not sufficient to guarantee an interesting story ( ’ Lib er at io n From Work’ , ’ P r o f e s s i o n a l Ambition ’ ) : 0.48278886249443476 0003−09: StartANewJob ( subject = F e l i c i t y Marston (306) , business = farm (95) ) 0003−09: Retire ( sub je ct = N e l l i e Lashley (114 ) , business = farm (95) ) 0015−06: Retire ( subject = Louis Felton (356) , business = farm (95) ) 0042−07: PromotedToBusinessOwner ( subject = F e l i c i t y Marston (306) , business = farm (95) , former_owner = Bryce Jewel (117) ) 0042−07: Retire ( subject = Bryce Jewel (117) , business = farm (95) ) 0042−07: LeaveJob ( subject = F e l i c i t y Marston (306) , business = farm (95) ) 0043−06: BecomeSeniorEvent ( subject = F e l i c i t y Marston (306) ) 0043−10: Retire ( subject = F e l i c i t y Marston (306) , business = farm (95) ) 0043−10: LeaveJob ( subject = F e l i c i t y Marston (306) , business = farm (95) )
85 0043−10: BusinessClosedEvent ( subject = F e l i c i t y Marston (306) , business = farm (95) ) Textual representation : F e l i c i t y Marston s ta rte d a new job at a farm . At the same time , N e l l i e Lashley r e t i r e d from the same farm . Later , Louis Felton a ls o r e t i r e d from the farm . Years l at er , F e l i c i t y Marston was promoted to business owner of the farm , taking over from Bryce Jewel . Consequently , Bryce Jewel r e t i r ed . Shortly after , F e l i c i t y Marston l e f t her job at the farm . The f ol low in g year , F e l i c i t y Marston became a sen io r . Subsequently , F e l i c i t y Marston r e t i r e d from the farm again and l e f t her job . This s e r i e s of events led to the c lo su re of the farm .