@mailwoman/registry 9.4.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/lib/address-key.ts +14 -10
- package/lib/geocode-handler.ts +6 -4
- package/lib/geojson.ts +13 -17
- package/lib/ingest.ts +57 -83
- package/lib/learned-scorer.ts +38 -44
- package/lib/map-html.ts +24 -70
- package/lib/models/crosssource-gbt-en-us.ts +9 -7
- package/lib/models/dedup-gbt-en-us.ts +9 -8
- package/lib/models/org-crosssource-gbt-en-us.ts +10 -8
- package/lib/reconcile.ts +45 -55
- package/lib/resolve.ts +180 -124
- package/lib/types.ts +18 -12
- package/out/address-key.d.ts +14 -10
- package/out/address-key.d.ts.map +1 -1
- package/out/address-key.js +14 -10
- package/out/address-key.js.map +1 -1
- package/out/geocode-handler.d.ts +6 -4
- package/out/geocode-handler.d.ts.map +1 -1
- package/out/geocode-handler.js +6 -4
- package/out/geocode-handler.js.map +1 -1
- package/out/geojson.d.ts +9 -5
- package/out/geojson.d.ts.map +1 -1
- package/out/geojson.js +13 -15
- package/out/geojson.js.map +1 -1
- package/out/ingest.d.ts +46 -75
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +27 -54
- package/out/ingest.js.map +1 -1
- package/out/learned-scorer.d.ts +29 -26
- package/out/learned-scorer.d.ts.map +1 -1
- package/out/learned-scorer.js +31 -39
- package/out/learned-scorer.js.map +1 -1
- package/out/map-html.d.ts +13 -32
- package/out/map-html.d.ts.map +1 -1
- package/out/map-html.js +9 -62
- package/out/map-html.js.map +1 -1
- package/out/models/crosssource-gbt-en-us.d.ts +9 -7
- package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/crosssource-gbt-en-us.js +9 -7
- package/out/models/crosssource-gbt-en-us.js.map +1 -1
- package/out/models/dedup-gbt-en-us.d.ts +9 -8
- package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
- package/out/models/dedup-gbt-en-us.js +9 -8
- package/out/models/dedup-gbt-en-us.js.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.d.ts +10 -8
- package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.js +10 -8
- package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
- package/out/reconcile.d.ts +35 -50
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +19 -43
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts +150 -90
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +62 -63
- package/out/resolve.js.map +1 -1
- package/out/tools/coverage-reconciliation.d.ts +23 -23
- package/out/tools/coverage-reconciliation.d.ts.map +1 -1
- package/out/tools/coverage-reconciliation.js +15 -26
- package/out/tools/coverage-reconciliation.js.map +1 -1
- package/out/tools/cross/dataset-correlation.d.ts +58 -0
- package/out/tools/cross/dataset-correlation.d.ts.map +1 -0
- package/out/tools/{cross-dataset-correlation.js → cross/dataset-correlation.js} +10 -62
- package/out/tools/cross/dataset-correlation.js.map +1 -0
- package/out/tools/cross/source-threshold-sweep.d.ts +60 -0
- package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -0
- package/out/tools/{cross-source-threshold-sweep.js → cross/source-threshold-sweep.js} +15 -41
- package/out/tools/cross/source-threshold-sweep.js.map +1 -0
- package/out/tools/dedup-ceiling.d.ts +23 -26
- package/out/tools/dedup-ceiling.d.ts.map +1 -1
- package/out/tools/dedup-ceiling.js +22 -41
- package/out/tools/dedup-ceiling.js.map +1 -1
- package/out/tools/eval-geocoder.d.ts +22 -15
- package/out/tools/eval-geocoder.d.ts.map +1 -1
- package/out/tools/eval-geocoder.js +5 -6
- package/out/tools/eval-geocoder.js.map +1 -1
- package/out/tools/geocoder/namesake-probe.d.ts +33 -0
- package/out/tools/geocoder/namesake-probe.d.ts.map +1 -0
- package/out/tools/{geocoder-namesake-probe.js → geocoder/namesake-probe.js} +7 -8
- package/out/tools/geocoder/namesake-probe.js.map +1 -0
- package/out/tools/geocoder/vs-provided-coords.d.ts +53 -0
- package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -0
- package/out/tools/{geocoder-vs-provided-coords.js → geocoder/vs-provided-coords.js} +31 -28
- package/out/tools/geocoder/vs-provided-coords.js.map +1 -0
- package/out/tools/gold-set-sample.d.ts +27 -18
- package/out/tools/gold-set-sample.d.ts.map +1 -1
- package/out/tools/gold-set-sample.js +18 -22
- package/out/tools/gold-set-sample.js.map +1 -1
- package/out/tools/learned/scorer/clustering-eval.d.ts +77 -0
- package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -0
- package/out/tools/{learned-scorer-clustering-eval.js → learned/scorer/clustering-eval.js} +29 -39
- package/out/tools/learned/scorer/clustering-eval.js.map +1 -0
- package/out/tools/learned/scorer/crossstate-eval.d.ts +65 -0
- package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -0
- package/out/tools/{learned-scorer-crossstate-eval.js → learned/scorer/crossstate-eval.js} +20 -26
- package/out/tools/learned/scorer/crossstate-eval.js.map +1 -0
- package/out/tools/learned/scorer/eval.d.ts +60 -0
- package/out/tools/learned/scorer/eval.d.ts.map +1 -0
- package/out/tools/{learned-scorer-eval.js → learned/scorer/eval.js} +12 -72
- package/out/tools/learned/scorer/eval.js.map +1 -0
- package/out/tools/matcher-scale.d.ts +12 -17
- package/out/tools/matcher-scale.d.ts.map +1 -1
- package/out/tools/matcher-scale.js +11 -29
- package/out/tools/matcher-scale.js.map +1 -1
- package/out/tools/nppes/dedup-benchmark.d.ts +81 -0
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -0
- package/out/tools/{nppes-dedup-benchmark.js → nppes/dedup-benchmark.js} +21 -67
- package/out/tools/nppes/dedup-benchmark.js.map +1 -0
- package/out/tools/nppes/org-name.d.ts +5 -4
- package/out/tools/nppes/org-name.d.ts.map +1 -1
- package/out/tools/nppes/org-name.js +2 -2
- package/out/tools/nppes/org-name.js.map +1 -1
- package/out/tools/nppes/overmerge-packet.d.ts +15 -11
- package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
- package/out/tools/nppes/overmerge-packet.js +7 -8
- package/out/tools/nppes/overmerge-packet.js.map +1 -1
- package/out/tools/nppes/report.d.ts +17 -13
- package/out/tools/nppes/report.d.ts.map +1 -1
- package/out/tools/nppes/report.js +6 -14
- package/out/tools/nppes/report.js.map +1 -1
- package/out/tools/nppes/sample.d.ts +28 -17
- package/out/tools/nppes/sample.d.ts.map +1 -1
- package/out/tools/nppes/sample.js +23 -26
- package/out/tools/nppes/sample.js.map +1 -1
- package/out/tools/nppes/scoring.d.ts +7 -6
- package/out/tools/nppes/scoring.d.ts.map +1 -1
- package/out/tools/nppes/scoring.js +6 -5
- package/out/tools/nppes/scoring.js.map +1 -1
- package/out/tools/nppes/settings.d.ts +10 -7
- package/out/tools/nppes/settings.d.ts.map +1 -1
- package/out/tools/nppes/settings.js +16 -16
- package/out/tools/nppes/settings.js.map +1 -1
- package/out/tools/nppes/truth-grains.d.ts +36 -23
- package/out/tools/nppes/truth-grains.d.ts.map +1 -1
- package/out/tools/nppes/truth-grains.js +36 -20
- package/out/tools/nppes/truth-grains.js.map +1 -1
- package/out/tools/shared.d.ts +63 -59
- package/out/tools/shared.d.ts.map +1 -1
- package/out/tools/shared.js +49 -66
- package/out/tools/shared.js.map +1 -1
- package/out/tools/train/cross-gbt.d.ts +88 -0
- package/out/tools/train/cross-gbt.d.ts.map +1 -0
- package/out/tools/{train-cross-gbt.js → train/cross-gbt.js} +15 -26
- package/out/tools/train/cross-gbt.js.map +1 -0
- package/out/tools/train/gbt.d.ts +85 -0
- package/out/tools/train/gbt.d.ts.map +1 -0
- package/out/tools/{train-gbt.js → train/gbt.js} +28 -32
- package/out/tools/train/gbt.js.map +1 -0
- package/out/tools/train/org-cross-gbt.d.ts +84 -0
- package/out/tools/train/org-cross-gbt.d.ts.map +1 -0
- package/out/tools/{train-org-cross-gbt.js → train/org-cross-gbt.js} +19 -23
- package/out/tools/train/org-cross-gbt.js.map +1 -0
- package/out/tools/txhhsc-to-oarow.d.ts +14 -9
- package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
- package/out/tools/txhhsc-to-oarow.js +16 -15
- package/out/tools/txhhsc-to-oarow.js.map +1 -1
- package/out/tools/viz/browser.d.ts +6 -5
- package/out/tools/viz/browser.d.ts.map +1 -1
- package/out/tools/viz/browser.js +6 -5
- package/out/tools/viz/browser.js.map +1 -1
- package/out/tools/viz/cross-dataset-map.d.ts +7 -4
- package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
- package/out/tools/viz/cross-dataset-map.js +9 -6
- package/out/tools/viz/cross-dataset-map.js.map +1 -1
- package/out/tools/viz/geocode-first-surface.d.ts +10 -5
- package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
- package/out/tools/viz/geocode-first-surface.js +16 -11
- package/out/tools/viz/geocode-first-surface.js.map +1 -1
- package/out/tools/viz/{render-map.d.ts → render/map.d.ts} +6 -6
- package/out/tools/viz/render/map.d.ts.map +1 -0
- package/out/tools/viz/{render-map.js → render/map.js} +7 -6
- package/out/tools/viz/render/map.js.map +1 -0
- package/out/tools/viz/render.d.ts +12 -8
- package/out/tools/viz/render.d.ts.map +1 -1
- package/out/tools/viz/render.js +8 -7
- package/out/tools/viz/render.js.map +1 -1
- package/out/tools/viz/source-provenance-map.d.ts +19 -7
- package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
- package/out/tools/viz/source-provenance-map.js +11 -8
- package/out/tools/viz/source-provenance-map.js.map +1 -1
- package/out/tools/viz/yardstick-figure.d.ts +2 -21
- package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
- package/out/tools/viz/yardstick-figure.js +3 -39
- package/out/tools/viz/yardstick-figure.js.map +1 -1
- package/out/types.d.ts +17 -11
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -2
- package/out/types.js.map +1 -1
- package/package.json +41 -184
- package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
- package/{lib/tools/cross-dataset-correlation.ts → tools/cross/dataset-correlation.ts} +31 -72
- package/{lib/tools/cross-source-threshold-sweep.ts → tools/cross/source-threshold-sweep.ts} +29 -46
- package/{lib/tools → tools}/dedup-ceiling.ts +34 -45
- package/tools/eval-geocoder.ts +74 -0
- package/{lib/tools/geocoder-namesake-probe.ts → tools/geocoder/namesake-probe.ts} +9 -8
- package/{lib/tools/geocoder-vs-provided-coords.ts → tools/geocoder/vs-provided-coords.ts} +39 -30
- package/{lib/tools → tools}/gold-set-sample.ts +35 -29
- package/{lib/tools/learned-scorer-clustering-eval.ts → tools/learned/scorer/clustering-eval.ts} +49 -45
- package/{lib/tools/learned-scorer-crossstate-eval.ts → tools/learned/scorer/crossstate-eval.ts} +34 -30
- package/{lib/tools/learned-scorer-eval.ts → tools/learned/scorer/eval.ts} +35 -78
- package/{lib/tools → tools}/matcher-scale.ts +21 -33
- package/{lib/tools/nppes-dedup-benchmark.ts → tools/nppes/dedup-benchmark.ts} +37 -82
- package/{lib/tools → tools}/nppes/org-name.ts +5 -4
- package/{lib/tools → tools}/nppes/overmerge-packet.ts +17 -13
- package/{lib/tools → tools}/nppes/report.ts +32 -25
- package/{lib/tools → tools}/nppes/sample.ts +41 -36
- package/{lib/tools → tools}/nppes/scoring.ts +7 -6
- package/{lib/tools → tools}/nppes/settings.ts +16 -16
- package/{lib/tools → tools}/nppes/truth-grains.ts +46 -26
- package/{lib/tools → tools}/shared.ts +73 -83
- package/{lib/tools/train-cross-gbt.ts → tools/train/cross-gbt.ts} +38 -34
- package/{lib/tools/train-gbt.ts → tools/train/gbt.ts} +55 -41
- package/{lib/tools/train-org-cross-gbt.ts → tools/train/org-cross-gbt.ts} +39 -30
- package/{lib/tools → tools}/txhhsc-to-oarow.ts +24 -18
- package/{lib/tools → tools}/viz/browser.ts +6 -5
- package/{lib/tools → tools}/viz/cross-dataset-map.ts +15 -9
- package/{lib/tools → tools}/viz/geocode-first-surface.ts +28 -17
- package/{lib/tools/viz/render-map.ts → tools/viz/render/map.ts} +7 -6
- package/{lib/tools → tools}/viz/render.ts +16 -11
- package/{lib/tools → tools}/viz/source-provenance-map.ts +30 -15
- package/{lib/tools → tools}/viz/yardstick-figure.ts +6 -43
- package/lib/tools/eval-geocoder.ts +0 -67
- package/lib/tools/index.ts +0 -31
- package/out/tools/cross-dataset-correlation.d.ts +0 -65
- package/out/tools/cross-dataset-correlation.d.ts.map +0 -1
- package/out/tools/cross-dataset-correlation.js.map +0 -1
- package/out/tools/cross-source-threshold-sweep.d.ts +0 -66
- package/out/tools/cross-source-threshold-sweep.d.ts.map +0 -1
- package/out/tools/cross-source-threshold-sweep.js.map +0 -1
- package/out/tools/geocoder-namesake-probe.d.ts +0 -32
- package/out/tools/geocoder-namesake-probe.d.ts.map +0 -1
- package/out/tools/geocoder-namesake-probe.js.map +0 -1
- package/out/tools/geocoder-vs-provided-coords.d.ts +0 -50
- package/out/tools/geocoder-vs-provided-coords.d.ts.map +0 -1
- package/out/tools/geocoder-vs-provided-coords.js.map +0 -1
- package/out/tools/index.d.ts +0 -31
- package/out/tools/index.d.ts.map +0 -1
- package/out/tools/index.js +0 -31
- package/out/tools/index.js.map +0 -1
- package/out/tools/learned-scorer-clustering-eval.d.ts +0 -74
- package/out/tools/learned-scorer-clustering-eval.d.ts.map +0 -1
- package/out/tools/learned-scorer-clustering-eval.js.map +0 -1
- package/out/tools/learned-scorer-crossstate-eval.d.ts +0 -59
- package/out/tools/learned-scorer-crossstate-eval.d.ts.map +0 -1
- package/out/tools/learned-scorer-crossstate-eval.js.map +0 -1
- package/out/tools/learned-scorer-eval.d.ts +0 -77
- package/out/tools/learned-scorer-eval.d.ts.map +0 -1
- package/out/tools/learned-scorer-eval.js.map +0 -1
- package/out/tools/nppes-dedup-benchmark.d.ts +0 -101
- package/out/tools/nppes-dedup-benchmark.d.ts.map +0 -1
- package/out/tools/nppes-dedup-benchmark.js.map +0 -1
- package/out/tools/train-cross-gbt.d.ts +0 -78
- package/out/tools/train-cross-gbt.d.ts.map +0 -1
- package/out/tools/train-cross-gbt.js.map +0 -1
- package/out/tools/train-gbt.d.ts +0 -69
- package/out/tools/train-gbt.d.ts.map +0 -1
- package/out/tools/train-gbt.js.map +0 -1
- package/out/tools/train-org-cross-gbt.d.ts +0 -71
- package/out/tools/train-org-cross-gbt.d.ts.map +0 -1
- package/out/tools/train-org-cross-gbt.js.map +0 -1
- package/out/tools/viz/render-map.d.ts.map +0 -1
- package/out/tools/viz/render-map.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dedup-ceiling.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"dedup-ceiling.js","sourceRoot":"","sources":["../../tools/dedup-ceiling.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C,OAAO,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,WAAW,EAA0B,MAAM,eAAe,CAAA;AAEnH;;GAEG;AACH,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAoC/B;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CACjC,OAAO,GAAwB,EAAE,EACjC,MAA+B;IAE/B,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAA;IAC5E,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,MAAM,CAAA;IACjC,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;IAClC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,GAAG,CAAA;IAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,IAAI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HAAmH;YACnH,8DAA8D;QAC/D,gHAAgH;YAC/G,MAAM,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,sFAAsF;YACvH,kHAAkH;YAClH,mHAAmH;YACnH,yDAAyD;QAC1D,EAAE;QACF,kHAAkH;YACjH,wDAAwD,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,iCAAiC;YACpH,6GAA6G;YAC7G,wCAAwC;QACzC,EAAE;QACF,YAAY;QACZ,EAAE;QACF,kHAAkH;YACjH,2GAA2G;YAC3G,0EAA0E;QAC3E,kHAAkH;YACjH,iHAAiH;YACjH,+GAA+G;QAChH,6GAA6G;YAC5G,8FAA8F;QAC/F,EAAE;KACF,CAAA;IAED,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAE3B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAEf,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAChC,MAAM,EAAE,CAAC,aAAa,MAAM,EAAE,CAAC,CAAA;IAChC,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAA;AACxC,CAAC"}
|
|
@@ -3,35 +3,36 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The injected-geocoder
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `mailwoman/geocode-core` (see `mailwoman/commands/registry/run.tsx`)
|
|
11
|
-
* `GeocodeAddress` interface philosophy: ingest never pins the runtime, the caller wires it.
|
|
6
|
+
* The injected-geocoder interface for the record-matcher tools. The registry package never imports
|
|
7
|
+
* the heavy runtime (neural parser, WOF resolver, per-state extracts), since `mailwoman` depends on
|
|
8
|
+
* `@mailwoman/registry` and the reverse import would cycle the workspace graph. Each tool instead
|
|
9
|
+
* takes an {@linkcode EvalGeocoderFactory} the CLI command constructs from
|
|
10
|
+
* `mailwoman/geocode-core` (see `mailwoman/commands/registry/run.tsx`).
|
|
12
11
|
*/
|
|
13
12
|
import type { ColumnMapping, GeocodeAddress, SourceRecord } from "#index";
|
|
14
13
|
/**
|
|
15
|
-
* The raw single-address geocode surface
|
|
14
|
+
* The raw single-address geocode surface used by the probe tools, mirroring
|
|
15
|
+
* `mailwoman/geocode-core`'s wire shape.
|
|
16
16
|
*/
|
|
17
17
|
export interface EvalGeocodeResult {
|
|
18
18
|
lat: number | null;
|
|
19
19
|
lon: number | null;
|
|
20
20
|
/**
|
|
21
|
-
* Wire key
|
|
21
|
+
* Wire key that mirrors `GeocodeResult.resolution_tier`.
|
|
22
22
|
*/
|
|
23
23
|
resolution_tier?: string | null;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* A constructed geocoder: the matcher's ingest interface, the raw geocode
|
|
26
|
+
* A constructed geocoder: the matcher's ingest interface, the raw geocode and the handle release.
|
|
27
27
|
*/
|
|
28
28
|
export interface EvalGeocoder extends Disposable {
|
|
29
29
|
/**
|
|
30
|
-
* The matcher's ingest interface (parse
|
|
30
|
+
* The matcher's ingest interface (parse and geocode to `PostalAddress`),
|
|
31
|
+
* built through `geocodeAddressVia`.
|
|
31
32
|
*/
|
|
32
33
|
geocodeAddress: GeocodeAddress;
|
|
33
34
|
/**
|
|
34
|
-
* Raw single-address geocode
|
|
35
|
+
* Raw single-address geocode returning lat, lon and resolution tier.
|
|
35
36
|
*/
|
|
36
37
|
geocode: (address: string) => Promise<EvalGeocodeResult>;
|
|
37
38
|
}
|
|
@@ -40,17 +41,23 @@ export interface EvalGeocoder extends Disposable {
|
|
|
40
41
|
*/
|
|
41
42
|
export interface EvalGeocoderInit {
|
|
42
43
|
/**
|
|
43
|
-
*
|
|
44
|
+
* All-caps case normalization.
|
|
45
|
+
*
|
|
46
|
+
* Default on.
|
|
47
|
+
* `nppes-benchmark --legacy-join` turns it off for the A/B.
|
|
44
48
|
*/
|
|
45
49
|
normalizeCase?: boolean;
|
|
46
50
|
}
|
|
47
51
|
/**
|
|
48
|
-
* Build a geocoder on demand
|
|
52
|
+
* Build a geocoder on demand.
|
|
53
|
+
*
|
|
54
|
+
* Tools construct it late and dispose it as soon as geocoding is done.
|
|
49
55
|
*/
|
|
50
56
|
export type EvalGeocoderFactory = (init?: EvalGeocoderInit) => Promise<EvalGeocoder>;
|
|
51
57
|
/**
|
|
52
|
-
* The threaded geocode surface (`mailwoman/geocode-stream` behind the interface)
|
|
53
|
-
* --parallel-geocode`.
|
|
58
|
+
* The threaded geocode surface (`mailwoman/geocode-stream` behind the interface)
|
|
59
|
+
* for `nppes-dedup-benchmark --parallel-geocode`.
|
|
60
|
+
* It yields enriched records in completion order.
|
|
54
61
|
*/
|
|
55
62
|
export type EvalGeocodeStream = (records: SourceRecord[], opts: {
|
|
56
63
|
mapping: ColumnMapping;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-geocoder.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"eval-geocoder.d.ts","sourceRoot":"","sources":["../../tools/eval-geocoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAEzE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC/C;;;OAGG;IACH,cAAc,EAAE,cAAc,CAAA;IAC9B;;OAEG;IACH,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAA;CAIxD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;CACvB;AAED;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;AAEpF;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC/B,OAAO,EAAE,YAAY,EAAE,EACvB,IAAI,EAAE;IAAE,OAAO,EAAE,aAAa,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,KACjD,aAAa,CAAC,YAAY,CAAC,CAAA"}
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The injected-geocoder
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* `mailwoman/geocode-core` (see `mailwoman/commands/registry/run.tsx`)
|
|
11
|
-
* `GeocodeAddress` interface philosophy: ingest never pins the runtime, the caller wires it.
|
|
6
|
+
* The injected-geocoder interface for the record-matcher tools. The registry package never imports
|
|
7
|
+
* the heavy runtime (neural parser, WOF resolver, per-state extracts), since `mailwoman` depends on
|
|
8
|
+
* `@mailwoman/registry` and the reverse import would cycle the workspace graph. Each tool instead
|
|
9
|
+
* takes an {@linkcode EvalGeocoderFactory} the CLI command constructs from
|
|
10
|
+
* `mailwoman/geocode-core` (see `mailwoman/commands/registry/run.tsx`).
|
|
12
11
|
*/
|
|
13
12
|
export {};
|
|
14
13
|
//# sourceMappingURL=eval-geocoder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-geocoder.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"eval-geocoder.js","sourceRoot":"","sources":["../../tools/eval-geocoder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Admin-tier wrong-region probe. When no street extract covers an address, the admin cascade can
|
|
7
|
+
* resolve the locality by name and, when the region or postcode constraint is weak, pick the
|
|
8
|
+
* population-dominant foreign namesake instead of the in-state Texas city. This probes a curated
|
|
9
|
+
* set of TX namesake cities, with and without ZIP. It flags any result outside the Texas bounding
|
|
10
|
+
* box.
|
|
11
|
+
*
|
|
12
|
+
* Run: `mailwoman registry scorer-eval namesake-probe`
|
|
13
|
+
*/
|
|
14
|
+
import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
|
|
15
|
+
/**
|
|
16
|
+
* Options for {@linkcode geocoderNamesakeProbe}.
|
|
17
|
+
*/
|
|
18
|
+
export interface GeocoderNamesakeProbeOptions {
|
|
19
|
+
/**
|
|
20
|
+
* The injected geocoder factory.
|
|
21
|
+
*
|
|
22
|
+
* The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
|
|
23
|
+
*/
|
|
24
|
+
createGeocoder: EvalGeocoderFactory;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Probe a curated set of TX namesake cities and print one line per variant to stdout.
|
|
28
|
+
*/
|
|
29
|
+
export declare function geocoderNamesakeProbe(options: GeocoderNamesakeProbeOptions, report?: (line: string) => void): Promise<{
|
|
30
|
+
wrongRegion: number;
|
|
31
|
+
total: number;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=namesake-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namesake-probe.d.ts","sourceRoot":"","sources":["../../../tools/geocoder/namesake-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG/D;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAA;CACnC;AAgBD;;GAEG;AACH,wBAAsB,qBAAqB,CAC1C,OAAO,EAAE,4BAA4B,EACrC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAuCjD"}
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Admin-tier wrong-region probe
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* and flags any result outside the Texas bounding box.
|
|
6
|
+
* Admin-tier wrong-region probe. When no street extract covers an address, the admin cascade can
|
|
7
|
+
* resolve the locality by name and, when the region or postcode constraint is weak, pick the
|
|
8
|
+
* population-dominant foreign namesake instead of the in-state Texas city. This probes a curated
|
|
9
|
+
* set of TX namesake cities, with and without ZIP. It flags any result outside the Texas bounding
|
|
10
|
+
* box.
|
|
12
11
|
*
|
|
13
12
|
* Run: `mailwoman registry scorer-eval namesake-probe`
|
|
14
13
|
*/
|
|
@@ -28,7 +27,7 @@ const CASES = [
|
|
|
28
27
|
{ city: "Odessa", zip: "79761", tx: [31.85, -102.37], namesake: "Odessa, Ukraine (46.48, 30.72)" },
|
|
29
28
|
];
|
|
30
29
|
/**
|
|
31
|
-
*
|
|
30
|
+
* Probe a curated set of TX namesake cities and print one line per variant to stdout.
|
|
32
31
|
*/
|
|
33
32
|
export async function geocoderNamesakeProbe(options, report) {
|
|
34
33
|
report?.("[A] building the geocoder…");
|
|
@@ -58,4 +57,4 @@ export async function geocoderNamesakeProbe(options, report) {
|
|
|
58
57
|
console.log(`\n ${wrongRegion}/${total} variants resolved OUTSIDE Texas (wrong-region).`);
|
|
59
58
|
return { wrongRegion, total };
|
|
60
59
|
}
|
|
61
|
-
//# sourceMappingURL=
|
|
60
|
+
//# sourceMappingURL=namesake-probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namesake-probe.js","sourceRoot":"","sources":["../../../tools/geocoder/namesake-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAcxC;;GAEG;AACH,MAAM,KAAK,GAAiF;IAC3F,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,6BAA6B,EAAE;IAC7F,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,+BAA+B,EAAE;IAC/F,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,gCAAgC,EAAE;IACpG,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,8BAA8B,EAAE;IAC9F,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,8BAA8B,EAAE;IAC9F,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE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AAG,CAAC,CAAA;YACjC,MAAM,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,GAAG,CAAC,CAAA;YAEtD,IAAI,CAAC,EAAE,EAAE,CAAC;gBACT,WAAW,EAAE,CAAA;YACd,CAAC;YAED,OAAO,CAAC,GAAG,CACV,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,gBAAgB,MAAM,OAAO,QAAQ,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;gBAC3F,IAAI,CAAC,CAAC,eAAe,IAAI,GAAG,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,EAAE,CACjI,CAAA;QACF,CAAC;IACF,CAAC;IAED,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAA;IAE1B,OAAO,CAAC,GAAG,CAAC,OAAO,WAAW,IAAI,KAAK,kDAAkD,CAAC,CAAA;IAE1F,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,CAAA;AAC9B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Geocoder validation against provided coordinates. TX HHSC's nursing-facilities registry ships
|
|
7
|
+
* a `Geo Location` (`lat,lon`) per facility alongside its physical address. Geocode the address
|
|
8
|
+
* with mailwoman's parser and resolver, then measure the great-circle delta to the provided point,
|
|
9
|
+
* broken down by resolution tier.
|
|
10
|
+
*
|
|
11
|
+
* The provided coordinate is treated as ground truth for this eval, with the caveat that it is
|
|
12
|
+
* itself a third-party geocode of unknown provenance. A large delta is a discrepancy to inspect
|
|
13
|
+
* rather than automatically our error.
|
|
14
|
+
*
|
|
15
|
+
* Run: `mailwoman registry scorer-eval vs-provided-coords [--max 1176] [--wof <admin.db>]
|
|
16
|
+
* [--data-root <dir>] [--out-md docs/articles/evals/resolver-geo/<date>-...md]`
|
|
17
|
+
*/
|
|
18
|
+
import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
|
|
19
|
+
/**
|
|
20
|
+
* Options for {@linkcode geocoderVsProvidedCoords}.
|
|
21
|
+
*/
|
|
22
|
+
export interface GeocoderVsProvidedCoordsOptions {
|
|
23
|
+
/**
|
|
24
|
+
* The injected geocoder factory.
|
|
25
|
+
*
|
|
26
|
+
* The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
|
|
27
|
+
*/
|
|
28
|
+
createGeocoder: EvalGeocoderFactory;
|
|
29
|
+
/**
|
|
30
|
+
* Record-matcher sources directory.
|
|
31
|
+
*
|
|
32
|
+
* Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
|
|
33
|
+
*/
|
|
34
|
+
sources?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Facilities geocoded.
|
|
37
|
+
*
|
|
38
|
+
* Default 2000.
|
|
39
|
+
*/
|
|
40
|
+
max?: number;
|
|
41
|
+
/**
|
|
42
|
+
* Also write the markdown report here.
|
|
43
|
+
*/
|
|
44
|
+
outMd?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Geocode each facility's physical address and measure the delta to its provided
|
|
48
|
+
* coordinate, then emit the report to stdout.
|
|
49
|
+
*/
|
|
50
|
+
export declare function geocoderVsProvidedCoords(options: GeocoderVsProvidedCoordsOptions, report?: (line: string) => void): Promise<{
|
|
51
|
+
markdown: string;
|
|
52
|
+
}>;
|
|
53
|
+
//# sourceMappingURL=vs-provided-coords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vs-provided-coords.d.ts","sourceRoot":"","sources":["../../../tools/geocoder/vs-provided-coords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAa/D;;GAEG;AACH,MAAM,WAAW,+BAA+B;IAC/C;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAA;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAqCD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,+BAA+B,EACxC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CA0H/B"}
|
|
@@ -3,18 +3,14 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Geocoder validation against provided coordinates
|
|
7
|
-
*
|
|
6
|
+
* Geocoder validation against provided coordinates. TX HHSC's nursing-facilities registry ships
|
|
7
|
+
* a `Geo Location` (`lat,lon`) per facility alongside its physical address. Geocode the address
|
|
8
|
+
* with mailwoman's parser and resolver, then measure the great-circle delta to the provided point,
|
|
9
|
+
* broken down by resolution tier.
|
|
8
10
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* tier we assign (address_point / interpolated / admin). This is an independent check of the
|
|
13
|
-
* geocoder on real facility addresses; it does not touch the matcher.
|
|
14
|
-
*
|
|
15
|
-
* The provided coordinate is treated as ground truth for _this_ eval, with the honest caveat that
|
|
16
|
-
* it is itself a third-party geocode of unknown provenance — a large delta is a discrepancy to
|
|
17
|
-
* inspect, not automatically our error.
|
|
11
|
+
* The provided coordinate is treated as ground truth for this eval, with the caveat that it is
|
|
12
|
+
* itself a third-party geocode of unknown provenance. A large delta is a discrepancy to inspect
|
|
13
|
+
* rather than automatically our error.
|
|
18
14
|
*
|
|
19
15
|
* Run: `mailwoman registry scorer-eval vs-provided-coords [--max 1176] [--wof <admin.db>]
|
|
20
16
|
* [--data-root <dir>] [--out-md docs/articles/evals/resolver-geo/<date>-...md]`
|
|
@@ -24,6 +20,7 @@ import { writeLocalFile } from "@mailwoman/core/fs/writers";
|
|
|
24
20
|
import { isPresent } from "@mailwoman/core/objects";
|
|
25
21
|
import { percentile } from "@mailwoman/core/stats";
|
|
26
22
|
import { haversineKm } from "@mailwoman/match";
|
|
23
|
+
import { TextSpliterator } from "spliterator";
|
|
27
24
|
import { streamRows } from "#index";
|
|
28
25
|
import { norm } from "#tools/shared";
|
|
29
26
|
/**
|
|
@@ -35,34 +32,41 @@ const MAX_ABS_LATITUDE = 90;
|
|
|
35
32
|
*/
|
|
36
33
|
const MAX_ABS_LONGITUDE = 180;
|
|
37
34
|
/**
|
|
38
|
-
* Parse a `lat,lon` string into a coordinate, or null if malformed
|
|
35
|
+
* Parse a `lat,lon` string into a coordinate, or null if malformed or out of range.
|
|
36
|
+
*
|
|
37
|
+
* Deliberately strict and deliberately not `GeoPoint.from()`.
|
|
38
|
+
* The provided coordinate is this eval's ground truth, so a row that cannot be read exactly
|
|
39
|
+
* is dropped (counted in `noCoord`) rather than repaired into something plausible.
|
|
40
|
+
*
|
|
41
|
+
* A silently repaired coordinate lands in the delta distribution as geocoder error.
|
|
42
|
+
*
|
|
43
|
+
* This source writes `latitude,longitude`, while `GeoPoint` reads GeoJSON `[longitude, latitude]`,
|
|
44
|
+
* so `31.5,-89.5` is a Mississippi row here and a South-Atlantic point there.
|
|
45
|
+
* `GeoPoint.from` also maps 0,0 to null.
|
|
46
|
+
*
|
|
47
|
+
* This moves Null Island out of the measured outliers and into the skipped bucket.
|
|
48
|
+
*
|
|
49
|
+
* The report attributes part of its p99/max tail to malformed provided coordinates,
|
|
50
|
+
* so those rows have to stay rejected or measured as-is, never rewritten.
|
|
39
51
|
*
|
|
40
|
-
*
|
|
41
|
-
* a row we cannot read exactly has to be _dropped_ (counted in `noCoord`) rather than repaired into something plausible
|
|
42
|
-
* — a silently repaired coordinate lands in the delta distribution as geocoder error. Two of the three divergences that
|
|
43
|
-
* originally justified this parser were defects in `GeoPoint` and were fixed on 2026-08-05: it no longer guesses axis
|
|
44
|
-
* order from the magnitudes, and an out-of-range value is now rejected instead of accepted (`200,-97.74` used to become
|
|
45
|
-
* a point). What remains is not a defect and not negotiable. This source writes `latitude,longitude`; `GeoPoint` reads
|
|
46
|
-
* GeoJSON `[longitude, latitude]`, so `31.5,-89.5` is a Mississippi row here and a South-Atlantic point there — and
|
|
47
|
-
* `GeoPoint.from` maps 0,0 to null, which moves Null Island out of the measured outliers and into the skipped bucket.
|
|
48
|
-
* The report below attributes part of its p99/max tail to malformed provided coordinates, so those rows have to stay
|
|
49
|
-
* rejected or measured as-is, never rewritten. Strictness is the measurement, not an unfinished migration.
|
|
52
|
+
* Strictness is the measurement rather than an unfinished migration.
|
|
50
53
|
*/
|
|
51
54
|
function parseLatLon(raw) {
|
|
52
55
|
if (!raw)
|
|
53
56
|
return null;
|
|
54
|
-
const [a, b] =
|
|
57
|
+
const [a, b] = TextSpliterator.from(raw, { delimiter: "," }).map(Number).toArray();
|
|
55
58
|
if (!Number.isFinite(a) || !Number.isFinite(b))
|
|
56
59
|
return null;
|
|
57
60
|
if (Math.abs(a) > MAX_ABS_LATITUDE || Math.abs(b) > MAX_ABS_LONGITUDE)
|
|
58
61
|
return null;
|
|
59
62
|
return { latitude: a, longitude: b };
|
|
60
63
|
}
|
|
61
|
-
// The core nearest-rank `percentile` (q in [0,100])
|
|
62
|
-
//
|
|
64
|
+
// The core nearest-rank `percentile` (q in [0,100]) uses a floor index and clamping.
|
|
65
|
+
// `?? NaN` returns NaN when the percentile helper returns null for an empty sample.
|
|
63
66
|
const quantile = (xs, q) => percentile(xs, q * 100) ?? Number.NaN;
|
|
64
67
|
/**
|
|
65
|
-
*
|
|
68
|
+
* Geocode each facility's physical address and measure the delta to its provided
|
|
69
|
+
* coordinate, then emit the report to stdout.
|
|
66
70
|
*/
|
|
67
71
|
export async function geocoderVsProvidedCoords(options, report) {
|
|
68
72
|
const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
|
|
@@ -99,7 +103,6 @@ export async function geocoderVsProvidedCoords(options, report) {
|
|
|
99
103
|
results.push({ deltaM, tier: g.resolution_tier ?? "unknown" });
|
|
100
104
|
}
|
|
101
105
|
geocoder[Symbol.dispose]();
|
|
102
|
-
// Overall + per-tier percentiles.
|
|
103
106
|
const all = results.map((r) => r.deltaM).toSorted((a, b) => a - b);
|
|
104
107
|
const byTier = new Map();
|
|
105
108
|
for (const r of results) {
|
|
@@ -155,4 +158,4 @@ export async function geocoderVsProvidedCoords(options, report) {
|
|
|
155
158
|
}
|
|
156
159
|
return { markdown: md };
|
|
157
160
|
}
|
|
158
|
-
//# sourceMappingURL=
|
|
161
|
+
//# sourceMappingURL=vs-provided-coords.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vs-provided-coords.js","sourceRoot":"","sources":["../../../tools/geocoder/vs-provided-coords.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AA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IN)
|
|
9
|
-
* address with near-identical
|
|
10
|
-
*
|
|
11
|
-
* gold set must cover.
|
|
6
|
+
* Gold-set sampling for adjudication. The programmatic entity truth
|
|
7
|
+
* (`nppes-dedup-benchmark.ts`) collapses only NPPES-flagged subparts (Is-Subpart plus parent
|
|
8
|
+
* LBN/TIN), so it cannot settle the genuinely ambiguous co-located collisions: distinct NPIs at
|
|
9
|
+
* one address with near-identical name text and no subpart flag for the same parent.
|
|
10
|
+
* NPI truth and programmatic rules may disagree on these pairs. A frozen
|
|
11
|
+
* adjudicated gold set must cover.
|
|
12
12
|
*
|
|
13
|
-
* This
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* entity? yes/no" and we can MEASURE how often the programmatic truth matches judgment.
|
|
13
|
+
* This scans the full TX registry without geocoding and writes each pair as a JSONL row containing
|
|
14
|
+
* both records' fields (org name, address, authorized official, taxonomy, subpart and parent
|
|
15
|
+
* flags) plus the programmatic verdict. An adjudicator (human or LLM-as-judge, flagged as such)
|
|
16
|
+
* can then label same real-world entity or not.
|
|
18
17
|
*
|
|
19
18
|
* Run: `mailwoman registry gold-set-sample [--cap 200000] [--state TX] [--tau 0.7] [--n 300]
|
|
20
19
|
* [--out-jsonl <path>]`
|
|
@@ -24,32 +23,42 @@
|
|
|
24
23
|
*/
|
|
25
24
|
export interface GoldSetSampleOptions {
|
|
26
25
|
/**
|
|
27
|
-
* Record-matcher sources directory.
|
|
26
|
+
* Record-matcher sources directory.
|
|
27
|
+
*
|
|
28
|
+
* Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
|
|
28
29
|
*/
|
|
29
30
|
sources?: string;
|
|
30
31
|
/**
|
|
31
|
-
* Providers sampled from the registry.
|
|
32
|
+
* Providers sampled from the registry.
|
|
33
|
+
*
|
|
34
|
+
* Default 200000.
|
|
32
35
|
*/
|
|
33
36
|
cap?: number;
|
|
34
37
|
/**
|
|
35
|
-
* State filter.
|
|
38
|
+
* State filter.
|
|
39
|
+
*
|
|
40
|
+
* Default TX.
|
|
36
41
|
*/
|
|
37
42
|
state?: string;
|
|
38
43
|
/**
|
|
39
|
-
* Org-name Jaccard collision threshold.
|
|
44
|
+
* Org-name Jaccard collision threshold.
|
|
45
|
+
*
|
|
46
|
+
* Default 0.7.
|
|
40
47
|
*/
|
|
41
48
|
tau?: number;
|
|
42
49
|
/**
|
|
43
|
-
* Adjudication sample size.
|
|
50
|
+
* Adjudication sample size.
|
|
51
|
+
*
|
|
52
|
+
* Default 300.
|
|
44
53
|
*/
|
|
45
54
|
n?: number;
|
|
46
55
|
/**
|
|
47
|
-
* Write the sampled pairs here as
|
|
56
|
+
* Write the sampled pairs here as jsonl (otherwise the first 10 print to stdout).
|
|
48
57
|
*/
|
|
49
58
|
outJSONL?: string;
|
|
50
59
|
}
|
|
51
60
|
/**
|
|
52
|
-
*
|
|
61
|
+
* Sample the hard co-located name-collision stratum for adjudication.
|
|
53
62
|
*/
|
|
54
63
|
export declare function goldSetSample(options?: GoldSetSampleOptions, report?: (line: string) => void): Promise<{
|
|
55
64
|
hardPairs: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gold-set-sample.d.ts","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"gold-set-sample.d.ts","sourceRoot":"","sources":["../../tools/gold-set-sample.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AASH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,CAAC,CAAC,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CACjB;AAgBD;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,GAAE,oBAAyB,EAClC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CA0DjD"}
|
|
@@ -3,28 +3,28 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Gold-set
|
|
7
|
-
* (`nppes-dedup-benchmark.ts`) collapses only NPPES-
|
|
8
|
-
* LBN/TIN)
|
|
9
|
-
* address with near-identical
|
|
10
|
-
*
|
|
11
|
-
* gold set must cover.
|
|
6
|
+
* Gold-set sampling for adjudication. The programmatic entity truth
|
|
7
|
+
* (`nppes-dedup-benchmark.ts`) collapses only NPPES-flagged subparts (Is-Subpart plus parent
|
|
8
|
+
* LBN/TIN), so it cannot settle the genuinely ambiguous co-located collisions: distinct NPIs at
|
|
9
|
+
* one address with near-identical name text and no subpart flag for the same parent.
|
|
10
|
+
* NPI truth and programmatic rules may disagree on these pairs. A frozen
|
|
11
|
+
* adjudicated gold set must cover.
|
|
12
12
|
*
|
|
13
|
-
* This
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* entity? yes/no" and we can MEASURE how often the programmatic truth matches judgment.
|
|
13
|
+
* This scans the full TX registry without geocoding and writes each pair as a JSONL row containing
|
|
14
|
+
* both records' fields (org name, address, authorized official, taxonomy, subpart and parent
|
|
15
|
+
* flags) plus the programmatic verdict. An adjudicator (human or LLM-as-judge, flagged as such)
|
|
16
|
+
* can then label same real-world entity or not.
|
|
18
17
|
*
|
|
19
18
|
* Run: `mailwoman registry gold-set-sample [--cap 200000] [--state TX] [--tau 0.7] [--n 300]
|
|
20
19
|
* [--out-jsonl <path>]`
|
|
21
20
|
*/
|
|
22
21
|
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
23
|
-
import {
|
|
22
|
+
import { writeLocalJSONLFile } from "@mailwoman/core/fs/writers";
|
|
23
|
+
import { stringifyJSON } from "@mailwoman/core/json";
|
|
24
24
|
import { jaccard } from "@mailwoman/match";
|
|
25
25
|
import { colocatedDistinctPairs, scanColocatedProviders, stateOption } from "#tools/shared";
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* Sample the hard co-located name-collision stratum for adjudication.
|
|
28
28
|
*/
|
|
29
29
|
export async function goldSetSample(options = {}, report) {
|
|
30
30
|
const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
|
|
@@ -37,8 +37,6 @@ export async function goldSetSample(options = {}, report) {
|
|
|
37
37
|
report?.(`[A] streaming ${STATE} org providers (cap ${CAP})…`);
|
|
38
38
|
const { byAddr, kept } = await scanColocatedProviders({ registryPath: REGISTRY, state: STATE, cap: CAP });
|
|
39
39
|
report?.(` ${kept} providers at ${byAddr.size} addresses`);
|
|
40
|
-
// Hard pairs: co-located, name-similar (≥τ), DISTINCT NPIs that programmatic truth can't confidently
|
|
41
|
-
// collapse (NOT subparts of the same parent). Tag the programmatic verdict so adjudication can grade it.
|
|
42
40
|
const hard = [];
|
|
43
41
|
for (const { a, b } of colocatedDistinctPairs(byAddr)) {
|
|
44
42
|
const sim = jaccard(a.tokens, b.tokens);
|
|
@@ -46,7 +44,7 @@ export async function goldSetSample(options = {}, report) {
|
|
|
46
44
|
continue;
|
|
47
45
|
const sameParent = a.subpart && b.subpart && a.parent === b.parent && a.parent !== "|";
|
|
48
46
|
if (sameParent)
|
|
49
|
-
continue;
|
|
47
|
+
continue;
|
|
50
48
|
const sameAuth = a.auth !== "" && a.auth === b.auth;
|
|
51
49
|
const sameTax = a.taxonomy !== "" && a.taxonomy === b.taxonomy;
|
|
52
50
|
hard.push({
|
|
@@ -59,25 +57,23 @@ export async function goldSetSample(options = {}, report) {
|
|
|
59
57
|
sameAuthorizedOfficial: sameAuth,
|
|
60
58
|
sameTaxonomy: sameTax,
|
|
61
59
|
bothSubpartSameParent: false,
|
|
62
|
-
//
|
|
63
|
-
// subparts): same authorized official ⇒ likely one org; different official + different
|
|
64
|
-
// specialty ⇒ likely distinct. The whole point is to ADJUDICATE whether this is right.
|
|
60
|
+
// The verdict records what an entity-level rule would say, so adjudication can grade it.
|
|
65
61
|
programmaticVerdict: sameAuth ? "same-entity" : "distinct",
|
|
66
62
|
adjudication: null,
|
|
67
63
|
});
|
|
68
64
|
}
|
|
69
65
|
report?.(` ${hard.length} hard co-located name-collision pairs (non-flagged-subpart)`);
|
|
70
|
-
//
|
|
66
|
+
// A deterministic stride sample avoids file-order bias in the adjudication set.
|
|
71
67
|
const stride = Math.max(1, Math.floor(hard.length / N));
|
|
72
68
|
const sample = hard.filter((_, i) => i % stride === 0).slice(0, N);
|
|
73
69
|
report?.(` sampling ${sample.length} (stride ${stride}) for adjudication`);
|
|
74
70
|
if (OUT) {
|
|
75
|
-
await
|
|
71
|
+
await writeLocalJSONLFile(sample, OUT);
|
|
76
72
|
report?.(`[written] ${OUT}`);
|
|
77
73
|
}
|
|
78
74
|
else {
|
|
79
75
|
for (const p of sample.slice(0, 10)) {
|
|
80
|
-
console.log(
|
|
76
|
+
console.log(stringifyJSON(p));
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
79
|
return { hardPairs: hard.length, sampled: sample.length };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gold-set-sample.js","sourceRoot":"","sources":["../../
|
|
1
|
+
{"version":3,"file":"gold-set-sample.js","sourceRoot":"","sources":["../../tools/gold-set-sample.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB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