Bard, The Automatic Storyteller

Federico Peinado

Bard is an Automatic Storytelling application, completely implemented in Object-Oriented Programming (OOP). It has a structure-oriented knowledge model and a set of atomic operators implemented as extensibles trees of classes.

The purpose of this project is to explore the possibilities of OOP creative systems in the field of automatic generation of stories.

Picture: Maler der Grabkammer des Nacht at Wikipedia.

From an engineering point of view, this application is a testbed for exploring the use of OPP in the implementation of creative systems. For this purpose, the program is divided in two parts: the knowledge models (subdivided in different but connected domains of knowledge) and the logical operators of the application.

While the model is based on a well-known composition pattern of classes, that are organized in a hierarchical fashion, the operators capture the semantic of the creative processes involved in the generation of new and valuable stories.

The set of operators that are modelled in the Bard application can be extended, but the main groups are:


jBard is the implementation of the Bard application using only Java standard plus one additional library of open source software (JUnit) for testing.

The purpose of using Java is to simplify the reusability and extensibility of the application. What jBard offers is a framework of Java classes and a pre-established workflow for the code of other developers to reuse creating other storytellers in different domains of knowledge or with different operational features.

The two main packages of jBard are es.ucm.disia.bard.model.* and es.ucm.disia.bard.logic.*. In the first one only classes representing domain elements are included, implementing a set of interfaces meaning what type of operations can be performed over each element of the story. The second packages contains classes of logical operators, which really do the "creative job" dealing with those elements of the story that implement the appropiate interfaces.

In the current prototype, some operators are following a simple approach. Storage operators deal with files that are loaded and saved in binary format using Java serialization mechanisms. View operators use simple template-based approaches for generating the "natural language" necessary for showing a story to the user.


In this section the main window of the graphic user interface (GUI) is shown, explaining what is the funcionality of the application and how the different operations can be performed by the user.

In the screenshot, a file containing some Russian folk tales of the popular Alexander Afanasiev's Collection has been loaded, and the story called "The Magic Swan-Geese" is currently selected.

At the bottom of the window there is a panel for managing the different corpora of stories. From left to right the element are:

At the right side of the window there is a panel for managing the different stories of the active corpus. From top to down the elements are:


Finally, two stories generated by jBard are presented. Titles are the only text that has not been generated automatically.
The Princess and the Lioness 

Once upon a time... there was a princess. 
The princess said not to go outside. 
The princess went outside. 
The princess heard about the lioness. 
The lioness scared the princess. 
The lioness kidnapped the princess.
The knight departured. 
The knight and the lioness fought. 
The knight won the fight. 
The knight solved the problem of the princess. 
The knight returned. 
A big treasure to the knight.
The Frog and the Self-Sacrificing King 

Once upon a time... the frog fell in the trap of the witch.
The witch scared the frog. 
The witch used a magic spell against the frog. 
Others and the king heard about the witch. 
The king heard something. 
The witch heard about the king. 
The king shared information with others. 
The knight departed.
The knight fell in the trap. 
The witch enchanted the knight. 
The frog returned.