{'fraction_non_alphanumeric': 0.02379546796239953, 'fraction_numerical': 0.009854230053131102, 'mean_word_length': 4.623595505617978, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Content Determination for Chess as a Source for Suspenseful Narratives

In this paper, we explore a way of viewing a chess game as a narrative. Using the model of suspense described in Doust (2015), Doust and Piwek (2017) and Doust (2017), we derive a fluctuating step-by-step prediction of the suspense level evoked by a series of steps in a particular chess endgame scenario. Based on these predictions, particular variations from a given set-up of the game may be chosen to induce a story for the game that optimises the value of the suspense perceived by an observer following the narrative that results from the game. This provides a content determination strategy for a system that constructs chess games specifically to support suspenseful stories.


Introduction
When an author sits down to write a story, one possible goal in his mind may be to evoke feelings of suspense in the prospective reader. To achieve this, the writer plays both with the content that he includes in his story and the order in which it is presented to the reader. Some recent efforts in the computational study of narrative have focused in the way this inducement of feelings of suspense may be achieved (Delatorre and Arfè, 2015;Delatorre et al., 2016). In this paper, we explore a possible way of selecting between possible continuations of a chess game such that the story of its telling be such that it evokes a desirable amount of suspense.
The game of chess -being a simplified model of a world that includes conflict between opposing factions (black and white) constituted by individuals (pieces) that carry out actions (moves) driven by an illusion of purpose (the strategy of each player) -has already been used as a case study for computational studies on the construction of narrative (Gervás, 2014;Delatorre and Gervás, 2014;Gervás, 2018a,b).
In this paper, we explore a way of viewing a chess game as a narrative. Using the model of suspense described in Doust (2015), Doust and Piwek (2017) and Doust (2017), we derive a fluctuating step-by-step prediction of the suspense level evoked by a series of steps in a particular chess endgame scenario. Based on these predictions, particular variations from a given set-up of the game may be chosen to induce a story for the game that optimises the value of the suspense perceived by an observer following the narrative that results from the game. This provides a content determination strategy for a system that constructs chess games specifically to support suspenseful stories.

Design choices
In searching for suitable domains to explore the potential and the validity of our model, the chess world has the advantages of simplicity, clarity and closure. This is especially true in the endgame phase where there are fewer pieces on the board and the available options are easy to see and predict. In the endgame, the King and Pawns have the advantage of only moving one square at a time. Their movement has a certain linearity. The goal of queening a pawn is also a very clear endpoint for a pawn. For these reasons we have limited ourselves to a particular chess endgame with only Kings and Pawns on the board. If the model is successful, other more complex setups with additional pieces could be considered.
In extrapolating a narrative from a board game or indeed any sport, there are several options. One of these would be to consider the individual stories of the different pieces. For the chess example we could create a narrative of the pawn's selfrealisation in becoming a queen. We could use terms such as far, near, close, within firing range to simulate the approximate non-omniscient knowl-edge or field of view that a piece has of the other pieces on the board. In this way, we could tell the suspenseful and surprising story of the events that happen to a given piece. In such an approach, the unpredictability that is essential to narrative would be achievable because the piece in question might not be aware beforehand of a different piece's sudden appearance in its field of view.
In this paper however, we follow the perhaps more usual idea of the suspenseful and surprising story derived from the movement of the pieces that is understood by a viewer of the game who observes both sides, white and black, and maybe supports one of the sides. In such an approach, however, it would appear to be harder to model the unpredictability needed to create a model of narrative, as all moves are visible and, theoretically at least, calculable by the observer. However, we will be simulating a non-expert observer with certain limits to its analytical powers, and this will enable us to simulate a narrative-like process with a degree of unpredictability from a series of chess moves.

Related Work
This section reviews existing studies on computational narrative based on chess and existing models of suspense.

Computational Narrative Studies based on Chess
The use of a chess game as a reference world on which to developed basic mechanics of narrative composition had been explored in Gervás (2014), where a basic concept of a narrative thread is introduced similar to the ones used in this paper. The evaluation of the perception of suspense over a chess game was addressed in Delatorre and Gervás (2014), using simple models of the level of threat perceived by each faction. Elementary models for proposing possible plot structures to account for a selected sequence of moves out of the record of a complete chess game are described in Gervás (2018a) and Gervás (2018b).

Computational Models of Suspense
Based on systematic reviews of existing cognitive models of suspense, the work described in Delatorre and Arfè (2015) and Delatorre et al. (2016) outlines a computational approach for measuring the suspense evoked by a given narrative, in terms of particular characteristics such as the relative strengths of the characters in opposition, the empathy inspired by different characters in the reader, and the props and settings for particular scenes.

Our narrative thread model of suspense
We now give a brief review of our narrative model of suspense as shown in Doust (2015), Doust and Piwek (2017) and Doust (2017). Much research on computational models of narrative has often centred on use of detailed representations for character goals and plans -see for example Cavazza and Charles (2005). Also, approaches to suspense modelling often interlock with the concept of a story protagonist under some kind of threat -see for example, the suspense modelling in the SUSPENSER system Cheong and Young (2015) which attempts to maximise suspense by varying the number of potential actions of a central protagonist which could allow him or her to escape a threat.
In Doust (2015), we proposed a domainindependent model of suspense together with a method for measuring the suspensefulness of simple chronological narratives. By separating out emotional salience and character empathy considerations from informational and attentional processes at the heart of the suspense reaction, we constructed a modular definition of suspense.
In our model, which was inspired by the informal model presented in Brewer and Lichtenstein (1982), the concept of a narrative thread plays a pivotal role. Narrative threads model the reader's expectations about what might happen next in a given story. As a story is told, narrative threads are activated and de-activated. Different threads may point to conflicting events that are situated in the future. As more of the story is revealed, the moment of resolution of the conflict may appear more or less proximal in time. We capture this by formally defining the concept of Imminence. Imminence is based on the potential for upcoming storyworld events to conflict with one another and on the narrative proximity with these conflicts. It is the key factor in what we call conflict-based suspense 1 .
For a given storyworld, our model requires a set of narrative threads. Each thread consists in a chronological list of potential events taken from the storyworld. In addition, we used a set of dis-Proceedings of the 3 rd Workshop on Computational Creativity and Natural Language Generation, pages 26-33, Tilburg, November 2018. c 2018 Association for Computational Linguistics allowing ordered pairs of events to represents incompatible storyworld events. If one of a pair of disallowing events is told in the story, then the other event can no longer be told. A story is then an ordered list of events taken from the storyworld that usually includes events from different narrative threads. Telling a story is equivalent to going through this ordered list of events one by one. Each new told event may have an effect on one or more narrative threads. Each narrative thread also has a Told and Untold event list. If the new story event matches a member of the Untold list of any narrative thread, then we move it (and all the events before it) into the thread's Told list. Additionally, the thread also becomes active (if previously, it was not). Finally, threads can get deactivated by certain events in the story according to a defined set of disallowing pairs of events.

Content Determination for
Suspense-Inducing Stories based on Chess Games We will use an endgame study by Réti as a working example (taken from Dvoretsky (2011, p. 29).

Deriving the narrative threads
It should ultimately be possible to derive the narrative threads inherent in a given chess position from automatic computational analysis of the position. However, we have chosen in this first approach to derive them by hand. This choice is linked to our strategy of focussing on a relatively simple endgame situation where, because we use only Kings and Pawns, the move choices more visibly resemble a thread-like structure. Criteria for the identification of a narrative thread are that it has a clear start and end point. As we shall see, in the chess storyworld, a thread can of-ten be usefully labelled with a goal-like description such as 'wants to take a piece', 'wants to stop a piece getting taken', 'wants to make a queen', etc. We inferred a set of narrative threads that we consider relevant for this chess position. We now show these on the chessboard.
The black king has a thread of two steps culminating in the capture of the white pawn (grey arrows). The white pawn has a thread of two steps culminating in becoming a queen (blue arrows) and the black pawn has a thread of 4 steps to become a queen (purple arrows). The white king has two sets of threads: one set (red arrows) contains the more or less equivalent paths to try to catch the black pawn (currently 3 steps away), the other set (brown arrows) contains roughly equivalent paths to get close to the white pawn to stop it being taken by the black king (currently 4 steps away).
In Table 1, we show a sample of the threads in a table form. Computationally, we use the following format for each thread: a Name, an Importance value, a sequence of Told events (or moves) and a sequence of as yet Untold events.
• arc(Name,Importance,[Told],[Untold]) To help to understand the overall structure and interlinking of these narrative threads, we now show some visual interpretations of the narrative threads In this figure, each thread has its own colour. We can see that different threads can 'pass through' the same chess move. The red dotted lines identify the moves that disallow each other, that is, if one of these occurs, then the other can no longer occur in the game. These disallowing links are necessary to eliminate certain threads as soon as for example the pawn is captured.
Next, in order to give an idea of the global structure of our narrative thread systems, we show the complete system of narrative threads for this chess position (with abbreviated labels due to space) in Figure 2.
This global view also helps to see how the different threads are linked and where interesting narratives may lie. In this Figure, several threads for the White King link up to the square e5 2 and then split into two directions: one to protect the white pawn, the other to try to capture the black pawn. Indeed, this move turns out to be the key to solving the original study.

Modelling our observer
We will make some assumptions that the observer of our game is a rather naive beginner who does not calculate the interaction of the narrative threads in absolute terms, but rather has a feel for each narrative thread's end-point and how soon this endpoint could be reached.
We will assume that our observer absolutely wants the white pieces to win and each thread is evaluated with respect to this desire. We therefore evaluate moves that are good for white as positive, and those good for black as negative.
With this setup, we can now simulate the suspense in a chess position with our narrative threadbased model of conflict-based suspense.

Applying our algorithm to the Réti study
According to the suspense algorithm in Doust (2015), after the telling of the n th story event, we calculate the suspense as a function of the Imminence n (Z), Foregroundedness n (Z), Confidence n (Z) and Importance n (Z) of each ac-Proceedings of the 3 rd Workshop on Computational Creativity and Natural Language Generation, pages 26-33, Tilburg, November 2018. c 2018 Association for Computational Linguistics tive narrative thread Z after story event n: Of course, some threads are more important than others and will have a bigger effect on suspense. The Importance of each narrative thread is equivalent to the predicted degree of positive or negative appraisal of the storyworld situation that the observer would have, were Z to succeed. The Importance values given here are based on standard chess practice that uses relative values of the pieces to evaluate board positions. Thus, if the white pawn queens at the endpoint of a thread, then this will give a value of +8 to that thread, because the value of a queen is 8 and the observer supports white.
In a standard chess game, the Confidence variable will always be equal to 1, as there are no hidden or untold moves.
As for the Foregroundedness variable, in previous work, we used a decay factor of 0.88 to determine the rate at which threads decay in importance when they are not explicitly evoked in a story step. However, in this first approach, we will ignore this variable, that is, we will ignore any memory effects and consider its value as always equal to 1.
Thus, the suspense contribution of a thread will depend only on its Importance and its Imminence.

Imminence
At a given point in the telling of the story, each active narrative thread Z generates two values for Imminence.
Completion Imminence is related to the number of moves in Z still to be played for it to be completed or to 'succeed'. For the starting position of the chess board above, the thread corresponding to the black pawn advancing to queen has a completion imminence of 4. In other words, it will take this thread 4 steps to complete.
Interruption Imminence is related to the smallest number of steps still to be played in some other thread before a step can be occur which interrupts Z by disallowing one of its steps 3 . The question to ask is: "How soon can this thread be interrupted?".
In the case of our black pawn thread, the interruption imminence is 3, as the pawn's moves can only be interrupted by the white king taking it and this requires 3 steps.
We use the definition in Doust (2015) of the Total Imminence n (Z) of a narrative thread Z after the n th event in the story: where H is the number of events to the completion of Z and R is the minimum number of events before an event in some other narrative thread could be told which would disallow some untold event in Z. The factor ρ is used to vary the relative weighting of these two imminence effects. Experimentation with the implementation of our model (see Doust (2015)) led us to choose ρ = 0.7, in effect boosting the relative effect of Completion imminence over Interruption Imminence.

Overall step-by-step suspense value
Finally we use a heuristic to combine all these individual narrative thread suspense values and produce the global suspense level at each moment in the story. Our method is to assume that it is the thread with the highest suspense value that is the one responsible for the story's evoked suspense at that point and we take this thread's contribution as equivalent to the overall suspense level of the narrative at that point in the story. Different threads will have the most important effect on suspense at different points in the story. We can now apply our algorithm to calculate values for the suspense inherent at any point in this chess endgame.

Starting position
We first represent the starting positions of the pieces on the board: [White King h8, Black pawn h5, White Pawn c6, Black King a6]. Of course, in this starting position, it seems likely that there will already be some suspense. We therefore consider that the following threads may already be active in the starting position: • Black Pawn tries to queen • White Pawn tries to queen

• Black King chases the White Pawn
The only piece to which we ascribe no active thread at the beginning is the White King. This Proceedings of the 3 rd Workshop on Computational Creativity and Natural Language Generation, pages 26-33, Tilburg, November 2018. c 2018 Association for Computational Linguistics first list of threads can be used to calculate the initial suspense levels.

Choosing a story
In the starting position of the study in question, it is White's move. Two options seem to present themselves: • The White King tries (hopelessly) to move down the column to catch the Black Pawn and stop it from queening (h8-h7-h6-...) • The White King tries to move along the row to get close to the White Pawn and protect it so that it can queen. (h8-g8-f8-...) The interesting choice in chess terms, however, is for the White King to move to g7 which actually satisfies both of the above goals. (This choice also allows White to draw the game as shown in the standard analysis of the study.) We will therefore first examine a sequence of moves that starts with this move. The particular 'chess story' of (necessarily) alternating white and black 'events' we will consider is the following: Now after each move, we can update the completion and interruption distances for each thread ands obtain a prediction of the overall suspense level at that point in the 'story'.

Suspense predictions
We show the suspense predictions given by our algorithm in Figure 3. The figure also shows the contributions from some individual threads to the overall value.
To show some of the potential of our approach, we show the suspense profiles of two different 'chess stories' that could be told in this position.  In Figure 4, we show the suspense levels for the story where the White King moves towards the White Pawn and protects it as it advances and queens: wkg7,bph4,wkf6,bph3,wke6,bph2,wkd6,bph1q,wpc7. In Figure 5, we show the suspense levels for the story where the White King merely tries to catch the Black Pawn as the Black Pawn moves down the board and queens: wkh7,bph4,wkh6,bph3,wkh5,bph2,wkh4,bph1q.

Discussion
Chess studies are interesting for our purposes in that they are specifically designed to be surprising to the observer of the moves. This paper explores the possibility that at least one aspect of what makes a series of chess moves interesting is their ability to evoke story-like scenarios and more specifically generate suspense, surprise and curiosity.
The graph of suspense levels (Figure 3) clearly shows the switch in the pieces generating the suspense levels as the sequence of moves unfolds. We may consider therefore that a suspenseful chess match therefore will need different pieces to carry out the 'suspense creation' as the match progresses.
The design choices made for the present paper (see Section 1.1) align better with the approach to telling the story of a chess game followed in Delatorre and Gervás (2014), in the sense that the story considered is based on a perception of the complete chess board and the moves that take place over it. The alternative described -but not followed in this paper -where the story of the game is told in terms of partial views by certain pieces aligns better with the approach followed in Gervás (2014).
The model of suspense applied in this paper differs from others in the literature in that it is based on the interaction between a set of possible narrative threads as inferred by the reader from the partially told story. Other approaches do not consider this narrative level of suspense and focus more on the construction of possible plans for a given character (usually aimed at its survival in the face of danger).

Conclusions and Future Work
A further point is that it should be possible to calculate the suspensefulness of different move options and potentially to choose those options that produce the most suspense. Such an approach could be used as part of a system generating potential narrative sequences and then evaluating them for their suspensefulness in order to choose among them the most entertaining options.
Lastly, challenging though it may be, the predictions that this model makes need to be tested empirically for a range of participants. A factor that may be difficult to account for is the varying chess ability of the participants. Typically, in the study above, for example, as soon as it becomes clear to a reasonable chess player that the Black Pawn will be captured, then arguably there is no more suspense left in the game. This in itself points to further work on defining suspense for a specific player profile. One way to approach this would be to place different sized event horizons for the different players: experienced players would be able to see several moves ahead, beginners much fewer. These different levels of awareness may then generate predictably different suspense experiences.