@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
package/out/reconcile.js
CHANGED
|
@@ -1,37 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Coverage reconciliation (#621) — the library home for what `registry/tools/
|
|
7
|
-
* coverage-reconciliation.ts` does inline, so the CLI (`registry --reconcile`) and any consumer
|
|
8
|
-
* can reuse it.
|
|
9
|
-
*
|
|
10
|
-
* Given entities already resolved ACROSS sources (#618), classify each by which KIND of source its
|
|
11
|
-
* records come from. You tag each source label as either an **eligibility** source (it denotes
|
|
12
|
-
* membership in some base set — e.g. registered providers/facilities) or a **funding/enrollment**
|
|
13
|
-
* source (it denotes participation in a program). Three buckets fall out per entity:
|
|
14
|
-
*
|
|
15
|
-
* - **enrolled** — resolves to BOTH an eligibility and a funding record.
|
|
16
|
-
* - **eligible, not enrolled** — an eligibility record with NO funding record resolving to it (the
|
|
17
|
-
* ANTI-JOIN).
|
|
18
|
-
* - **funded, not in the eligibility set** — a funding record with no eligibility record resolving to
|
|
19
|
-
* it.
|
|
20
|
-
*
|
|
21
|
-
* This is strictly a **set-membership reconciliation, never a determination.** We produce the
|
|
22
|
-
* reconciled join and surface the candidate set; what a gap MEANS — and whether it is real, a
|
|
23
|
-
* sampling artifact, or actionable — is entirely the data consumer's call. Nothing here is an
|
|
24
|
-
* allegation. {@link reconciliationReport} bakes that caveat in by construction.
|
|
25
|
-
*
|
|
26
|
-
* Pairs with {@link toMapHTML}: {@link reconciliationGeoJSON} tags each feature with its `bucket`,
|
|
27
|
-
* which the map auto-detects and colors categorically.
|
|
28
|
-
*/
|
|
29
|
-
import { isPresent } from "@mailwoman/core/objects";
|
|
1
|
+
import { formatPersonName } from "@mailwoman/record/name";
|
|
30
2
|
import { toFeature } from "#geojson";
|
|
31
3
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
4
|
+
* Places an entity in a reconciliation bucket by whether its source labels include
|
|
5
|
+
* eligibility sources, funding sources, or both.
|
|
6
|
+
*
|
|
7
|
+
* @returns `null` when the entity has neither kind of source.
|
|
35
8
|
*/
|
|
36
9
|
export function bucketOf(sources, config) {
|
|
37
10
|
const elig = new Set(config.eligibilitySources);
|
|
@@ -55,8 +28,9 @@ export function bucketOf(sources, config) {
|
|
|
55
28
|
return null;
|
|
56
29
|
}
|
|
57
30
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
31
|
+
* Buckets resolved entities by their sources with {@link bucketOf}.
|
|
32
|
+
*
|
|
33
|
+
* Entities without an eligibility or funding source are dropped.
|
|
60
34
|
*/
|
|
61
35
|
export function reconcileCoverage(entities, config) {
|
|
62
36
|
const reconciled = [];
|
|
@@ -76,17 +50,17 @@ export function reconcileCoverage(entities, config) {
|
|
|
76
50
|
return { reconciled, counts };
|
|
77
51
|
}
|
|
78
52
|
/**
|
|
79
|
-
*
|
|
80
|
-
*
|
|
53
|
+
* Returns a display name for an entity's representative record.
|
|
54
|
+
*
|
|
55
|
+
* It prefers the organization's canonical name, then the person's name, then the record ID.
|
|
81
56
|
*/
|
|
82
57
|
export function repName(entity) {
|
|
83
58
|
const rep = entity.representative;
|
|
84
|
-
const person =
|
|
59
|
+
const person = formatPersonName(rep.name, "short");
|
|
85
60
|
return rep.organization?.canonical ?? (person || rep.id);
|
|
86
61
|
}
|
|
87
62
|
/**
|
|
88
|
-
*
|
|
89
|
-
* {@link toMapHTML} colors categorically by bucket. Entities without a coordinate are skipped.
|
|
63
|
+
* Converts the reconciled entities that have coordinates to point features tagged with their bucket.
|
|
90
64
|
*/
|
|
91
65
|
export function reconciliationGeoJSON(result) {
|
|
92
66
|
return {
|
|
@@ -97,8 +71,10 @@ export function reconciliationGeoJSON(result) {
|
|
|
97
71
|
};
|
|
98
72
|
}
|
|
99
73
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
74
|
+
* Renders a Markdown reconciliation report with the bucket counts, the enrolled rate,
|
|
75
|
+
* a spot-check of `eligible-not-enrolled` entities and a fixed caveat.
|
|
76
|
+
*
|
|
77
|
+
* The report presents the enrolled rate as a floor because incomplete resolution can only miss links.
|
|
102
78
|
*/
|
|
103
79
|
export function reconciliationReport(result, options = {}) {
|
|
104
80
|
const { counts, reconciled } = result;
|
|
@@ -120,8 +96,8 @@ export function reconciliationReport(result, options = {}) {
|
|
|
120
96
|
lines.push(`| bucket | entities | meaning |`);
|
|
121
97
|
lines.push(`|---|---:|---|`);
|
|
122
98
|
lines.push(`| **enrolled** | ${counts.enrolled} | resolves to an eligibility record AND a funding record |`);
|
|
123
|
-
lines.push(`| **eligible, not enrolled** | ${counts["eligible-not-enrolled"]} | eligibility record
|
|
124
|
-
lines.push(`| **funded, not in eligibility set** | ${counts["funded-not-eligible"]} | funding record
|
|
99
|
+
lines.push(`| **eligible, not enrolled** | ${counts["eligible-not-enrolled"]} | eligibility record without a resolved funding record (the **anti-join**) |`);
|
|
100
|
+
lines.push(`| **funded, not in eligibility set** | ${counts["funded-not-eligible"]} | funding record without a resolved eligibility record |`);
|
|
125
101
|
lines.push("");
|
|
126
102
|
lines.push(`Of the ${eligibleTotal} entities with an eligibility record, ${enrolledRate.toFixed(1)}% also resolve to a ` +
|
|
127
103
|
`funding record — a **floor**, not a coverage rate (imperfect resolution + any sampling only ever miss ` +
|
package/out/reconcile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../lib/reconcile.ts"],"names":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,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACd,KAAK,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAA;IACxC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACd,MAAM,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,CAAA;IAEjE,KAAK,CAAC,IAAI,CACT,GAAG,MAAM,sGAAsG;QAC9G,8GAA8G;QAC9G,8GAA8G;QAC9G,qEAAqE,CACtE,CAAA;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
|
package/out/resolve.d.ts
CHANGED
|
@@ -3,87 +3,105 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The resolve pipeline
|
|
7
|
-
* (geo-first) → score (Fellegi-Sunter) → cluster → canonical entities.
|
|
6
|
+
* The resolve pipeline wires the matching modules over concrete contact and organization records.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
* phone / email; score on name, organization, address key, and great-circle distance — and can
|
|
11
|
-
* fit the scorer's `m`/`u` to the data with EM (`trainEM`), so it runs with no labels and no
|
|
12
|
-
* per-dataset tuning. Everything is overridable: pass your own model, blocking keys, or
|
|
13
|
-
* threshold.
|
|
14
|
-
*
|
|
15
|
-
* Geocoding is assumed already done upstream (each `address` carries its coordinate + canonical
|
|
16
|
-
* key). Wiring mailwoman's parser + geocoder to turn raw rows into `SourceRecord`s is the ingest
|
|
17
|
-
* layer that sits in front of this.
|
|
8
|
+
* The upstream pipeline geocodes each `address` and supplies its coordinate and canonical key.
|
|
18
9
|
*/
|
|
19
10
|
import { type BlockingKey, type FellegiSunterModel, type GBT, type TermFrequencyTable } from "@mailwoman/match";
|
|
20
11
|
import type { ResolvedEntity, SourceRecord } from "#types";
|
|
21
12
|
/**
|
|
22
|
-
* Cheap, parse-free normalization for the address-frequency key
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
13
|
+
* Cheap, parse-free normalization for the address-frequency key: uppercase,
|
|
14
|
+
* collapse whitespace, drop punctuation.
|
|
15
|
+
*
|
|
16
|
+
* The count covers distinct entities that share an address.
|
|
17
|
+
* It is computable over millions of rows without geocoding.
|
|
18
|
+
*
|
|
19
|
+
* A crowded clinic or billing address is weak identity evidence.
|
|
20
|
+
* A lonely address is strong.
|
|
27
21
|
*/
|
|
28
22
|
export declare function addressFrequencyKey(raw: string): string;
|
|
29
23
|
/**
|
|
30
|
-
* Last-10-
|
|
31
|
-
*
|
|
32
|
-
*
|
|
24
|
+
* Last-10-digit normalization for phone agreement, dropping country code, punctuation and extensions.
|
|
25
|
+
*
|
|
26
|
+
* A shorter digit string is kept as-is, since partial agreement still contributes
|
|
27
|
+
* weight in the comparison model.
|
|
28
|
+
* `null` means no digits at all.
|
|
33
29
|
*/
|
|
34
30
|
export declare function normalizePhone(raw: string | null | undefined): string | null;
|
|
35
31
|
/**
|
|
36
|
-
* {@link normalizePhone} under the probes' stricter
|
|
37
|
-
*
|
|
38
|
-
*
|
|
32
|
+
* {@link normalizePhone} under the probes' stricter interface, where only a full line counts.
|
|
33
|
+
*
|
|
34
|
+
* Returns the last 10 digits when the input contains at least 10.
|
|
35
|
+
* Returns `""` for shorter input, so callers never receive a partial digit string.
|
|
36
|
+
*
|
|
37
|
+
* Callers guard on truthiness, so `""` reads as no comparable phone rather than a weaker key.
|
|
39
38
|
*/
|
|
40
39
|
export declare function normalizePhoneStrict(raw: string | null | undefined): string;
|
|
41
40
|
/**
|
|
42
|
-
* Options for {@link buildDefaultModel}.
|
|
41
|
+
* Options for {@link buildDefaultModel}.
|
|
42
|
+
*
|
|
43
|
+
* Each change is default-off, so the base model is byte-stable.
|
|
43
44
|
*/
|
|
44
45
|
export interface DefaultModelOptions {
|
|
45
46
|
/**
|
|
46
|
-
* Corpus-wide address-frequency table
|
|
47
|
-
*
|
|
48
|
-
*
|
|
47
|
+
* Corpus-wide address-frequency table over {@link addressFrequencyKey}, which makes
|
|
48
|
+
* the address agreement weight inverse to how shared the address is.
|
|
49
|
+
*
|
|
50
|
+
* A building with 50 providers makes a same-address match near-worthless evidence.
|
|
51
|
+
*
|
|
52
|
+
* The table's `value` is the record's raw address string.
|
|
49
53
|
*/
|
|
50
54
|
addressFrequency?: TermFrequencyTable;
|
|
51
55
|
/**
|
|
52
|
-
*
|
|
53
|
-
* {@link spatialComparison spatial-agreement} signal
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
+
* Collapse the redundant address-key and great-circle-distance comparisons into one
|
|
57
|
+
* {@link spatialComparison spatial-agreement} signal, an exact-key tier over distance buckets.
|
|
58
|
+
*
|
|
59
|
+
* Removes the double-count that over-merges co-located providers, since an
|
|
60
|
+
* exact key match already implies distance ≈ 0.
|
|
56
61
|
*/
|
|
57
62
|
collapseSpatial?: boolean;
|
|
58
63
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
64
|
+
* Add a normalized-phone exact-match comparison.
|
|
65
|
+
*
|
|
66
|
+
* A shared line is strong evidence and the secondary corroborator that lets a
|
|
67
|
+
* true same-entity link survive name drift.
|
|
61
68
|
*/
|
|
62
69
|
usePhone?: boolean;
|
|
63
70
|
/**
|
|
64
|
-
* Extra secondary-identifier comparisons drawn from {@link SourceRecord.attributes}
|
|
65
|
-
*
|
|
66
|
-
*
|
|
71
|
+
* Extra secondary-identifier comparisons drawn from {@link SourceRecord.attributes},
|
|
72
|
+
* such as `["authorizedOfficial"]`.
|
|
73
|
+
*
|
|
74
|
+
* Each becomes an `attr:<key>` comparison and counts toward corroboration.
|
|
75
|
+
* It is a more reliable discriminator than phone where the data has one.
|
|
67
76
|
*/
|
|
68
77
|
discriminators?: string[];
|
|
69
78
|
/**
|
|
70
|
-
* Closed-vocabulary
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
79
|
+
* Closed-vocabulary code-set discriminators drawn from {@link SourceRecord.attributes},
|
|
80
|
+
* such as NPPES taxonomy codes or license numbers.
|
|
81
|
+
*
|
|
82
|
+
* The attribute value is a whitespace-joined set of codes.
|
|
83
|
+
* Any shared code counts as agreement.
|
|
84
|
+
*
|
|
85
|
+
* This is set overlap rather than string similarity, since `207R00000X`
|
|
86
|
+
* and `207Q00000X` are different specialties despite near-identical text.
|
|
87
|
+
*
|
|
88
|
+
* Similarity scores mis-rank that case because the codes identify different specialties.
|
|
89
|
+
* The over-merge separator: two co-located records of one entity nearly always share
|
|
90
|
+
* a code, while two distinct co-located providers usually do not.
|
|
75
91
|
*/
|
|
76
92
|
exactDiscriminators?: string[];
|
|
77
93
|
}
|
|
78
94
|
/**
|
|
79
|
-
* The default geocode-first scoring model: name
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
95
|
+
* The default geocode-first scoring model: name, organization and a spatial signal.
|
|
96
|
+
*
|
|
97
|
+
* The spatial signal is either two comparisons (address-key similarity and great-circle distance)
|
|
98
|
+
* or, with {@link DefaultModelOptions.collapseSpatial}, one collapsed {@link spatialComparison}.
|
|
99
|
+
* `addressFrequency` down-weights agreement on a crowded address either way.
|
|
83
100
|
*/
|
|
84
101
|
export declare function buildDefaultModel(opts?: DefaultModelOptions): FellegiSunterModel<SourceRecord>;
|
|
85
102
|
/**
|
|
86
|
-
* The default blocking keys
|
|
103
|
+
* The default blocking keys include location and canonical address.
|
|
104
|
+
* They also include phone and email.
|
|
87
105
|
*/
|
|
88
106
|
export declare function defaultBlockingKeys(): BlockingKey<SourceRecord>[];
|
|
89
107
|
/**
|
|
@@ -91,15 +109,21 @@ export declare function defaultBlockingKeys(): BlockingKey<SourceRecord>[];
|
|
|
91
109
|
*/
|
|
92
110
|
export interface ResolveConfig {
|
|
93
111
|
/**
|
|
94
|
-
*
|
|
112
|
+
* The model used to score candidate pairs.
|
|
113
|
+
*
|
|
114
|
+
* Default {@link buildDefaultModel}.
|
|
95
115
|
*/
|
|
96
116
|
model?: FellegiSunterModel<SourceRecord>;
|
|
97
117
|
/**
|
|
98
|
-
*
|
|
118
|
+
* The blocking keys whose union forms the candidate set.
|
|
119
|
+
*
|
|
120
|
+
* Default {@link defaultBlockingKeys}.
|
|
99
121
|
*/
|
|
100
122
|
blockingKeys?: BlockingKey<SourceRecord>[];
|
|
101
123
|
/**
|
|
102
|
-
* Link two records into the same entity at or above this match weight (bits).
|
|
124
|
+
* Link two records into the same entity at or above this match weight (bits).
|
|
125
|
+
*
|
|
126
|
+
* Default 0.
|
|
103
127
|
*/
|
|
104
128
|
threshold?: number;
|
|
105
129
|
/**
|
|
@@ -107,74 +131,108 @@ export interface ResolveConfig {
|
|
|
107
131
|
*/
|
|
108
132
|
maxBlockSize?: number;
|
|
109
133
|
/**
|
|
110
|
-
* Fit the model's `m`/`u` to the candidate pairs with EM before scoring (label-free).
|
|
134
|
+
* Fit the model's `m`/`u` to the candidate pairs with EM before scoring (label-free).
|
|
135
|
+
*
|
|
136
|
+
* Default false.
|
|
111
137
|
*/
|
|
112
138
|
trainEM?: boolean;
|
|
113
139
|
/**
|
|
114
|
-
* Address-frequency table
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
140
|
+
* Address-frequency table over {@link addressFrequencyKey}, which down-weights address
|
|
141
|
+
* agreement by how shared the address is. **Default-on:** when omitted, `resolveEntities`
|
|
142
|
+
* computes the table over the input records' addresses, the right scope for a single dataset.
|
|
143
|
+
*
|
|
144
|
+
* Pass your own {@link TermFrequencyTable} (for example a corpus-wide one) to override,
|
|
145
|
+
* or `false` to disable (the legacy bare baseline).
|
|
146
|
+
* Ignored if `model` is supplied.
|
|
119
147
|
*/
|
|
120
148
|
addressFrequency?: TermFrequencyTable | false;
|
|
121
149
|
/**
|
|
122
|
-
*
|
|
123
|
-
* (true)**
|
|
124
|
-
*
|
|
150
|
+
* Collapse the redundant address-key and distance pair into one {@link spatialComparison}.
|
|
151
|
+
* **Default-on (true)** is the cleaner, less-over-merging spatial model.
|
|
152
|
+
*
|
|
153
|
+
* Set `false` for the legacy two-signal baseline.
|
|
154
|
+
* Ignored if `model` is supplied.
|
|
125
155
|
*/
|
|
126
156
|
collapseSpatial?: boolean;
|
|
127
157
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
158
|
+
* Require positive name or organization corroboration ({@link CORROBORATING_FIELDS}) for
|
|
159
|
+
* a link, so a shared address cannot merge two records without that corroboration.
|
|
160
|
+
*
|
|
161
|
+
* Suppresses the spatial-only links that fuse distinct co-located providers.
|
|
162
|
+
* Default false.
|
|
131
163
|
*/
|
|
132
164
|
requireCorroboration?: boolean;
|
|
133
165
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
166
|
+
* Add a normalized-phone comparison to the default model.
|
|
167
|
+
*
|
|
168
|
+
* Phone agreement provides strong secondary evidence when entity names have drifted.
|
|
169
|
+
*
|
|
170
|
+
* Ignored if `model` is supplied.
|
|
136
171
|
*/
|
|
137
172
|
usePhone?: boolean;
|
|
138
173
|
/**
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
174
|
+
* The linkage method used for clustering.
|
|
175
|
+
*
|
|
176
|
+
* `"single"` (default) is connected components, while `"average"` is an average-linkage
|
|
177
|
+
* refinement that splits a component whose sub-clusters are joined only by a weak bridge.
|
|
142
178
|
*/
|
|
143
179
|
linkage?: "single" | "average";
|
|
144
180
|
/**
|
|
145
|
-
* Extra secondary-identifier keys
|
|
146
|
-
* `["authorizedOfficial"]`.
|
|
181
|
+
* Extra secondary-identifier keys from {@link SourceRecord.attributes} to add as
|
|
182
|
+
* comparisons and corroborators, for example `["authorizedOfficial"]`.
|
|
183
|
+
*
|
|
184
|
+
* Ignored if `model` is supplied.
|
|
147
185
|
*/
|
|
148
186
|
discriminators?: string[];
|
|
149
187
|
/**
|
|
150
|
-
* Closed-vocabulary code-
|
|
151
|
-
*
|
|
188
|
+
* Closed-vocabulary code-set discriminator keys ({@link DefaultModelOptions.exactDiscriminators}),
|
|
189
|
+
* which use set-overlap agreement.
|
|
190
|
+
* An example is `["taxonomy"]`.
|
|
191
|
+
*
|
|
192
|
+
* Also corroborators.
|
|
193
|
+
* Ignored if `model` is supplied.
|
|
152
194
|
*/
|
|
153
195
|
exactDiscriminators?: string[];
|
|
154
196
|
/**
|
|
155
|
-
* Override the Fellegi-Sunter link weight with a
|
|
156
|
-
* this function's return value (same threshold-comparable units as the FS weight) instead of {@link scorePair}'s.
|
|
157
|
-
* Default undefined (pure FS). The blocking + clustering are unchanged, so a trained scorer can be A/B'd against the
|
|
158
|
-
* FS baseline on the identical pipeline. The function is responsible for its own feature computation (e.g. the
|
|
159
|
-
* agreement pattern, which is EM-independent, plus any corpus statistics it captured).
|
|
197
|
+
* Override the Fellegi-Sunter link weight with a learned score.
|
|
160
198
|
*
|
|
161
|
-
*
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
199
|
+
* When set, a candidate pair's match weight is this function's return value instead of
|
|
200
|
+
* {@link scorePair}'s, in the same threshold-comparable units as the FS weight.
|
|
201
|
+
* Default is undefined (pure FS).
|
|
202
|
+
*
|
|
203
|
+
* The blocking and clustering are unchanged, so a trained scorer can be A/B tested
|
|
204
|
+
* against the FS baseline on the identical pipeline.
|
|
205
|
+
* The function is responsible for its own feature computation, such as the
|
|
206
|
+
* agreement pattern plus any corpus statistics it captured.
|
|
207
|
+
*
|
|
208
|
+
* The corroboration check is independent of the learned score and is still evaluated on
|
|
209
|
+
* the Fellegi-Sunter `contributions`, so a learned-high pair with no positive FS name,
|
|
210
|
+
* organization or phone agreement is still held out.
|
|
211
|
+
*
|
|
212
|
+
* A learned scorer is normally trained to subsume corroboration, so use one or the other.
|
|
213
|
+
* The independent FS check can veto the learned score when both checks run.
|
|
166
214
|
*/
|
|
167
215
|
scorer?: (a: SourceRecord, b: SourceRecord) => number;
|
|
168
216
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
177
|
-
*
|
|
217
|
+
* The learned gradient-boosted-tree scorer, default-on.
|
|
218
|
+
*
|
|
219
|
+
* Omitted or `true` uses the bundled {@link DEDUP_GBT_MODEL}, which was trained on
|
|
220
|
+
* the NPPES NPI-truth set and beats the Fellegi-Sunter baseline by roughly +5pp dedup
|
|
221
|
+
* F1 held-out within a state and +22pp on states it never trained on.
|
|
222
|
+
*
|
|
223
|
+
* `false` opts out to the pure FS baseline.
|
|
224
|
+
* Pass your own {@link GBT} for a custom model.
|
|
225
|
+
*
|
|
226
|
+
* The scorer is built over the same collapsed-spatial and address-frequency feature
|
|
227
|
+
* model as training, independent of this call's comparison config.
|
|
228
|
+
* An explicit {@link scorer} takes precedence.
|
|
229
|
+
*
|
|
230
|
+
* When the bundled model is active and no {@link threshold} is set,
|
|
231
|
+
* its calibrated link threshold ({@link DEDUP_GBT_META}.recommendedThreshold) is used,
|
|
232
|
+
* because the GBT logit is not in FS-weight units and 0 would over-merge.
|
|
233
|
+
*
|
|
234
|
+
* The model is NPPES/US-trained.
|
|
235
|
+
* For a very different domain, A/B it or pass `false`.
|
|
178
236
|
*/
|
|
179
237
|
learnedScorer?: boolean | GBT;
|
|
180
238
|
}
|
|
@@ -196,8 +254,10 @@ export interface ResolveResult {
|
|
|
196
254
|
}>;
|
|
197
255
|
}
|
|
198
256
|
/**
|
|
199
|
-
* Resolve source records into canonical entities: block
|
|
200
|
-
*
|
|
257
|
+
* Resolve source records into canonical entities: block, score, cluster.
|
|
258
|
+
*
|
|
259
|
+
* Every record belongs to exactly one entity.
|
|
260
|
+
* A record without a confident link forms a singleton entity.
|
|
201
261
|
*/
|
|
202
262
|
export declare function resolveEntities(records: readonly SourceRecord[], config?: ResolveConfig): ResolveResult;
|
|
203
263
|
//# sourceMappingURL=resolve.d.ts.map
|
package/out/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../lib/resolve.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../lib/resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAEN,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,GAAG,EAER,KAAK,kBAAkB,EAgBvB,MAAM,kBAAkB,CAAA;AAIzB,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1D;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMvD;AAiDD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAK5E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAI3E;AAWD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,kBAAkB,CAAA;IACrC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,mBAAwB,GAAG,kBAAkB,CAAC,YAAY,CAA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