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 aname, 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 itsScorerResult.score weighted by that scorer’s weight. The combined confidence is the weighted average:
- 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_confidenceis the accept floor. After the matrix is built,optimal_assignruns the Hungarian algorithm for the best global 1:1 assignment, then drops any assigned pair scoring belowmin_confidence(default0.2). Those source and target fields land inunmapped_source/unmapped_targetinstead.
Configuring a mapping run
MapEngine(...) takes the run knobs as keyword arguments:
Optional YAML config
When you passconfig_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: setfalseto 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>.
infermap.yaml.example:
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
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.