Skip to main content

Coarse-placer soft prior — assembled-pipeline country-disambiguation gate (#244 M1)

Generated by scripts/eval/coarse-placer-country-disambig.ts. EvalevalRunning the model against a held-out golden dataset and computing per-component F1, exact-match, calibration, and resolved-coordinate error. set: data/eval/external/country-homograph-real.jsonl (54 rows). Modelneural classifierThe machine learning model at the core of Mailwoman's parser — a transformer encoder (~30M parameters) trained from scratch to do BIO token classification over addresses. It learns the 'grammar' of address formats; the gazetteer supplies the 'atlas.' 4.6.0, abstainBelow 0.9, anchorWeight 1. Right-countrycountryThe top-level address component (an ISO country). Closed-vocabulary, so it is best handled by a deterministic matcher feeding a proposal rather than a retrained model head. = most-specific resolved admin node's spr.country vs gold, NO defaultCountry (honest unknown-countrycountryThe top-level address component (an ISO country). Closed-vocabulary, so it is best handled by a deterministic matcher feeding a proposal rather than a retrained model head. baseline).

Scope. The baseline resolves with NO defaultCountry — the multi-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. / no-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for.-gate path the soft priorsoft priorOutside knowledge fed to the model or resolver as overridable evidence (a feature, a score term) rather than a hard filter. A focus-country hint becomes an anchor feature; a focus-point becomes a ranking term. exists to serve (library batchbatch sizeHow many examples the model processes before each parameter update. Larger batches give smoother gradients but cost more memory; gradient accumulation simulates a big batch on a small GPU. geocodinggeocodingThe process of converting an address into geographic coordinates (latitude and longitude). Mailwoman geocodes in a multi-tier cascade: exact address-point match → street interpolation → locality centroid. Each tier is progressively coarser but more widely available., the client demo). A flow that already pins --default-country US or runs the locale gatelocale gateStage 2 of the runtime pipeline: rule-based locale detection from the query shape's script and known-format signals. Returns a LocaleHint with the top candidate and alternatives, surfacing disagreement with an explicit --locale flag. fixes most in-map cases without the prior; this gate isolates the prior's contribution where no other countrycountryThe top-level address component (an ISO country). Closed-vocabulary, so it is best handled by a deterministic matcher feeding a proposal rather than a retrained model head. signal exists. Off-map rows (gold ∉ the 11) are the graceful-degradation check: the placer says OTHER (or a low-confidence abstain) and injects no posterior, so the resolverresolverThe component that converts parsed address components (locality, region, postcode) into coordinates by looking them up in the gazetteer. The resolver ranks candidates by name match, population, and proximity, and returns the best-matching place with its centroid or polygon. ranks unconstrained — the prior must not move them.

Right-country rate — WITHOUT vs WITH the prior

SubsetnOFFONΔ
All5422/54 (40.7%)29/54 (53.7%)+13.0pp
In-map (placer's 11)3422/34 (64.7%)29/34 (85.3%)+20.6pp
Off-map (OTHER)200/20 (0.0%)0/20 (0.0%)+0.0pp

Movement

  • Wins (wrong → right): 7
  • Regressions (right → wrong): 0
  • Neutral flips (countrycountryThe top-level address component (an ISO country). Closed-vocabulary, so it is best handled by a deterministic matcher feeding a proposal rather than a retrained model head. changed, correctness unchanged): 0
  • Abstain/OTHER rows (no signal → must be identical OFF/ON): 14
  • Invariant violations (abstained but OFF≠ON): 0 ✅

Wins

inputgoldplacerOFFON
Jordan, MN 55352USUS 0.97ITUS
Lebanon, TN 37087USUS 0.99ITUS
San Jose, CA 95113USUS 1.00ITUS
Mexico, MO 65265USUS 0.99ITUS
Sacramento, CA 95814USUS 1.00ITUS
Philadelphia, PA 19103USUS 0.95ITUS
500 Oak Lane, Denver, CO 80202USUS 1.00ITUS

Verdict

PASS — no regression; right-countrycountryThe top-level address component (an ISO country). Closed-vocabulary, so it is best handled by a deterministic matcher feeding a proposal rather than a retrained model head. 40.7% → 53.7% (in-map 64.7→85.3).