At first glance, it seems that the template-based generation is just one sentence-realization method. But how do applications using template-based generation decide which templates should be selected, which values should be used for the template variables and how the selected templates should be arranged in order to generate a text?
In most cases, data-driven approaches are used for the template activation. First, a preselection of data according to application specific parameters and user preferences takes place. In a second step, according to this preselection process, those templates are determined which contain template variables that can be substituted with instances of the selected data.
Macrostructure. To make the template-based method more flexible, we employ a macrostructure, conditional template-categories and templates. Within the macrostructure the structure of a particular text type is characterized in terms of typical parts (structural elements), and the content that is conveyed by these parts. Furthermore, the macrostructure imposes restrictions on the order of structural elements.
Template category. A template category characterizes the content of a structural element. A template category is a collection of several conditional templates which covers frequently used phrases to convey the content of a structural element.
Thus, the most important task of text planning--the content selection--takes place as a separate process, whereas no explicit description of coherence relations between the structural elements takes place. The selection of a template according to their constraining conditions is a simple kind of sentence planning, in terms of the framework introduced in the last subsection.
Lexical mapping. The process of the sentence realization is reduced to a lexical mapping of the instances substituted for the template variables. When these instances represent numerical values, an interval is directly mapped to a sequence of words. With this approach, a certain value is always described in the same way. Colors are an example where this is useful. For this attribute, a widely accepted color naming system has been developed by Berk et al.\  which can be used to describe colors objectively.
In some cases, absolute mappings using fixed intervals are not suitable. Values are considered differently depending on the range of the values for this quantity in a given visualization; what is large in one context may be very small in another. These issues are discussed in more detail in .
The constraints of template categories and templates can be used to validate generated figure captions in case of changes to the visualization. If the conditions for a structural element or a template realizing the content of this structural element are violated, or the lexical mapping of a template variable results in another value, these structural elements or portions of these structural elements are invalid (recall Section 5.1).