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, OPEN-SET (1-P(OTHER)) reject rule, 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 USor 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 saysOTHER(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
| Subset | n | OFF | ON | Δ |
|---|---|---|---|---|
| All | 54 | 22/54 (40.7%) | 31/54 (57.4%) | +16.7pp |
| In-map (placer's 11) | 34 | 22/34 (64.7%) | 31/34 (91.2%) | +26.5pp |
| Off-map (OTHER) | 20 | 0/20 (0.0%) | 0/20 (0.0%) | +0.0pp |
Movement
- Wins (wrong → right): 9
- 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): 1
- Abstain/OTHER rows (no signal → must be identical OFF/ON): 2
- Invariant violations (abstained but OFF≠ON): 0 ✅
Wins
| input | gold | placer | OFF | ON |
|---|---|---|---|---|
| Jordan, MN 55352 | US | US 0.97 | IT | US |
| Lebanon, TN 37087 | US | US 0.99 | IT | US |
| San Jose, CA 95113 | US | US 1.00 | IT | US |
| Mexico, MO 65265 | US | US 0.99 | IT | US |
| Los Angeles, CA 90012 | US | US 0.81 | IT | US |
| Sacramento, CA 95814 | US | US 1.00 | IT | US |
| Philadelphia, PA 19103 | US | US 0.95 | IT | US |
| Birmingham, AL 35203 | US | US 0.79 | GB | US |
| 500 Oak Lane, Denver, CO 80202 | US | US 1.00 | IT | US |
Neutral flips
| input | gold | placer | OFF | ON |
|---|---|---|---|---|
| San Jose, Costa Rica | CR | ES 0.80 | US | ES |
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% → 57.4% (in-map 64.7→91.2).