@mailwoman/registry 10.1.0 → 10.2.1
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 +1 -4
- package/lib/geocode-handler.ts +1 -1
- package/lib/geojson.ts +2 -1
- package/lib/ingest.ts +18 -14
- package/lib/map-html.ts +2 -2
- package/lib/reconcile.ts +4 -3
- package/lib/resolve.ts +12 -11
- package/lib/types.ts +17 -17
- package/out/geocode-handler.js +1 -1
- package/out/geocode-handler.js.map +1 -1
- package/out/geojson.d.ts.map +1 -1
- package/out/geojson.js +2 -1
- package/out/geojson.js.map +1 -1
- package/out/ingest.d.ts +6 -4
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +13 -11
- package/out/ingest.js.map +1 -1
- package/out/map-html.js +2 -2
- package/out/map-html.js.map +1 -1
- package/out/reconcile.d.ts +3 -2
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +1 -1
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts +7 -6
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +5 -5
- package/out/resolve.js.map +1 -1
- package/out/tools/coverage-reconciliation.d.ts +3 -3
- package/out/tools/cross/dataset-correlation.d.ts +7 -4
- package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
- package/out/tools/cross/dataset-correlation.js.map +1 -1
- package/out/tools/cross/source-threshold-sweep.d.ts +3 -3
- package/out/tools/dedup-ceiling.d.ts +4 -4
- package/out/tools/eval-geocoder.d.ts +5 -3
- package/out/tools/eval-geocoder.d.ts.map +1 -1
- package/out/tools/geocoder/vs-provided-coords.d.ts +2 -2
- package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
- package/out/tools/gold-set-sample.d.ts +5 -5
- package/out/tools/learned/scorer/clustering-eval.d.ts +6 -6
- package/out/tools/learned/scorer/crossstate-eval.d.ts +4 -4
- package/out/tools/learned/scorer/eval.d.ts +9 -5
- package/out/tools/learned/scorer/eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/eval.js.map +1 -1
- package/out/tools/nppes/dedup-benchmark.d.ts +3 -2
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
- package/out/tools/nppes/dedup-benchmark.js +2 -2
- package/out/tools/nppes/dedup-benchmark.js.map +1 -1
- package/out/tools/nppes/org-name.d.ts +0 -7
- package/out/tools/nppes/org-name.d.ts.map +1 -1
- package/out/tools/nppes/org-name.js +0 -7
- package/out/tools/nppes/org-name.js.map +1 -1
- package/out/tools/nppes/overmerge-packet.js +1 -1
- package/out/tools/nppes/overmerge-packet.js.map +1 -1
- package/out/tools/nppes/sample.d.ts +1 -1
- package/out/tools/nppes/sample.d.ts.map +1 -1
- package/out/tools/nppes/sample.js +1 -2
- package/out/tools/nppes/sample.js.map +1 -1
- package/out/tools/shared.d.ts +6 -14
- package/out/tools/shared.d.ts.map +1 -1
- package/out/tools/shared.js +1 -1
- package/out/tools/shared.js.map +1 -1
- package/out/tools/train/cross-gbt.d.ts +8 -7
- package/out/tools/train/cross-gbt.d.ts.map +1 -1
- package/out/tools/train/cross-gbt.js.map +1 -1
- package/out/tools/train/gbt.d.ts +6 -6
- package/out/tools/train/org-cross-gbt.d.ts +7 -6
- package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
- package/out/tools/train/org-cross-gbt.js.map +1 -1
- package/out/tools/txhhsc-to-oarow.d.ts +2 -2
- package/out/tools/viz/cross-dataset-map.d.ts +2 -2
- package/out/tools/viz/geocode-first-surface.d.ts +3 -2
- package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
- package/out/tools/viz/geocode-first-surface.js.map +1 -1
- package/out/tools/viz/render.d.ts +2 -2
- package/out/tools/viz/source-provenance-map.d.ts +6 -6
- package/out/types.d.ts +18 -18
- package/out/types.d.ts.map +1 -1
- package/package.json +11 -11
- package/tools/coverage-reconciliation.ts +3 -3
- package/tools/cross/dataset-correlation.ts +8 -5
- package/tools/cross/source-threshold-sweep.ts +3 -3
- package/tools/dedup-ceiling.ts +4 -4
- package/tools/eval-geocoder.ts +6 -3
- package/tools/geocoder/vs-provided-coords.ts +3 -3
- package/tools/gold-set-sample.ts +5 -5
- package/tools/learned/scorer/clustering-eval.ts +6 -6
- package/tools/learned/scorer/crossstate-eval.ts +4 -4
- package/tools/learned/scorer/eval.ts +9 -5
- package/tools/nppes/dedup-benchmark.ts +5 -4
- package/tools/nppes/org-name.ts +0 -9
- package/tools/nppes/overmerge-packet.ts +1 -1
- package/tools/nppes/sample.ts +2 -2
- package/tools/shared.ts +7 -16
- package/tools/train/cross-gbt.ts +8 -7
- package/tools/train/gbt.ts +6 -6
- package/tools/train/org-cross-gbt.ts +7 -6
- package/tools/txhhsc-to-oarow.ts +2 -2
- package/tools/viz/cross-dataset-map.ts +2 -2
- package/tools/viz/geocode-first-surface.ts +3 -2
- package/tools/viz/render.ts +2 -2
- package/tools/viz/source-provenance-map.ts +6 -6
package/tools/shared.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { makeDirectories, writeLocalFile } from "@mailwoman/core/fs/writers"
|
|
|
10
10
|
import { stringifyJSON } from "@mailwoman/core/json"
|
|
11
11
|
import { isPresent } from "@mailwoman/core/objects"
|
|
12
12
|
import { makeLcg } from "@mailwoman/core/random"
|
|
13
|
-
import { block, gbtScore, trainGBT, type TermFrequencyTable } from "@mailwoman/match"
|
|
13
|
+
import { block, gbtScore, trainGBT, type GBTOpts, type TermFrequencyTable } from "@mailwoman/match"
|
|
14
14
|
import { dirname } from "path-ts"
|
|
15
15
|
|
|
16
16
|
import {
|
|
@@ -43,15 +43,16 @@ export interface SourceSpec {
|
|
|
43
43
|
inState: (row: Record<string, string>) => boolean
|
|
44
44
|
/**
|
|
45
45
|
* Optional: a row carrying ≥1 addressable entity yields each as its own row.
|
|
46
|
-
*
|
|
46
|
+
*
|
|
47
|
+
* @defaultValue identity.
|
|
47
48
|
*/
|
|
48
49
|
explode?: (row: Record<string, string>) => Record<string, string>[]
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
/**
|
|
52
|
-
* Trim, treating `undefined` as empty — the shape every probe's raw CSV columns arrive in.
|
|
53
|
+
* Trim, treating `null` or `undefined` as empty — the shape every probe's raw CSV columns arrive in.
|
|
53
54
|
*/
|
|
54
|
-
export const norm = (s: string | undefined): string => (s ?? "").trim()
|
|
55
|
+
export const norm = (s: string | null | undefined): string => (s ?? "").trim()
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
58
|
* Corporate-form suffixes and function words that add no identity — dropped from an organization name
|
|
@@ -505,17 +506,7 @@ export const buildSpecs = (S: string, STATE: string): SourceSpec[] => [
|
|
|
505
506
|
},
|
|
506
507
|
]
|
|
507
508
|
|
|
508
|
-
|
|
509
|
-
* The GBT hyperparameter shape the trainers stamp into their model meta.
|
|
510
|
-
*/
|
|
511
|
-
export interface GBTHyperparameters {
|
|
512
|
-
rounds: number
|
|
513
|
-
depth: number
|
|
514
|
-
lr: number
|
|
515
|
-
minLeaf: number
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
const CROSS_SOURCE_HYPERPARAMS: GBTHyperparameters = { rounds: 120, depth: 3, lr: 0.3, minLeaf: 20 }
|
|
509
|
+
const CROSS_SOURCE_HYPERPARAMS: GBTOpts = { rounds: 120, depth: 3, lr: 0.3, minLeaf: 20 }
|
|
519
510
|
|
|
520
511
|
const FIT_SPLIT_FRACTION = 0.8
|
|
521
512
|
|
|
@@ -544,7 +535,7 @@ export interface CrossSourceTrainingFigures {
|
|
|
544
535
|
f1Max: number
|
|
545
536
|
recommendedThreshold: number
|
|
546
537
|
features: number
|
|
547
|
-
hyperparams:
|
|
538
|
+
hyperparams: GBTOpts
|
|
548
539
|
}
|
|
549
540
|
|
|
550
541
|
/**
|
package/tools/train/cross-gbt.ts
CHANGED
|
@@ -45,42 +45,43 @@ export interface TrainCrossSourceGBTOptions {
|
|
|
45
45
|
/**
|
|
46
46
|
* Record-matcher sources directory.
|
|
47
47
|
*
|
|
48
|
-
*
|
|
48
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
|
|
49
49
|
*/
|
|
50
50
|
sources?: PathBuilderLike
|
|
51
51
|
/**
|
|
52
52
|
* State filter.
|
|
53
53
|
*
|
|
54
|
-
*
|
|
54
|
+
* @defaultValue TX.
|
|
55
55
|
*/
|
|
56
56
|
state?: string
|
|
57
57
|
/**
|
|
58
58
|
* NPIs sampled.
|
|
59
59
|
*
|
|
60
|
-
*
|
|
60
|
+
* @defaultValue `2000`
|
|
61
61
|
*/
|
|
62
62
|
npis?: number
|
|
63
63
|
/**
|
|
64
64
|
* Output TS module path.
|
|
65
65
|
*
|
|
66
|
-
*
|
|
66
|
+
* @defaultValue `registry/models/crosssource-gbt-en-us.ts`
|
|
67
67
|
*/
|
|
68
68
|
out?: string
|
|
69
69
|
/**
|
|
70
70
|
* Locale recorded in the model meta.
|
|
71
71
|
*
|
|
72
|
-
*
|
|
72
|
+
* @defaultValue `"en-US"`
|
|
73
73
|
*/
|
|
74
74
|
locale?: string
|
|
75
75
|
/**
|
|
76
76
|
* Max cross-source recall subject to this held-out pairwise precision.
|
|
77
|
-
*
|
|
77
|
+
*
|
|
78
|
+
* @defaultValue `0.95`
|
|
78
79
|
*/
|
|
79
80
|
precisionBar?: number
|
|
80
81
|
/**
|
|
81
82
|
* The training date stored in the metadata.
|
|
82
83
|
*
|
|
83
|
-
*
|
|
84
|
+
* @defaultValue today.
|
|
84
85
|
*/
|
|
85
86
|
date?: string
|
|
86
87
|
}
|
package/tools/train/gbt.ts
CHANGED
|
@@ -57,31 +57,31 @@ export interface TrainDedupGBTOptions {
|
|
|
57
57
|
/**
|
|
58
58
|
* Record-matcher sources directory.
|
|
59
59
|
*
|
|
60
|
-
*
|
|
60
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
|
|
61
61
|
*/
|
|
62
62
|
sources?: string
|
|
63
63
|
/**
|
|
64
64
|
* State filter.
|
|
65
65
|
*
|
|
66
|
-
*
|
|
66
|
+
* @defaultValue TX.
|
|
67
67
|
*/
|
|
68
68
|
state?: string
|
|
69
69
|
/**
|
|
70
70
|
* NPIs sampled.
|
|
71
71
|
*
|
|
72
|
-
*
|
|
72
|
+
* @defaultValue `3000`
|
|
73
73
|
*/
|
|
74
74
|
npis?: number
|
|
75
75
|
/**
|
|
76
76
|
* Output TS module path.
|
|
77
77
|
*
|
|
78
|
-
*
|
|
78
|
+
* @defaultValue `registry/models/dedup-gbt-en-us.ts`
|
|
79
79
|
*/
|
|
80
80
|
out?: string
|
|
81
81
|
/**
|
|
82
82
|
* Locale recorded in the model meta (the command's factory loads the matching weights).
|
|
83
83
|
*
|
|
84
|
-
*
|
|
84
|
+
* @defaultValue `"en-US"`
|
|
85
85
|
*/
|
|
86
86
|
locale?: string
|
|
87
87
|
/**
|
|
@@ -97,7 +97,7 @@ export interface TrainDedupGBTOptions {
|
|
|
97
97
|
/**
|
|
98
98
|
* The training date stored in the metadata (overridable for reproducible commits).
|
|
99
99
|
*
|
|
100
|
-
*
|
|
100
|
+
* @defaultValue today.
|
|
101
101
|
*/
|
|
102
102
|
date?: string
|
|
103
103
|
}
|
|
@@ -44,36 +44,37 @@ export interface TrainOrgCrossSourceGBTOptions {
|
|
|
44
44
|
/**
|
|
45
45
|
* Record-matcher sources directory.
|
|
46
46
|
*
|
|
47
|
-
*
|
|
47
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
|
|
48
48
|
*/
|
|
49
49
|
sources?: PathBuilderLike
|
|
50
50
|
/**
|
|
51
51
|
* Care Compare facilities sampled.
|
|
52
52
|
*
|
|
53
|
-
*
|
|
53
|
+
* @defaultValue `6000`
|
|
54
54
|
*/
|
|
55
55
|
cap?: number
|
|
56
56
|
/**
|
|
57
57
|
* Output TS module path.
|
|
58
58
|
*
|
|
59
|
-
*
|
|
59
|
+
* @defaultValue `registry/models/org-crosssource-gbt-en-us.ts`
|
|
60
60
|
*/
|
|
61
61
|
out?: string
|
|
62
62
|
/**
|
|
63
63
|
* Locale recorded in the model meta.
|
|
64
64
|
*
|
|
65
|
-
*
|
|
65
|
+
* @defaultValue `"en-US"`
|
|
66
66
|
*/
|
|
67
67
|
locale?: string
|
|
68
68
|
/**
|
|
69
69
|
* Max cross-source recall subject to this held-out pairwise precision.
|
|
70
|
-
*
|
|
70
|
+
*
|
|
71
|
+
* @defaultValue `0.95`
|
|
71
72
|
*/
|
|
72
73
|
precisionBar?: number
|
|
73
74
|
/**
|
|
74
75
|
* The training date stored in the metadata.
|
|
75
76
|
*
|
|
76
|
-
*
|
|
77
|
+
* @defaultValue today.
|
|
77
78
|
*/
|
|
78
79
|
date?: string
|
|
79
80
|
}
|
package/tools/txhhsc-to-oarow.ts
CHANGED
|
@@ -30,13 +30,13 @@ export interface TXHHSCConvertOptions {
|
|
|
30
30
|
/**
|
|
31
31
|
* The TX hhsc nursing-facilities TSV.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
33
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources/…`
|
|
34
34
|
*/
|
|
35
35
|
src?: PathBuilderLike
|
|
36
36
|
/**
|
|
37
37
|
* Output OaRow jsonl path.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
39
|
+
* @defaultValue `/tmp/txhhsc-oarow.jsonl`
|
|
40
40
|
*/
|
|
41
41
|
out?: string
|
|
42
42
|
}
|
|
@@ -26,13 +26,13 @@ export interface CrossDatasetMapOptions {
|
|
|
26
26
|
/**
|
|
27
27
|
* The `cross-dataset-links` GeoJSON.
|
|
28
28
|
*
|
|
29
|
-
*
|
|
29
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/2026-06-16-cross-dataset-links.geojson`
|
|
30
30
|
*/
|
|
31
31
|
in?: string
|
|
32
32
|
/**
|
|
33
33
|
* Output html path.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
35
|
+
* @defaultValue `/tmp/cross-dataset-map.html`
|
|
36
36
|
*/
|
|
37
37
|
outHTML?: string
|
|
38
38
|
/**
|
|
@@ -21,13 +21,14 @@ export interface GeocodeFirstSurfaceOptions {
|
|
|
21
21
|
* Production's record matcher uses λ=1e-4 (calibrated for the full multi-field model with phone
|
|
22
22
|
*
|
|
23
23
|
* - Spatial exact-key); here we want the boundary visible in a two-axis projection.
|
|
24
|
-
*
|
|
24
|
+
*
|
|
25
|
+
* @defaultValue `0.02`
|
|
25
26
|
*/
|
|
26
27
|
lambda?: number
|
|
27
28
|
/**
|
|
28
29
|
* Output html path.
|
|
29
30
|
*
|
|
30
|
-
*
|
|
31
|
+
* @defaultValue `/tmp/geocode-first-surface.html`
|
|
31
32
|
*/
|
|
32
33
|
outHTML?: string
|
|
33
34
|
}
|
package/tools/viz/render.ts
CHANGED
|
@@ -32,13 +32,13 @@ export interface RenderPlotlyOptions {
|
|
|
32
32
|
/**
|
|
33
33
|
* Viewport width.
|
|
34
34
|
*
|
|
35
|
-
*
|
|
35
|
+
* @defaultValue `1160`
|
|
36
36
|
*/
|
|
37
37
|
width?: number
|
|
38
38
|
/**
|
|
39
39
|
* Viewport height.
|
|
40
40
|
*
|
|
41
|
-
*
|
|
41
|
+
* @defaultValue `1000`
|
|
42
42
|
*/
|
|
43
43
|
height?: number
|
|
44
44
|
}
|
|
@@ -24,37 +24,37 @@ export interface SourceProvenanceMapOptions {
|
|
|
24
24
|
/**
|
|
25
25
|
* State (lowercase postal).
|
|
26
26
|
*
|
|
27
|
-
*
|
|
27
|
+
* @defaultValue `"ny"`
|
|
28
28
|
*/
|
|
29
29
|
state?: string
|
|
30
30
|
/**
|
|
31
31
|
* Address-point DB path.
|
|
32
32
|
*
|
|
33
|
-
*
|
|
33
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/db/address-points/address-points-us-<state>.db`
|
|
34
34
|
*/
|
|
35
35
|
db?: string
|
|
36
36
|
/**
|
|
37
37
|
* Output html path.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
39
|
+
* @defaultValue `/tmp/source-provenance.html`
|
|
40
40
|
*/
|
|
41
41
|
outHTML?: string
|
|
42
42
|
/**
|
|
43
43
|
* Keep ~1/N of NAD points.
|
|
44
44
|
*
|
|
45
|
-
*
|
|
45
|
+
* @defaultValue `700`
|
|
46
46
|
*/
|
|
47
47
|
nadMod?: number
|
|
48
48
|
/**
|
|
49
49
|
* Keep ~1/N of OpenAddresses points.
|
|
50
50
|
*
|
|
51
|
-
*
|
|
51
|
+
* @defaultValue `120`
|
|
52
52
|
*/
|
|
53
53
|
oaMod?: number
|
|
54
54
|
/**
|
|
55
55
|
* Per-source marker cap.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
57
|
+
* @defaultValue `7000`
|
|
58
58
|
*/
|
|
59
59
|
cap?: number
|
|
60
60
|
}
|