Natural Language Generation in ERIC

Natural Language Generation in ERIC is performed by a template-based system similar to D2S [Theune et al, 2001] and YAG [Channarukul, 1999], using Jess rules to represent the templates. These Jess rules are generated by Java code (since they share significant structure): aside from the template contents and the lexicon, the NLG module is domain-independent.

A template consists of a priority (for comparison with other templates), a number of conditions that must be true for the template to be active and a set of information conveyed by the template, as well as a backward semantic center and a number of forward semantic centers for discourse coherence (inspired by [Grosz et al, 1995]). Every time the NLG module receives new facts from the knowledge and affect modules, it attempts to match all the templates to the new knowledge base (this is done automatically by the execution cycle of Jess). Every template that matches adds a number of candidate utterances to the knowledge base. Once all templates have been attempted, the generated candidate utterances are passed to the module's observers.

Each template can be matched to a number of "lexicon" entries. Selection of an appropriate lexicon entry (once a template has matched) is done on the basis of the agent's affective state (computed by the affect module.

Once all the possible utterances have been generated, the fusion module chooses a shortlist of the candidates by comparing their forward and backward centers according to the three coherence relations presented in [Grosz et al, 1995]: less coherent utterances are removed. In future it is planned to move this functionality into a separate "discourse" module. Further down the pipeline, the fusion module selects a single utterance from the shortlist by first comparing the priorities, and then by random choice. The text representation of this selected utterance is transformed into spoken audio by the Nuance RealSpeak Solo TTS system.