@mailwoman/registry 10.7.0 → 11.0.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 +93 -98
- package/data/manifests/artifacts.json +32 -0
- package/data/manifests/coverage.json +56 -0
- package/data/manifests/sources.lock.json +48 -0
- package/data/normalized/iata-airports.json +126749 -0
- package/data/normalized/iso3166-1.json +2035 -0
- package/definitions/namespaces.json +63 -0
- package/definitions/sections.json +73 -0
- package/docs/data-policy.md +81 -0
- package/docs/performance.md +146 -0
- package/docs/rgy1.md +144 -0
- package/lib/artifacts/country-airport-collision.ts +26 -0
- package/lib/artifacts/iata-airport/membership.ts +26 -0
- package/lib/artifacts/iata-airport/records.ts +26 -0
- package/lib/artifacts/iso3166-1/alpha2-membership.ts +26 -0
- package/lib/artifacts/iso3166-1/alpha3-membership.ts +26 -0
- package/lib/artifacts/iso3166-1/records.ts +26 -0
- package/lib/errors.ts +44 -0
- package/lib/iata/airports/records.ts +174 -0
- package/lib/iata/airports/validate.ts +49 -0
- package/lib/index.ts +25 -15
- package/lib/inspect.ts +56 -0
- package/lib/iso3166/alpha2.ts +48 -0
- package/lib/iso3166/alpha3.ts +51 -0
- package/lib/iso3166/records.ts +149 -0
- package/lib/iso3166/relations.ts +30 -0
- package/lib/key.ts +146 -0
- package/lib/normalize.ts +31 -0
- package/lib/overlap/country-airport.ts +108 -0
- package/lib/rgy1/base64.ts +24 -0
- package/lib/rgy1/reader.ts +316 -0
- package/lib/rgy1/sections.generated.ts +79 -0
- package/lib/rgy1/views.ts +267 -0
- package/lib/types.ts +88 -74
- package/lib/wasm.ts +285 -0
- package/out/artifacts/country-airport-collision.d.ts +15 -0
- package/out/artifacts/country-airport-collision.d.ts.map +1 -0
- package/out/artifacts/country-airport-collision.js +21 -0
- package/out/artifacts/country-airport-collision.js.map +1 -0
- package/out/artifacts/iata-airport/membership.d.ts +15 -0
- package/out/artifacts/iata-airport/membership.d.ts.map +1 -0
- package/out/artifacts/iata-airport/membership.js +21 -0
- package/out/artifacts/iata-airport/membership.js.map +1 -0
- package/out/artifacts/iata-airport/records.d.ts +15 -0
- package/out/artifacts/iata-airport/records.d.ts.map +1 -0
- package/out/artifacts/iata-airport/records.js +21 -0
- package/out/artifacts/iata-airport/records.js.map +1 -0
- package/out/artifacts/iso3166-1/alpha2-membership.d.ts +15 -0
- package/out/artifacts/iso3166-1/alpha2-membership.d.ts.map +1 -0
- package/out/artifacts/iso3166-1/alpha2-membership.js +21 -0
- package/out/artifacts/iso3166-1/alpha2-membership.js.map +1 -0
- package/out/artifacts/iso3166-1/alpha3-membership.d.ts +15 -0
- package/out/artifacts/iso3166-1/alpha3-membership.d.ts.map +1 -0
- package/out/artifacts/iso3166-1/alpha3-membership.js +21 -0
- package/out/artifacts/iso3166-1/alpha3-membership.js.map +1 -0
- package/out/artifacts/iso3166-1/records.d.ts +15 -0
- package/out/artifacts/iso3166-1/records.d.ts.map +1 -0
- package/out/artifacts/iso3166-1/records.js +21 -0
- package/out/artifacts/iso3166-1/records.js.map +1 -0
- package/out/errors.d.ts +38 -0
- package/out/errors.d.ts.map +1 -0
- package/out/errors.js +35 -0
- package/out/errors.js.map +1 -0
- package/out/iata/airports/records.d.ts +44 -0
- package/out/iata/airports/records.d.ts.map +1 -0
- package/out/iata/airports/records.js +137 -0
- package/out/iata/airports/records.js.map +1 -0
- package/out/iata/airports/validate.d.ts +27 -0
- package/out/iata/airports/validate.d.ts.map +1 -0
- package/out/iata/airports/validate.js +42 -0
- package/out/iata/airports/validate.js.map +1 -0
- package/out/index.d.ts +19 -15
- package/out/index.d.ts.map +1 -1
- package/out/index.js +14 -15
- package/out/index.js.map +1 -1
- package/out/inspect.d.ts +38 -0
- package/out/inspect.d.ts.map +1 -0
- package/out/inspect.js +33 -0
- package/out/inspect.js.map +1 -0
- package/out/iso3166/alpha2.d.ts +24 -0
- package/out/iso3166/alpha2.d.ts.map +1 -0
- package/out/iso3166/alpha2.js +41 -0
- package/out/iso3166/alpha2.js.map +1 -0
- package/out/iso3166/alpha3.d.ts +29 -0
- package/out/iso3166/alpha3.d.ts.map +1 -0
- package/out/iso3166/alpha3.js +44 -0
- package/out/iso3166/alpha3.js.map +1 -0
- package/out/iso3166/records.d.ts +38 -0
- package/out/iso3166/records.d.ts.map +1 -0
- package/out/iso3166/records.js +105 -0
- package/out/iso3166/records.js.map +1 -0
- package/out/iso3166/relations.d.ts +20 -0
- package/out/iso3166/relations.d.ts.map +1 -0
- package/out/iso3166/relations.js +27 -0
- package/out/iso3166/relations.js.map +1 -0
- package/out/key.d.ts +68 -0
- package/out/key.d.ts.map +1 -0
- package/out/key.js +122 -0
- package/out/key.js.map +1 -0
- package/out/normalize.d.ts +25 -0
- package/out/normalize.d.ts.map +1 -0
- package/out/normalize.js +21 -0
- package/out/normalize.js.map +1 -0
- package/out/overlap/country-airport.d.ts +57 -0
- package/out/overlap/country-airport.d.ts.map +1 -0
- package/out/overlap/country-airport.js +71 -0
- package/out/overlap/country-airport.js.map +1 -0
- package/out/rgy1/base64.d.ts +15 -0
- package/out/rgy1/base64.d.ts.map +1 -0
- package/out/rgy1/base64.js +22 -0
- package/out/rgy1/base64.js.map +1 -0
- package/out/rgy1/reader.d.ts +103 -0
- package/out/rgy1/reader.d.ts.map +1 -0
- package/out/rgy1/reader.js +230 -0
- package/out/rgy1/reader.js.map +1 -0
- package/out/rgy1/sections.generated.d.ts +54 -0
- package/out/rgy1/sections.generated.d.ts.map +1 -0
- package/out/rgy1/sections.generated.js +69 -0
- package/out/rgy1/sections.generated.js.map +1 -0
- package/out/rgy1/views.d.ts +96 -0
- package/out/rgy1/views.d.ts.map +1 -0
- package/out/rgy1/views.js +218 -0
- package/out/rgy1/views.js.map +1 -0
- package/out/sdk/fetch.d.ts +53 -0
- package/out/sdk/fetch.d.ts.map +1 -0
- package/out/sdk/fetch.js +107 -0
- package/out/sdk/fetch.js.map +1 -0
- package/out/sdk/fetch.run.d.ts +14 -0
- package/out/sdk/fetch.run.d.ts.map +1 -0
- package/out/sdk/fetch.run.js +20 -0
- package/out/sdk/fetch.run.js.map +1 -0
- package/out/sdk/sources.d.ts +111 -0
- package/out/sdk/sources.d.ts.map +1 -0
- package/out/sdk/sources.js +98 -0
- package/out/sdk/sources.js.map +1 -0
- package/out/tools/artifact-path.d.ts +10 -0
- package/out/tools/artifact-path.d.ts.map +1 -0
- package/out/tools/artifact-path.js +12 -0
- package/out/tools/artifact-path.js.map +1 -0
- package/out/tools/bench.run.d.ts +19 -0
- package/out/tools/bench.run.d.ts.map +1 -0
- package/out/tools/bench.run.js +204 -0
- package/out/tools/bench.run.js.map +1 -0
- package/out/tools/build-wasm.run.d.ts +18 -0
- package/out/tools/build-wasm.run.d.ts.map +1 -0
- package/out/tools/build-wasm.run.js +71 -0
- package/out/tools/build-wasm.run.js.map +1 -0
- package/out/tools/generate-sections.run.d.ts +13 -0
- package/out/tools/generate-sections.run.d.ts.map +1 -0
- package/out/tools/generate-sections.run.js +136 -0
- package/out/tools/generate-sections.run.js.map +1 -0
- package/out/tools/generate.run.d.ts +18 -0
- package/out/tools/generate.run.d.ts.map +1 -0
- package/out/tools/generate.run.js +118 -0
- package/out/tools/generate.run.js.map +1 -0
- package/out/tools/normalize.d.ts +155 -0
- package/out/tools/normalize.d.ts.map +1 -0
- package/out/tools/normalize.js +303 -0
- package/out/tools/normalize.js.map +1 -0
- package/out/tools/normalize.run.d.ts +14 -0
- package/out/tools/normalize.run.d.ts.map +1 -0
- package/out/tools/normalize.run.js +29 -0
- package/out/tools/normalize.run.js.map +1 -0
- package/out/types.d.ts +90 -76
- package/out/types.d.ts.map +1 -1
- package/out/types.js +20 -4
- package/out/types.js.map +1 -1
- package/out/wasm.d.ts +98 -0
- package/out/wasm.d.ts.map +1 -0
- package/out/wasm.js +137 -0
- package/out/wasm.js.map +1 -0
- package/package.json +49 -28
- package/sdk/fetch.run.ts +24 -0
- package/sdk/fetch.ts +146 -0
- package/sdk/sources.ts +162 -0
- package/tools/artifact-path.ts +12 -0
- package/tools/bench.run.ts +265 -0
- package/tools/build-wasm.run.ts +82 -0
- package/tools/generate-sections.run.ts +152 -0
- package/tools/generate.run.ts +146 -0
- package/tools/normalize.run.ts +36 -0
- package/tools/normalize.ts +474 -0
- package/wasm/registry-simd.wasm +0 -0
- package/wasm/registry.wasm +0 -0
- package/lib/address-key.ts +0 -46
- package/lib/geocode-handler.ts +0 -37
- package/lib/geojson.ts +0 -73
- package/lib/ingest.ts +0 -349
- package/lib/learned-scorer.ts +0 -134
- package/lib/map-html.ts +0 -287
- package/lib/models/crosssource-gbt-en-us.ts +0 -43
- package/lib/models/dedup-gbt-en-us.ts +0 -47
- package/lib/models/org-crosssource-gbt-en-us.ts +0 -43
- package/lib/reconcile.ts +0 -239
- package/lib/resolve.ts +0 -570
- package/out/address-key.d.ts +0 -34
- package/out/address-key.d.ts.map +0 -1
- package/out/address-key.js +0 -41
- package/out/address-key.js.map +0 -1
- package/out/geocode-handler.d.ts +0 -20
- package/out/geocode-handler.d.ts.map +0 -1
- package/out/geocode-handler.js +0 -29
- package/out/geocode-handler.js.map +0 -1
- package/out/geojson.d.ts +0 -28
- package/out/geojson.d.ts.map +0 -1
- package/out/geojson.js +0 -63
- package/out/geojson.js.map +0 -1
- package/out/ingest.d.ts +0 -173
- package/out/ingest.d.ts.map +0 -1
- package/out/ingest.js +0 -185
- package/out/ingest.js.map +0 -1
- package/out/learned-scorer.d.ts +0 -61
- package/out/learned-scorer.d.ts.map +0 -1
- package/out/learned-scorer.js +0 -91
- package/out/learned-scorer.js.map +0 -1
- package/out/map-html.d.ts +0 -39
- package/out/map-html.d.ts.map +0 -1
- package/out/map-html.js +0 -220
- package/out/map-html.js.map +0 -1
- package/out/models/crosssource-gbt-en-us.d.ts +0 -45
- package/out/models/crosssource-gbt-en-us.d.ts.map +0 -1
- package/out/models/crosssource-gbt-en-us.js +0 -40
- package/out/models/crosssource-gbt-en-us.js.map +0 -1
- package/out/models/dedup-gbt-en-us.d.ts +0 -44
- package/out/models/dedup-gbt-en-us.d.ts.map +0 -1
- package/out/models/dedup-gbt-en-us.js +0 -44
- package/out/models/dedup-gbt-en-us.js.map +0 -1
- package/out/models/org-crosssource-gbt-en-us.d.ts +0 -45
- package/out/models/org-crosssource-gbt-en-us.d.ts.map +0 -1
- package/out/models/org-crosssource-gbt-en-us.js +0 -40
- package/out/models/org-crosssource-gbt-en-us.js.map +0 -1
- package/out/reconcile.d.ts +0 -96
- package/out/reconcile.d.ts.map +0 -1
- package/out/reconcile.js +0 -127
- package/out/reconcile.js.map +0 -1
- package/out/resolve.d.ts +0 -264
- package/out/resolve.d.ts.map +0 -1
- package/out/resolve.js +0 -282
- package/out/resolve.js.map +0 -1
- package/out/tools/coverage-reconciliation.d.ts +0 -67
- package/out/tools/coverage-reconciliation.d.ts.map +0 -1
- package/out/tools/coverage-reconciliation.js +0 -113
- package/out/tools/coverage-reconciliation.js.map +0 -1
- package/out/tools/cross/dataset-correlation.d.ts +0 -61
- package/out/tools/cross/dataset-correlation.d.ts.map +0 -1
- package/out/tools/cross/dataset-correlation.js +0 -244
- package/out/tools/cross/dataset-correlation.js.map +0 -1
- package/out/tools/cross/source-threshold-sweep.d.ts +0 -60
- package/out/tools/cross/source-threshold-sweep.d.ts.map +0 -1
- package/out/tools/cross/source-threshold-sweep.js +0 -264
- package/out/tools/cross/source-threshold-sweep.js.map +0 -1
- package/out/tools/dedup-ceiling.d.ts +0 -62
- package/out/tools/dedup-ceiling.d.ts.map +0 -1
- package/out/tools/dedup-ceiling.js +0 -171
- package/out/tools/dedup-ceiling.js.map +0 -1
- package/out/tools/eval-geocoder.d.ts +0 -68
- package/out/tools/eval-geocoder.d.ts.map +0 -1
- package/out/tools/eval-geocoder.js +0 -13
- package/out/tools/eval-geocoder.js.map +0 -1
- package/out/tools/geocoder/namesake-probe.d.ts +0 -33
- package/out/tools/geocoder/namesake-probe.d.ts.map +0 -1
- package/out/tools/geocoder/namesake-probe.js +0 -60
- package/out/tools/geocoder/namesake-probe.js.map +0 -1
- package/out/tools/geocoder/vs-provided-coords.d.ts +0 -53
- package/out/tools/geocoder/vs-provided-coords.d.ts.map +0 -1
- package/out/tools/geocoder/vs-provided-coords.js +0 -161
- package/out/tools/geocoder/vs-provided-coords.js.map +0 -1
- package/out/tools/gold-set-sample.d.ts +0 -67
- package/out/tools/gold-set-sample.d.ts.map +0 -1
- package/out/tools/gold-set-sample.js +0 -81
- package/out/tools/gold-set-sample.js.map +0 -1
- package/out/tools/learned/scorer/clustering-eval.d.ts +0 -77
- package/out/tools/learned/scorer/clustering-eval.d.ts.map +0 -1
- package/out/tools/learned/scorer/clustering-eval.js +0 -207
- package/out/tools/learned/scorer/clustering-eval.js.map +0 -1
- package/out/tools/learned/scorer/crossstate-eval.d.ts +0 -65
- package/out/tools/learned/scorer/crossstate-eval.d.ts.map +0 -1
- package/out/tools/learned/scorer/crossstate-eval.js +0 -168
- package/out/tools/learned/scorer/crossstate-eval.js.map +0 -1
- package/out/tools/learned/scorer/eval.d.ts +0 -64
- package/out/tools/learned/scorer/eval.d.ts.map +0 -1
- package/out/tools/learned/scorer/eval.js +0 -275
- package/out/tools/learned/scorer/eval.js.map +0 -1
- package/out/tools/matcher-scale.d.ts +0 -40
- package/out/tools/matcher-scale.d.ts.map +0 -1
- package/out/tools/matcher-scale.js +0 -111
- package/out/tools/matcher-scale.js.map +0 -1
- package/out/tools/nppes/dedup-benchmark.d.ts +0 -82
- package/out/tools/nppes/dedup-benchmark.d.ts.map +0 -1
- package/out/tools/nppes/dedup-benchmark.js +0 -226
- package/out/tools/nppes/dedup-benchmark.js.map +0 -1
- package/out/tools/nppes/org-name.d.ts +0 -15
- package/out/tools/nppes/org-name.d.ts.map +0 -1
- package/out/tools/nppes/org-name.js +0 -6
- package/out/tools/nppes/org-name.js.map +0 -1
- package/out/tools/nppes/overmerge-packet.d.ts +0 -43
- package/out/tools/nppes/overmerge-packet.d.ts.map +0 -1
- package/out/tools/nppes/overmerge-packet.js +0 -54
- package/out/tools/nppes/overmerge-packet.js.map +0 -1
- package/out/tools/nppes/report.d.ts +0 -97
- package/out/tools/nppes/report.d.ts.map +0 -1
- package/out/tools/nppes/report.js +0 -178
- package/out/tools/nppes/report.js.map +0 -1
- package/out/tools/nppes/sample.d.ts +0 -101
- package/out/tools/nppes/sample.d.ts.map +0 -1
- package/out/tools/nppes/sample.js +0 -127
- package/out/tools/nppes/sample.js.map +0 -1
- package/out/tools/nppes/scoring.d.ts +0 -37
- package/out/tools/nppes/scoring.d.ts.map +0 -1
- package/out/tools/nppes/scoring.js +0 -81
- package/out/tools/nppes/scoring.js.map +0 -1
- package/out/tools/nppes/settings.d.ts +0 -41
- package/out/tools/nppes/settings.d.ts.map +0 -1
- package/out/tools/nppes/settings.js +0 -79
- package/out/tools/nppes/settings.js.map +0 -1
- package/out/tools/nppes/truth-grains.d.ts +0 -63
- package/out/tools/nppes/truth-grains.d.ts.map +0 -1
- package/out/tools/nppes/truth-grains.js +0 -139
- package/out/tools/nppes/truth-grains.js.map +0 -1
- package/out/tools/shared.d.ts +0 -325
- package/out/tools/shared.d.ts.map +0 -1
- package/out/tools/shared.js +0 -453
- package/out/tools/shared.js.map +0 -1
- package/out/tools/train/cross-gbt.d.ts +0 -89
- package/out/tools/train/cross-gbt.d.ts.map +0 -1
- package/out/tools/train/cross-gbt.js +0 -132
- package/out/tools/train/cross-gbt.js.map +0 -1
- package/out/tools/train/gbt.d.ts +0 -85
- package/out/tools/train/gbt.d.ts.map +0 -1
- package/out/tools/train/gbt.js +0 -155
- package/out/tools/train/gbt.js.map +0 -1
- package/out/tools/train/org-cross-gbt.d.ts +0 -85
- package/out/tools/train/org-cross-gbt.d.ts.map +0 -1
- package/out/tools/train/org-cross-gbt.js +0 -122
- package/out/tools/train/org-cross-gbt.js.map +0 -1
- package/out/tools/txhhsc-to-oarow.d.ts +0 -42
- package/out/tools/txhhsc-to-oarow.d.ts.map +0 -1
- package/out/tools/txhhsc-to-oarow.js +0 -78
- package/out/tools/txhhsc-to-oarow.js.map +0 -1
- package/out/tools/viz/browser.d.ts +0 -31
- package/out/tools/viz/browser.d.ts.map +0 -1
- package/out/tools/viz/browser.js +0 -26
- package/out/tools/viz/browser.js.map +0 -1
- package/out/tools/viz/cross-dataset-map.d.ts +0 -39
- package/out/tools/viz/cross-dataset-map.d.ts.map +0 -1
- package/out/tools/viz/cross-dataset-map.js +0 -84
- package/out/tools/viz/cross-dataset-map.js.map +0 -1
- package/out/tools/viz/geocode-first-surface.d.ts +0 -36
- package/out/tools/viz/geocode-first-surface.d.ts.map +0 -1
- package/out/tools/viz/geocode-first-surface.js +0 -234
- package/out/tools/viz/geocode-first-surface.js.map +0 -1
- package/out/tools/viz/render/map.d.ts +0 -42
- package/out/tools/viz/render/map.d.ts.map +0 -1
- package/out/tools/viz/render/map.js +0 -40
- package/out/tools/viz/render/map.js.map +0 -1
- package/out/tools/viz/render.d.ts +0 -46
- package/out/tools/viz/render.d.ts.map +0 -1
- package/out/tools/viz/render.js +0 -49
- package/out/tools/viz/render.js.map +0 -1
- package/out/tools/viz/source-provenance-map.d.ts +0 -57
- package/out/tools/viz/source-provenance-map.d.ts.map +0 -1
- package/out/tools/viz/source-provenance-map.js +0 -82
- package/out/tools/viz/source-provenance-map.js.map +0 -1
- package/out/tools/viz/yardstick-figure.d.ts +0 -22
- package/out/tools/viz/yardstick-figure.d.ts.map +0 -1
- package/out/tools/viz/yardstick-figure.js +0 -106
- package/out/tools/viz/yardstick-figure.js.map +0 -1
- package/tools/coverage-reconciliation.ts +0 -192
- package/tools/cross/dataset-correlation.ts +0 -380
- package/tools/cross/source-threshold-sweep.ts +0 -416
- package/tools/dedup-ceiling.ts +0 -225
- package/tools/eval-geocoder.ts +0 -77
- package/tools/geocoder/namesake-probe.ts +0 -91
- package/tools/geocoder/vs-provided-coords.ts +0 -232
- package/tools/gold-set-sample.ts +0 -147
- package/tools/learned/scorer/clustering-eval.ts +0 -349
- package/tools/learned/scorer/crossstate-eval.ts +0 -280
- package/tools/learned/scorer/eval.ts +0 -429
- package/tools/matcher-scale.ts +0 -185
- package/tools/nppes/dedup-benchmark.ts +0 -364
- package/tools/nppes/org-name.ts +0 -15
- package/tools/nppes/overmerge-packet.ts +0 -98
- package/tools/nppes/report.ts +0 -380
- package/tools/nppes/sample.ts +0 -250
- package/tools/nppes/scoring.ts +0 -115
- package/tools/nppes/settings.ts +0 -102
- package/tools/nppes/truth-grains.ts +0 -181
- package/tools/shared.ts +0 -743
- package/tools/train/cross-gbt.ts +0 -214
- package/tools/train/gbt.ts +0 -261
- package/tools/train/org-cross-gbt.ts +0 -189
- package/tools/txhhsc-to-oarow.ts +0 -118
- package/tools/viz/browser.ts +0 -41
- package/tools/viz/cross-dataset-map.ts +0 -133
- package/tools/viz/geocode-first-surface.ts +0 -305
- package/tools/viz/render/map.ts +0 -61
- package/tools/viz/render.ts +0 -103
- package/tools/viz/source-provenance-map.ts +0 -154
- package/tools/viz/yardstick-figure.ts +0 -197
package/out/learned-scorer.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
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}.
|
|
8
|
-
*
|
|
9
|
-
* {@link createMatchFeaturizer} is the one feature extractor for a candidate pair, used
|
|
10
|
-
* identically at train time (`registry/tools/train-gbt.ts`), eval time and inference time.
|
|
11
|
-
* {@link createGBTScorer} wraps a trained {@link GBT} and the featurizer into the `(a, b) => number`
|
|
12
|
-
* the resolve pipeline's `scorer` hook expects (a logit, threshold-comparable with the
|
|
13
|
-
* Fellegi-Sunter weight it replaces).
|
|
14
|
-
*
|
|
15
|
-
* Both take the comparison set as input rather than importing {@link buildDefaultModel}, so this
|
|
16
|
-
* module has no dependency cycle with `resolve.ts`. Feed the comparisons from
|
|
17
|
-
* `buildDefaultModel({ collapseSpatial: true, addressFrequency })`, since that config fixes the
|
|
18
|
-
* feature layout.
|
|
19
|
-
*/
|
|
20
|
-
import { agreementPattern, gbtScore, nameSimilarity, } from "@mailwoman/match";
|
|
21
|
-
/**
|
|
22
|
-
* Similarity at which two official names count as the same organization.
|
|
23
|
-
*
|
|
24
|
-
* Set high because the feature is a near-exact agreement signal rather than a fuzzy one.
|
|
25
|
-
*/
|
|
26
|
-
const OFFICIAL_NAME_AGREEMENT = 0.93;
|
|
27
|
-
/**
|
|
28
|
-
* Build the per-pair feature extractor.
|
|
29
|
-
*
|
|
30
|
-
* The vector is: one-hot of each comparison's agreement level, then the two over-merge
|
|
31
|
-
* interaction terms (spatial-exact × name-disagree, spatial-exact × org-disagree,
|
|
32
|
-
* the "same place, different names" signature that drives co-located over-merges),
|
|
33
|
-
* then address crowdedness scaled into [0, 1].
|
|
34
|
-
* Deterministic and EM-independent, so it is identical across train / eval / inference.
|
|
35
|
-
*/
|
|
36
|
-
export function createMatchFeaturizer(config) {
|
|
37
|
-
const { comparisons, addressFrequency } = config;
|
|
38
|
-
const levelCounts = comparisons.map((c) => c.levels.length);
|
|
39
|
-
const index = Object.fromEntries(comparisons.map((c, i) => [c.name, i]));
|
|
40
|
-
const spatialI = index["spatial"];
|
|
41
|
-
const givenI = index["given"];
|
|
42
|
-
const familyI = index["family"];
|
|
43
|
-
const orgI = index["organization"];
|
|
44
|
-
const lastLevel = (i) => levelCounts[i] - 1;
|
|
45
|
-
return (a, b) => {
|
|
46
|
-
const pat = agreementPattern(comparisons, a, b);
|
|
47
|
-
const f = [];
|
|
48
|
-
for (let i = 0; i < pat.length; i++) {
|
|
49
|
-
const lvl = pat[i];
|
|
50
|
-
for (let l = 0; l < levelCounts[i]; l++) {
|
|
51
|
-
f.push(lvl === l ? 1 : 0);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
const spatialExact = spatialI !== undefined && pat[spatialI] === 0 ? 1 : 0;
|
|
55
|
-
const nameDisagree = givenI !== undefined &&
|
|
56
|
-
familyI !== undefined &&
|
|
57
|
-
pat[givenI] === lastLevel(givenI) &&
|
|
58
|
-
pat[familyI] === lastLevel(familyI)
|
|
59
|
-
? 1
|
|
60
|
-
: 0;
|
|
61
|
-
const orgDisagree = orgI !== undefined && pat[orgI] === lastLevel(orgI) ? 1 : 0;
|
|
62
|
-
f.push(spatialExact * nameDisagree);
|
|
63
|
-
f.push(spatialExact * orgDisagree);
|
|
64
|
-
const freq = a.address?.raw ? addressFrequency.frequency(a.address.raw) : 0;
|
|
65
|
-
f.push(Math.min(1, freq * 1000));
|
|
66
|
-
// Roll-up signature: a shared corporate address can host differently-branded
|
|
67
|
-
// operating entities whose authorized official also agrees.
|
|
68
|
-
// The official is not in the comparison set, so these three features express that evidence directly.
|
|
69
|
-
// They are appended at the end, so models trained without them keep scoring unchanged.
|
|
70
|
-
const offA = a.attributes?.["authorizedOfficial"]?.trim();
|
|
71
|
-
const offB = b.attributes?.["authorizedOfficial"]?.trim();
|
|
72
|
-
const officialAgree = offA && offB && nameSimilarity(offA, offB) >= OFFICIAL_NAME_AGREEMENT ? 1 : 0;
|
|
73
|
-
f.push(officialAgree);
|
|
74
|
-
f.push(officialAgree * orgDisagree);
|
|
75
|
-
f.push(officialAgree * orgDisagree * spatialExact);
|
|
76
|
-
return f;
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Wrap a trained {@link GBT} into the `(a, b) => number` link scorer for {@link ResolveConfig.scorer}.
|
|
81
|
-
*
|
|
82
|
-
* The returned weight is the model's logit.
|
|
83
|
-
* Same threshold-comparable units as the Fellegi-Sunter weight it replaces,
|
|
84
|
-
* so the pipeline's clustering + threshold semantics are unchanged.
|
|
85
|
-
*/
|
|
86
|
-
export function createGBTScorer(config) {
|
|
87
|
-
const featurize = createMatchFeaturizer(config);
|
|
88
|
-
const { model } = config;
|
|
89
|
-
return (a, b) => gbtScore(model, featurize(a, b));
|
|
90
|
-
}
|
|
91
|
-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I,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC,CAAA;QAChC,6EAA6E;QAC7E,4DAA4D;QAC5D,qGAAqG;QACrG,uFAAuF;QACvF,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAA;QACzD,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAA;QACzD,MAAM,aAAa,GAAG,IAAI,IAAI,IAAI,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACnG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QACrB,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,CAAA;QACnC,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC,CAAA;QAElD,OAAO,CAAC,CAAA;IACT,CAAC,CAAA;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC9B,MAA6C;IAE7C,MAAM,SAAS,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAC/C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAExB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAClD,CAAC"}
|
package/out/map-html.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import type { GeoFeatureCollection, PointLiteral } from "@mailwoman/spatial";
|
|
7
|
-
import type { MapFeatureData } from "#types";
|
|
8
|
-
/**
|
|
9
|
-
* Protomaps stock flavors (shipped by `@protomaps/basemaps`).
|
|
10
|
-
*/
|
|
11
|
-
export type MapFlavor = "light" | "dark" | "white" | "grayscale" | "black";
|
|
12
|
-
/**
|
|
13
|
-
* Options for {@link toMapHTML}.
|
|
14
|
-
*
|
|
15
|
-
* With `colorBy: "auto"`, markers are colored by `bucket` when any feature has one
|
|
16
|
-
* and otherwise by whether two or more sources agree.
|
|
17
|
-
*/
|
|
18
|
-
export interface MapHTMLOptions {
|
|
19
|
-
/**
|
|
20
|
-
* Sets the document title and on-map heading, defaulting to `Mailwoman — resolved entities`.
|
|
21
|
-
*/
|
|
22
|
-
title?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Selects the Protomaps basemap flavor, defaulting to `light`, which keeps contrast with the markers.
|
|
25
|
-
*/
|
|
26
|
-
flavor?: MapFlavor;
|
|
27
|
-
/**
|
|
28
|
-
* Chooses marker colors: `bucket` uses the `bucket` property, `sources` shows
|
|
29
|
-
* whether two or more sources are linked.
|
|
30
|
-
* The default `auto` picks `bucket` when any feature has one.
|
|
31
|
-
*/
|
|
32
|
-
colorBy?: "auto" | "sources" | "bucket";
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Renders a {@link toGeoJSON} or reconciliation feature collection as a standalone MapLibre
|
|
36
|
-
* HTML document, with an empty-state panel when the collection has no features.
|
|
37
|
-
*/
|
|
38
|
-
export declare function toMapHTML(geojson: GeoFeatureCollection<PointLiteral, MapFeatureData>, options?: MapHTMLOptions): string;
|
|
39
|
-
//# sourceMappingURL=map-html.d.ts.map
|
package/out/map-html.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"map-html.d.ts","sourceRoot":"","sources":["../lib/map-html.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAa5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAA;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;CACvC;AAgBD;;;GAGG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,oBAAoB,CAAC,YAAY,EAAE,cAAc,CAAC,EAC3D,OAAO,GAAE,cAAmB,GAC1B,MAAM,CAmNR"}
|
package/out/map-html.js
DELETED
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Sister Software
|
|
3
|
-
* @license AGPL-3.0
|
|
4
|
-
* @author Teffen Ellis, et al.
|
|
5
|
-
*/
|
|
6
|
-
import { stringifyJSON } from "@mailwoman/core/json";
|
|
7
|
-
import { escapeHTML } from "@mailwoman/core/strings/escape";
|
|
8
|
-
import { layers, namedFlavor } from "@protomaps/basemaps";
|
|
9
|
-
const MAPLIBRE_VERSION = "5.24.0";
|
|
10
|
-
const MAPLIBRE_JS_SRI = "sha384-5+cfbwT0iiub6VsQAdn6yz16nr6sDiQoHx6tm4O8OVYXHYOxcffFmCJBL0dgdvGp";
|
|
11
|
-
const MAPLIBRE_CSS_SRI = "sha384-uTttxo/aOKbdE5RlD/SPzSDoDmNvGlUYPjONi2MN/b7c9HPSvW07OIuyP7uL6jxK";
|
|
12
|
-
const BASEMAP_SOURCE_ID = "basemap-v4";
|
|
13
|
-
const BASEMAP_TILEJSON_URL = "https://tiles.mailwoman.ai/basemap-v4.json";
|
|
14
|
-
// The glyph mirror and its Bliss Pro stacks, as `@mailwoman/cartographer/styles/fonts` documents them.
|
|
15
|
-
const GLYPHS_URL = "https://public.mailwoman.ai/protomaps/fonts/{fontstack}/{range}.pbf";
|
|
16
|
-
const MAP_FONTS = { regular: "Bliss Pro Regular", bold: "Bliss Pro Medium", italic: "Bliss Pro Italic" };
|
|
17
|
-
const SPRITE_URL = "https://protomaps.github.io/basemaps-assets/sprites/v4/light";
|
|
18
|
-
const PALETTE = ["#2f9e44", "#f08c00", "#1971c2", "#e8590c", "#9c36b5", "#0c8599", "#e03131", "#5c940d"];
|
|
19
|
-
const SINGLE_COLOR = "#3388ff";
|
|
20
|
-
const CROSS_COLOR = "#e8590c";
|
|
21
|
-
function safeJSONForScript(value) {
|
|
22
|
-
return stringifyJSON(value).replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026");
|
|
23
|
-
}
|
|
24
|
-
function sourceCount(props) {
|
|
25
|
-
return Array.isArray(props["sources"]) ? props["sources"].length : 0;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Renders a {@link toGeoJSON} or reconciliation feature collection as a standalone MapLibre
|
|
29
|
-
* HTML document, with an empty-state panel when the collection has no features.
|
|
30
|
-
*/
|
|
31
|
-
export function toMapHTML(geojson, options = {}) {
|
|
32
|
-
const title = options.title ?? "Mailwoman — resolved entities";
|
|
33
|
-
const flavorName = options.flavor ?? "light";
|
|
34
|
-
const colorBy = options.colorBy ?? "auto";
|
|
35
|
-
const hasBuckets = geojson.features.some((f) => f.properties?.["bucket"] != null);
|
|
36
|
-
const mode = colorBy === "auto" ? (hasBuckets ? "bucket" : "sources") : colorBy;
|
|
37
|
-
const bucketColors = {};
|
|
38
|
-
if (mode === "bucket") {
|
|
39
|
-
let i = 0;
|
|
40
|
-
for (const f of geojson.features) {
|
|
41
|
-
const b = f.properties?.["bucket"] ? String(f.properties["bucket"]) : "—";
|
|
42
|
-
if (!(b in bucketColors)) {
|
|
43
|
-
bucketColors[b] = PALETTE[i++ % PALETTE.length];
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const colorFor = (props) => {
|
|
48
|
-
if (mode === "bucket") {
|
|
49
|
-
const b = props["bucket"] ? String(props["bucket"]) : "—";
|
|
50
|
-
return bucketColors[b] ?? SINGLE_COLOR;
|
|
51
|
-
}
|
|
52
|
-
return sourceCount(props) >= 2 ? CROSS_COLOR : SINGLE_COLOR;
|
|
53
|
-
};
|
|
54
|
-
let minLng = Infinity;
|
|
55
|
-
let minLat = Infinity;
|
|
56
|
-
let maxLng = -Infinity;
|
|
57
|
-
let maxLat = -Infinity;
|
|
58
|
-
const features = geojson.features.map((f) => {
|
|
59
|
-
const [lng, lat] = f.geometry.coordinates;
|
|
60
|
-
if (lng < minLng) {
|
|
61
|
-
minLng = lng;
|
|
62
|
-
}
|
|
63
|
-
if (lat < minLat) {
|
|
64
|
-
minLat = lat;
|
|
65
|
-
}
|
|
66
|
-
if (lng > maxLng) {
|
|
67
|
-
maxLng = lng;
|
|
68
|
-
}
|
|
69
|
-
if (lat > maxLat) {
|
|
70
|
-
maxLat = lat;
|
|
71
|
-
}
|
|
72
|
-
return { ...f, properties: { ...f.properties, _color: colorFor(f.properties) } };
|
|
73
|
-
});
|
|
74
|
-
const bbox = features.length ? [[minLng, minLat], [maxLng, maxLat]] : null;
|
|
75
|
-
const style = {
|
|
76
|
-
version: 8,
|
|
77
|
-
glyphs: GLYPHS_URL,
|
|
78
|
-
sprite: SPRITE_URL,
|
|
79
|
-
sources: {
|
|
80
|
-
[BASEMAP_SOURCE_ID]: { type: "vector", url: BASEMAP_TILEJSON_URL },
|
|
81
|
-
entities: { type: "geojson", data: { type: "FeatureCollection", features } },
|
|
82
|
-
},
|
|
83
|
-
layers: [
|
|
84
|
-
...layers(BASEMAP_SOURCE_ID, { ...namedFlavor(flavorName), ...MAP_FONTS }, { lang: "en" }),
|
|
85
|
-
{
|
|
86
|
-
id: "mw-entities",
|
|
87
|
-
type: "circle",
|
|
88
|
-
source: "entities",
|
|
89
|
-
paint: {
|
|
90
|
-
"circle-radius": [
|
|
91
|
-
"interpolate",
|
|
92
|
-
["linear"],
|
|
93
|
-
["coalesce", ["get", "recordCount"], 1],
|
|
94
|
-
1,
|
|
95
|
-
5,
|
|
96
|
-
5,
|
|
97
|
-
9,
|
|
98
|
-
25,
|
|
99
|
-
15,
|
|
100
|
-
100,
|
|
101
|
-
22,
|
|
102
|
-
],
|
|
103
|
-
"circle-color": ["get", "_color"],
|
|
104
|
-
"circle-stroke-color": "#ffffff",
|
|
105
|
-
"circle-stroke-width": 1.2,
|
|
106
|
-
"circle-opacity": 0.9,
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
],
|
|
110
|
-
};
|
|
111
|
-
const legendRows = mode === "bucket"
|
|
112
|
-
? Object.entries(bucketColors)
|
|
113
|
-
.map(([b, c]) => `<div><i style="background:${c}"></i>${escapeHTML(b)}</div>`)
|
|
114
|
-
.join("")
|
|
115
|
-
: `<div><i style="background:${CROSS_COLOR}"></i>cross-dataset link (≥2 sources)</div>` +
|
|
116
|
-
`<div><i style="background:${SINGLE_COLOR}"></i>single-source entity</div>` +
|
|
117
|
-
`<div class="muted" style="margin-top:4px">marker size = records merged</div>`;
|
|
118
|
-
const crossLinks = geojson.features.filter((f) => sourceCount(f.properties) >= 2).length;
|
|
119
|
-
const summary = `${geojson.features.length} entities` + (mode === "sources" ? ` · ${crossLinks} cross-dataset links` : "");
|
|
120
|
-
return `<!doctype html>
|
|
121
|
-
<html lang="en">
|
|
122
|
-
<head>
|
|
123
|
-
<meta charset="utf-8" />
|
|
124
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
125
|
-
<title>${escapeHTML(title)}</title>
|
|
126
|
-
<link
|
|
127
|
-
rel="stylesheet"
|
|
128
|
-
href="https://unpkg.com/maplibre-gl@${MAPLIBRE_VERSION}/dist/maplibre-gl.css"
|
|
129
|
-
integrity="${MAPLIBRE_CSS_SRI}"
|
|
130
|
-
crossorigin="anonymous" />
|
|
131
|
-
<style>
|
|
132
|
-
html, body { margin: 0; height: 100%; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
133
|
-
#map { position: absolute; inset: 0; }
|
|
134
|
-
.mw-panel {
|
|
135
|
-
position: absolute; z-index: 1; background: rgba(255,255,255,0.94); padding: 10px 12px;
|
|
136
|
-
border-radius: 8px; box-shadow: 0 1px 6px rgba(0,0,0,0.3); font-size: 12px; line-height: 1.5; color: #1a1a1a;
|
|
137
|
-
}
|
|
138
|
-
.mw-title { top: 10px; left: 10px; max-width: 60%; }
|
|
139
|
-
.mw-title h1 { font-size: 14px; margin: 0 0 4px; }
|
|
140
|
-
.mw-legend { bottom: 22px; right: 10px; }
|
|
141
|
-
.mw-legend i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 50%; vertical-align: -1px; }
|
|
142
|
-
.muted { color: #666; }
|
|
143
|
-
.mw-popup { font-size: 12px; line-height: 1.5; max-width: 260px; }
|
|
144
|
-
.mw-popup .nm { font-weight: 600; font-size: 13px; }
|
|
145
|
-
.mw-popup dt { color: #666; display: inline; }
|
|
146
|
-
.mw-popup .link { color: ${CROSS_COLOR}; font-weight: 600; }
|
|
147
|
-
.mw-empty { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
|
|
148
|
-
.mw-warn { bottom: 10px; left: 10px; max-width: 52%; background: rgba(255,243,205,0.97); }
|
|
149
|
-
.mw-warn code { background: rgba(0,0,0,0.06); padding: 0 3px; border-radius: 3px; }
|
|
150
|
-
</style>
|
|
151
|
-
</head>
|
|
152
|
-
<body>
|
|
153
|
-
<div id="map"></div>
|
|
154
|
-
<div class="mw-panel mw-title"><h1>${escapeHTML(title)}</h1><div class="muted">${summary}</div></div>
|
|
155
|
-
${features.length ? `<div class="mw-panel mw-legend">${legendRows}</div>` : `<div class="mw-empty"><div class="mw-panel"><h1>${escapeHTML(title)}</h1><div class="muted">No geocoded entities to display.</div></div></div>`}
|
|
156
|
-
<script
|
|
157
|
-
src="https://unpkg.com/maplibre-gl@${MAPLIBRE_VERSION}/dist/maplibre-gl.js"
|
|
158
|
-
integrity="${MAPLIBRE_JS_SRI}"
|
|
159
|
-
crossorigin="anonymous"></script>
|
|
160
|
-
<script>
|
|
161
|
-
"use strict";
|
|
162
|
-
var STYLE = ${safeJSONForScript(style)};
|
|
163
|
-
var BBOX = ${safeJSONForScript(bbox)};
|
|
164
|
-
|
|
165
|
-
function esc(v) {
|
|
166
|
-
if (v === null || v === undefined) return "";
|
|
167
|
-
return String(v).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function popupHTML(p) {
|
|
171
|
-
var rows = [];
|
|
172
|
-
var heading = p.name || p.organization || p.entityID || "entity";
|
|
173
|
-
rows.push('<div class="nm">' + esc(heading) + '</div>');
|
|
174
|
-
if (p.organization && p.organization !== p.name) rows.push('<div>' + esc(p.organization) + '</div>');
|
|
175
|
-
if (p.address) rows.push('<div class="muted">' + esc(p.address) + '</div>');
|
|
176
|
-
rows.push('<hr style="border:none;border-top:1px solid #eee;margin:6px 0" />');
|
|
177
|
-
rows.push('<div><dt>records merged:</dt> ' + esc(p.recordCount) + '</div>');
|
|
178
|
-
var srcs = Array.isArray(p.sources) ? p.sources : [];
|
|
179
|
-
if (srcs.length) {
|
|
180
|
-
var cls = srcs.length >= 2 ? ' class="link"' : '';
|
|
181
|
-
rows.push('<div><dt>sources:</dt> <span' + cls + '>' + esc(srcs.join(", ")) + '</span>'
|
|
182
|
-
+ (srcs.length >= 2 ? ' (cross-dataset link)' : '') + '</div>');
|
|
183
|
-
}
|
|
184
|
-
if (p.bucket !== null && p.bucket !== undefined) rows.push('<div><dt>bucket:</dt> ' + esc(p.bucket) + '</div>');
|
|
185
|
-
if (p.cohesion !== null && p.cohesion !== undefined) rows.push('<div><dt>cohesion:</dt> ' + esc(p.cohesion) + ' bits</div>');
|
|
186
|
-
if (p.geocodeTier) rows.push('<div><dt>geocode tier:</dt> ' + esc(p.geocodeTier) + '</div>');
|
|
187
|
-
return '<div class="mw-popup">' + rows.join("") + '</div>';
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
var map = new maplibregl.Map({ container: "map", style: STYLE, center: [-98, 39], zoom: 3, attributionControl: { compact: true } });
|
|
191
|
-
map.addControl(new maplibregl.NavigationControl({ showCompass: false }), "top-right");
|
|
192
|
-
|
|
193
|
-
map.on("load", function () {
|
|
194
|
-
if (BBOX) map.fitBounds(BBOX, { padding: 56, maxZoom: 15, duration: 0 });
|
|
195
|
-
});
|
|
196
|
-
map.on("click", "mw-entities", function (e) {
|
|
197
|
-
var f = e.features && e.features[0];
|
|
198
|
-
if (!f) return;
|
|
199
|
-
new maplibregl.Popup({ closeButton: true }).setLngLat(e.lngLat).setHTML(popupHTML(f.properties || {})).addTo(map);
|
|
200
|
-
});
|
|
201
|
-
map.on("mouseenter", "mw-entities", function () { map.getCanvas().style.cursor = "pointer"; });
|
|
202
|
-
map.on("mouseleave", "mw-entities", function () { map.getCanvas().style.cursor = ""; });
|
|
203
|
-
|
|
204
|
-
// The house basemap tiles are cors-restricted to localhost + the docs domain, so a page opened
|
|
205
|
-
// straight off disk (file://) shows the markers on a blank basemap. Make that explicit rather than
|
|
206
|
-
// silent — the entity positions are correct regardless of whether the basemap paints.
|
|
207
|
-
if (location.protocol === "file:") {
|
|
208
|
-
var warn = document.createElement("div");
|
|
209
|
-
warn.className = "mw-panel mw-warn";
|
|
210
|
-
warn.innerHTML = "⚠ Basemap tiles are blocked from <code>file://</code>. Serve this over "
|
|
211
|
-
+ "<code>http://localhost</code> (e.g. <code>npx serve</code> or <code>python3 -m http.server</code>) "
|
|
212
|
-
+ "to see the map background — the markers are accurate either way.";
|
|
213
|
-
document.body.appendChild(warn);
|
|
214
|
-
}
|
|
215
|
-
</script>
|
|
216
|
-
</body>
|
|
217
|
-
</html>
|
|
218
|
-
`;
|
|
219
|
-
}
|
|
220
|
-
//# sourceMappingURL=map-html.js.map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6
|
-
* The cross-source link scorer, trained on NPI-joined NPPES ↔ Open Payments pairs (the
|
|
7
|
-
* non-circular cross-registry anchor, both public domain). Scores "same provider, different
|
|
8
|
-
* registry text" links the dedup GBT rejects by construction. Generated by
|
|
9
|
-
* scripts/eval/record-matcher/train-cross-gbt.ts. Retrain and re-run rather than editing.
|
|
10
|
-
*/
|
|
11
|
-
import type { GBT } from "@mailwoman/match";
|
|
12
|
-
/**
|
|
13
|
-
* Metadata records the training provenance for {@link CROSS_SOURCE_GBT_MODEL}: seed, split and scores.
|
|
14
|
-
*/
|
|
15
|
-
export declare const CROSS_SOURCE_GBT_META: {
|
|
16
|
-
readonly version: "1.0.0";
|
|
17
|
-
readonly objective: "cross-source-link";
|
|
18
|
-
readonly locale: "en-US";
|
|
19
|
-
readonly trainedOn: "2026-07-06";
|
|
20
|
-
readonly state: "TX";
|
|
21
|
-
readonly npis: 1954;
|
|
22
|
-
readonly records: 3908;
|
|
23
|
-
readonly pairs: 175200;
|
|
24
|
-
readonly posRate: 0.0109;
|
|
25
|
-
readonly precisionBar: 0.95;
|
|
26
|
-
readonly holdoutBarRecall: 1;
|
|
27
|
-
readonly holdoutF1Max: 0.9916;
|
|
28
|
-
readonly hyperparams: {
|
|
29
|
-
readonly rounds: 120;
|
|
30
|
-
readonly depth: 3;
|
|
31
|
-
readonly lr: 0.3;
|
|
32
|
-
readonly minLeaf: 20;
|
|
33
|
-
};
|
|
34
|
-
readonly recommendedThreshold: -1.5259;
|
|
35
|
-
readonly features: 17;
|
|
36
|
-
readonly sources: readonly ["nppes", "openpayments"];
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Gradient-boosted trees scoring person matches across sources.
|
|
40
|
-
*
|
|
41
|
-
* Generated by `registry/tools/train-cross-gbt.ts`.
|
|
42
|
-
* Do not hand-edit.
|
|
43
|
-
*/
|
|
44
|
-
export declare const CROSS_SOURCE_GBT_MODEL: GBT;
|
|
45
|
-
//# sourceMappingURL=crosssource-gbt-en-us.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"crosssource-gbt-en-us.d.ts","sourceRoot":"","sources":["../../lib/models/crosssource-gbt-en-us.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,qBAAqB;aACjC,OAAO,EAAE,OAAO;aAChB,SAAS,EAAE,mBAAmB;aAC9B,MAAM,EAAE,OAAO;aACf,SAAS,EAAE,YAAY;aACvB,KAAK,EAAE,IAAI;aACX,IAAI,EAAE,IAAI;aACV,OAAO,EAAE,IAAI;aACb,KAAK,EAAE,MAAO;aACd,OAAO,EAAE,MAAM;aACf,YAAY,EAAE,IAAI;aAClB,gBAAgB,EAAE,CAAC;aACnB,YAAY,EAAE,MAAM;aACpB,WAAW;iBAAI,MAAM,EAAE,GAAG;iBAAE,KAAK,EAAE,CAAC;iBAAE,EAAE,EAAE,GAAG;iBAAE,OAAO,EAAE,EAAE;;aAC1D,oBAAoB,EAAE,CAAC,MAAM;aAC7B,QAAQ,EAAE,EAAE;aACZ,OAAO,YAAG,OAAO,EAAE,cAAc;CACxB,CAAA;AAGV;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,EAAE,GAA6l5C,CAAA"}
|