Skip to main content
InferMap (GoldenSchema) maps messy source columns onto a known target schema. For every source-by-target field pair it runs a pipeline of independent scorers, combines their opinions into a single confidence, and then picks the best 1:1 assignment across the whole M x N matrix with the Hungarian algorithm. Each accepted mapping carries a confidence in 0.0..1.0 and a human-readable reason. Mapping runs after schema extraction (which profiles each column: dtype, null rate, unique rate, and sample values) and produces (source_field, target_field, confidence) triples plus the per-scorer breakdown behind each one.

Scorer reference

Each scorer is a small class with a name, a default weight, and a score(source, target) method that returns a ScorerResult (a score plus reasoning) or None to abstain. Abstaining matters: a scorer that has no opinion returns None and is left out of the weighted average entirely, rather than dragging the pair down with a zero. The default pipeline (default_scorers()) is the six non-LLM scorers above, evaluated in this order: ExactScorer, AliasScorer, PatternTypeScorer, ProfileScorer, FuzzyNameScorer, InitialismScorer. LLMScorer is opt-in and must be added explicitly.

Profile sub-weights

ProfileScorer is itself a weighted blend of five column-shape comparisons: It abstains when either column has zero rows.

How the scores combine

For each pair, every scorer that does not abstain contributes its ScorerResult.score weighted by that scorer’s weight. The combined confidence is the weighted average:
Two rules shape the result:
  • Minimum contributors. A pair needs at least 2 non-abstaining scorers or its combined score is forced to 0.0. This stops a single always-on scorer (like FuzzyNameScorer) from carrying a mapping on its own.
  • min_confidence is the accept floor. After the matrix is built, optimal_assign runs the Hungarian algorithm for the best global 1:1 assignment, then drops any assigned pair scoring below min_confidence (default 0.2). Those source and target fields land in unmapped_source / unmapped_target instead.
A scorer that raises is caught, logged, and treated as an abstain, so one bad custom scorer never fails the run.

Configuring a mapping run

MapEngine(...) takes the run knobs as keyword arguments:

Optional YAML config

When you pass config_path, the YAML can load domain dictionaries, enable or reweight individual scorers, and add aliases. Recognized keys:
  • domains: list of domain dictionaries to merge in.
  • scorers.<Name>.enabled: set false to drop a scorer from the pipeline.
  • scorers.<Name>.weight: override that scorer’s default weight.
  • aliases.<canonical>: a list of extra alias names that resolve to <canonical>.
This is the shape of infermap.yaml.example:
A fuller config that also pulls in domain dictionaries:

Inference vocabularies

Two small vocabularies drive the type-aware scorers.

Data types

VALID_DTYPES is the closed set of dtypes a column can carry (FieldInfo.dtype). Anything else is coerced to string.

Semantic pattern types

SEMANTIC_TYPES (in scorers/pattern_type.py) is the ordered set of regex-detected value shapes PatternTypeScorer classifies against. Earlier entries win when several patterns match. A column is assigned a type only when at least 60 percent of its sampled values match.

Python example

Each FieldMapping also carries a breakdown dict of scorer_name -> ScorerResult, so you can inspect exactly which scorers contributed and what each one saw. For the always-current, code-generated list of every MapEngine argument, CLI option, and vocabulary value, see the config matrix. For install, quickstart, and the TypeScript API, see the overview.