AI Glossary / Graphs and symbolic AI / Intermediate
Wrapper
Definition
A wrapper is an outer software procedure that provides a particular way to use another resource or procedure. In AI information extraction, a wrapper translates information from a source, such as a formatted web page, into structured records. In machine learning, the same word can describe an outer procedure that repeatedly calls a learner to select or evaluate a configuration. The surrounding context determines the intended meaning.
What it means
This glossary term is ambiguous in its source: AIMA's index explicitly lists both Internet-site wrappers and learning wrappers. The central idea is an outer layer with a defined input-output contract, but the tasks differ.
An extraction wrapper might turn course listings into records containing title, duration, and format. A learning wrapper might organize repeated training and validation runs. Neither meaning automatically implies a new underlying AI model. The informal commercial phrase AI wrapper is broader still and should not replace a precise description of what the software actually does.
How it works
For information extraction, define the target record structure, identify where fields appear, and apply extraction rules to the source response. The rules may be written manually or learned from labeled examples, a process called wrapper induction. The resulting records should be checked for missing fields, type errors, and incorrect associations.
For a learning wrapper, define the choices being compared, call the underlying learner under each choice, and evaluate results using the designated data procedure. Feature-subset selection is one example. The outer procedure controls the experiment; it does not make evaluation data safe to reuse without limit or guarantee that the selected model generalizes.
Three practical examples
- A catalog extractor can convert repeated product cards into rows with an identifier, name, and displayed price field.
- A course-directory integration can normalize one site's duration text into a common structured format for downstream use.
- A feature-selection wrapper can compare candidate feature subsets by training and evaluating the same learning method under each subset.
Think of it this way
Think of an adapter that lets a device connect to a different interface. The adapter translates expectations between the two sides while depending on what the underlying device provides. The analogy is limited because wrappers may perform substantial extraction, validation, or experimental control, and changes in the source can silently break assumptions rather than simply making the connection fail.
Worked example
Consider an original fictional course page containing two repeated course cards. The first has title Data Basics, duration 6 hours, and format Online. The second has title Model Testing, duration 4 hours, and format Classroom. Define the desired record as title, duration_hours, and delivery_format.
A wrapper that operates within each card produces (Data Basics, 6, Online) and (Model Testing, 4, Classroom). It strips the unit word from the duration and records the numeric field under an explicitly hour-based schema. Two cards yield two records, each with fields from the same source unit.
Now suppose the second card temporarily omits its duration. A fragile procedure that separately collects all titles, all durations, and all formats, then pairs them only by list position, risks associating unrelated fields as the page evolves. A card-scoped wrapper instead produces a missing duration for the second record and preserves the first record's association.
Next, imagine the first duration changes to 90 minutes. Simply removing the word minutes would incorrectly store 90 hours. The wrapper must recognize the unit and convert 90/60 to 1.5 hours, or flag the unfamiliar format if that conversion is outside its supported contract.
Finally, changing the page's card markup can invalidate the extraction rule even though a human still sees the same information. Tests should therefore include both expected records and deliberate variations. This example specifies behavior; it is not a claim that an extractor was run against an external website.
Illustrative case study
Fictional case: an AI learning portal imports structured course descriptions from a maintained partner feed. A presentation change introduces optional fields, and the old wrapper starts dropping some listings.
The team checks missing-record counts, compares representative inputs with outputs, and updates its extraction contract. It retains source references so editors can inspect disputed records. The incident illustrates maintenance of an integration layer. Correct extraction still does not establish that every source claim is accurate or that an AI summary preserves all qualifications.
Common misconceptions and mistakes
Do not assume wrapper refers to one universal algorithm. State whether it wraps a data source, a learner, or another software interface. Do not confuse wrapper induction with the already-constructed wrapper: one learns the extraction procedure, while the other performs extraction.
Also avoid assuming that clean structured output proves correct field association. Valid numbers can belong to the wrong record. In learning wrappers, repeatedly selecting the best validation result can overfit the selection procedure, so keep final evaluation distinct from the data used to make those choices.
Business use
Wrappers can make existing resources useful within larger systems without requiring those resources to change their interfaces. Their business value often lies in reliable translation, validation, and integration.
Document supported source formats, output fields, missing-value policy, and failure behavior. Monitor both obvious failures and plausible-looking incorrect records. For learning wrappers, document which decisions the outer procedure makes and how evaluation is separated from selection. This makes the layer's responsibilities clear and helps estimate the maintenance effort when an underlying source or learner changes.
People also ask
Is every wrapper an AI model?
No. A wrapper can be ordinary software that calls or translates another component.
What is wrapper induction?
It is learning an extraction wrapper from examples of source material and the records that should be extracted.
Does a wrapper guarantee stable integration?
No. Source structure, field meaning, or underlying interfaces can change, so validation and maintenance remain necessary.
Check your understanding
Why should a missing duration stay attached to its own course card rather than shifting values from later cards?
Answer: Record association is part of correctness. Filling fields by position across unrelated lists can create a complete-looking but false record.
Related terms
- Information extraction
- Schema
- Feature Selection
- Cross-validation
- Wrapper induction
- Data integration
- API adapter
- Validation leakage
Learn next
Extend the fictional course page with a duration written as two sessions of 45 minutes. Decide whether the wrapper should convert it to 1.5 hours or flag it for review. State the supported rule explicitly, then add an example that the rule must reject rather than guess.
More in Graphs and symbolic AI
- Type signature - A type signature specifies the types of inputs and outputs associated with a function or operation.
- UCB1 - UCB1 is a multi-armed bandit algorithm that selects an action using its average observed reward plus an exploration bonus.
- UCT - UCT is a method for guiding Monte Carlo tree search by applying upper-confidence-bound ideas at decision nodes.
- Łukasiewicz logic - Łukasiewicz logic is a family of many-valued logics associated with Jan Łukasiewicz.
- Unary constraint - A unary constraint is a rule that restricts the allowed values of one variable in a constraint satisfaction problem.
- Unbounded cost search - Unbounded-cost search seeks a valid solution without requiring its cost to fall below a specified threshold or within a specified factor of the best...
Sources
Primary sources: AIMA official index, which distinguishes Internet-site and learning senses: https://aima.cs.berkeley.edu/aima-index.html ; Kushmerick, Weld, and Doorenbos, Wrapper Induction for Information Extraction: https://homes.cs.washington.edu/~weld/papers/kushmerick-ijcai97.pdf . Learning feature-subset scope also checked against indexed excerpts of Kohavi and John's original paper: https://robotics.stanford.edu/~ronnyk/wrappers.pdf . Examples are original.
Previous: Workspace representation Next: Write - write conflict