@mailwoman/registry 10.0.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 +11 -6
- 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 +43 -53
- 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 +11 -6
- 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 +17 -41
- 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 +20 -27
- package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
- package/out/tools/cross/dataset-correlation.js +9 -61
- package/out/tools/cross/dataset-correlation.js.map +1 -1
- package/out/tools/cross/source-threshold-sweep.d.ts +20 -26
- package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -1
- package/out/tools/cross/source-threshold-sweep.js +14 -40
- package/out/tools/cross/source-threshold-sweep.js.map +1 -1
- 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 +9 -8
- package/out/tools/geocoder/namesake-probe.d.ts.map +1 -1
- package/out/tools/geocoder/namesake-probe.js +6 -7
- package/out/tools/geocoder/namesake-probe.js.map +1 -1
- package/out/tools/geocoder/vs-provided-coords.d.ts +18 -15
- package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -1
- package/out/tools/geocoder/vs-provided-coords.js +30 -27
- package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
- 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 +30 -27
- package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/clustering-eval.js +28 -38
- package/out/tools/learned/scorer/clustering-eval.js.map +1 -1
- package/out/tools/learned/scorer/crossstate-eval.d.ts +24 -18
- package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/crossstate-eval.js +19 -25
- package/out/tools/learned/scorer/crossstate-eval.js.map +1 -1
- package/out/tools/learned/scorer/eval.d.ts +22 -39
- package/out/tools/learned/scorer/eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/eval.js +11 -71
- package/out/tools/learned/scorer/eval.js.map +1 -1
- 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 +21 -41
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
- package/out/tools/nppes/dedup-benchmark.js +20 -66
- package/out/tools/nppes/dedup-benchmark.js.map +1 -1
- 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 +5 -6
- 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 +36 -26
- package/out/tools/train/cross-gbt.d.ts.map +1 -1
- package/out/tools/train/cross-gbt.js +14 -25
- package/out/tools/train/cross-gbt.js.map +1 -1
- package/out/tools/train/gbt.d.ts +36 -20
- package/out/tools/train/gbt.d.ts.map +1 -1
- package/out/tools/train/gbt.js +27 -31
- package/out/tools/train/gbt.js.map +1 -1
- package/out/tools/train/org-cross-gbt.d.ts +37 -24
- package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
- package/out/tools/train/org-cross-gbt.js +18 -22
- package/out/tools/train/org-cross-gbt.js.map +1 -1
- 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 +5 -5
- package/out/tools/viz/render/map.d.ts.map +1 -1
- package/out/tools/viz/render/map.js +6 -5
- package/out/tools/viz/render/map.js.map +1 -1
- package/out/tools/viz/{render/index.d.ts → render.d.ts} +13 -9
- package/out/tools/viz/render.d.ts.map +1 -0
- package/out/tools/viz/{render/index.js → render.js} +9 -8
- package/out/tools/viz/render.js.map +1 -0
- 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 → tools}/cross/dataset-correlation.ts +31 -72
- package/{lib/tools → 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 → tools}/geocoder/namesake-probe.ts +9 -8
- package/{lib/tools → tools}/geocoder/vs-provided-coords.ts +39 -30
- package/{lib/tools → tools}/gold-set-sample.ts +35 -29
- package/{lib/tools → tools}/learned/scorer/clustering-eval.ts +49 -45
- package/{lib/tools → tools}/learned/scorer/crossstate-eval.ts +34 -30
- package/{lib/tools → tools}/learned/scorer/eval.ts +35 -78
- package/{lib/tools → tools}/matcher-scale.ts +21 -33
- package/{lib/tools → 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 +15 -11
- 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 → tools}/train/cross-gbt.ts +38 -34
- package/{lib/tools → tools}/train/gbt.ts +55 -41
- package/{lib/tools → 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 → tools}/viz/render/map.ts +7 -6
- package/{lib/tools/viz/render/index.ts → 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/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/viz/render/index.d.ts.map +0 -1
- package/out/tools/viz/render/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/registry",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "The geocode-first record-matching application: resolve messy contact/organization records into canonical, geocoded entities (block → score → cluster) and export them as GeoJSON for spatial analysis. The clinic-funding use case mailwoman was built for.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
"out/**/*.js.map",
|
|
14
14
|
"out/**/*.d.ts",
|
|
15
15
|
"out/**/*.d.ts.map",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"**/*.tsx",
|
|
20
|
-
"!*.test.ts",
|
|
21
|
-
"!*.test.tsx",
|
|
16
|
+
"lib/**/*.ts",
|
|
17
|
+
"lib/**/*.tsx",
|
|
18
|
+
"tools/**/*.ts",
|
|
22
19
|
"!**/*.test.ts",
|
|
23
|
-
"!**/*.test.tsx"
|
|
24
|
-
"!test/**"
|
|
20
|
+
"!**/*.test.tsx"
|
|
25
21
|
],
|
|
26
22
|
"type": "module",
|
|
27
23
|
"sideEffects": false,
|
|
28
24
|
"imports": {
|
|
25
|
+
"#tools/*": {
|
|
26
|
+
"types": "./out/tools/*.d.ts",
|
|
27
|
+
"node": "./out/tools/*.js",
|
|
28
|
+
"default": "./out/tools/*.js"
|
|
29
|
+
},
|
|
29
30
|
"#index": {
|
|
30
31
|
"types": "./out/index.d.ts",
|
|
31
32
|
"node": "./out/index.js",
|
|
@@ -44,90 +45,15 @@
|
|
|
44
45
|
"node": "./out/index.js",
|
|
45
46
|
"default": "./out/index.js"
|
|
46
47
|
},
|
|
47
|
-
"./
|
|
48
|
-
"types": "./out/
|
|
49
|
-
"node": "./out/
|
|
50
|
-
"default": "./out/
|
|
51
|
-
},
|
|
52
|
-
"./geojson": {
|
|
53
|
-
"types": "./out/geojson.d.ts",
|
|
54
|
-
"node": "./out/geojson.js",
|
|
55
|
-
"default": "./out/geojson.js"
|
|
56
|
-
},
|
|
57
|
-
"./ingest": {
|
|
58
|
-
"types": "./out/ingest.d.ts",
|
|
59
|
-
"node": "./out/ingest.js",
|
|
60
|
-
"default": "./out/ingest.js"
|
|
61
|
-
},
|
|
62
|
-
"./tools": {
|
|
63
|
-
"types": "./out/tools/index.d.ts",
|
|
64
|
-
"node": "./out/tools/index.js",
|
|
65
|
-
"default": "./out/tools/index.js"
|
|
66
|
-
},
|
|
67
|
-
"./address-key": {
|
|
68
|
-
"types": "./out/address-key.d.ts",
|
|
69
|
-
"node": "./out/address-key.js",
|
|
70
|
-
"default": "./out/address-key.js"
|
|
71
|
-
},
|
|
72
|
-
"./types": {
|
|
73
|
-
"types": "./out/types.d.ts",
|
|
74
|
-
"node": "./out/types.js",
|
|
75
|
-
"default": "./out/types.js"
|
|
76
|
-
},
|
|
77
|
-
"./geocode-handler": {
|
|
78
|
-
"types": "./out/geocode-handler.d.ts",
|
|
79
|
-
"node": "./out/geocode-handler.js",
|
|
80
|
-
"default": "./out/geocode-handler.js"
|
|
81
|
-
},
|
|
82
|
-
"./learned-scorer": {
|
|
83
|
-
"types": "./out/learned-scorer.d.ts",
|
|
84
|
-
"node": "./out/learned-scorer.js",
|
|
85
|
-
"default": "./out/learned-scorer.js"
|
|
86
|
-
},
|
|
87
|
-
"./map-html": {
|
|
88
|
-
"types": "./out/map-html.d.ts",
|
|
89
|
-
"node": "./out/map-html.js",
|
|
90
|
-
"default": "./out/map-html.js"
|
|
91
|
-
},
|
|
92
|
-
"./reconcile": {
|
|
93
|
-
"types": "./out/reconcile.d.ts",
|
|
94
|
-
"node": "./out/reconcile.js",
|
|
95
|
-
"default": "./out/reconcile.js"
|
|
48
|
+
"./tools/*": {
|
|
49
|
+
"types": "./out/tools/*.d.ts",
|
|
50
|
+
"node": "./out/tools/*.js",
|
|
51
|
+
"default": "./out/tools/*.js"
|
|
96
52
|
},
|
|
97
|
-
"
|
|
98
|
-
"types": "./out
|
|
99
|
-
"node": "./out
|
|
100
|
-
"default": "./out
|
|
101
|
-
},
|
|
102
|
-
"./tools/nppes/overmerge-packet": {
|
|
103
|
-
"types": "./out/tools/nppes/overmerge-packet.d.ts",
|
|
104
|
-
"node": "./out/tools/nppes/overmerge-packet.js",
|
|
105
|
-
"default": "./out/tools/nppes/overmerge-packet.js"
|
|
106
|
-
},
|
|
107
|
-
"./tools/nppes/report": {
|
|
108
|
-
"types": "./out/tools/nppes/report.d.ts",
|
|
109
|
-
"node": "./out/tools/nppes/report.js",
|
|
110
|
-
"default": "./out/tools/nppes/report.js"
|
|
111
|
-
},
|
|
112
|
-
"./tools/nppes/sample": {
|
|
113
|
-
"types": "./out/tools/nppes/sample.d.ts",
|
|
114
|
-
"node": "./out/tools/nppes/sample.js",
|
|
115
|
-
"default": "./out/tools/nppes/sample.js"
|
|
116
|
-
},
|
|
117
|
-
"./tools/nppes/scoring": {
|
|
118
|
-
"types": "./out/tools/nppes/scoring.d.ts",
|
|
119
|
-
"node": "./out/tools/nppes/scoring.js",
|
|
120
|
-
"default": "./out/tools/nppes/scoring.js"
|
|
121
|
-
},
|
|
122
|
-
"./tools/nppes/settings": {
|
|
123
|
-
"types": "./out/tools/nppes/settings.d.ts",
|
|
124
|
-
"node": "./out/tools/nppes/settings.js",
|
|
125
|
-
"default": "./out/tools/nppes/settings.js"
|
|
126
|
-
},
|
|
127
|
-
"./tools/nppes/truth-grains": {
|
|
128
|
-
"types": "./out/tools/nppes/truth-grains.d.ts",
|
|
129
|
-
"node": "./out/tools/nppes/truth-grains.js",
|
|
130
|
-
"default": "./out/tools/nppes/truth-grains.js"
|
|
53
|
+
"./*": {
|
|
54
|
+
"types": "./out/*.d.ts",
|
|
55
|
+
"node": "./out/*.js",
|
|
56
|
+
"default": "./out/*.js"
|
|
131
57
|
}
|
|
132
58
|
},
|
|
133
59
|
"publishConfig": {
|
|
@@ -139,93 +65,23 @@
|
|
|
139
65
|
"node": "./out/index.js",
|
|
140
66
|
"default": "./out/index.js"
|
|
141
67
|
},
|
|
142
|
-
"./
|
|
143
|
-
"types": "./out/
|
|
144
|
-
"node": "./out/
|
|
145
|
-
"default": "./out/
|
|
68
|
+
"./tools/*": {
|
|
69
|
+
"types": "./out/tools/*.d.ts",
|
|
70
|
+
"node": "./out/tools/*.js",
|
|
71
|
+
"default": "./out/tools/*.js"
|
|
146
72
|
},
|
|
147
|
-
"
|
|
148
|
-
"types": "./out
|
|
149
|
-
"node": "./out
|
|
150
|
-
"default": "./out
|
|
151
|
-
},
|
|
152
|
-
"./ingest": {
|
|
153
|
-
"types": "./out/ingest.d.ts",
|
|
154
|
-
"node": "./out/ingest.js",
|
|
155
|
-
"default": "./out/ingest.js"
|
|
156
|
-
},
|
|
157
|
-
"./tools": {
|
|
158
|
-
"types": "./out/tools/index.d.ts",
|
|
159
|
-
"node": "./out/tools/index.js",
|
|
160
|
-
"default": "./out/tools/index.js"
|
|
161
|
-
},
|
|
162
|
-
"./address-key": {
|
|
163
|
-
"types": "./out/address-key.d.ts",
|
|
164
|
-
"node": "./out/address-key.js",
|
|
165
|
-
"default": "./out/address-key.js"
|
|
166
|
-
},
|
|
167
|
-
"./types": {
|
|
168
|
-
"types": "./out/types.d.ts",
|
|
169
|
-
"node": "./out/types.js",
|
|
170
|
-
"default": "./out/types.js"
|
|
171
|
-
},
|
|
172
|
-
"./geocode-handler": {
|
|
173
|
-
"types": "./out/geocode-handler.d.ts",
|
|
174
|
-
"node": "./out/geocode-handler.js",
|
|
175
|
-
"default": "./out/geocode-handler.js"
|
|
176
|
-
},
|
|
177
|
-
"./learned-scorer": {
|
|
178
|
-
"types": "./out/learned-scorer.d.ts",
|
|
179
|
-
"node": "./out/learned-scorer.js",
|
|
180
|
-
"default": "./out/learned-scorer.js"
|
|
181
|
-
},
|
|
182
|
-
"./map-html": {
|
|
183
|
-
"types": "./out/map-html.d.ts",
|
|
184
|
-
"node": "./out/map-html.js",
|
|
185
|
-
"default": "./out/map-html.js"
|
|
186
|
-
},
|
|
187
|
-
"./reconcile": {
|
|
188
|
-
"types": "./out/reconcile.d.ts",
|
|
189
|
-
"node": "./out/reconcile.js",
|
|
190
|
-
"default": "./out/reconcile.js"
|
|
191
|
-
},
|
|
192
|
-
"./tools/nppes/org-name": {
|
|
193
|
-
"types": "./out/tools/nppes/org-name.d.ts",
|
|
194
|
-
"node": "./out/tools/nppes/org-name.js",
|
|
195
|
-
"default": "./out/tools/nppes/org-name.js"
|
|
196
|
-
},
|
|
197
|
-
"./tools/nppes/overmerge-packet": {
|
|
198
|
-
"types": "./out/tools/nppes/overmerge-packet.d.ts",
|
|
199
|
-
"node": "./out/tools/nppes/overmerge-packet.js",
|
|
200
|
-
"default": "./out/tools/nppes/overmerge-packet.js"
|
|
201
|
-
},
|
|
202
|
-
"./tools/nppes/report": {
|
|
203
|
-
"types": "./out/tools/nppes/report.d.ts",
|
|
204
|
-
"node": "./out/tools/nppes/report.js",
|
|
205
|
-
"default": "./out/tools/nppes/report.js"
|
|
206
|
-
},
|
|
207
|
-
"./tools/nppes/sample": {
|
|
208
|
-
"types": "./out/tools/nppes/sample.d.ts",
|
|
209
|
-
"node": "./out/tools/nppes/sample.js",
|
|
210
|
-
"default": "./out/tools/nppes/sample.js"
|
|
211
|
-
},
|
|
212
|
-
"./tools/nppes/scoring": {
|
|
213
|
-
"types": "./out/tools/nppes/scoring.d.ts",
|
|
214
|
-
"node": "./out/tools/nppes/scoring.js",
|
|
215
|
-
"default": "./out/tools/nppes/scoring.js"
|
|
216
|
-
},
|
|
217
|
-
"./tools/nppes/settings": {
|
|
218
|
-
"types": "./out/tools/nppes/settings.d.ts",
|
|
219
|
-
"node": "./out/tools/nppes/settings.js",
|
|
220
|
-
"default": "./out/tools/nppes/settings.js"
|
|
221
|
-
},
|
|
222
|
-
"./tools/nppes/truth-grains": {
|
|
223
|
-
"types": "./out/tools/nppes/truth-grains.d.ts",
|
|
224
|
-
"node": "./out/tools/nppes/truth-grains.js",
|
|
225
|
-
"default": "./out/tools/nppes/truth-grains.js"
|
|
73
|
+
"./*": {
|
|
74
|
+
"types": "./out/*.d.ts",
|
|
75
|
+
"node": "./out/*.js",
|
|
76
|
+
"default": "./out/*.js"
|
|
226
77
|
}
|
|
227
78
|
},
|
|
228
79
|
"imports": {
|
|
80
|
+
"#tools/*": {
|
|
81
|
+
"types": "./out/tools/*.d.ts",
|
|
82
|
+
"node": "./out/tools/*.js",
|
|
83
|
+
"default": "./out/tools/*.js"
|
|
84
|
+
},
|
|
229
85
|
"#index": {
|
|
230
86
|
"types": "./out/index.d.ts",
|
|
231
87
|
"node": "./out/index.js",
|
|
@@ -239,20 +95,21 @@
|
|
|
239
95
|
}
|
|
240
96
|
},
|
|
241
97
|
"dependencies": {
|
|
242
|
-
"@mailwoman/address-id": "10.
|
|
243
|
-
"@mailwoman/
|
|
244
|
-
"@mailwoman/
|
|
245
|
-
"@mailwoman/
|
|
246
|
-
"@mailwoman/
|
|
247
|
-
"@mailwoman/
|
|
248
|
-
"@mailwoman/
|
|
98
|
+
"@mailwoman/address-id": "10.1.0",
|
|
99
|
+
"@mailwoman/annotations": "10.1.0",
|
|
100
|
+
"@mailwoman/core": "10.1.0",
|
|
101
|
+
"@mailwoman/match": "10.1.0",
|
|
102
|
+
"@mailwoman/record": "10.1.0",
|
|
103
|
+
"@mailwoman/resolver-wof-sqlite": "10.1.0",
|
|
104
|
+
"@mailwoman/spatial": "10.1.0",
|
|
105
|
+
"@mailwoman/sqlite": "10.1.0",
|
|
249
106
|
"@protomaps/basemaps": "^5.7.2",
|
|
250
107
|
"h3-js": "^4.5.0",
|
|
251
|
-
"spliterator": "^
|
|
108
|
+
"spliterator": "^8.1.0"
|
|
252
109
|
},
|
|
253
110
|
"devDependencies": {
|
|
254
111
|
"@types/node": "^26.4.1",
|
|
255
|
-
"path-ts": "^2.
|
|
112
|
+
"path-ts": "^2.5.0",
|
|
256
113
|
"playwright": "^1.63.0"
|
|
257
114
|
}
|
|
258
115
|
}
|
|
@@ -3,27 +3,18 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Coverage reconciliation
|
|
6
|
+
* Coverage reconciliation, the product output that replaces inspecting the map by eye.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Each resolved entity is classified by the kind of source its records come from. An eligibility
|
|
9
|
+
* source holds providers and facilities, such as NPPES org NPIs or TX HHSC nursing facilities. A
|
|
10
|
+
* funding source holds entities enrolled in a funding program, such as FCC Rural Health Care
|
|
11
|
+
* filings.
|
|
10
12
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
13
|
+
* The buckets are enrolled (both an eligibility and a funding record), eligible rather than
|
|
14
|
+
* enrolled (an eligibility record with no funding record resolving to it), and funded rather than
|
|
15
|
+
* in the eligibility set (a funding record with no eligibility record resolving to it).
|
|
14
16
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* - **enrolled** — resolves to BOTH an eligibility and a funding record.
|
|
18
|
-
* - **eligible, not enrolled** — an eligibility record with NO funding record resolving to it (the
|
|
19
|
-
* ANTI-JOIN: the set you currently find by eye).
|
|
20
|
-
* - **funded, not in the eligibility set** — a funding record with no eligibility record resolving to
|
|
21
|
-
* it.
|
|
22
|
-
*
|
|
23
|
-
* Output: GeoJSON (drops on the same map) + a table, each entity tagged with its bucket + source
|
|
24
|
-
* memberships. We produce the reconciled join; what a gap MEANS — and whether it's real or a
|
|
25
|
-
* sampling artifact — is the consumer's call, not ours. This is strictly a set-membership
|
|
26
|
-
* reconciliation, never an allegation.
|
|
17
|
+
* This is strictly a set-membership reconciliation, never an allegation.
|
|
27
18
|
*
|
|
28
19
|
* Run: `mailwoman registry scorer-eval coverage-reconciliation [--cap 2000] [--wof <admin.db>]
|
|
29
20
|
* [--data-root <dir>] [--out-md <md>] [--out-geojson <geojson>]`
|
|
@@ -51,19 +42,27 @@ import { buildSpecs, stateOption } from "#tools/shared"
|
|
|
51
42
|
*/
|
|
52
43
|
export interface CoverageReconciliationOptions {
|
|
53
44
|
/**
|
|
54
|
-
* The injected geocoder factory
|
|
45
|
+
* The injected geocoder factory.
|
|
46
|
+
*
|
|
47
|
+
* The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
|
|
55
48
|
*/
|
|
56
49
|
createGeocoder: EvalGeocoderFactory
|
|
57
50
|
/**
|
|
58
|
-
* Record-matcher sources directory.
|
|
51
|
+
* Record-matcher sources directory.
|
|
52
|
+
*
|
|
53
|
+
* Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
|
|
59
54
|
*/
|
|
60
55
|
sources?: string
|
|
61
56
|
/**
|
|
62
|
-
* Rows kept per source.
|
|
57
|
+
* Rows kept per source.
|
|
58
|
+
*
|
|
59
|
+
* Default 2000.
|
|
63
60
|
*/
|
|
64
61
|
cap?: number
|
|
65
62
|
/**
|
|
66
|
-
* State filter.
|
|
63
|
+
* State filter.
|
|
64
|
+
*
|
|
65
|
+
* Default TX.
|
|
67
66
|
*/
|
|
68
67
|
state?: string
|
|
69
68
|
/**
|
|
@@ -83,7 +82,8 @@ const ELIGIBILITY = new Set(["nppes", "txhhsc-nursing"])
|
|
|
83
82
|
const FUNDING = new Set(["fcc-rhc"])
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
|
-
*
|
|
85
|
+
* Reconcile eligibility and funding sources.
|
|
86
|
+
* Emit the markdown report to stdout.
|
|
87
87
|
*/
|
|
88
88
|
export async function coverageReconciliation(
|
|
89
89
|
options: CoverageReconciliationOptions,
|
|
@@ -96,7 +96,6 @@ export async function coverageReconciliation(
|
|
|
96
96
|
const OUT_GEOJSON = options.outGeojson || ""
|
|
97
97
|
const SPECS = buildSpecs(`${SOURCES}`, STATE)
|
|
98
98
|
|
|
99
|
-
// Ingest every source into one combined, geo-resolved record set.
|
|
100
99
|
const rawBySource = new Map<string, Record<string, string>[]>()
|
|
101
100
|
|
|
102
101
|
for (const spec of SPECS) {
|
|
@@ -120,7 +119,6 @@ export async function coverageReconciliation(
|
|
|
120
119
|
let geo = 0
|
|
121
120
|
let total = 0
|
|
122
121
|
|
|
123
|
-
// Count placements at the boundary (parity with the retired in-script counter).
|
|
124
122
|
const geocodeForIngest: GeocodeAddress = async (raw) => {
|
|
125
123
|
const g = await geocoder.geocodeAddress(raw)
|
|
126
124
|
|
|
@@ -150,13 +148,12 @@ export async function coverageReconciliation(
|
|
|
150
148
|
report?.(` ${records.length} records; geocoded ${geo}/${total} (${((100 * geo) / total).toFixed(1)}%)`)
|
|
151
149
|
|
|
152
150
|
report?.("[D] resolving + reconciling…")
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
// GBT default rejects
|
|
151
|
+
// Use the Fellegi-Sunter baseline for this cross-dataset join.
|
|
152
|
+
// It is recall-oriented because the signal is the same facility under a different operational name.
|
|
153
|
+
// The dedup-calibrated GBT default rejects that pair.
|
|
156
154
|
const { entities } = resolveEntities(records, { trainEM: true, collapseSpatial: true, learnedScorer: false })
|
|
157
155
|
|
|
158
|
-
// Reconcile
|
|
159
|
-
// `mailwoman registry --reconcile`, so the script and the CLI can't drift. ---
|
|
156
|
+
// Reconcile through the shared @mailwoman/registry code path, so the script and the CLI agree.
|
|
160
157
|
const config: ReconcileConfig = { eligibilitySources: [...ELIGIBILITY], fundingSources: [...FUNDING] }
|
|
161
158
|
const result = reconcileCoverage(entities, config)
|
|
162
159
|
const geojson = reconciliationGeoJSON(result)
|
|
@@ -2,21 +2,6 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Cross-dataset correlation (#618) — the marquee proof: resolve ONE record set across datasets that
|
|
7
|
-
* share NO key. NPPES (the national provider registry), FCC Rural Health Care filings, and TX
|
|
8
|
-
* HHSC facility registries each describe overlapping physical entities under different names,
|
|
9
|
-
* formats, and schemas. Geo-first blocking is what makes resolving them tractable.
|
|
10
|
-
*
|
|
11
|
-
* We ingest each source under its own {@link ColumnMapping} + a `source` provenance label into ONE
|
|
12
|
-
* combined record set, geocode every address through mailwoman's real parser + resolver, resolve
|
|
13
|
-
* to canonical entities, and report the entities whose members span ≥2 sources — those are the
|
|
14
|
-
* cross-dataset links. We surface the correlation; interpretation is the consumer's.
|
|
15
|
-
*
|
|
16
|
-
* Tractable slice: TX-scoped, capped per source. Streams the 4.8 GB NPPES registry via `streamRows`.
|
|
17
|
-
*
|
|
18
|
-
* Run: `mailwoman registry scorer-eval cross-dataset [--cap 300] [--wof <admin.db>]
|
|
19
|
-
* [--data-root <dir>] [--out-md docs/articles/evals/matcher-dedup/<date>-...md]`
|
|
20
5
|
*/
|
|
21
6
|
|
|
22
7
|
import { dataRootPath } from "@mailwoman/core/data-root"
|
|
@@ -36,9 +21,6 @@ import {
|
|
|
36
21
|
import type { EvalGeocoderFactory } from "#tools/eval-geocoder"
|
|
37
22
|
import { buildSpecs, norm, pct, stateOption, type SourceSpec } from "#tools/shared"
|
|
38
23
|
|
|
39
|
-
/**
|
|
40
|
-
* Distinct sources an entity needs to count toward the triple-corroborated tally.
|
|
41
|
-
*/
|
|
42
24
|
const MIN_TRIPLE_SOURCES = 3
|
|
43
25
|
|
|
44
26
|
/**
|
|
@@ -46,44 +28,49 @@ const MIN_TRIPLE_SOURCES = 3
|
|
|
46
28
|
*/
|
|
47
29
|
export interface CrossDatasetCorrelationOptions {
|
|
48
30
|
/**
|
|
49
|
-
*
|
|
31
|
+
* Creates the geocoder that resolves the sampled rows.
|
|
50
32
|
*/
|
|
51
33
|
createGeocoder: EvalGeocoderFactory
|
|
34
|
+
|
|
52
35
|
/**
|
|
53
|
-
*
|
|
36
|
+
* The record-matcher sources directory.
|
|
37
|
+
*
|
|
38
|
+
* It defaults to `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
|
|
54
39
|
*/
|
|
55
40
|
sources?: string
|
|
41
|
+
|
|
56
42
|
/**
|
|
57
|
-
*
|
|
43
|
+
* The number of in-state rows sampled per source for geocoding.
|
|
44
|
+
* It defaults to 300.
|
|
58
45
|
*/
|
|
59
46
|
cap?: number
|
|
47
|
+
|
|
60
48
|
/**
|
|
61
|
-
*
|
|
49
|
+
* The state filter.
|
|
50
|
+
* It defaults to `TX`.
|
|
62
51
|
*/
|
|
63
52
|
state?: string
|
|
53
|
+
|
|
64
54
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
55
|
+
* Whether to scan every in-state row to build a corpus-wide address-frequency table.
|
|
56
|
+
* It defaults to true.
|
|
57
|
+
*
|
|
58
|
+
* The scan reads the full source files, including the multi-gigabyte NPPES file.
|
|
59
|
+
* When it is false, `resolveEntities` computes frequencies from the sample only.
|
|
70
60
|
*/
|
|
71
61
|
corpusFrequency?: boolean
|
|
62
|
+
|
|
72
63
|
/**
|
|
73
|
-
*
|
|
64
|
+
* An optional path for the Markdown report.
|
|
74
65
|
*/
|
|
75
66
|
outMd?: string
|
|
67
|
+
|
|
76
68
|
/**
|
|
77
|
-
*
|
|
69
|
+
* An optional path for the entity GeoJSON FeatureCollection.
|
|
78
70
|
*/
|
|
79
71
|
outGeojson?: string
|
|
80
72
|
}
|
|
81
73
|
|
|
82
|
-
/**
|
|
83
|
-
* Compose a row's address for the corpus-wide frequency table. {@link ingestRows} joins the mapped address columns with
|
|
84
|
-
* `", "` (the #694 flip) while this join uses a space — the two agree once `addressFrequencyKey` folds punctuation to
|
|
85
|
-
* spaces, so a frequency key built here matches the geocoded record's `address.raw`.
|
|
86
|
-
*/
|
|
87
74
|
function composeAddress(row: Record<string, string>, columns: string | string[] | undefined): string {
|
|
88
75
|
if (!columns) return ""
|
|
89
76
|
const list = Array.isArray(columns) ? columns : [columns]
|
|
@@ -95,11 +82,6 @@ function composeAddress(row: Record<string, string>, columns: string | string[]
|
|
|
95
82
|
.trim()
|
|
96
83
|
}
|
|
97
84
|
|
|
98
|
-
/**
|
|
99
|
-
* FCC RHC funding commitments — TWO addressable entities per row (a Filing HCP and a Participating HCP), each exploded
|
|
100
|
-
* into its own record (the #618 B1 two-entity-per-row case). Composed after the shared {@link buildSpecs} trio, which
|
|
101
|
-
* this probe correlates against.
|
|
102
|
-
*/
|
|
103
85
|
const commitmentsSpec = (S: string, STATE: string): SourceSpec => ({
|
|
104
86
|
source: "fcc-rhc-commitments",
|
|
105
87
|
path: `${S}/fcc-rhc_commitments-disbursements_form462-466-466a_20260615.tsv`,
|
|
@@ -138,25 +120,24 @@ const commitmentsSpec = (S: string, STATE: string): SourceSpec => ({
|
|
|
138
120
|
})
|
|
139
121
|
|
|
140
122
|
/**
|
|
141
|
-
*
|
|
123
|
+
* Geocodes a sample of each source dataset in one state, resolves the records into entities across sources.
|
|
124
|
+
* It returns a Markdown report of the cross-source links.
|
|
125
|
+
*
|
|
126
|
+
* Progress lines go to `report`.
|
|
127
|
+
* The function also writes the report and GeoJSON when `outMd` or `outGeojson` is set.
|
|
142
128
|
*/
|
|
143
129
|
export async function crossDatasetCorrelation(
|
|
144
130
|
options: CrossDatasetCorrelationOptions,
|
|
145
131
|
report?: (line: string) => void
|
|
146
132
|
): Promise<{ markdown: string }> {
|
|
147
133
|
const SOURCES = options.sources || dataRootPath("record-matcher", "sources")
|
|
148
|
-
const CAP = options.cap ?? 300
|
|
134
|
+
const CAP = options.cap ?? 300
|
|
149
135
|
const STATE = stateOption(options)
|
|
150
136
|
const OUT_MD = options.outMd || ""
|
|
151
|
-
const OUT_GEOJSON = options.outGeojson || ""
|
|
137
|
+
const OUT_GEOJSON = options.outGeojson || ""
|
|
152
138
|
const CORPUS_FREQ = options.corpusFrequency ?? true
|
|
153
139
|
const SPECS = [...buildSpecs(`${SOURCES}`, STATE), commitmentsSpec(`${SOURCES}`, STATE)]
|
|
154
140
|
|
|
155
|
-
// Stream each source, filter Texas rows, and retain the first capped rows for geocoding.
|
|
156
|
-
// (when --corpus-frequency, the default) count EVERY in-state address into a corpus-wide table. The
|
|
157
|
-
// sample is the matched set; the frequency table reflects the full TX population, so the proven
|
|
158
|
-
// inverse-frequency change down-weights a genuinely-crowded shared campus even when it appears once in
|
|
159
|
-
// the geocoded sample. ---
|
|
160
141
|
const rawBySource = new Map<string, Record<string, string>[]>()
|
|
161
142
|
const addrCounts = new Map<string, number>()
|
|
162
143
|
let addrTotal = 0
|
|
@@ -186,7 +167,6 @@ export async function crossDatasetCorrelation(
|
|
|
186
167
|
}
|
|
187
168
|
}
|
|
188
169
|
|
|
189
|
-
// Stop early only when we DON'T need the full frequency pass (otherwise scan to EOF).
|
|
190
170
|
if (!CORPUS_FREQ && kept.length >= CAP) break
|
|
191
171
|
}
|
|
192
172
|
|
|
@@ -194,7 +174,6 @@ export async function crossDatasetCorrelation(
|
|
|
194
174
|
report?.(` ${spec.source}: ${kept.length} sampled`)
|
|
195
175
|
}
|
|
196
176
|
|
|
197
|
-
// The in-state corpus-wide address-frequency table (the #617 change, fed to the matcher below).
|
|
198
177
|
const addressFrequency = CORPUS_FREQ
|
|
199
178
|
? {
|
|
200
179
|
total: addrTotal,
|
|
@@ -207,14 +186,12 @@ export async function crossDatasetCorrelation(
|
|
|
207
186
|
report?.(` address-frequency table: ${addrCounts.size} distinct over ${addrTotal} ${STATE} addresses`)
|
|
208
187
|
}
|
|
209
188
|
|
|
210
|
-
// Construct the injected geocoder used by this evaluation.
|
|
211
189
|
report?.("[B] building the geocoder…")
|
|
212
190
|
const geocoder = await options.createGeocoder()
|
|
213
191
|
|
|
214
192
|
let geo = 0
|
|
215
193
|
let total = 0
|
|
216
194
|
|
|
217
|
-
// Count placements at the boundary (parity with the retired in-script counter).
|
|
218
195
|
const geocodeForIngest: GeocodeAddress = async (raw) => {
|
|
219
196
|
const g = await geocoder.geocodeAddress(raw)
|
|
220
197
|
|
|
@@ -227,14 +204,12 @@ export async function crossDatasetCorrelation(
|
|
|
227
204
|
return g
|
|
228
205
|
}
|
|
229
206
|
|
|
230
|
-
// Ingest each mapped source into one combined labeled record set.
|
|
231
207
|
report?.("[C] geocoding + ingesting all sources…")
|
|
232
208
|
const records: SourceRecord[] = []
|
|
233
209
|
|
|
234
210
|
for (const spec of SPECS) {
|
|
235
211
|
const rows = rawBySource.get(spec.source)!
|
|
236
|
-
|
|
237
|
-
// them across each source to see WHERE nulls concentrate in the aggregate run.
|
|
212
|
+
|
|
238
213
|
const g0 = geo
|
|
239
214
|
const t0 = total
|
|
240
215
|
const recs = await ingestRows(rows, spec.mapping, { geocodeAddress: geocodeForIngest })
|
|
@@ -242,7 +217,6 @@ export async function crossDatasetCorrelation(
|
|
|
242
217
|
const dt = total - t0
|
|
243
218
|
report?.(` ${spec.source}: geocoded ${dg}/${dt} (${dt ? ((100 * dg) / dt).toFixed(1) : "0"}%)`)
|
|
244
219
|
|
|
245
|
-
// Namespace ids by source so cross-source ids never collide.
|
|
246
220
|
for (const r of recs) {
|
|
247
221
|
r.id = `${spec.source}:${r.id}`
|
|
248
222
|
}
|
|
@@ -253,24 +227,14 @@ export async function crossDatasetCorrelation(
|
|
|
253
227
|
geocoder[Symbol.dispose]()
|
|
254
228
|
report?.(` ${records.length} records; geocoded ${geo}/${total} (${((100 * geo) / total).toFixed(1)}%)`)
|
|
255
229
|
|
|
256
|
-
// Resolve records to canonical entities using the default-on proven changes.
|
|
257
|
-
// spatial (A1) + inverse-address-frequency. We feed the corpus-wide table when we built one; otherwise
|
|
258
|
-
// resolveEntities auto-computes the input-scoped default. ---
|
|
259
230
|
report?.("[D] resolving across sources…")
|
|
260
231
|
|
|
261
|
-
// learnedScorer:false — the GBT default is calibrated for same-dataset DEDUP, where "same address +
|
|
262
|
-
// different name" means distinct co-located providers (reject). CROSS-dataset linkage is the opposite
|
|
263
|
-
// objective: "same address + different name" is the prototypical signal of the SAME facility under a
|
|
264
|
-
// different operational name across sources. The dedup GBT rejects exactly those true cross-source
|
|
265
|
-
// links (measured: cross-source 219→166, triple-source 10→1), so this flow uses the recall-appropriate
|
|
266
|
-
// FS baseline. (A cross-objective GBT threshold is the documented follow-up — #655.)
|
|
267
232
|
const { entities, candidatePairs } = resolveEntities(records, {
|
|
268
233
|
trainEM: true,
|
|
269
234
|
learnedScorer: false,
|
|
270
235
|
...(addressFrequency ? { addressFrequency } : {}),
|
|
271
236
|
})
|
|
272
237
|
|
|
273
|
-
// Find entities whose members span at least two distinct sources.
|
|
274
238
|
const sourceOf = (r: SourceRecord) => r.source ?? "?"
|
|
275
239
|
|
|
276
240
|
const crossSource = entities
|
|
@@ -278,7 +242,6 @@ export async function crossDatasetCorrelation(
|
|
|
278
242
|
.filter((x) => x.sources.size >= 2)
|
|
279
243
|
.toSorted((a, b) => b.sources.size - a.sources.size || b.e.records.length - a.e.records.length)
|
|
280
244
|
|
|
281
|
-
// Source-pair co-occurrence matrix.
|
|
282
245
|
const pairCounts = new Map<string, number>()
|
|
283
246
|
|
|
284
247
|
for (const { sources } of crossSource) {
|
|
@@ -292,7 +255,6 @@ export async function crossDatasetCorrelation(
|
|
|
292
255
|
}
|
|
293
256
|
}
|
|
294
257
|
|
|
295
|
-
// Report the resulting cross-source correlations.
|
|
296
258
|
const lines: string[] = [
|
|
297
259
|
`# Cross-dataset correlation (#618 / #87 real-data run)`,
|
|
298
260
|
"",
|
|
@@ -389,8 +351,8 @@ export async function crossDatasetCorrelation(
|
|
|
389
351
|
`${SPECS.length} datasets with no shared key — a provider registry, a federal funding program (two of its forms, ` +
|
|
390
352
|
`the commitments form exploded into its Filing + Participating HCP per row), and a state facility registry — ` +
|
|
391
353
|
`resolve into a single entity model where ${crossSource.length} entities are corroborated by ≥2 independent ` +
|
|
392
|
-
`sources (${triple} by all three kinds), purely on geocoded location + name/org agreement, in pure Node
|
|
393
|
-
`Elasticsearch
|
|
354
|
+
`sources (${triple} by all three kinds), purely on geocoded location + name/org agreement, in pure Node without ` +
|
|
355
|
+
`Elasticsearch or a server. Each cross-source entity is a candidate "same place, multiple records" surfaced for ` +
|
|
394
356
|
`review; whether a correlation means anything is the data consumer's call, not ours.`
|
|
395
357
|
)
|
|
396
358
|
|
|
@@ -405,9 +367,6 @@ export async function crossDatasetCorrelation(
|
|
|
405
367
|
report?.(`\n[written] ${OUT_MD}`)
|
|
406
368
|
}
|
|
407
369
|
|
|
408
|
-
// Emit a GeoJSON FeatureCollection for every resolved entity.
|
|
409
|
-
// carries `sources` + `sourceIDs` (so an analyst filters the cross-dataset links by `sources` length ≥ 2)
|
|
410
|
-
// and the geocode tier. QGIS-ready; this is the operator-verifiable output of the matcher. ---
|
|
411
370
|
if (OUT_GEOJSON) {
|
|
412
371
|
const fc = toGeoJSON(entities)
|
|
413
372
|
await writeLocalJSONFile(fc, OUT_GEOJSON)
|