AI Glossary / Graphs and symbolic AI / Beginner
Template
Definition
In information extraction, a template is a structured specification of the information a system should capture about an entity, event, or relationship. It defines fields, often called slots, and the kinds of values or linked objects that can fill them. This entry uses the information-extraction sense, rather than a document layout or a reusable prompt.
What it means
A source document may describe several events in ordinary language. A template states which details matter for a task and how those details should be represented consistently. An event template might ask for participants, a date, a location, and a status.
The empty template is the structure; a filled instance contains the extracted information. Multiple events can require multiple instances, even when they appear in one paragraph. A missing value is not automatically zero, false, or evidence that the event did not happen. The template's instructions must specify how absence, uncertainty, and conflicting evidence are represented.
How it works
Define the target phenomenon and the information needed by the downstream application. Specify slot names, value types, whether multiple values are allowed, and links between objects. Include units or time qualifiers where their absence would make a value ambiguous.
An extraction system identifies relevant passages, recognizes participants and relationships, and assigns supported values to the appropriate slots. It may need to combine evidence across sentences or resolve references to the same entity. Normalization converts compatible expressions into a standard representation while preserving their meaning.
Validate the filled structure and its supporting evidence separately. A record can satisfy its format while containing an incorrect value. When the text describes several similar events, ensure that each participant, date, and status remains attached to the correct instance. The template constrains representation; it does not itself solve extraction or guarantee factual accuracy.
Three practical examples
1. Appointment notices: an extractor fills person, role, organization, and effective-date slots, distinguishing an announced future appointment from a completed change.
2. Delivery reports: a system records shipment identifier, destination, delivery date, and status, keeping separate shipments separate even when one note discusses several.
3. Research summaries: a template captures experiment conditions, measured quantities, values, and units. A result without its relevant conditions may be misleading even if the number was copied correctly.
Think of it this way
Think of a carefully designed form that tells a clerk what information to collect. The labels guide consistent recording, and separate forms prevent details from unrelated events being mixed together.
The analogy is limited because information extraction may involve linked objects, multiple values, and evidence spread through long documents. A template can be a graph of related records rather than one flat page, and completing a field may require more than copying nearby words.
Worked example
Consider this invented notice: “On 4 May, Northstar Supplies shipped 12 monitors to Elm Studio. A second shipment of 5 keyboards to Elm Studio is planned for 9 May. No delivery date has been confirmed for either shipment.” No year is supplied.
Define a Shipment template with slots sender, recipient, item, quantity, shipment_date, status, and delivery_date. Create instance S1 with sender Northstar Supplies, recipient Elm Studio, item monitors, quantity 12, shipment_date 4 May with year unspecified, status shipped, and delivery_date unconfirmed.
Create S2 with the same sender and recipient, item keyboards, quantity 5, shipment_date 9 May with year unspecified, status planned, and delivery_date unconfirmed. Preserve the distinction between a completed shipment action and a planned one. Do not invent a year or interpret the shipment date as a delivery date.
There are two event instances and 17 total items described, but combining quantities into one shipment record would lose the item and status associations. A downstream count of already shipped items is 12, not 17. The template design and filling rules therefore affect the answers the extracted data can support.
Illustrative case study
Fictional case: NoticeGrid extracts personnel changes from internal announcements. Its first design gives every person one role field and one organization field. When a notice describes a move between roles, the output mixes the old organization with the new title.
The team introduces separate appointment-event records that link a person, role, organization, and effective date. It keeps the person's identity record separate from the changing relationship. Reviewers then check each filled event against its evidence. The case illustrates how representation choices can prevent ambiguity; it does not report real extraction performance.
Common misconceptions and mistakes
A template is not merely a formatting pattern. Slot meanings and relationships are as important as field names.
Do not assume one document corresponds to one event. A document may describe zero, one, or several relevant instances.
An empty field does not authorize guessing. Distinguish unknown, not mentioned, not applicable, and explicitly absent when the task needs those differences.
Format compliance is not correctness. A plausible date in a valid date field may still refer to the wrong event. Also avoid collapsing distinct entities merely because their names are similar or their roles overlap.
Business use
Templates make extracted information easier to compare, search, and pass into workflows. Their usefulness depends on whether they preserve the distinctions the organization actually needs.
Design the schema with both source examples and downstream questions in view. Provide clear filling rules and representative edge cases before annotating training or evaluation data. Measure missing, spurious, and incorrectly assigned information, including errors in links between records. Version the template when fields or meanings change, and retain supporting text so reviewers can trace each value to evidence.
People also ask
Is the template the same as a filled record?
No. The template defines the structure; an instance supplies values for a particular entity, event, or relationship.
Can one slot contain several values?
Yes, if the specification permits that and defines how they relate to the instance.
Does a template require a rule-based extractor?
No. Rules, statistical models, or other methods can fill the same defined structure.
Check your understanding
Why should the notice's 12 monitors and 5 keyboards not become one shipment instance?
Answer: They belong to different shipment events with different dates and statuses. Combining them would obscure which items have actually shipped.
Related terms
- Information extraction
- Slot filling
- Schema
- Event extraction
- Relation extraction
- Normalization
- Structured data
- entity resolution
- provenance
Learn next
Study event extraction and coreference next. Design a small appointment template, then test it against a notice describing both a departure and a replacement. Identify which facts belong to people and which belong to time-dependent relationships before deciding how many records to create.
More in Graphs and symbolic AI
- Tabu search - Tabu search is an optimization method that guides local search using memory of earlier moves or solution features.
- Taylor expansion - A Taylor expansion represents a function near a chosen point using its value and derivatives at that point.
- Technological singularity - The technological singularity is a hypothetical transition in which technological change, often associated with intelligence exceeding human capabilities...
- Temporal-difference - Temporal-difference, usually abbreviated TD, refers to a learning approach that updates a prediction using newly observed information and a later prediction.
- Temporal logic - Temporal logic is a family of formal languages for expressing how statements hold across time or sequences of states.
- Temporal-projection - Temporal-projection is the reasoning task of determining what will hold after specified actions or events, given an initial description and a model of change.
Sources
Primary reference: Boyan Onyshkevych, “Template Design for Information Extraction,” https://aclanthology.org/M93-1003.pdf. The original paper's design and structured-object discussion was read. AIMA's index, https://aima.cs.berkeley.edu/aima-index.html, locates the supplied term in its language-processing context. The shipment notice and case are original teaching examples; the title's scope is stated explicitly.
Previous: Temperature Scaling Next: Template filling