Content uploaded by Emiel Krahmer
Author content
All content in this area was uploaded by Emiel Krahmer on Dec 12, 2013
Content may be subject to copyright.
Plan-based vs. template-based NLG:
a false opposition?
Kees van Deemter , Emiel Krahmer & Mari
¨
et Theune
ITRI , Brighton and IPO , Eindhoven
January 11, 2001
Abstract
Thispaperuses the algorithmemployedina numberofrecenttemplate-based
NLG systems to challenge the wide-spread assumption that template-based
methods are inherently less well-founded than plan-based methods.
Keywords: NLG paradigms, D2S, templates for NLG, plan-based NLG
1 Introduction: a caricature
Natural Language Generation (NLG) systems are sometimes partitioned into two
mutually exclusive, jointlyexhaustiveclasses[1,11,13]: (A)theoretically well-founded
systems, which embody generic linguistic insights and are, as a result, easily main-
tainable. Sometimes, the term ‘(full-blown) NLG’ has been narrowed down to de-
note this class only; and (B) application-dependent systems which lack a proper
theoretical foundation. These systems may be relatively easy to deploy but they
are difficult to maintain. The following equalities tend to be stated or suggested:
A = plan-based NLG systems; B = template-based NLG systems.
We will argue
against these two identifications. We start out by sketching a class of systems that
are template-based, while at the same time being as theoretically well-founded as
any existing plan-based system.
This identification may have originated when the term ‘template’ approach was used (‘for lack
of a better name’) to refer to ‘programs that simply manipulate character strings, in a way that uses
little, if any, linguistic knowledge’ [11]. In the present paper, ‘template-based’ will be taken to mean
“making extensive use of a mapping between semantic structures and representations of linguistic
surface structure that contain gaps”.
1
2 NLG with syntactically structured templates
In this section a brief description of a data-to-speech method called D2S is given.
D2S is the foundation of a number of language generation applications for different
domains (Mozart compositions, soccer reports, route descriptions, train informa-
tion) and languages (Dutch, English, German). As a running example we use the
GoalGetter system which generates Dutch soccer reports. (See http://iris19.ipo.-
tue.nl:9000/english.html for an on-line demonstration.) D2S consists of two mod-
ules: (1)alanguage generation module(LGM) whichconvertsatypeddata-structure
into enriched text, i.e., a text annotated with information about the placement of ac-
cents and boundaries, and (2) a speech generation module (SGM) which turns the
enriched text into a speech signal. Here we focus on the LGM and in particular on
its use of syntactically structured templates, an example of which is given in Figure
1.
CP
NP
time
C
C
V
liet
IP
NP
player
VP
NP
DET
playergen
N
ADJ
ordinal
N
doelpunt
V
aantekenen
time ExpressTime (currentgoal.time)
player
ExpressObject (currentgoal.player, P, nom)
playergen ExpressObject (currentgoal.player, P, gen)
ordinal ExpressOrdinal (ordinalnumber)
Known (currentmatch.result) currentgoal First (notknown,goallist)
currentgoal.type owngoal
goalscoring
Figure 1: Sample syntactic template from the GoalGetter system.
liet een doelpunt aantekenen (‘let a goal be noted’)
means put a goal on the scoresheet
Formally, a syntactic template , where is a syntactic tree (typ-
ically for a sentence) with open slots in it,
is a set of links to additional syntactic
structures (typically NPs and PPs) which may be substituted in the gaps of
, is
a condition on the applicability of
and is a set of topics. We discuss the four
components in more detail, beginning with the syntactic tree,
. All interior nodes
of the tree are labeled by non-terminal symbols, while the nodes on the frontier are
labeled by terminal or non-terminal symbols, where the non-terminal nodes are the
gaps which are open for substitution and are marked by a
. Many templates con-
tain only one (group of) lexical node(s), which may be thought of as the head of
the construction, while the gaps are to be filled by its arguments. An example is the
template in Figure 1, whose head is the collocation een doelpunt laten aantekenen
(put a goal on the scoresheet).
The second element of a syntactic template is
: the slot fillers. Each open slot
in the tree
is associated with a call of some Express function, which generates
the set of possible slot fillers. This process is handled by the function ApplyTem-
plate, shown on the left in Figure 2. ApplyTemplate first calls FillSlots to ob-
tain the set of all possible trees that can be generated from the template, using all
possible combinations of slot fillers generated by the Expressfunctions associated
with the slots. Figure 2 (right) shows an example Express function, namely Ex-
pressObject, which generates a set of NP-trees and is used to generate fillers for
the
player and playergen slots in the template of Figure 1. The first of the two,
for example, leads to the generation of NPs such as ‘Atteveld’ (proper name), ‘the
defender Atteveld’, ‘Vitesse player Atteveld’, ‘Vitesse’s Atteveld’, etc., depending
on the context in the which the NP is generated.
Once all the gaps in the template
are filled, the set all
trees results. For each tree in this set, it is checked (i) whether
it obeys Chomsky’s Binding Theory and (ii) whether it is compatible with the Con-
text Model, which is a record containing all the objects introduced so far and the
anaphoric relations among them. From the resulting set of allowed
trees, one is se-
lected randomly and returned to the main generation algorithm.
For a more sophisticated version of the way in which nominals are generated in context, see [8].
ApplyTemplate(template)
allowed trees
chosen tree nil
all trees FillSlots(template)
for each member of all trees do
if ViolateBindingTheory
false
Wellformed(UpdateContext = true
then allowed
trees allowed trees
if allowed trees = nil
then return false
else chosen
tree PickAny(allowed trees)
return final tree
ExpressObject(r, P, case)
PN, PR, RE nil
trees
PN MakeProperName (r)
PR MakePronoun (r, case)
RE MakeReferringExp (r, P)
trees
PN PR RE
return trees
Figure 2: Functions ApplyTemplate (left) and ExpressObject (right).
be410pie The thirdingredient of a syntactic template is : the Boolean condition.
A template
is applicable if and only if its associated condition is true. Several
kinds of conditions can be distinguished including, most notably perhaps, condi-
tions on the knowledge state. An example is the condition saying ‘ should not be
conveyed to the user before
is conveyed’, which implies that the template can
only be used if the result of the current match described has been conveyed to the
user (i.e., is known) and the current goal is the first one which has not been con-
veyed (is not known). Finally, each template
contains a set of topics , which the
LGM algorithm uses to group sentences together into coherent chunks of text.
3 The caricature exposed
Taking our inspiration from D2S [4,6,7], we will argue that the caricature from the
introduction is precisely this: a caricature. For starters, D2S’ application across do-
mains and languages (cf. Section 2), has revealed a remarkable genericity. Import-
ant parts of the system (e.g., the basic generation algorithm and such functions as
ApplyTemplate and ExpressObject) turned out to be independent of application
domain (Classical Music / Soccer games) and output language (English / Dutch).
This is, of course, not true for the templates themselves, many of which have to
be written anew for each new domain as well as for each language. Based on these
experiences, however, it seems fairto say that D2S is as generic andmaintainable as
anyplan-based system, whichwillhavetoadapt itsgrammar, forexample, whenever
a new application or a new output language comes along.
Butis D2S also well-founded? This depends on whatit means foran NLGsystem to
be well-founded. If it means that every decision made by the system (e.g., express-
ing a proposition in one or in two sentences, using passive or active voice; lexical
choice [2]) should be based on sound linguistic principles, then no NLG system we
are aware of qualifies as being even remotely well-founded: the gap between raw
data and text is bridged in ways that are often arbitrary. Many NLG systems use
linguistic principles, but typically such sophistication is reserved for a few aspects
of the generated text. D2S is no exception, as may be seen from Section 2. For
example, D2S uses well-established rules for constraining the use of anaphors (see
e.g., ViolateBindingTheoryand Wellformedin ApplyTemplate),and anew vari-
ant of Dale and Reiter’s algorithm [3] for the generation of referring expressions
that takes contextual salience into account (MakeReferringExp in ExpressOb-
ject) [7]. Other choices (most notably, perhaps, the choice of a pool of templates
from whichthe generator can picka candidate) are madeon less principled grounds.
The main limiting factor for the deployment of linguistic rules in D2S is not that
the method does not allow it, but simply that not enough good linguistic rules are
known. In sum: D2S, though it is a template-based system, is as well-founded as
any plan-based system.
In fact, we believe that the terminology itself is misleading. Few if any NLG sys-
tems are plan-based in the full sense in which this term is used in artificial intel-
ligence: in NLG, there usually is no place for logical inference (e.g., avoiding a
certain wording because of some explicitly represented common-sense knowledge)
or even backtracking. (Whether or not this limitation reflects a property of human
speaking and writing is a different matter.) If, as has become usual in NLG, the no-
tion of planning is stretched to cover, say, Moore andParis-style NLG[10], then the
system described in Section2 could be described as implementing a distributive, re-
active (‘situated’) planner. (See also the Conclusion of this paper.)
It is worth noting that D2S rather resembles an approach to NLG that is sometimes
omitted in discussions about practical versus applied systems, namely Tree Adjoin-
ing Grammar(TAG) (e.g., [5,9,14]). The trees in D2S are similarto the ‘initial trees’
of TAG. Joshi [5:234] points out that “The initial (...) trees are not constrained in
any manner other than as indicated above. The idea, however, is that [they] will be
minimal in some sense.” The minimalism constraint is usually interpreted as: the
tree should not contain more than the lexical head plus its arguments. The com-
parison with TAG-based NLG suggests that it is not the choice of a template-based
approach that makes an NLG system theoretically unwell-founded, but the choice
for nonminimal templates / elementary trees in these systems (or the use of canned
text in plan-based systems, forthat matter). Of course, non-minimal templates/ ele-
mentary trees are essential for the treatment of any phenomena where composition-
ality breaks down, such as idioms, special collocations, etc. (cf. the treatment of
collocations in [14]). But, generally speaking, the larger the templates/elementary
trees, the less systematic the treatment, the less insight it gives into the composi-
tional structure oflanguage, andthelarger thenumberoftemplates/elementary trees
needed. Unlike the earliest D2S-based NLG systems (e.g., [4]), GoalGetter can be
argued to use templates that are minimal except where there is a good reason to
make them larger [6].
4 Conclusion
We have argued against the caricature presented in Section 1, according to which
template-based NLGsystemsarealways linguistically lessinteresting than so-called
plan-based systems. We have illustrated our claim by sketching a template-based
generation system that is theoretically as well-founded as any plan-based system,
as well as being practically useful (deployable, maintainable, etc.). Of course, there
are genuine and interesting differences between the two paradigms. For example,
template-based systems do not conform to the well-known pipeline model for NLG
[12], which starts from the assumption that the entire semantic content of a dis-
course is known at the beginning of the pipeline – after which this content is pro-
cessed by the next module and so on until the document comes out at the end of
the pipeline. This could point the way to an understanding of what makes plan-
based systems more suitable for one type of application and template-based sys-
tems for another. We hypothesize that their pipeline structure (in a different jargon,
their top-down orientation) makes plan-based systems unsuitable for the modeling
of ‘spontaneous’ types of speaking/writing, in which the speaker/writer does not
always have a plan for the complete discourse before the first word is uttered. The
incremental setup of D2S’s language generation module, which lets templates ‘fire’
until a topic (e.g. the topic of goalscoring) is exhausted, without a preconceived
plan about the orderin which this must happen [4,6], illustrates how such a spontan-
eous manner of speaking/writing can be modeled using a template-based method.
References
1. S. Busemannand H. Horacek. A Flexible Shallow Approachto Text Generation. In Pro-
ceedings of the 9th InternationalWorkshop on NaturalLanguage Generation(IWNLG’98),
Niagara-on-the-Lake, 238-247, 1998.
2. L. Cahill. Lexicalisation in applied NLG systems. ITRI report ITRI-99-04, obtainable
via http://www.itri.brighton.ac.uk/projects/rags/, 1998.
3. R. Dale and E. Reiter. Computational Interpretationsof the GriceanMaxims in the Gen-
eration of Referring Expressions. Cognitive Science 18, 233-263, 1995.
4. K. van Deemter and J. Odijk. Context Modelling and the Generation of Spoken Dis-
course. Speech Communication 21(1/2), 101-121, 1997.
5. A.K. Joshi. The Relevance of Tree Adjoining Grammar to Generation. In G. Kempen
(ed.), Natural Language Generation, Martinus Nijhoff, Dordrecht, The Netherlands, 233-
252, 1987.
6. E. Klabbers, E. Krahmer, and M. Theune. A Generic Algorithm for Generating Spoken
Monologues. InProceedingsofthe 5thInternationalConferenceonSpokenLanguagePro-
cessing (ICSLP’98), Sydney, 2759-2762, 1998.
7. E. Krahmer and M. Theune. Context Sensitive Generation of Descriptions. In Pro-
ceedings of the 5th International Conferenceon Spoken LanguageProcessing (ICSLP’98),
Sydney, 1151-1154, 1998.
8. E. Krahmer and M. Theune. Efficient Generation of Descriptions in Context. To appear
in Proceedings of ESSLLI workshop Generation of Nominals, Utrecht, August 1999.
9. D. McDonaldand J. Pustejovsky. TAG’s as a Grammatical Formalismfor Generation. In
Proceedings of the 23rd Annual Meeting of the Association for Computational Linguistics
(ACL’85), Chicago, 94-103, 1985.
10. J.D. Moore and C.L. Paris. Planning Text for Advisory Dialogues: Capturing Inten-
tional and Rhetorical Information. Computational Linguistics 19(4), 652-694, 1994.
11. E. Reiter. NLG vs. Templates. In Proceedings of the 5th European Workshop on Nat-
ural Language Generation (EWNLG’95), Leiden, 95-106, 1995.
12. E. Reiter. Has a Consensus NLG Architectureappearedandis it PsychologicallyPlaus-
ible? Proceedingsof the 7thInternational Workshop on Natural LanguageGeneration, pp.
163-170, 1994.
13. E. Reiter and R. Dale. Building Applied Natural Language Generation Systems. Nat-
ural Language Engineering 3(1), 57-87, 1997.
14. M. Stone and C. Doran. Paying Heed to Collocations. In Proceedings of the 8th Inter-
nationalWorkshop on Natural LanguageGeneration(IWNLG’96),Herstmonceux, 91-100,
1996.