@mailwoman/entity-resolution 11.0.0 → 11.2.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 +3 -3
- package/lib/address-key.ts +14 -12
- package/lib/geocode-handler.ts +6 -5
- package/lib/geojson.ts +8 -8
- package/lib/index.ts +8 -8
- package/lib/ingest.ts +5 -4
- package/lib/learned-scorer.ts +16 -17
- package/lib/map-html.ts +2 -5
- package/lib/models/crosssource-gbt-en-us.ts +8 -7
- package/lib/models/dedup-gbt-en-us.ts +9 -6
- package/lib/models/org-crosssource-gbt-en-us.ts +8 -7
- package/lib/reconcile.ts +3 -0
- package/lib/resolve.ts +5 -6
- package/lib/types.ts +5 -6
- package/out/address-key.d.ts +11 -12
- package/out/address-key.d.ts.map +1 -1
- package/out/address-key.js +13 -12
- package/out/address-key.js.map +1 -1
- package/out/geocode-handler.d.ts +3 -5
- package/out/geocode-handler.d.ts.map +1 -1
- package/out/geocode-handler.js +5 -5
- package/out/geocode-handler.js.map +1 -1
- package/out/geojson.d.ts +0 -11
- package/out/geojson.d.ts.map +1 -1
- package/out/geojson.js +7 -8
- package/out/geojson.js.map +1 -1
- package/out/index.d.ts +5 -8
- package/out/index.d.ts.map +1 -1
- package/out/index.js +7 -8
- package/out/index.js.map +1 -1
- package/out/ingest.d.ts +0 -7
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +4 -4
- package/out/ingest.js.map +1 -1
- package/out/learned-scorer.d.ts +11 -15
- package/out/learned-scorer.d.ts.map +1 -1
- package/out/learned-scorer.js +15 -17
- package/out/learned-scorer.js.map +1 -1
- package/out/map-html.d.ts +0 -5
- package/out/map-html.d.ts.map +1 -1
- package/out/map-html.js +2 -5
- package/out/map-html.js.map +1 -1
- package/out/models/crosssource-gbt-en-us.d.ts +5 -7
- package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/crosssource-gbt-en-us.js +2 -10
- package/out/models/crosssource-gbt-en-us.js.map +1 -1
- package/out/models/dedup-gbt-en-us.d.ts +6 -6
- package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
- package/out/models/dedup-gbt-en-us.js +2 -11
- package/out/models/dedup-gbt-en-us.js.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.d.ts +5 -7
- package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.js +2 -10
- package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +2 -0
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts +1 -5
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +3 -5
- package/out/resolve.js.map +1 -1
- package/out/tools/address-pairs/grade.d.ts +74 -0
- package/out/tools/address-pairs/grade.d.ts.map +1 -0
- package/out/tools/address-pairs/grade.js +184 -0
- package/out/tools/address-pairs/grade.js.map +1 -0
- package/out/tools/address-pairs/sample.d.ts +137 -0
- package/out/tools/address-pairs/sample.d.ts.map +1 -0
- package/out/tools/address-pairs/sample.js +262 -0
- package/out/tools/address-pairs/sample.js.map +1 -0
- package/out/tools/coverage-reconciliation.d.ts +0 -21
- package/out/tools/coverage-reconciliation.d.ts.map +1 -1
- package/out/tools/coverage-reconciliation.js +10 -11
- package/out/tools/coverage-reconciliation.js.map +1 -1
- package/out/tools/cross/dataset-correlation.d.ts +0 -5
- package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
- package/out/tools/cross/dataset-correlation.js +2 -5
- package/out/tools/cross/dataset-correlation.js.map +1 -1
- package/out/tools/cross/source-threshold-sweep.d.ts +0 -12
- package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -1
- package/out/tools/cross/source-threshold-sweep.js +13 -13
- package/out/tools/cross/source-threshold-sweep.js.map +1 -1
- package/out/tools/dedup-ceiling.d.ts +0 -19
- package/out/tools/dedup-ceiling.d.ts.map +1 -1
- package/out/tools/dedup-ceiling.js +14 -13
- package/out/tools/dedup-ceiling.js.map +1 -1
- package/out/tools/eval-geocoder.d.ts +6 -8
- package/out/tools/eval-geocoder.d.ts.map +1 -1
- package/out/tools/eval-geocoder.js +2 -11
- package/out/tools/eval-geocoder.js.map +1 -1
- package/out/tools/geocoder/namesake-probe.d.ts +0 -13
- package/out/tools/geocoder/namesake-probe.d.ts.map +1 -1
- package/out/tools/geocoder/namesake-probe.js +8 -8
- package/out/tools/geocoder/namesake-probe.js.map +1 -1
- package/out/tools/geocoder/vs-provided-coords.d.ts +0 -17
- package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -1
- package/out/tools/geocoder/vs-provided-coords.js +10 -10
- package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
- package/out/tools/gold-set-sample.d.ts +0 -20
- package/out/tools/gold-set-sample.d.ts.map +1 -1
- package/out/tools/gold-set-sample.js +11 -12
- package/out/tools/gold-set-sample.js.map +1 -1
- package/out/tools/learned/scorer/clustering-eval.d.ts +0 -17
- package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/clustering-eval.js +12 -10
- package/out/tools/learned/scorer/clustering-eval.js.map +1 -1
- package/out/tools/learned/scorer/crossstate-eval.d.ts +0 -17
- package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/crossstate-eval.js +11 -10
- package/out/tools/learned/scorer/crossstate-eval.js.map +1 -1
- package/out/tools/learned/scorer/eval.d.ts +0 -5
- package/out/tools/learned/scorer/eval.d.ts.map +1 -1
- package/out/tools/learned/scorer/eval.js +2 -5
- package/out/tools/learned/scorer/eval.js.map +1 -1
- package/out/tools/matcher-scale.d.ts +0 -5
- package/out/tools/matcher-scale.d.ts.map +1 -1
- package/out/tools/matcher-scale.js +2 -5
- package/out/tools/matcher-scale.js.map +1 -1
- package/out/tools/nppes/dedup-benchmark.d.ts +0 -10
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
- package/out/tools/nppes/dedup-benchmark.js +10 -10
- package/out/tools/nppes/dedup-benchmark.js.map +1 -1
- package/out/tools/nppes/org-name.d.ts.map +1 -1
- package/out/tools/nppes/org-name.js +2 -0
- package/out/tools/nppes/org-name.js.map +1 -1
- package/out/tools/nppes/overmerge-packet.d.ts +0 -6
- package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
- package/out/tools/nppes/overmerge-packet.js +2 -3
- package/out/tools/nppes/overmerge-packet.js.map +1 -1
- package/out/tools/nppes/report.d.ts +0 -5
- package/out/tools/nppes/report.d.ts.map +1 -1
- package/out/tools/nppes/report.js +2 -5
- package/out/tools/nppes/report.js.map +1 -1
- package/out/tools/nppes/sample.d.ts +0 -9
- package/out/tools/nppes/sample.d.ts.map +1 -1
- package/out/tools/nppes/sample.js +6 -7
- package/out/tools/nppes/sample.js.map +1 -1
- package/out/tools/nppes/scoring.d.ts +0 -3
- package/out/tools/nppes/scoring.d.ts.map +1 -1
- package/out/tools/nppes/scoring.js +2 -7
- package/out/tools/nppes/scoring.js.map +1 -1
- package/out/tools/nppes/settings.d.ts +2 -6
- package/out/tools/nppes/settings.d.ts.map +1 -1
- package/out/tools/nppes/settings.js +2 -8
- package/out/tools/nppes/settings.js.map +1 -1
- package/out/tools/nppes/truth-grains.d.ts +1 -8
- package/out/tools/nppes/truth-grains.d.ts.map +1 -1
- package/out/tools/nppes/truth-grains.js +3 -4
- package/out/tools/nppes/truth-grains.js.map +1 -1
- package/out/tools/shared.d.ts +0 -7
- package/out/tools/shared.d.ts.map +1 -1
- package/out/tools/shared.js +5 -9
- package/out/tools/shared.js.map +1 -1
- package/out/tools/train/cross-gbt.d.ts +0 -25
- package/out/tools/train/cross-gbt.d.ts.map +1 -1
- package/out/tools/train/cross-gbt.js +15 -12
- package/out/tools/train/cross-gbt.js.map +1 -1
- package/out/tools/train/gbt.d.ts +0 -17
- package/out/tools/train/gbt.d.ts.map +1 -1
- package/out/tools/train/gbt.js +15 -14
- package/out/tools/train/gbt.js.map +1 -1
- package/out/tools/train/org-cross-gbt.d.ts +0 -24
- package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
- package/out/tools/train/org-cross-gbt.js +14 -9
- package/out/tools/train/org-cross-gbt.js.map +1 -1
- package/out/tools/txhhsc-to-oarow.d.ts +0 -15
- package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
- package/out/tools/txhhsc-to-oarow.js +4 -6
- package/out/tools/txhhsc-to-oarow.js.map +1 -1
- package/out/tools/viz/browser.d.ts +0 -10
- package/out/tools/viz/browser.d.ts.map +1 -1
- package/out/tools/viz/browser.js +4 -4
- package/out/tools/viz/browser.js.map +1 -1
- package/out/tools/viz/cross-dataset-map.d.ts +0 -8
- package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
- package/out/tools/viz/cross-dataset-map.js +4 -5
- package/out/tools/viz/cross-dataset-map.js.map +1 -1
- package/out/tools/viz/geocode-first-surface.d.ts +0 -8
- package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
- package/out/tools/viz/geocode-first-surface.js +5 -5
- package/out/tools/viz/geocode-first-surface.js.map +1 -1
- package/out/tools/viz/render/map.d.ts +0 -21
- package/out/tools/viz/render/map.d.ts.map +1 -1
- package/out/tools/viz/render/map.js +9 -11
- package/out/tools/viz/render/map.js.map +1 -1
- package/out/tools/viz/render.d.ts +0 -13
- package/out/tools/viz/render.d.ts.map +1 -1
- package/out/tools/viz/render.js +9 -9
- package/out/tools/viz/render.js.map +1 -1
- package/out/tools/viz/source-provenance-map.d.ts +0 -8
- package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
- package/out/tools/viz/source-provenance-map.js +4 -5
- package/out/tools/viz/source-provenance-map.js.map +1 -1
- package/out/tools/viz/yardstick-figure.d.ts +0 -5
- package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
- package/out/tools/viz/yardstick-figure.js +2 -5
- package/out/tools/viz/yardstick-figure.js.map +1 -1
- package/out/types.d.ts +2 -6
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -8
- package/out/types.js.map +1 -1
- package/package.json +10 -9
- package/tools/address-pairs/grade.ts +277 -0
- package/tools/address-pairs/sample.ts +451 -0
- package/tools/coverage-reconciliation.ts +11 -11
- package/tools/cross/dataset-correlation.ts +2 -5
- package/tools/cross/source-threshold-sweep.ts +8 -7
- package/tools/dedup-ceiling.ts +15 -13
- package/tools/eval-geocoder.ts +9 -8
- package/tools/geocoder/namesake-probe.ts +9 -8
- package/tools/geocoder/vs-provided-coords.ts +11 -10
- package/tools/gold-set-sample.ts +12 -12
- package/tools/learned/scorer/clustering-eval.ts +13 -10
- package/tools/learned/scorer/crossstate-eval.ts +12 -10
- package/tools/learned/scorer/eval.ts +2 -5
- package/tools/matcher-scale.ts +2 -5
- package/tools/nppes/dedup-benchmark.ts +6 -5
- package/tools/nppes/org-name.ts +3 -0
- package/tools/nppes/overmerge-packet.ts +3 -3
- package/tools/nppes/report.ts +2 -5
- package/tools/nppes/sample.ts +7 -7
- package/tools/nppes/scoring.ts +3 -3
- package/tools/nppes/settings.ts +5 -6
- package/tools/nppes/truth-grains.ts +4 -4
- package/tools/shared.ts +5 -8
- package/tools/train/cross-gbt.ts +16 -12
- package/tools/train/gbt.ts +15 -13
- package/tools/train/org-cross-gbt.ts +15 -9
- package/tools/txhhsc-to-oarow.ts +5 -6
- package/tools/viz/browser.ts +5 -4
- package/tools/viz/cross-dataset-map.ts +5 -5
- package/tools/viz/geocode-first-surface.ts +6 -5
- package/tools/viz/render/map.ts +10 -11
- package/tools/viz/render.ts +10 -9
- package/tools/viz/source-provenance-map.ts +6 -6
- package/tools/viz/yardstick-figure.ts +2 -5
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ before blocking can use them.
|
|
|
80
80
|
|
|
81
81
|
The `mailwoman` CLI exposes `registry` as a command:
|
|
82
82
|
|
|
83
|
-
```
|
|
83
|
+
```sh
|
|
84
84
|
# Multi-source entity resolution
|
|
85
85
|
mailwoman registry --sources config.json --resolve-db "$MAILWOMAN_CANDIDATE_DB" --out entities.geojson
|
|
86
86
|
|
|
@@ -96,7 +96,7 @@ A nonexistent path satisfies that requirement.
|
|
|
96
96
|
|
|
97
97
|
So: set `$MAILWOMAN_CANDIDATE_DB` and pass anything to `--resolve-db`. Do not pass `candidate.db` to
|
|
98
98
|
`--resolve-db` with the environment variable unset. The flag is believed on that path, and the admin
|
|
99
|
-
backend queries `place_search`/`spr`, which a candidate gazetteer
|
|
99
|
+
backend queries `place_search`/`spr`, which a candidate gazetteer doesn't have.
|
|
100
100
|
|
|
101
101
|
An argument required only to discard it is a defect in this command. Documented rather than fixed.
|
|
102
102
|
|
|
@@ -108,7 +108,7 @@ Fellegi-Sunter baseline rather than the bundled model's calibrated 2.8324, and `
|
|
|
108
108
|
- [`@mailwoman/match`](../match) — the low-level block/score/cluster primitives
|
|
109
109
|
- [`@mailwoman/record`](../record) — `SourceRecord` schema and normalizers
|
|
110
110
|
- [`@mailwoman/address-id`](../address-id) — exact-match join key
|
|
111
|
-
- [
|
|
111
|
+
- [Compare candidate duplicate addresses](https://mailwoman.post/docs/guides/match-records)
|
|
112
112
|
|
|
113
113
|
## License
|
|
114
114
|
|
package/lib/address-key.ts
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The address-id consumer for the matcher.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
7
|
+
* Derives a stable {@link PostalAddressID} from a resolved {@link SourceRecord}
|
|
8
|
+
* and exposes it as a blocking key, the deterministic exact-canonical-address
|
|
9
|
+
* complement to the fuzzy Fellegi-Sunter / GBT scoring.
|
|
10
|
+
* Two uses:
|
|
9
11
|
*
|
|
10
|
-
* - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the
|
|
14
|
-
*
|
|
12
|
+
* - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records
|
|
13
|
+
* that resolve to the same place and share a canonical address with no scoring at all.
|
|
14
|
+
* That's the cheap, certain part of dedup before the matcher does the fuzzy rest.
|
|
15
|
+
* - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the
|
|
16
|
+
* blocking union, so records sharing one are guaranteed to be compared.
|
|
15
17
|
*/
|
|
16
18
|
|
|
17
19
|
import { createPostalAddressID, type PostalAddressID } from "@mailwoman/address-id"
|
|
@@ -20,7 +22,7 @@ import { type BlockingKey, exactKey } from "@mailwoman/match"
|
|
|
20
22
|
import type { SourceRecord } from "#types"
|
|
21
23
|
|
|
22
24
|
/**
|
|
23
|
-
* The stable address primary key for a record, or null when it
|
|
25
|
+
* The stable address primary key for a record, or null when it isn't geocoded
|
|
24
26
|
* (no coordinate means no locality cell) or includes no raw address to hash.
|
|
25
27
|
*
|
|
26
28
|
* The state prefix is plucked from the address when present.
|
package/lib/geocode-handler.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The per-record geocode step, factored out of the worker so it unit-tests against
|
|
6
|
+
* a fake geocoder (no neural model / SQLite).
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
* neural model / SQLite). `geocode-worker.ts` builds the real geocoder from config and wraps this.
|
|
8
|
+
* `geocode-worker.ts` builds the real geocoder from config and wraps this.
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
import { type ColumnMapping, type GeocodeAddress, pick } from "#ingest"
|
package/lib/geojson.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* Export resolved entities as GeoJSON — the bridge to QGIS and any web map.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* a coordinate are omitted (a Point feature needs one).
|
|
7
|
+
* Each entity becomes a Point at its resolved coordinate, carrying the properties an analyst needs:
|
|
8
|
+
* the count of records merged into it, how tightly (cohesion), the canonical name/org/address
|
|
9
|
+
* and the geocode tier (so rooftop-precise entities can be styled apart from admin-centroid guesses).
|
|
10
|
+
* Entities without a coordinate are omitted (a Point feature needs one).
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import { formatPersonName } from "@mailwoman/record/name"
|
package/lib/index.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* `@mailwoman/entity-resolution` — the geocode-first record-matching application.
|
|
7
6
|
*
|
|
8
|
-
* {@link resolveEntities} runs the whole matcher (block → score → cluster) over
|
|
9
|
-
* contact/organization {@link SourceRecord}s and returns canonical
|
|
10
|
-
* {@link toGeoJSON} exports them for QGIS.
|
|
11
|
-
*
|
|
7
|
+
* {@link resolveEntities} runs the whole matcher (block → score → cluster) over
|
|
8
|
+
* normalized contact/organization {@link SourceRecord}s and returns canonical
|
|
9
|
+
* {@link ResolvedEntity entities}; {@link toGeoJSON} exports them for QGIS.
|
|
10
|
+
* This is the clinic-funding use case mailwoman was built for, finally standing
|
|
11
|
+
* on a calibrated, label-free matcher.
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
export * from "#address-key"
|
package/lib/ingest.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* Column mapping and normalization are pure.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
+
* The caller injects geocoding, so this package never imports the neural parser, resolver, or extracts.
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
import { isPresent } from "@mailwoman/core/objects"
|
package/lib/learned-scorer.ts
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The learned scorer, the production wiring for the gradient-boosted-tree model behind
|
|
7
|
-
* {@link ResolveConfig.scorer}.
|
|
5
|
+
* The learned scorer, the production wiring for the gradient-boosted-tree
|
|
6
|
+
* model behind {@link ResolveConfig.scorer}.
|
|
8
7
|
*
|
|
9
|
-
* {@link createMatchFeaturizer} is the one feature extractor for a candidate pair,
|
|
10
|
-
* identically at train time (`registry/tools/train-gbt.ts`), eval time
|
|
11
|
-
* {@link createGBTScorer} wraps a trained {@link GBT} and the
|
|
12
|
-
* the resolve pipeline's `scorer` hook expects
|
|
13
|
-
* Fellegi-Sunter weight it replaces).
|
|
8
|
+
* {@link createMatchFeaturizer} is the one feature extractor for a candidate pair,
|
|
9
|
+
* used identically at train time (`registry/tools/train-gbt.ts`), eval time
|
|
10
|
+
* and inference time. {@link createGBTScorer} wraps a trained {@link GBT} and the
|
|
11
|
+
* featurizer into the `(a, b) => number` the resolve pipeline's `scorer` hook expects
|
|
12
|
+
* (a logit, threshold-comparable with the Fellegi-Sunter weight it replaces).
|
|
14
13
|
*
|
|
15
|
-
* Both take the comparison set as input rather than importing {@link buildDefaultModel},
|
|
16
|
-
* module has no dependency cycle with `resolve.ts`.
|
|
17
|
-
* `buildDefaultModel({ collapseSpatial: true, addressFrequency })`,
|
|
18
|
-
* feature layout.
|
|
14
|
+
* Both take the comparison set as input rather than importing {@link buildDefaultModel},
|
|
15
|
+
* so this module has no dependency cycle with `resolve.ts`.
|
|
16
|
+
* Feed the comparisons from `buildDefaultModel({ collapseSpatial: true, addressFrequency })`,
|
|
17
|
+
* since that config fixes the feature layout.
|
|
19
18
|
*/
|
|
20
19
|
|
|
21
20
|
import {
|
|
@@ -104,8 +103,8 @@ export function createMatchFeaturizer(config: LearnedFeatureConfig): (a: SourceR
|
|
|
104
103
|
f.push(Math.min(1, freq * 1000))
|
|
105
104
|
// Roll-up signature: a shared corporate address can host differently-branded
|
|
106
105
|
// operating entities whose authorized official also agrees.
|
|
107
|
-
// The official
|
|
108
|
-
// They
|
|
106
|
+
// The official isn't in the comparison set, so these three features express that evidence directly.
|
|
107
|
+
// They're appended at the end, so models trained without them keep scoring unchanged.
|
|
109
108
|
const offA = a.attributes?.["authorizedOfficial"]?.trim()
|
|
110
109
|
const offB = b.attributes?.["authorizedOfficial"]?.trim()
|
|
111
110
|
const officialAgree = offA && offB && nameSimilarity(offA, offB) >= OFFICIAL_NAME_AGREEMENT ? 1 : 0
|
package/lib/map-html.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
6
3
|
|
|
7
4
|
import { stringifyJSON } from "@mailwoman/core/json"
|
|
8
5
|
import { escapeHTML } from "@mailwoman/core/strings/escape"
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The cross-source link scorer, trained on NPI-joined NPPES ↔ Open Payments pairs
|
|
6
|
+
* (the non-circular cross-registry anchor, both public domain).
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* scripts/eval/record-matcher/train-cross-gbt.ts. Retrain and re-run rather than editing.
|
|
8
|
+
* Scores "same provider, different registry text" links the dedup GBT rejects by construction.
|
|
9
|
+
* Generated by scripts/eval/record-matcher/train-cross-gbt.ts.
|
|
10
|
+
* Retrain and re-run rather than editing.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import type { GBT } from "@mailwoman/match"
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* Generated by scripts/eval/record-matcher/train-gbt.ts.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
+
* Do not edit by hand.
|
|
8
|
+
* Retrain to update.
|
|
7
9
|
*
|
|
8
|
-
* The default learned-scorer model, a gradient-boosted-tree dedup scorer
|
|
9
|
-
*
|
|
10
|
+
* The default learned-scorer model, a gradient-boosted-tree dedup scorer
|
|
11
|
+
* trained on the NPPES NPI-truth set.
|
|
12
|
+
* Used by resolveEntities' opt-in learnedScorer hook via createGBTScorer.
|
|
10
13
|
* The trained {@link GBT} is plain data.
|
|
11
14
|
*/
|
|
12
15
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
+
* The ORG-level cross-source link scorer, trained on CCN-joined CMS POS ↔ Care
|
|
6
|
+
* Compare facility pairs (both public domain).
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* scripts/eval/record-matcher/train-org-cross-gbt.ts. Retrain and re-run rather than editing.
|
|
8
|
+
* Scores "same facility, different registry text" links for org-level cross-dataset flows.
|
|
9
|
+
* Generated by scripts/eval/record-matcher/train-org-cross-gbt.ts.
|
|
10
|
+
* Retrain and re-run rather than editing.
|
|
10
11
|
*/
|
|
11
12
|
|
|
12
13
|
import type { GBT } from "@mailwoman/match"
|
package/lib/reconcile.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
import { formatPersonName } from "@mailwoman/record/name"
|
|
2
5
|
import type { GeoFeatureCollection, PointLiteral } from "@mailwoman/spatial"
|
|
3
6
|
|
package/lib/resolve.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
5
|
* The resolve pipeline wires the matching modules over concrete contact and organization records.
|
|
7
6
|
*
|
|
8
7
|
* The upstream pipeline geocodes each `address` and supplies its coordinate and canonical key.
|
|
@@ -425,7 +424,7 @@ export interface ResolveConfig {
|
|
|
425
424
|
*
|
|
426
425
|
* When the bundled model is active and no {@link threshold} is set,
|
|
427
426
|
* its calibrated link threshold ({@link DEDUP_GBT_META}.recommendedThreshold) is used,
|
|
428
|
-
* because the GBT logit
|
|
427
|
+
* because the GBT logit isn't in FS-weight units and 0 would over-merge.
|
|
429
428
|
*
|
|
430
429
|
* The model is NPPES/US-trained.
|
|
431
430
|
* For a very different domain, A/B it or pass `false`.
|
|
@@ -495,7 +494,7 @@ export function resolveEntities(records: readonly SourceRecord[], config: Resolv
|
|
|
495
494
|
|
|
496
495
|
// An explicit threshold wins.
|
|
497
496
|
// Otherwise the bundled model uses its calibrated threshold, because its logit
|
|
498
|
-
//
|
|
497
|
+
// isn't in FS-weight units and 0 would over-merge.
|
|
499
498
|
// The FS baseline or a custom model uses 0.
|
|
500
499
|
const threshold = config.threshold ?? (usingBundledModel ? DEDUP_GBT_META.recommendedThreshold : 0)
|
|
501
500
|
|
package/lib/types.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The application's data shapes — the messy record that goes in and the canonical entity that
|
|
7
|
-
* comes out. Plain interfaces over the `@mailwoman/record` types.
|
|
5
|
+
* The application's data shapes — the messy record that goes in and the canonical entity that comes out.
|
|
6
|
+
* Plain interfaces over the `@mailwoman/record` types.
|
|
8
7
|
*/
|
|
9
8
|
|
|
10
9
|
import type { ResolutionTier } from "@mailwoman/annotations/geo"
|
package/out/address-key.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
2
|
+
* The address-id consumer for the matcher.
|
|
5
3
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
4
|
+
* Derives a stable {@link PostalAddressID} from a resolved {@link SourceRecord}
|
|
5
|
+
* and exposes it as a blocking key, the deterministic exact-canonical-address
|
|
6
|
+
* complement to the fuzzy Fellegi-Sunter / GBT scoring.
|
|
7
|
+
* Two uses:
|
|
9
8
|
*
|
|
10
|
-
* - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the
|
|
14
|
-
*
|
|
9
|
+
* - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records
|
|
10
|
+
* that resolve to the same place and share a canonical address with no scoring at all.
|
|
11
|
+
* That's the cheap, certain part of dedup before the matcher does the fuzzy rest.
|
|
12
|
+
* - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the
|
|
13
|
+
* blocking union, so records sharing one are guaranteed to be compared.
|
|
15
14
|
*/
|
|
16
15
|
import { type PostalAddressID } from "@mailwoman/address-id";
|
|
17
16
|
import { type BlockingKey } from "@mailwoman/match";
|
|
18
17
|
import type { SourceRecord } from "#types";
|
|
19
18
|
/**
|
|
20
|
-
* The stable address primary key for a record, or null when it
|
|
19
|
+
* The stable address primary key for a record, or null when it isn't geocoded
|
|
21
20
|
* (no coordinate means no locality cell) or includes no raw address to hash.
|
|
22
21
|
*
|
|
23
22
|
* The state prefix is plucked from the address when present.
|
package/out/address-key.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-key.d.ts","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"address-key.d.ts","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,kBAAkB,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,GAAG,IAAI,CAO5E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,YAAY,CAAC,CAEhE"}
|
package/out/address-key.js
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
4
|
+
* The address-id consumer for the matcher.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Derives a stable {@link PostalAddressID} from a resolved {@link SourceRecord}
|
|
7
|
+
* and exposes it as a blocking key, the deterministic exact-canonical-address
|
|
8
|
+
* complement to the fuzzy Fellegi-Sunter / GBT scoring.
|
|
9
|
+
* Two uses:
|
|
9
10
|
*
|
|
10
|
-
* - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the
|
|
14
|
-
*
|
|
11
|
+
* - **As a pre-dedup / join key:** `group BY postalAddressID(record)` collapses records
|
|
12
|
+
* that resolve to the same place and share a canonical address with no scoring at all.
|
|
13
|
+
* That's the cheap, certain part of dedup before the matcher does the fuzzy rest.
|
|
14
|
+
* - **As a blocking key:** {@link addressIDBlockingKey} adds the address-id to the
|
|
15
|
+
* blocking union, so records sharing one are guaranteed to be compared.
|
|
15
16
|
*/
|
|
16
17
|
import { createPostalAddressID } from "@mailwoman/address-id";
|
|
17
18
|
import { exactKey } from "@mailwoman/match";
|
|
18
19
|
/**
|
|
19
|
-
* The stable address primary key for a record, or null when it
|
|
20
|
+
* The stable address primary key for a record, or null when it isn't geocoded
|
|
20
21
|
* (no coordinate means no locality cell) or includes no raw address to hash.
|
|
21
22
|
*
|
|
22
23
|
* The state prefix is plucked from the address when present.
|
package/out/address-key.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-key.js","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"address-key.js","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,qBAAqB,EAAwB,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAoB,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAI7D;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAoB;IACnD,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAA;IACtD,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,GAAG,CAAA;IAEnC,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAExC,OAAO,qBAAqB,CAAC,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC,CAAA;AACtD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB;IACnC,OAAO,QAAQ,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAA;AACrD,CAAC"}
|
package/out/geocode-handler.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
2
|
+
* The per-record geocode step, factored out of the worker so it unit-tests against
|
|
3
|
+
* a fake geocoder (no neural model / SQLite).
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
* neural model / SQLite). `geocode-worker.ts` builds the real geocoder from config and wraps this.
|
|
5
|
+
* `geocode-worker.ts` builds the real geocoder from config and wraps this.
|
|
8
6
|
*/
|
|
9
7
|
import { type ColumnMapping, type GeocodeAddress } from "#ingest";
|
|
10
8
|
import type { SourceRecord } from "#types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geocode-handler.d.ts","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geocode-handler.d.ts","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,cAAc,EAAQ,MAAM,SAAS,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CACjC,OAAO,EAAE,cAAc,EACvB,OAAO,EAAE,aAAa,EACtB,gBAAgB,SAAO,GACrB,CAAC,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,YAAY,CAAC,CAYjD"}
|
package/out/geocode-handler.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
4
|
+
* The per-record geocode step, factored out of the worker so it unit-tests against
|
|
5
|
+
* a fake geocoder (no neural model / SQLite).
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
* neural model / SQLite). `geocode-worker.ts` builds the real geocoder from config and wraps this.
|
|
7
|
+
* `geocode-worker.ts` builds the real geocoder from config and wraps this.
|
|
8
8
|
*/
|
|
9
9
|
import { pick } from "#ingest";
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geocode-handler.js","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"geocode-handler.js","sourceRoot":"","sources":["../lib/geocode-handler.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;GAKG;AAEH,OAAO,EAA2C,IAAI,EAAE,MAAM,SAAS,CAAA;AAGvE;;;;;;;GAOG;AACH,MAAM,UAAU,kBAAkB,CACjC,OAAuB,EACvB,OAAsB,EACtB,gBAAgB,GAAG,IAAI;IAEvB,OAAO,KAAK,EAAE,MAAM,EAAE,EAAE;QACvB,IAAI,CAAC,MAAM,CAAC,GAAG;YAAE,OAAO,MAAM,CAAA;QAE9B,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA;QAExE,IAAI,CAAC,YAAY;YAAE,OAAO,MAAM,CAAA;QAEhC,MAAM,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,IAAI,CAAA;QAErD,OAAO,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,CAAA;IAC9B,CAAC,CAAA;AACF,CAAC"}
|
package/out/geojson.d.ts
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Export resolved entities as GeoJSON — the bridge to QGIS and any web map. Each entity becomes a
|
|
7
|
-
* Point at its resolved coordinate, carrying the properties an analyst needs: the count of records
|
|
8
|
-
* merged into it, how tightly (cohesion), the canonical name/org/address and the geocode tier
|
|
9
|
-
* (so rooftop-precise entities can be styled apart from admin-centroid guesses). Entities without
|
|
10
|
-
* a coordinate are omitted (a Point feature needs one).
|
|
11
|
-
*/
|
|
12
1
|
import type { GeoFeature, GeoFeatureCollection, PointLiteral } from "@mailwoman/spatial";
|
|
13
2
|
import type { EntityGeoData, ResolvedEntity } from "#types";
|
|
14
3
|
/**
|
package/out/geojson.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../lib/geojson.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"geojson.d.ts","sourceRoot":"","sources":["../lib/geojson.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAExF,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAgB,MAAM,QAAQ,CAAA;AASzE;;;;;;GAMG;AACH,wBAAgB,SAAS,CACxB,MAAM,EAAE,cAAc,EACtB,KAAK,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,GAC5B,UAAU,CAAC,YAAY,EAAE,aAAa,CAAC,CAyBzC;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,SAAS,cAAc,EAAE,GAAG,oBAAoB,CAAC,YAAY,EAAE,aAAa,CAAC,CAKhH"}
|
package/out/geojson.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
1
3
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
4
|
+
* Export resolved entities as GeoJSON — the bridge to QGIS and any web map.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* a coordinate are omitted (a Point feature needs one).
|
|
6
|
+
* Each entity becomes a Point at its resolved coordinate, carrying the properties an analyst needs:
|
|
7
|
+
* the count of records merged into it, how tightly (cohesion), the canonical name/org/address
|
|
8
|
+
* and the geocode tier (so rooftop-precise entities can be styled apart from admin-centroid guesses).
|
|
9
|
+
* Entities without a coordinate are omitted (a Point feature needs one).
|
|
11
10
|
*/
|
|
12
11
|
import { formatPersonName } from "@mailwoman/record/name";
|
|
13
12
|
/**
|
package/out/geojson.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geojson.js","sourceRoot":"","sources":["../lib/geojson.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"geojson.js","sourceRoot":"","sources":["../lib/geojson.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;GAOG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAKzD;;GAEG;AACH,SAAS,WAAW,CAAC,MAAoB;IACxC,OAAO,gBAAgB,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,CAAA;AACrD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SA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AE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;KAC3F,CAAA;AACF,CAAC"}
|
package/out/index.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
2
|
* `@mailwoman/entity-resolution` — the geocode-first record-matching application.
|
|
7
3
|
*
|
|
8
|
-
* {@link resolveEntities} runs the whole matcher (block → score → cluster) over
|
|
9
|
-
* contact/organization {@link SourceRecord}s and returns canonical
|
|
10
|
-
* {@link toGeoJSON} exports them for QGIS.
|
|
11
|
-
*
|
|
4
|
+
* {@link resolveEntities} runs the whole matcher (block → score → cluster) over
|
|
5
|
+
* normalized contact/organization {@link SourceRecord}s and returns canonical
|
|
6
|
+
* {@link ResolvedEntity entities}; {@link toGeoJSON} exports them for QGIS.
|
|
7
|
+
* This is the clinic-funding use case mailwoman was built for, finally standing
|
|
8
|
+
* on a calibrated, label-free matcher.
|
|
12
9
|
*/
|
|
13
10
|
export * from "#address-key";
|
|
14
11
|
export * from "#geojson";
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
|
package/out/index.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
|
|
2
|
+
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
|
|
1
3
|
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
4
|
* `@mailwoman/entity-resolution` — the geocode-first record-matching application.
|
|
7
5
|
*
|
|
8
|
-
* {@link resolveEntities} runs the whole matcher (block → score → cluster) over
|
|
9
|
-
* contact/organization {@link SourceRecord}s and returns canonical
|
|
10
|
-
* {@link toGeoJSON} exports them for QGIS.
|
|
11
|
-
*
|
|
6
|
+
* {@link resolveEntities} runs the whole matcher (block → score → cluster) over
|
|
7
|
+
* normalized contact/organization {@link SourceRecord}s and returns canonical
|
|
8
|
+
* {@link ResolvedEntity entities}; {@link toGeoJSON} exports them for QGIS.
|
|
9
|
+
* This is the clinic-funding use case mailwoman was built for, finally standing
|
|
10
|
+
* on a calibrated, label-free matcher.
|
|
12
11
|
*/
|
|
13
12
|
export * from "#address-key";
|
|
14
13
|
export * from "#geojson";
|
package/out/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;;;;;;GAQG;AAEH,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,kBAAkB,CAAA;AAChC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,WAAW,CAAA;AACzB,cAAc,yBAAyB,CAAA;AACvC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA"}
|
package/out/ingest.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* Column mapping and normalization are pure. The caller injects geocoding, so this package never imports the neural parser, resolver, or extracts.
|
|
7
|
-
*/
|
|
8
1
|
import type { AddressGeocode, PostalAddress } from "@mailwoman/record";
|
|
9
2
|
import { toPostalAddress } from "@mailwoman/record";
|
|
10
3
|
import type { PathBuilderLike } from "path-ts";
|
package/out/ingest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../lib/ingest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ingest.d.ts","sourceRoot":"","sources":["../lib/ingest.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EAAiD,eAAe,EAAe,MAAM,mBAAmB,CAAA;AAC/G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,KAAK,aAAa,EAA8B,MAAM,aAAa,CAAA;AAE5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,GAAG,aAAa,GAAG,IAAI,CAAA;AAElG;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB;;;CAG+F,CAAA;AAEtH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,OAAO,iBAAiB,CAAA;AAEtD;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MA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