@mailwoman/entity-resolution 0.0.0-stage → 10.8.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 +114 -2
- package/lib/address-key.ts +46 -0
- package/lib/geocode-handler.ts +37 -0
- package/lib/geojson.ts +72 -0
- package/lib/index.ts +23 -0
- package/lib/ingest.ts +349 -0
- package/lib/learned-scorer.ts +134 -0
- package/lib/map-html.ts +287 -0
- package/lib/models/crosssource-gbt-en-us.ts +43 -0
- package/lib/models/dedup-gbt-en-us.ts +47 -0
- package/lib/models/org-crosssource-gbt-en-us.ts +43 -0
- package/lib/reconcile.ts +239 -0
- package/lib/resolve.ts +569 -0
- package/lib/types.ts +110 -0
- package/out/address-key.d.ts +34 -0
- package/out/address-key.d.ts.map +1 -0
- package/out/address-key.js +41 -0
- package/out/address-key.js.map +1 -0
- package/out/geocode-handler.d.ts +20 -0
- package/out/geocode-handler.d.ts.map +1 -0
- package/out/geocode-handler.js +29 -0
- package/out/geocode-handler.js.map +1 -0
- package/out/geojson.d.ts +28 -0
- package/out/geojson.d.ts.map +1 -0
- package/out/geojson.js +62 -0
- package/out/geojson.js.map +1 -0
- package/out/index.d.ts +23 -0
- package/out/index.d.ts.map +1 -0
- package/out/index.js +23 -0
- package/out/index.js.map +1 -0
- package/out/ingest.d.ts +173 -0
- package/out/ingest.d.ts.map +1 -0
- package/out/ingest.js +185 -0
- package/out/ingest.js.map +1 -0
- package/out/learned-scorer.d.ts +61 -0
- package/out/learned-scorer.d.ts.map +1 -0
- package/out/learned-scorer.js +91 -0
- package/out/learned-scorer.js.map +1 -0
- package/out/map-html.d.ts +39 -0
- package/out/map-html.d.ts.map +1 -0
- package/out/map-html.js +220 -0
- package/out/map-html.js.map +1 -0
- package/out/models/crosssource-gbt-en-us.d.ts +45 -0
- package/out/models/crosssource-gbt-en-us.d.ts.map +1 -0
- package/out/models/crosssource-gbt-en-us.js +40 -0
- package/out/models/crosssource-gbt-en-us.js.map +1 -0
- package/out/models/dedup-gbt-en-us.d.ts +44 -0
- package/out/models/dedup-gbt-en-us.d.ts.map +1 -0
- package/out/models/dedup-gbt-en-us.js +44 -0
- package/out/models/dedup-gbt-en-us.js.map +1 -0
- package/out/models/org-crosssource-gbt-en-us.d.ts +45 -0
- package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -0
- package/out/models/org-crosssource-gbt-en-us.js +40 -0
- package/out/models/org-crosssource-gbt-en-us.js.map +1 -0
- package/out/reconcile.d.ts +96 -0
- package/out/reconcile.d.ts.map +1 -0
- package/out/reconcile.js +127 -0
- package/out/reconcile.js.map +1 -0
- package/out/resolve.d.ts +264 -0
- package/out/resolve.d.ts.map +1 -0
- package/out/resolve.js +282 -0
- package/out/resolve.js.map +1 -0
- package/out/tools/coverage-reconciliation.d.ts +67 -0
- package/out/tools/coverage-reconciliation.d.ts.map +1 -0
- package/out/tools/coverage-reconciliation.js +113 -0
- package/out/tools/coverage-reconciliation.js.map +1 -0
- package/out/tools/cross/dataset-correlation.d.ts +61 -0
- package/out/tools/cross/dataset-correlation.d.ts.map +1 -0
- package/out/tools/cross/dataset-correlation.js +244 -0
- 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 +264 -0
- package/out/tools/cross/source-threshold-sweep.js.map +1 -0
- package/out/tools/dedup-ceiling.d.ts +62 -0
- package/out/tools/dedup-ceiling.d.ts.map +1 -0
- package/out/tools/dedup-ceiling.js +171 -0
- package/out/tools/dedup-ceiling.js.map +1 -0
- package/out/tools/eval-geocoder.d.ts +68 -0
- package/out/tools/eval-geocoder.d.ts.map +1 -0
- package/out/tools/eval-geocoder.js +13 -0
- package/out/tools/eval-geocoder.js.map +1 -0
- 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 +60 -0
- 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 +161 -0
- package/out/tools/geocoder/vs-provided-coords.js.map +1 -0
- package/out/tools/gold-set-sample.d.ts +67 -0
- package/out/tools/gold-set-sample.d.ts.map +1 -0
- package/out/tools/gold-set-sample.js +81 -0
- package/out/tools/gold-set-sample.js.map +1 -0
- 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 +207 -0
- 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 +168 -0
- package/out/tools/learned/scorer/crossstate-eval.js.map +1 -0
- package/out/tools/learned/scorer/eval.d.ts +64 -0
- package/out/tools/learned/scorer/eval.d.ts.map +1 -0
- package/out/tools/learned/scorer/eval.js +275 -0
- package/out/tools/learned/scorer/eval.js.map +1 -0
- package/out/tools/matcher-scale.d.ts +40 -0
- package/out/tools/matcher-scale.d.ts.map +1 -0
- package/out/tools/matcher-scale.js +111 -0
- package/out/tools/matcher-scale.js.map +1 -0
- package/out/tools/nppes/dedup-benchmark.d.ts +82 -0
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -0
- package/out/tools/nppes/dedup-benchmark.js +226 -0
- package/out/tools/nppes/dedup-benchmark.js.map +1 -0
- package/out/tools/nppes/org-name.d.ts +15 -0
- package/out/tools/nppes/org-name.d.ts.map +1 -0
- package/out/tools/nppes/org-name.js +6 -0
- package/out/tools/nppes/org-name.js.map +1 -0
- package/out/tools/nppes/overmerge-packet.d.ts +43 -0
- package/out/tools/nppes/overmerge-packet.d.ts.map +1 -0
- package/out/tools/nppes/overmerge-packet.js +54 -0
- package/out/tools/nppes/overmerge-packet.js.map +1 -0
- package/out/tools/nppes/report.d.ts +97 -0
- package/out/tools/nppes/report.d.ts.map +1 -0
- package/out/tools/nppes/report.js +178 -0
- package/out/tools/nppes/report.js.map +1 -0
- package/out/tools/nppes/sample.d.ts +101 -0
- package/out/tools/nppes/sample.d.ts.map +1 -0
- package/out/tools/nppes/sample.js +127 -0
- package/out/tools/nppes/sample.js.map +1 -0
- package/out/tools/nppes/scoring.d.ts +37 -0
- package/out/tools/nppes/scoring.d.ts.map +1 -0
- package/out/tools/nppes/scoring.js +81 -0
- package/out/tools/nppes/scoring.js.map +1 -0
- package/out/tools/nppes/settings.d.ts +41 -0
- package/out/tools/nppes/settings.d.ts.map +1 -0
- package/out/tools/nppes/settings.js +79 -0
- package/out/tools/nppes/settings.js.map +1 -0
- package/out/tools/nppes/truth-grains.d.ts +63 -0
- package/out/tools/nppes/truth-grains.d.ts.map +1 -0
- package/out/tools/nppes/truth-grains.js +142 -0
- package/out/tools/nppes/truth-grains.js.map +1 -0
- package/out/tools/shared.d.ts +325 -0
- package/out/tools/shared.d.ts.map +1 -0
- package/out/tools/shared.js +453 -0
- package/out/tools/shared.js.map +1 -0
- package/out/tools/train/cross-gbt.d.ts +89 -0
- package/out/tools/train/cross-gbt.d.ts.map +1 -0
- package/out/tools/train/cross-gbt.js +132 -0
- 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 +155 -0
- package/out/tools/train/gbt.js.map +1 -0
- package/out/tools/train/org-cross-gbt.d.ts +85 -0
- package/out/tools/train/org-cross-gbt.d.ts.map +1 -0
- package/out/tools/train/org-cross-gbt.js +122 -0
- package/out/tools/train/org-cross-gbt.js.map +1 -0
- package/out/tools/txhhsc-to-oarow.d.ts +42 -0
- package/out/tools/txhhsc-to-oarow.d.ts.map +1 -0
- package/out/tools/txhhsc-to-oarow.js +78 -0
- package/out/tools/txhhsc-to-oarow.js.map +1 -0
- package/out/tools/viz/browser.d.ts +31 -0
- package/out/tools/viz/browser.d.ts.map +1 -0
- package/out/tools/viz/browser.js +26 -0
- package/out/tools/viz/browser.js.map +1 -0
- package/out/tools/viz/cross-dataset-map.d.ts +39 -0
- package/out/tools/viz/cross-dataset-map.d.ts.map +1 -0
- package/out/tools/viz/cross-dataset-map.js +84 -0
- package/out/tools/viz/cross-dataset-map.js.map +1 -0
- package/out/tools/viz/geocode-first-surface.d.ts +36 -0
- package/out/tools/viz/geocode-first-surface.d.ts.map +1 -0
- package/out/tools/viz/geocode-first-surface.js +234 -0
- package/out/tools/viz/geocode-first-surface.js.map +1 -0
- package/out/tools/viz/render/map.d.ts +42 -0
- package/out/tools/viz/render/map.d.ts.map +1 -0
- package/out/tools/viz/render/map.js +40 -0
- package/out/tools/viz/render/map.js.map +1 -0
- package/out/tools/viz/render.d.ts +46 -0
- package/out/tools/viz/render.d.ts.map +1 -0
- package/out/tools/viz/render.js +49 -0
- package/out/tools/viz/render.js.map +1 -0
- package/out/tools/viz/source-provenance-map.d.ts +57 -0
- package/out/tools/viz/source-provenance-map.d.ts.map +1 -0
- package/out/tools/viz/source-provenance-map.js +82 -0
- package/out/tools/viz/source-provenance-map.js.map +1 -0
- package/out/tools/viz/yardstick-figure.d.ts +22 -0
- package/out/tools/viz/yardstick-figure.d.ts.map +1 -0
- package/out/tools/viz/yardstick-figure.js +106 -0
- package/out/tools/viz/yardstick-figure.js.map +1 -0
- package/out/types.d.ts +108 -0
- package/out/types.d.ts.map +1 -0
- package/out/types.js +11 -0
- package/out/types.js.map +1 -0
- package/package.json +113 -3
- package/tools/coverage-reconciliation.ts +192 -0
- package/tools/cross/dataset-correlation.ts +380 -0
- package/tools/cross/source-threshold-sweep.ts +416 -0
- package/tools/dedup-ceiling.ts +225 -0
- package/tools/eval-geocoder.ts +77 -0
- package/tools/geocoder/namesake-probe.ts +91 -0
- package/tools/geocoder/vs-provided-coords.ts +232 -0
- package/tools/gold-set-sample.ts +147 -0
- package/tools/learned/scorer/clustering-eval.ts +349 -0
- package/tools/learned/scorer/crossstate-eval.ts +280 -0
- package/tools/learned/scorer/eval.ts +429 -0
- package/tools/matcher-scale.ts +185 -0
- package/tools/nppes/dedup-benchmark.ts +364 -0
- package/tools/nppes/org-name.ts +15 -0
- package/tools/nppes/overmerge-packet.ts +98 -0
- package/tools/nppes/report.ts +380 -0
- package/tools/nppes/sample.ts +250 -0
- package/tools/nppes/scoring.ts +115 -0
- package/tools/nppes/settings.ts +102 -0
- package/tools/nppes/truth-grains.ts +185 -0
- package/tools/shared.ts +743 -0
- package/tools/train/cross-gbt.ts +214 -0
- package/tools/train/gbt.ts +261 -0
- package/tools/train/org-cross-gbt.ts +189 -0
- package/tools/txhhsc-to-oarow.ts +118 -0
- package/tools/viz/browser.ts +41 -0
- package/tools/viz/cross-dataset-map.ts +133 -0
- package/tools/viz/geocode-first-surface.ts +305 -0
- package/tools/viz/render/map.ts +61 -0
- package/tools/viz/render.ts +103 -0
- package/tools/viz/source-provenance-map.ts +154 -0
- package/tools/viz/yardstick-figure.ts +197 -0
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*/
|
|
6
|
+
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
7
|
+
import { writeLocalFile, writeLocalJSONFile } from "@mailwoman/core/fs/writers";
|
|
8
|
+
import { isPresent } from "@mailwoman/core/objects";
|
|
9
|
+
import { addressFrequencyKey, ingestRows, repName, resolveEntities, streamRows, toGeoJSON, } from "#index";
|
|
10
|
+
import { buildSpecs, norm, pct, stateOption } from "#tools/shared";
|
|
11
|
+
const MIN_TRIPLE_SOURCES = 3;
|
|
12
|
+
function composeAddress(row, columns) {
|
|
13
|
+
if (!columns)
|
|
14
|
+
return "";
|
|
15
|
+
const list = Array.isArray(columns) ? columns : [columns];
|
|
16
|
+
return list
|
|
17
|
+
.map((c) => norm(row[c]))
|
|
18
|
+
.filter(isPresent)
|
|
19
|
+
.join(" ")
|
|
20
|
+
.trim();
|
|
21
|
+
}
|
|
22
|
+
const commitmentsSpec = (S, STATE) => ({
|
|
23
|
+
source: "fcc-rhc-commitments",
|
|
24
|
+
path: `${S}/fcc-rhc_commitments-disbursements_form462-466-466a_20260615.tsv`,
|
|
25
|
+
mapping: {
|
|
26
|
+
id: "hcpID",
|
|
27
|
+
organization: "hcpName",
|
|
28
|
+
address: ["hcpStreet", "hcpCity", "hcpState", "hcpZip"],
|
|
29
|
+
source: "fcc-rhc-commitments",
|
|
30
|
+
},
|
|
31
|
+
inState: (r) => norm(r["Filing HCP State"]).toUpperCase() === STATE || norm(r["Participating HCP State"]).toUpperCase() === STATE,
|
|
32
|
+
explode: (r) => {
|
|
33
|
+
const out = [];
|
|
34
|
+
const add = (prefix, role) => {
|
|
35
|
+
const id = norm(r[`${prefix} HCP`]);
|
|
36
|
+
const state = norm(r[`${prefix} HCP State`]).toUpperCase();
|
|
37
|
+
if (id && state === STATE) {
|
|
38
|
+
out.push({
|
|
39
|
+
hcpID: `${role}-${id}`,
|
|
40
|
+
hcpName: norm(r[`${prefix} HCP Name`]),
|
|
41
|
+
hcpStreet: norm(r[`${prefix} HCP Street`]),
|
|
42
|
+
hcpCity: norm(r[`${prefix} HCP City`]),
|
|
43
|
+
hcpState: state,
|
|
44
|
+
hcpZip: norm(r[`${prefix} HCP Zip Code`]),
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
add("Filing", "filing");
|
|
49
|
+
add("Participating", "participating");
|
|
50
|
+
return out;
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Geocodes a sample of each source dataset in one state, resolves the records into entities across sources.
|
|
55
|
+
* It returns a Markdown report of the cross-source links.
|
|
56
|
+
*
|
|
57
|
+
* Progress lines go to `report`.
|
|
58
|
+
* The function also writes the report and GeoJSON when `outMd` or `outGeojson` is set.
|
|
59
|
+
*/
|
|
60
|
+
export async function crossDatasetCorrelation(options, report) {
|
|
61
|
+
const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
|
|
62
|
+
const CAP = options.cap ?? 300;
|
|
63
|
+
const STATE = stateOption(options);
|
|
64
|
+
const OUT_MD = options.outMd || "";
|
|
65
|
+
const OUT_GEOJSON = options.outGeojson || "";
|
|
66
|
+
const CORPUS_FREQ = options.corpusFrequency ?? true;
|
|
67
|
+
const SPECS = [...buildSpecs(`${SOURCES}`, STATE), commitmentsSpec(`${SOURCES}`, STATE)];
|
|
68
|
+
const rawBySource = new Map();
|
|
69
|
+
const addrCounts = new Map();
|
|
70
|
+
let addrTotal = 0;
|
|
71
|
+
for (const spec of SPECS) {
|
|
72
|
+
report?.(`[A] ${spec.source}: streaming + ${STATE} filter (sample ${CAP}${CORPUS_FREQ ? ", full freq scan" : ""})…`);
|
|
73
|
+
const kept = [];
|
|
74
|
+
for await (const row of streamRows(spec.path)) {
|
|
75
|
+
if (!spec.inState(row))
|
|
76
|
+
continue;
|
|
77
|
+
const exploded = spec.explode ? spec.explode(row) : [row];
|
|
78
|
+
for (const e of exploded) {
|
|
79
|
+
if (CORPUS_FREQ) {
|
|
80
|
+
const a = composeAddress(e, spec.mapping.address);
|
|
81
|
+
if (a) {
|
|
82
|
+
const k = addressFrequencyKey(a);
|
|
83
|
+
addrCounts.set(k, (addrCounts.get(k) ?? 0) + 1);
|
|
84
|
+
addrTotal++;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
if (kept.length < CAP) {
|
|
88
|
+
kept.push(e);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (!CORPUS_FREQ && kept.length >= CAP)
|
|
92
|
+
break;
|
|
93
|
+
}
|
|
94
|
+
rawBySource.set(spec.source, kept);
|
|
95
|
+
report?.(` ${spec.source}: ${kept.length} sampled`);
|
|
96
|
+
}
|
|
97
|
+
const addressFrequency = CORPUS_FREQ
|
|
98
|
+
? {
|
|
99
|
+
total: addrTotal,
|
|
100
|
+
distinct: addrCounts.size,
|
|
101
|
+
frequency: (v) => (v ? (addrCounts.get(addressFrequencyKey(v)) ?? 0) / addrTotal : 0),
|
|
102
|
+
}
|
|
103
|
+
: null;
|
|
104
|
+
if (CORPUS_FREQ) {
|
|
105
|
+
report?.(` address-frequency table: ${addrCounts.size} distinct over ${addrTotal} ${STATE} addresses`);
|
|
106
|
+
}
|
|
107
|
+
report?.("[B] building the geocoder…");
|
|
108
|
+
const geocoder = await options.createGeocoder();
|
|
109
|
+
let geo = 0;
|
|
110
|
+
let total = 0;
|
|
111
|
+
const geocodeForIngest = async (raw) => {
|
|
112
|
+
const g = await geocoder.geocodeAddress(raw);
|
|
113
|
+
total++;
|
|
114
|
+
if (g?.geocode) {
|
|
115
|
+
geo++;
|
|
116
|
+
}
|
|
117
|
+
return g;
|
|
118
|
+
};
|
|
119
|
+
report?.("[C] geocoding + ingesting all sources…");
|
|
120
|
+
const records = [];
|
|
121
|
+
for (const spec of SPECS) {
|
|
122
|
+
const rows = rawBySource.get(spec.source);
|
|
123
|
+
const g0 = geo;
|
|
124
|
+
const t0 = total;
|
|
125
|
+
const recs = await ingestRows(rows, spec.mapping, { geocodeAddress: geocodeForIngest });
|
|
126
|
+
const dg = geo - g0;
|
|
127
|
+
const dt = total - t0;
|
|
128
|
+
report?.(` ${spec.source}: geocoded ${dg}/${dt} (${dt ? ((100 * dg) / dt).toFixed(1) : "0"}%)`);
|
|
129
|
+
for (const r of recs) {
|
|
130
|
+
r.id = `${spec.source}:${r.id}`;
|
|
131
|
+
}
|
|
132
|
+
records.push(...recs);
|
|
133
|
+
}
|
|
134
|
+
geocoder[Symbol.dispose]();
|
|
135
|
+
report?.(` ${records.length} records; geocoded ${geo}/${total} (${((100 * geo) / total).toFixed(1)}%)`);
|
|
136
|
+
report?.("[D] resolving across sources…");
|
|
137
|
+
const { entities, candidatePairs } = resolveEntities(records, {
|
|
138
|
+
trainEM: true,
|
|
139
|
+
learnedScorer: false,
|
|
140
|
+
...(addressFrequency ? { addressFrequency } : {}),
|
|
141
|
+
});
|
|
142
|
+
const sourceOf = (r) => r.source ?? "?";
|
|
143
|
+
const crossSource = entities
|
|
144
|
+
.map((e) => ({ e, sources: new Set(e.records.map(sourceOf)) }))
|
|
145
|
+
.filter((x) => x.sources.size >= 2)
|
|
146
|
+
.toSorted((a, b) => b.sources.size - a.sources.size || b.e.records.length - a.e.records.length);
|
|
147
|
+
const pairCounts = new Map();
|
|
148
|
+
for (const { sources } of crossSource) {
|
|
149
|
+
const list = [...sources].toSorted();
|
|
150
|
+
for (let i = 0; i < list.length; i++) {
|
|
151
|
+
for (let j = i + 1; j < list.length; j++) {
|
|
152
|
+
const k = `${list[i]} ↔ ${list[j]}`;
|
|
153
|
+
pairCounts.set(k, (pairCounts.get(k) ?? 0) + 1);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const lines = [
|
|
158
|
+
`# Cross-dataset correlation (#618 / #87 real-data run)`,
|
|
159
|
+
"",
|
|
160
|
+
`_Generated by \`mailwoman registry scorer-eval cross-dataset\`. ${STATE}-scoped, ≤${CAP} rows per ` +
|
|
161
|
+
`source geocoded, resolved BLIND across sources (geo-first block → Fellegi-Sunter + EM → cluster) with the ` +
|
|
162
|
+
`proven changes default-on (#86). The sources share no key; an entity spanning ≥2 sources is a cross-dataset ` +
|
|
163
|
+
`link we surface for review — interpretation is the consumer's._`,
|
|
164
|
+
"",
|
|
165
|
+
`## Sources`,
|
|
166
|
+
"",
|
|
167
|
+
];
|
|
168
|
+
const blurb = {
|
|
169
|
+
"txhhsc-nursing": "TX HHSC licensed nursing facilities",
|
|
170
|
+
"fcc-rhc": "FCC Rural Health Care posted-services filings",
|
|
171
|
+
"fcc-rhc-commitments": "FCC RHC funding commitments (Filing + Participating HCP, exploded)",
|
|
172
|
+
nppes: "NPPES organization NPIs",
|
|
173
|
+
};
|
|
174
|
+
lines.push(`| source | rows | what it is |`);
|
|
175
|
+
lines.push(`|---|---:|---|`);
|
|
176
|
+
for (const spec of SPECS) {
|
|
177
|
+
lines.push(`| \`${spec.source}\` | ${rawBySource.get(spec.source).length} | ${blurb[spec.source] ?? ""} |`);
|
|
178
|
+
}
|
|
179
|
+
lines.push("");
|
|
180
|
+
lines.push(`Combined: **${records.length} records**, geocoded ${pct(geo / total)}%. Resolved to ` +
|
|
181
|
+
`**${entities.length} entities** from ${candidatePairs} candidate pairs.`);
|
|
182
|
+
lines.push("");
|
|
183
|
+
lines.push(addressFrequency
|
|
184
|
+
? `Matched with the proven changes default-on (#86): collapsed spatial (A1) + inverse-address-frequency, fed ` +
|
|
185
|
+
`a corpus-wide table built from the full source files (**${addressFrequency.distinct.toLocaleString()}** distinct ` +
|
|
186
|
+
`addresses over **${addressFrequency.total.toLocaleString()}** ${STATE} rows — a crowded shared campus is ` +
|
|
187
|
+
`down-weighted as weak identity evidence).`
|
|
188
|
+
: `Matched with the zero-config default (#86): collapsed spatial (A1) + an input-scoped address-frequency table ` +
|
|
189
|
+
`(\`--no-corpus-frequency\`; pass nothing to build the corpus-wide table from the full files instead).`);
|
|
190
|
+
lines.push("");
|
|
191
|
+
lines.push(`Scored with the Fellegi-Sunter baseline (\`learnedScorer: false\`): cross-dataset link discovery is ` +
|
|
192
|
+
`recall-oriented — the same facility under different operational names across sources is the signal — so the ` +
|
|
193
|
+
`dedup-calibrated GBT default (#603), which is trained to REJECT "same place, different name," is pinned off ` +
|
|
194
|
+
`here. A cross-objective GBT threshold is the follow-up (#655).`);
|
|
195
|
+
lines.push("");
|
|
196
|
+
lines.push(`## Cross-dataset links (entities spanning ≥2 sources)`);
|
|
197
|
+
lines.push("");
|
|
198
|
+
lines.push(`**${crossSource.length}** entities resolve across ≥2 sources.`);
|
|
199
|
+
lines.push("");
|
|
200
|
+
if (pairCounts.size) {
|
|
201
|
+
lines.push(`| source pair | entities linked |`);
|
|
202
|
+
lines.push(`|---|---:|`);
|
|
203
|
+
for (const [k, v] of [...pairCounts.entries()].toSorted((a, b) => b[1] - a[1])) {
|
|
204
|
+
lines.push(`| ${k} | ${v} |`);
|
|
205
|
+
}
|
|
206
|
+
lines.push("");
|
|
207
|
+
}
|
|
208
|
+
const triple = crossSource.filter((x) => x.sources.size >= MIN_TRIPLE_SOURCES).length;
|
|
209
|
+
if (triple) {
|
|
210
|
+
lines.push(`Of those, **${triple}** span all three sources.`);
|
|
211
|
+
}
|
|
212
|
+
lines.push("");
|
|
213
|
+
lines.push(`## Spot-check — the first 12 cross-source entities (verify by eye)`);
|
|
214
|
+
lines.push("");
|
|
215
|
+
lines.push(`| entity | sources | name (representative) | coordinate |`);
|
|
216
|
+
lines.push(`|---|---|---|---|`);
|
|
217
|
+
for (const { e, sources } of crossSource.slice(0, 12)) {
|
|
218
|
+
const coord = e.coordinate ? `${e.coordinate.latitude.toFixed(4)}, ${e.coordinate.longitude.toFixed(4)}` : "—";
|
|
219
|
+
lines.push(`| ${e.id} | ${[...sources].toSorted().join(", ")} | ${repName(e)} | ${coord} |`);
|
|
220
|
+
}
|
|
221
|
+
lines.push("");
|
|
222
|
+
lines.push(`## Reading`);
|
|
223
|
+
lines.push("");
|
|
224
|
+
lines.push(`${SPECS.length} datasets with no shared key — a provider registry, a federal funding program (two of its forms, ` +
|
|
225
|
+
`the commitments form exploded into its Filing + Participating HCP per row), and a state facility registry — ` +
|
|
226
|
+
`resolve into a single entity model where ${crossSource.length} entities are corroborated by ≥2 independent ` +
|
|
227
|
+
`sources (${triple} by all three kinds), purely on geocoded location + name/org agreement, in pure Node without ` +
|
|
228
|
+
`Elasticsearch or a server. Each cross-source entity is a candidate "same place, multiple records" surfaced for ` +
|
|
229
|
+
`review; whether a correlation means anything is the data consumer's call, not ours.`);
|
|
230
|
+
lines.push("");
|
|
231
|
+
const md = lines.join("\n");
|
|
232
|
+
console.log(md);
|
|
233
|
+
if (OUT_MD) {
|
|
234
|
+
await writeLocalFile(md, OUT_MD);
|
|
235
|
+
report?.(`\n[written] ${OUT_MD}`);
|
|
236
|
+
}
|
|
237
|
+
if (OUT_GEOJSON) {
|
|
238
|
+
const fc = toGeoJSON(entities);
|
|
239
|
+
await writeLocalJSONFile(fc, OUT_GEOJSON);
|
|
240
|
+
report?.(`[written] ${OUT_GEOJSON} — ${fc.features.length} entity features (${crossSource.length} cross-source)`);
|
|
241
|
+
}
|
|
242
|
+
return { markdown: md };
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=dataset-correlation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataset-correlation.js","sourceRoot":"","sources":["../../../tools/cross/dataset-correlation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,eAAe,EACf,UAAU,EACV,SAAS,GAGT,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAA;AAEnF,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAqD5B,SAAS,cAAc,CAAC,GAA2B,EAAE,OAA6C;IACjG,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAA;IACvB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAEzD,OAAO,IAAI;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACxB,M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AA;IAEf,IAAI,MAAM,EAAE,CAAC;QACZ,MAAM,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAChC,MAAM,EAAE,CAAC,eAAe,MAAM,EAAE,CAAC,CAAA;IAClC,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QACjB,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;QAC9B,MAAM,kBAAkB,CAAC,EAAE,EAAE,WAAW,CAAC,CAAA;QACzC,MAAM,EAAE,CAAC,aAAa,WAAW,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,qBAAqB,WAAW,CAAC,MAAM,gBAAgB,CAAC,CAAA;IAClH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;AACxB,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Cross-source threshold sweep. Resolve the sources once, then compare the Fellegi-Sunter
|
|
7
|
+
* baseline against the bundled GBT over a fine threshold sweep, scoring each arm on cross-source
|
|
8
|
+
* links, triple-source entities, total entities and phone corroboration.
|
|
9
|
+
*
|
|
10
|
+
* Run: `mailwoman registry scorer-eval threshold-sweep [--cap 2000] [--state TX]
|
|
11
|
+
* [--wof <admin.db>] [--data-root <dir>] [--out-md <md>]`
|
|
12
|
+
*/
|
|
13
|
+
import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
|
|
14
|
+
/**
|
|
15
|
+
* Options for {@linkcode crossSourceThresholdSweep}.
|
|
16
|
+
*/
|
|
17
|
+
export interface CrossSourceThresholdSweepOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The injected geocoder factory.
|
|
20
|
+
*
|
|
21
|
+
* The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
|
|
22
|
+
*/
|
|
23
|
+
createGeocoder: EvalGeocoderFactory;
|
|
24
|
+
/**
|
|
25
|
+
* Record-matcher sources directory.
|
|
26
|
+
*
|
|
27
|
+
* @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
|
|
28
|
+
*/
|
|
29
|
+
sources?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Rows kept per source.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue `2000`
|
|
34
|
+
*/
|
|
35
|
+
cap?: number;
|
|
36
|
+
/**
|
|
37
|
+
* State filter.
|
|
38
|
+
*
|
|
39
|
+
* @defaultValue TX.
|
|
40
|
+
*/
|
|
41
|
+
state?: string;
|
|
42
|
+
/**
|
|
43
|
+
* A trained cross-source GBT module (exports CROSS_SOURCE_GBT_MODEL + _META) to
|
|
44
|
+
* grade as a third arm at its recommended threshold.
|
|
45
|
+
* This is the model `registry train-scorer cross-gbt` emits.
|
|
46
|
+
*/
|
|
47
|
+
candidate?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Also write the markdown report here.
|
|
50
|
+
*/
|
|
51
|
+
outMd?: string;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Compare the FS baseline against bundled GBT over a threshold sweep.
|
|
55
|
+
* Emit the markdown report to stdout.
|
|
56
|
+
*/
|
|
57
|
+
export declare function crossSourceThresholdSweep(options: CrossSourceThresholdSweepOptions, report?: (line: string) => void): Promise<{
|
|
58
|
+
markdown: string;
|
|
59
|
+
}>;
|
|
60
|
+
//# sourceMappingURL=source-threshold-sweep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-threshold-sweep.d.ts","sourceRoot":"","sources":["../../../tools/cross/source-threshold-sweep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAQ/D;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAA;IACnC;;;;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,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAmGD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE,gCAAgC,EACzC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAsO/B"}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Cross-source threshold sweep. Resolve the sources once, then compare the Fellegi-Sunter
|
|
7
|
+
* baseline against the bundled GBT over a fine threshold sweep, scoring each arm on cross-source
|
|
8
|
+
* links, triple-source entities, total entities and phone corroboration.
|
|
9
|
+
*
|
|
10
|
+
* Run: `mailwoman registry scorer-eval threshold-sweep [--cap 2000] [--state TX]
|
|
11
|
+
* [--wof <admin.db>] [--data-root <dir>] [--out-md <md>]`
|
|
12
|
+
*/
|
|
13
|
+
var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
|
|
14
|
+
if (typeof path === "string" && /^\.\.?\//.test(path)) {
|
|
15
|
+
return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
|
|
16
|
+
return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return path;
|
|
20
|
+
};
|
|
21
|
+
import { dataRootPath } from "@mailwoman/core/data-root";
|
|
22
|
+
import { writeLocalFile } from "@mailwoman/core/fs/writers";
|
|
23
|
+
import { pathToFileURL } from "@mailwoman/core/module/file-url";
|
|
24
|
+
import { formatPercent } from "@mailwoman/core/stats";
|
|
25
|
+
import { resolvePath } from "path-ts";
|
|
26
|
+
import { addressFrequencyKey, buildDefaultModel, createGBTScorer, DEDUP_GBT_META, DEDUP_GBT_MODEL, ingestRows, normalizePhoneStrict, resolveEntities, streamRows, } from "#index";
|
|
27
|
+
import { buildSpecs, stateOption } from "#tools/shared";
|
|
28
|
+
/**
|
|
29
|
+
* Independent sources that must agree before a cluster counts as cross-source corroborated.
|
|
30
|
+
*/
|
|
31
|
+
const MIN_CROSS_SOURCE_AGREEMENT = 3;
|
|
32
|
+
const entitySources = (e) => new Set(e.records.map((r) => r.source).filter((s) => !!s));
|
|
33
|
+
/**
|
|
34
|
+
* Label-free precision proxy: does this cross-source entity have the same phone
|
|
35
|
+
* in records from two different sources?
|
|
36
|
+
*
|
|
37
|
+
* Phone is not the join key, so a match is independent corroboration of one facility.
|
|
38
|
+
* Entities without phone numbers on two cross-source records are unknown.
|
|
39
|
+
* Only checkable entities count.
|
|
40
|
+
*/
|
|
41
|
+
function phoneEvidence(e) {
|
|
42
|
+
const bySource = new Map();
|
|
43
|
+
for (const r of e.records) {
|
|
44
|
+
const ph = normalizePhoneStrict(r.phone);
|
|
45
|
+
if (!ph)
|
|
46
|
+
continue;
|
|
47
|
+
const s = r.source ?? "?";
|
|
48
|
+
if (!bySource.has(s)) {
|
|
49
|
+
bySource.set(s, new Set());
|
|
50
|
+
}
|
|
51
|
+
bySource.get(s).add(ph);
|
|
52
|
+
}
|
|
53
|
+
const sources = [...bySource.keys()];
|
|
54
|
+
if (sources.length < 2)
|
|
55
|
+
return "unknown";
|
|
56
|
+
let any = false;
|
|
57
|
+
for (let i = 0; i < sources.length; i++) {
|
|
58
|
+
for (let j = i + 1; j < sources.length; j++) {
|
|
59
|
+
any = true;
|
|
60
|
+
for (const ph of bySource.get(sources[i]))
|
|
61
|
+
if (bySource.get(sources[j]).has(ph))
|
|
62
|
+
return "corroborated";
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return any ? "contradicted" : "unknown";
|
|
66
|
+
}
|
|
67
|
+
async function measure(label, threshold, entities) {
|
|
68
|
+
let crossSource = 0;
|
|
69
|
+
let tripleSource = 0;
|
|
70
|
+
let phoneCorrob = 0;
|
|
71
|
+
let phoneContradict = 0;
|
|
72
|
+
let phoneCheckable = 0;
|
|
73
|
+
for (const e of entities) {
|
|
74
|
+
const n = entitySources(e).size;
|
|
75
|
+
if (n < 2)
|
|
76
|
+
continue;
|
|
77
|
+
crossSource++;
|
|
78
|
+
if (n >= MIN_CROSS_SOURCE_AGREEMENT) {
|
|
79
|
+
tripleSource++;
|
|
80
|
+
}
|
|
81
|
+
const ev = phoneEvidence(e);
|
|
82
|
+
if (ev === "corroborated") {
|
|
83
|
+
phoneCorrob++;
|
|
84
|
+
phoneCheckable++;
|
|
85
|
+
}
|
|
86
|
+
else if (ev === "contradicted") {
|
|
87
|
+
phoneContradict++;
|
|
88
|
+
phoneCheckable++;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return {
|
|
92
|
+
label,
|
|
93
|
+
threshold,
|
|
94
|
+
entities: entities.length,
|
|
95
|
+
crossSource,
|
|
96
|
+
tripleSource,
|
|
97
|
+
phoneCorrob,
|
|
98
|
+
phoneContradict,
|
|
99
|
+
phoneCheckable,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Compare the FS baseline against bundled GBT over a threshold sweep.
|
|
104
|
+
* Emit the markdown report to stdout.
|
|
105
|
+
*/
|
|
106
|
+
export async function crossSourceThresholdSweep(options, report) {
|
|
107
|
+
const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
|
|
108
|
+
const CAP = options.cap ?? 2000;
|
|
109
|
+
const STATE = stateOption(options);
|
|
110
|
+
const OUT_MD = options.outMd || "";
|
|
111
|
+
const CANDIDATE = options.candidate || "";
|
|
112
|
+
const SPECS = buildSpecs(`${SOURCES}`, STATE);
|
|
113
|
+
const rawBySource = new Map();
|
|
114
|
+
for (const spec of SPECS) {
|
|
115
|
+
report?.(`[A] ${spec.source}: streaming + ${STATE} filter (cap ${CAP})…`);
|
|
116
|
+
const kept = [];
|
|
117
|
+
for await (const row of streamRows(spec.path)) {
|
|
118
|
+
if (!spec.inState(row))
|
|
119
|
+
continue;
|
|
120
|
+
kept.push(row);
|
|
121
|
+
if (kept.length >= CAP)
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
rawBySource.set(spec.source, kept);
|
|
125
|
+
report?.(` ${spec.source}: ${kept.length} rows`);
|
|
126
|
+
}
|
|
127
|
+
report?.("[B] building the geocoder…");
|
|
128
|
+
const geocoder = await options.createGeocoder();
|
|
129
|
+
const geocodeForIngest = geocoder.geocodeAddress;
|
|
130
|
+
report?.("[C] geocoding + ingesting…");
|
|
131
|
+
const records = [];
|
|
132
|
+
for (const spec of SPECS) {
|
|
133
|
+
const recs = await ingestRows(rawBySource.get(spec.source), spec.mapping, { geocodeAddress: geocodeForIngest });
|
|
134
|
+
for (const r of recs) {
|
|
135
|
+
r.id = `${spec.source}:${r.id}`;
|
|
136
|
+
}
|
|
137
|
+
records.push(...recs);
|
|
138
|
+
}
|
|
139
|
+
geocoder[Symbol.dispose]();
|
|
140
|
+
const geocoded = records.filter((r) => r.address?.geocode).length;
|
|
141
|
+
report?.(` ${records.length} records; geocoded ${geocoded}`);
|
|
142
|
+
const addrCounts = new Map();
|
|
143
|
+
let addrTotal = 0;
|
|
144
|
+
for (const r of records) {
|
|
145
|
+
if (!r.address?.raw)
|
|
146
|
+
continue;
|
|
147
|
+
addrCounts.set(addressFrequencyKey(r.address.raw), (addrCounts.get(addressFrequencyKey(r.address.raw)) ?? 0) + 1);
|
|
148
|
+
addrTotal++;
|
|
149
|
+
}
|
|
150
|
+
const addressFrequency = {
|
|
151
|
+
total: addrTotal,
|
|
152
|
+
distinct: addrCounts.size,
|
|
153
|
+
frequency: (v) => (v ? (addrCounts.get(addressFrequencyKey(v)) ?? 0) / addrTotal : 0),
|
|
154
|
+
};
|
|
155
|
+
const comparisons = buildDefaultModel({ collapseSpatial: true, addressFrequency }).comparisons;
|
|
156
|
+
const gbtScorer = createGBTScorer({ model: DEDUP_GBT_MODEL, comparisons, addressFrequency });
|
|
157
|
+
report?.("[D] resolving — FS baseline baseline…");
|
|
158
|
+
const fs = await measure("FS baseline", 0, resolveEntities(records, { trainEM: true, collapseSpatial: true, addressFrequency, learnedScorer: false }).entities);
|
|
159
|
+
const SWEEP = [-8, -6, -5, -4, -3, -2, -1, 0, 1, 2, DEDUP_GBT_META.recommendedThreshold];
|
|
160
|
+
const gbtArms = [];
|
|
161
|
+
for (const t of SWEEP) {
|
|
162
|
+
report?.(`[D] resolving — GBT @ threshold ${t}…`);
|
|
163
|
+
const { entities } = resolveEntities(records, {
|
|
164
|
+
collapseSpatial: true,
|
|
165
|
+
addressFrequency,
|
|
166
|
+
scorer: gbtScorer,
|
|
167
|
+
threshold: t,
|
|
168
|
+
});
|
|
169
|
+
gbtArms.push(await measure(`GBT @ ${t.toFixed(2)}`, t, entities));
|
|
170
|
+
}
|
|
171
|
+
// A GBT arm dominates only when it matches FS cross-source links at no lower phone corroboration and
|
|
172
|
+
// keeps at least 90% of FS entities, since a collapse means giant-blob artifacts rather than links.
|
|
173
|
+
const pct = (n, d) => formatPercent(n, d, 0);
|
|
174
|
+
const candidateArms = [];
|
|
175
|
+
if (CANDIDATE) {
|
|
176
|
+
const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(resolvePath(CANDIDATE)).href)));
|
|
177
|
+
const candModel = mod.CROSS_SOURCE_GBT_MODEL ?? mod.ORG_CROSS_SOURCE_GBT_MODEL;
|
|
178
|
+
if (!candModel)
|
|
179
|
+
throw new Error(`--candidate module exports neither CROSS_SOURCE_GBT_MODEL nor ORG_CROSS_SOURCE_GBT_MODEL`);
|
|
180
|
+
const t0 = (mod.CROSS_SOURCE_GBT_META ?? mod.ORG_CROSS_SOURCE_GBT_META)?.recommendedThreshold ?? 0;
|
|
181
|
+
const candScorer = createGBTScorer({ model: candModel, comparisons, addressFrequency });
|
|
182
|
+
report?.(`[E] resolving — cross-source GBT candidate @ ${t0.toFixed(3)} (±)…`);
|
|
183
|
+
for (const t of [t0 - 1, t0, t0 + 1]) {
|
|
184
|
+
candidateArms.push(await measure(`cross-GBT @ ${t.toFixed(2)}`, t, resolveEntities(records, {
|
|
185
|
+
trainEM: true,
|
|
186
|
+
collapseSpatial: true,
|
|
187
|
+
addressFrequency,
|
|
188
|
+
scorer: candScorer,
|
|
189
|
+
threshold: t,
|
|
190
|
+
}).entities));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
const rate = (a) => (a.phoneCheckable > 0 ? a.phoneCorrob / a.phoneCheckable : 0);
|
|
194
|
+
const fsCorrobRate = rate(fs);
|
|
195
|
+
const minEntities = Math.floor(fs.entities * 0.9);
|
|
196
|
+
const dominating = gbtArms.find((a) => a.crossSource >= fs.crossSource && rate(a) >= fsCorrobRate && a.entities >= minEntities);
|
|
197
|
+
// The candidate gets its own verdict scan, separate from the option-1 verdict for the dedup GBT.
|
|
198
|
+
const candidateDominating = candidateArms.find((a) => a.crossSource >= fs.crossSource && rate(a) >= fsCorrobRate && a.entities >= minEntities);
|
|
199
|
+
let candidateBest = null;
|
|
200
|
+
for (const arm of candidateArms) {
|
|
201
|
+
if (arm.entities >= minEntities && arm.crossSource > (candidateBest?.crossSource ?? -1)) {
|
|
202
|
+
candidateBest = arm;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const rows = [fs, ...gbtArms, ...candidateArms];
|
|
206
|
+
const lines = [
|
|
207
|
+
`# #655 — cross-source threshold sweep: can a re-thresholded GBT beat FS?`,
|
|
208
|
+
"",
|
|
209
|
+
`_TX-scoped, ≤${CAP} rows/source (NPPES org + TX HHSC nursing = eligibility-ish; FCC-RHC = funding), ` +
|
|
210
|
+
`geocoded once then resolved per arm. **Phone-corrob** = of the cross-source entities whose records carry ` +
|
|
211
|
+
`a phone in ≥2 different sources, the fraction where those phones MATCH — a label-free precision proxy ` +
|
|
212
|
+
`(phone is not the join key). Higher cross-source + higher phone-corrob = better._`,
|
|
213
|
+
"",
|
|
214
|
+
`| arm | threshold | total entities | cross-source links | triple-source | phone-corrob (of checkable) |`,
|
|
215
|
+
`|---|---:|---:|---:|---:|---|`,
|
|
216
|
+
];
|
|
217
|
+
for (const r of rows) {
|
|
218
|
+
lines.push(`| ${r.label} | ${r.threshold === null ? "—" : r.threshold} | ${r.entities} | ${r.crossSource} | ` +
|
|
219
|
+
`${r.tripleSource} | ${r.phoneCorrob}/${r.phoneCheckable} (${pct(r.phoneCorrob, r.phoneCheckable)}) |`);
|
|
220
|
+
}
|
|
221
|
+
lines.push("");
|
|
222
|
+
lines.push(`## Verdict`);
|
|
223
|
+
if (CANDIDATE) {
|
|
224
|
+
const c = candidateDominating ?? candidateBest;
|
|
225
|
+
lines.push("");
|
|
226
|
+
if (candidateDominating) {
|
|
227
|
+
lines.push(`**The --candidate model DOMINATES FS**: ${candidateDominating.crossSource} cross-source links (FS ${fs.crossSource}) at phone-corrob ${(100 * rate(candidateDominating)).toFixed(0)}% ≥ FS ${(100 * fsCorrobRate).toFixed(0)}%, entities ${candidateDominating.entities} (no collapse). Un-pinning FS for this objective is supported by this run.`);
|
|
228
|
+
}
|
|
229
|
+
else if (c) {
|
|
230
|
+
lines.push(`**--candidate (best non-collapsing arm)**: ${c.crossSource} cross-source links vs FS ${fs.crossSource}, phone-corrob ${(100 * rate(c)).toFixed(0)}% vs FS ${(100 * fsCorrobRate).toFixed(0)}%, entities ${c.entities}. Does not STRICTLY dominate — judge the margins (the phone proxy is one-link noisy at this n).`);
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
lines.push(`**--candidate**: no non-collapsing arm (every threshold fell below the entity floor).`);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
lines.push("");
|
|
237
|
+
lines.push(`FS baseline: **${fs.crossSource}** cross-source links (${fs.tripleSource} triple), ` +
|
|
238
|
+
`phone-corrob ${pct(fs.phoneCorrob, fs.phoneCheckable)} (${fs.phoneCorrob}/${fs.phoneCheckable}).`);
|
|
239
|
+
lines.push("");
|
|
240
|
+
if (!dominating) {
|
|
241
|
+
lines.push(`**No GBT threshold dominates FS** — none matches FS's ${fs.crossSource} cross-source links at ≥ its ` +
|
|
242
|
+
`${pct(fs.phoneCorrob, fs.phoneCheckable)} phone-corrob without over-merging (entity count collapsing below ` +
|
|
243
|
+
`${minEntities}). At its dedup threshold the GBT finds FEWER cross-source links than FS; lowering the ` +
|
|
244
|
+
`threshold to admit more only over-merges (the over-merge features REPLACE the FS weight, so true ` +
|
|
245
|
+
`cross-source pairs share a logit band with genuine over-merges). Threshold alone (option 1) is ` +
|
|
246
|
+
`**INSUFFICIENT** — FS stays pinned (correct + best-precision for this objective); a cross-objective ` +
|
|
247
|
+
`retrain (option 2), conditioned on cross-source labels, is the only change. See #655.`);
|
|
248
|
+
}
|
|
249
|
+
else {
|
|
250
|
+
lines.push(`**GBT @ ${dominating.threshold} dominates FS**: ${dominating.crossSource} links (vs ${fs.crossSource}) at ` +
|
|
251
|
+
`${pct(dominating.phoneCorrob, dominating.phoneCheckable)} phone-corrob (vs ${pct(fs.phoneCorrob, fs.phoneCheckable)}), ` +
|
|
252
|
+
`${dominating.entities} entities (vs ${fs.entities}). The threshold fix (option 1) WORKS: ship a cross-source ` +
|
|
253
|
+
`threshold ≈ ${dominating.threshold}.`);
|
|
254
|
+
}
|
|
255
|
+
lines.push("");
|
|
256
|
+
const md = lines.join("\n");
|
|
257
|
+
console.log(md);
|
|
258
|
+
if (OUT_MD) {
|
|
259
|
+
await writeLocalFile(md, OUT_MD);
|
|
260
|
+
report?.(`[written] ${OUT_MD}`);
|
|
261
|
+
}
|
|
262
|
+
return { markdown: md };
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=source-threshold-sweep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source-threshold-sweep.js","sourceRoot":"","sources":["../../../tools/cross/source-threshold-sweep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;;;;;;;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAErC,OAAO,EACN,mBAAmB,EACnB,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,eAAe,EACf,UAAU,EACV,oBAAoB,EACpB,eAAe,EACf,UAAU,GAIV,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEvD;;GAEG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAA;AA0CpC,MAAM,aAAa,GAAG,CAAC,CAAiB,EAAe,EAAE,CACxD,IAAI,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAExE;;;;;;;GAOG;AACH,SAAS,aAAa,CAAC,CAAiB;IACvC,MAAM,QAAQ,GAAG,IAAI,GAAG,EAAuB,CAAA;IAE/C,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAC3B,MAAM,EAAE,GAAG,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,CAA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