Redcap

How to Create Content in Scenejo Spierling November 2009

Creating content in Scenejo mainly consists of creating the ‘knowledge base’ for each virtual actor, in other words, a database of word patterns (utterances that the bot can ‘understand’ as a stimulus),  and corresponding verbal templates to be uttered as a response. All content is mapped to an XML structure, which is an extension of AIML (Artificial Intelligence Markup Language, see http://www.alicebot.org/aiml.html). Therefore, it is an advantage if authors are knowledgeable in writing AIML. The XML structure can either be written in a text editor, or a graphical interface can be used.

In general, plain AIML can also be run with Scenejo, which means that it is possible to ignore the Scenejo authoring concepts and just feed a chatbot’s word pattern base (such as, an AIML file) into one or more ‘actors’. Using only one actor, this can result in a conventional chatbot interaction between a user and a bot, whereas using 2 or more actors leads to a conversation between the bots. Per se, this can entice one to experiment with emerging funny conversations that have not been foreseen by the authors of the individual pattern bases. However, in many cases it can also lead to rather meaningless chat, especially when non-sequitur answers occur. At the same time, building in some commonplace answers into your bots always helps to overcome the biggest challenge in this kind of interaction: having to react to some unforeseeable user input in a meaningful way.

The Scenejo authoring tools allow to model some structures based on this question/answer principle:

  • Abstraction of ‘direct discourse’-utterances into so-called dialogue acts: For example, the utterance “Hello” can be abstracted to the dialogue act “greeting”. On the other hand, the abstract act of greeting can be expressed in many ways of direct discourse, such as “Hi”, “Howdy”, “Good morning”, etc.
  • Connection of several single acts to dialogic pairs or sequences: For example, the act of greeting demands an answer from the conversational partners, for example a greeting in return, or in general, questions demand answers. Therefore, Scenejo allows the definition of short dialogue sequences, narrowing down the context for the pattern recognition of possible following acts.
  • Pre-conditions and effects: For example, giving the answer of a greeting in return can be conditioned by a predicate value that is checked before, such as “mood > 0”, and refusing a greeting in return can lead to the effect of increasing a resentment value. These changing states can be freely defined, and authors need to think of meaningful parameters for their stories.

 

We suggest the following steps of creation:

STEP 1: Think about three characters (one of which is human) and their potential dialogues or debates, and think about a main structure with possible outcomes of a discussion. Find a reason for the user/player actor to interact – either a reason to interrupt an ongoing conversation, or to contribute certain details! In the case of LRRH, we had the idea to let the user decide how to behave in an encounter with two foreign persons in an obscure setting: TheLoneWolf and LittleRedRidingHood.

STEP 2: It is then necessary to analyse the intended conversation in order to find typical interesting situations, which depend on certain states of affairs. Meaningful parameter states have to be identified early in the process – as well as critical incidents or events, which turn the ‘story’ into a different direction. In the small LRRH scene, we decided to work with the values of a so-called ‘chat-up’-level and a ‘danger’-level. If the user does not intervene with the flattery of TheLoneWolf, the chat-up-level increases and LittleRedRidingHood is more likely to follow the wolf to his cavern. This means, later dialogue acts have to be constrained to depend on the values of these levels.

STEP 3: A crucial part, of course, is to begin writing the dialogues for the bot actors. As a start, a linear dialogue script can be written. However, this soon has to be analysed and annotated, in order to be structured for interactivity. It is helpful if single utterances are then abstracted (generalised) into dialogue acts, and to think about what these acts can ‘do’ to the states of affairs. The more utterances really do affect some states, the more entertaining is the result of the interactive conversation.

STEP 4: A real challenge is then to think about possible utterances of user actors, as these can hardly be influenced, but only motivated with a strong mission for their interaction. Ideally, at each turn of the dialogue, some potential user utterance can have an effect – but that is lots of work. In our small example, we only provided for a few meaningful user interaction points (for example, intervening with the flattery of the wolf). It is recommended that many different potential user utterances (patterns containing wild cards) get generalised to some few dialogue acts.

STEP 5: Finally, the structured dialogue (from step 3, plus step 4) has to be implemented with the tools. The Scenejo graph structure helps visualising dialogue acts that are connected to sequences.
The Scenejo architecture, which is strictly ‘character-based’, requires that the word bases for each bot are entered and stored separately. According to the chatbot principle, as a first precondition for the successful utterance of a dialogue act, a word pattern has to be matched as an input. A linear and completely intertwined dialogue between two bots can be realised by exactly aligning these input patterns with the utterances of the partner bot.