@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.
Files changed (235) hide show
  1. package/README.md +3 -3
  2. package/lib/address-key.ts +14 -12
  3. package/lib/geocode-handler.ts +6 -5
  4. package/lib/geojson.ts +8 -8
  5. package/lib/index.ts +8 -8
  6. package/lib/ingest.ts +5 -4
  7. package/lib/learned-scorer.ts +16 -17
  8. package/lib/map-html.ts +2 -5
  9. package/lib/models/crosssource-gbt-en-us.ts +8 -7
  10. package/lib/models/dedup-gbt-en-us.ts +9 -6
  11. package/lib/models/org-crosssource-gbt-en-us.ts +8 -7
  12. package/lib/reconcile.ts +3 -0
  13. package/lib/resolve.ts +5 -6
  14. package/lib/types.ts +5 -6
  15. package/out/address-key.d.ts +11 -12
  16. package/out/address-key.d.ts.map +1 -1
  17. package/out/address-key.js +13 -12
  18. package/out/address-key.js.map +1 -1
  19. package/out/geocode-handler.d.ts +3 -5
  20. package/out/geocode-handler.d.ts.map +1 -1
  21. package/out/geocode-handler.js +5 -5
  22. package/out/geocode-handler.js.map +1 -1
  23. package/out/geojson.d.ts +0 -11
  24. package/out/geojson.d.ts.map +1 -1
  25. package/out/geojson.js +7 -8
  26. package/out/geojson.js.map +1 -1
  27. package/out/index.d.ts +5 -8
  28. package/out/index.d.ts.map +1 -1
  29. package/out/index.js +7 -8
  30. package/out/index.js.map +1 -1
  31. package/out/ingest.d.ts +0 -7
  32. package/out/ingest.d.ts.map +1 -1
  33. package/out/ingest.js +4 -4
  34. package/out/ingest.js.map +1 -1
  35. package/out/learned-scorer.d.ts +11 -15
  36. package/out/learned-scorer.d.ts.map +1 -1
  37. package/out/learned-scorer.js +15 -17
  38. package/out/learned-scorer.js.map +1 -1
  39. package/out/map-html.d.ts +0 -5
  40. package/out/map-html.d.ts.map +1 -1
  41. package/out/map-html.js +2 -5
  42. package/out/map-html.js.map +1 -1
  43. package/out/models/crosssource-gbt-en-us.d.ts +5 -7
  44. package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
  45. package/out/models/crosssource-gbt-en-us.js +2 -10
  46. package/out/models/crosssource-gbt-en-us.js.map +1 -1
  47. package/out/models/dedup-gbt-en-us.d.ts +6 -6
  48. package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
  49. package/out/models/dedup-gbt-en-us.js +2 -11
  50. package/out/models/dedup-gbt-en-us.js.map +1 -1
  51. package/out/models/org-crosssource-gbt-en-us.d.ts +5 -7
  52. package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
  53. package/out/models/org-crosssource-gbt-en-us.js +2 -10
  54. package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
  55. package/out/reconcile.d.ts.map +1 -1
  56. package/out/reconcile.js +2 -0
  57. package/out/reconcile.js.map +1 -1
  58. package/out/resolve.d.ts +1 -5
  59. package/out/resolve.d.ts.map +1 -1
  60. package/out/resolve.js +3 -5
  61. package/out/resolve.js.map +1 -1
  62. package/out/tools/address-pairs/grade.d.ts +74 -0
  63. package/out/tools/address-pairs/grade.d.ts.map +1 -0
  64. package/out/tools/address-pairs/grade.js +184 -0
  65. package/out/tools/address-pairs/grade.js.map +1 -0
  66. package/out/tools/address-pairs/sample.d.ts +137 -0
  67. package/out/tools/address-pairs/sample.d.ts.map +1 -0
  68. package/out/tools/address-pairs/sample.js +262 -0
  69. package/out/tools/address-pairs/sample.js.map +1 -0
  70. package/out/tools/coverage-reconciliation.d.ts +0 -21
  71. package/out/tools/coverage-reconciliation.d.ts.map +1 -1
  72. package/out/tools/coverage-reconciliation.js +10 -11
  73. package/out/tools/coverage-reconciliation.js.map +1 -1
  74. package/out/tools/cross/dataset-correlation.d.ts +0 -5
  75. package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
  76. package/out/tools/cross/dataset-correlation.js +2 -5
  77. package/out/tools/cross/dataset-correlation.js.map +1 -1
  78. package/out/tools/cross/source-threshold-sweep.d.ts +0 -12
  79. package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -1
  80. package/out/tools/cross/source-threshold-sweep.js +13 -13
  81. package/out/tools/cross/source-threshold-sweep.js.map +1 -1
  82. package/out/tools/dedup-ceiling.d.ts +0 -19
  83. package/out/tools/dedup-ceiling.d.ts.map +1 -1
  84. package/out/tools/dedup-ceiling.js +14 -13
  85. package/out/tools/dedup-ceiling.js.map +1 -1
  86. package/out/tools/eval-geocoder.d.ts +6 -8
  87. package/out/tools/eval-geocoder.d.ts.map +1 -1
  88. package/out/tools/eval-geocoder.js +2 -11
  89. package/out/tools/eval-geocoder.js.map +1 -1
  90. package/out/tools/geocoder/namesake-probe.d.ts +0 -13
  91. package/out/tools/geocoder/namesake-probe.d.ts.map +1 -1
  92. package/out/tools/geocoder/namesake-probe.js +8 -8
  93. package/out/tools/geocoder/namesake-probe.js.map +1 -1
  94. package/out/tools/geocoder/vs-provided-coords.d.ts +0 -17
  95. package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -1
  96. package/out/tools/geocoder/vs-provided-coords.js +10 -10
  97. package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
  98. package/out/tools/gold-set-sample.d.ts +0 -20
  99. package/out/tools/gold-set-sample.d.ts.map +1 -1
  100. package/out/tools/gold-set-sample.js +11 -12
  101. package/out/tools/gold-set-sample.js.map +1 -1
  102. package/out/tools/learned/scorer/clustering-eval.d.ts +0 -17
  103. package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -1
  104. package/out/tools/learned/scorer/clustering-eval.js +12 -10
  105. package/out/tools/learned/scorer/clustering-eval.js.map +1 -1
  106. package/out/tools/learned/scorer/crossstate-eval.d.ts +0 -17
  107. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -1
  108. package/out/tools/learned/scorer/crossstate-eval.js +11 -10
  109. package/out/tools/learned/scorer/crossstate-eval.js.map +1 -1
  110. package/out/tools/learned/scorer/eval.d.ts +0 -5
  111. package/out/tools/learned/scorer/eval.d.ts.map +1 -1
  112. package/out/tools/learned/scorer/eval.js +2 -5
  113. package/out/tools/learned/scorer/eval.js.map +1 -1
  114. package/out/tools/matcher-scale.d.ts +0 -5
  115. package/out/tools/matcher-scale.d.ts.map +1 -1
  116. package/out/tools/matcher-scale.js +2 -5
  117. package/out/tools/matcher-scale.js.map +1 -1
  118. package/out/tools/nppes/dedup-benchmark.d.ts +0 -10
  119. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
  120. package/out/tools/nppes/dedup-benchmark.js +10 -10
  121. package/out/tools/nppes/dedup-benchmark.js.map +1 -1
  122. package/out/tools/nppes/org-name.d.ts.map +1 -1
  123. package/out/tools/nppes/org-name.js +2 -0
  124. package/out/tools/nppes/org-name.js.map +1 -1
  125. package/out/tools/nppes/overmerge-packet.d.ts +0 -6
  126. package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
  127. package/out/tools/nppes/overmerge-packet.js +2 -3
  128. package/out/tools/nppes/overmerge-packet.js.map +1 -1
  129. package/out/tools/nppes/report.d.ts +0 -5
  130. package/out/tools/nppes/report.d.ts.map +1 -1
  131. package/out/tools/nppes/report.js +2 -5
  132. package/out/tools/nppes/report.js.map +1 -1
  133. package/out/tools/nppes/sample.d.ts +0 -9
  134. package/out/tools/nppes/sample.d.ts.map +1 -1
  135. package/out/tools/nppes/sample.js +6 -7
  136. package/out/tools/nppes/sample.js.map +1 -1
  137. package/out/tools/nppes/scoring.d.ts +0 -3
  138. package/out/tools/nppes/scoring.d.ts.map +1 -1
  139. package/out/tools/nppes/scoring.js +2 -7
  140. package/out/tools/nppes/scoring.js.map +1 -1
  141. package/out/tools/nppes/settings.d.ts +2 -6
  142. package/out/tools/nppes/settings.d.ts.map +1 -1
  143. package/out/tools/nppes/settings.js +2 -8
  144. package/out/tools/nppes/settings.js.map +1 -1
  145. package/out/tools/nppes/truth-grains.d.ts +1 -8
  146. package/out/tools/nppes/truth-grains.d.ts.map +1 -1
  147. package/out/tools/nppes/truth-grains.js +3 -4
  148. package/out/tools/nppes/truth-grains.js.map +1 -1
  149. package/out/tools/shared.d.ts +0 -7
  150. package/out/tools/shared.d.ts.map +1 -1
  151. package/out/tools/shared.js +5 -9
  152. package/out/tools/shared.js.map +1 -1
  153. package/out/tools/train/cross-gbt.d.ts +0 -25
  154. package/out/tools/train/cross-gbt.d.ts.map +1 -1
  155. package/out/tools/train/cross-gbt.js +15 -12
  156. package/out/tools/train/cross-gbt.js.map +1 -1
  157. package/out/tools/train/gbt.d.ts +0 -17
  158. package/out/tools/train/gbt.d.ts.map +1 -1
  159. package/out/tools/train/gbt.js +15 -14
  160. package/out/tools/train/gbt.js.map +1 -1
  161. package/out/tools/train/org-cross-gbt.d.ts +0 -24
  162. package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
  163. package/out/tools/train/org-cross-gbt.js +14 -9
  164. package/out/tools/train/org-cross-gbt.js.map +1 -1
  165. package/out/tools/txhhsc-to-oarow.d.ts +0 -15
  166. package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
  167. package/out/tools/txhhsc-to-oarow.js +4 -6
  168. package/out/tools/txhhsc-to-oarow.js.map +1 -1
  169. package/out/tools/viz/browser.d.ts +0 -10
  170. package/out/tools/viz/browser.d.ts.map +1 -1
  171. package/out/tools/viz/browser.js +4 -4
  172. package/out/tools/viz/browser.js.map +1 -1
  173. package/out/tools/viz/cross-dataset-map.d.ts +0 -8
  174. package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
  175. package/out/tools/viz/cross-dataset-map.js +4 -5
  176. package/out/tools/viz/cross-dataset-map.js.map +1 -1
  177. package/out/tools/viz/geocode-first-surface.d.ts +0 -8
  178. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  179. package/out/tools/viz/geocode-first-surface.js +5 -5
  180. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  181. package/out/tools/viz/render/map.d.ts +0 -21
  182. package/out/tools/viz/render/map.d.ts.map +1 -1
  183. package/out/tools/viz/render/map.js +9 -11
  184. package/out/tools/viz/render/map.js.map +1 -1
  185. package/out/tools/viz/render.d.ts +0 -13
  186. package/out/tools/viz/render.d.ts.map +1 -1
  187. package/out/tools/viz/render.js +9 -9
  188. package/out/tools/viz/render.js.map +1 -1
  189. package/out/tools/viz/source-provenance-map.d.ts +0 -8
  190. package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
  191. package/out/tools/viz/source-provenance-map.js +4 -5
  192. package/out/tools/viz/source-provenance-map.js.map +1 -1
  193. package/out/tools/viz/yardstick-figure.d.ts +0 -5
  194. package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
  195. package/out/tools/viz/yardstick-figure.js +2 -5
  196. package/out/tools/viz/yardstick-figure.js.map +1 -1
  197. package/out/types.d.ts +2 -6
  198. package/out/types.d.ts.map +1 -1
  199. package/out/types.js +2 -8
  200. package/out/types.js.map +1 -1
  201. package/package.json +10 -9
  202. package/tools/address-pairs/grade.ts +277 -0
  203. package/tools/address-pairs/sample.ts +451 -0
  204. package/tools/coverage-reconciliation.ts +11 -11
  205. package/tools/cross/dataset-correlation.ts +2 -5
  206. package/tools/cross/source-threshold-sweep.ts +8 -7
  207. package/tools/dedup-ceiling.ts +15 -13
  208. package/tools/eval-geocoder.ts +9 -8
  209. package/tools/geocoder/namesake-probe.ts +9 -8
  210. package/tools/geocoder/vs-provided-coords.ts +11 -10
  211. package/tools/gold-set-sample.ts +12 -12
  212. package/tools/learned/scorer/clustering-eval.ts +13 -10
  213. package/tools/learned/scorer/crossstate-eval.ts +12 -10
  214. package/tools/learned/scorer/eval.ts +2 -5
  215. package/tools/matcher-scale.ts +2 -5
  216. package/tools/nppes/dedup-benchmark.ts +6 -5
  217. package/tools/nppes/org-name.ts +3 -0
  218. package/tools/nppes/overmerge-packet.ts +3 -3
  219. package/tools/nppes/report.ts +2 -5
  220. package/tools/nppes/sample.ts +7 -7
  221. package/tools/nppes/scoring.ts +3 -3
  222. package/tools/nppes/settings.ts +5 -6
  223. package/tools/nppes/truth-grains.ts +4 -4
  224. package/tools/shared.ts +5 -8
  225. package/tools/train/cross-gbt.ts +16 -12
  226. package/tools/train/gbt.ts +15 -13
  227. package/tools/train/org-cross-gbt.ts +15 -9
  228. package/tools/txhhsc-to-oarow.ts +5 -6
  229. package/tools/viz/browser.ts +5 -4
  230. package/tools/viz/cross-dataset-map.ts +5 -5
  231. package/tools/viz/geocode-first-surface.ts +6 -5
  232. package/tools/viz/render/map.ts +10 -11
  233. package/tools/viz/render.ts +10 -9
  234. package/tools/viz/source-provenance-map.ts +6 -6
  235. package/tools/viz/yardstick-figure.ts +2 -5
@@ -1,16 +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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
+ * Learned-scorer clustering A/B.
6
+ *
7
+ * A better pairwise scorer need not lift the assembled clustering F1, because that
8
+ * F1 depends on the threshold and connected components.
9
+ * This measures the clustering F1 directly.
5
10
  *
6
- * Learned-scorer clustering A/B. A better pairwise scorer need not lift the assembled clustering F1,
7
- * because that F1 depends on the threshold and connected components. This measures the clustering F1
8
- * directly. It splits the NPIs into train and eval, trains a GBT and an LR on train pairs labeled by
9
- * same NPI, then clusters the eval records three ways through the same `resolveEntities` pipeline
10
- * (FS baseline, GBT scorer, LR scorer), sweeping the link threshold for each.
11
+ * It splits the NPIs into train and eval, trains a GBT and an LR on train pairs labeled by
12
+ * same NPI, then clusters the eval records three ways through the same `resolveEntities`
13
+ * pipeline (FS baseline, GBT scorer, LR scorer), sweeping the link threshold for each.
11
14
  *
12
- * The FS arm is the benchmark baseline (same model: address-frequency plus collapsed spatial,
13
- * EM-fit), and the split is in-domain, held out by NPI rather than by state.
15
+ * The FS arm is the benchmark baseline (same model: address-frequency plus collapsed spatial, EM-fit),
16
+ * and the split is in-domain, held out by NPI rather than by state.
14
17
  *
15
18
  * Run: `mailwoman registry scorer-eval clustering [--npis 2000] [--split 0.67] [--seed 1]
16
19
  * [--out-md <md>]`
@@ -1,16 +1,18 @@
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
+ * Learned-scorer cross-state generalization, the next axis after the held-out-NPI A/B.
6
+ *
7
+ * The within-state A/B showed the GBT beats the FS baseline on clustering, so this trains
8
+ * on one state and evaluates clustering F1 on a different state the model never saw.
5
9
  *
6
- * Learned-scorer cross-state generalization, the next axis after the held-out-NPI A/B. The
7
- * within-state A/B showed the GBT beats the FS baseline on clustering, so this trains on one state and
8
- * evaluates clustering F1 on a different state the model never saw.
10
+ * One registry pass builds the global address-frequency table, a train-state sample
11
+ * and an eval-state sample.
12
+ * Both samples are geocoded.
9
13
  *
10
- * One registry pass builds the global address-frequency table, a train-state sample and an
11
- * eval-state sample. Both samples are geocoded. The GBT and LR train on the train state's pairs and
12
- * cluster the eval state's records through the same `resolveEntities` pipeline, with best F1 over a
13
- * fine per-scorer threshold sweep.
14
+ * The GBT and LR train on the train state's pairs and cluster the eval state's records through
15
+ * the same `resolveEntities` pipeline, with best F1 over a fine per-scorer threshold sweep.
14
16
  *
15
17
  * Run: `mailwoman registry scorer-eval cross-state [--train-state TX] [--eval-state CA]
16
18
  * [--npis 2000] [--out-md <md>]`
@@ -1,8 +1,5 @@
1
- /**
2
- * @copyright Sister Software
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 { dataRootPath } from "@mailwoman/core/data-root"
8
5
  import { writeLocalFile } from "@mailwoman/core/fs/writers"
@@ -1,8 +1,5 @@
1
- /**
2
- * @copyright Sister Software
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 { writeLocalFile } from "@mailwoman/core/fs/writers"
8
5
  import { makeLcg } from "@mailwoman/core/random"
@@ -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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
5
  * Builds a varied multi-record set per NPI from real data.
6
+ *
7
7
  * Runs the matcher without NPI values, then scores recovered clusters against the NPI grouping.
8
8
  *
9
- * Run: `mailwoman registry scorer-eval nppes-benchmark [--state TX] [--max-npis 300] [--wof <admin.db>] [--data-root <dir>] [--no-train-em] [--out-md docs/articles/evals/matcher-dedup/<date>-nppes-dedup-benchmark.md]`
9
+ * Run:
10
+ * `mailwoman registry scorer-eval nppes-benchmark [--state TX] [--max-npis 300] [--wof <admin.db>] [--data-root <dir>] [--no-train-em] [--out-md docs/articles/evals/matcher-dedup/<date>-nppes-dedup-benchmark.md]`
10
11
  */
11
12
 
12
13
  import { dataRootPath } from "@mailwoman/core/data-root"
@@ -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
  /**
2
5
  * Jaccard floor at or above which two {@linkcode orgTokens} sets count as the
3
6
  * same organization — the gold-set threshold.
@@ -1,7 +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
5
  * @file Writes the over-merged NPPES clusters with every matcher-visible field for human adjudication.
6
6
  */
7
7
 
@@ -1,8 +1,5 @@
1
- /**
2
- * @copyright Sister Software
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 type { TermFrequencyTable } from "@mailwoman/match"
8
5
 
@@ -1,11 +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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
+ * The NPPES benchmark's input sample: the variation-rich multi-record set per NPI,
6
+ * plus the corpus-wide address-frequency table built in the same pass.
5
7
  *
6
- * The NPPES benchmark's input sample: the variation-rich multi-record set per NPI, plus the
7
- * corpus-wide address-frequency table built in the same pass. One registry pass serves any number
8
- * of states, so the cross-state eval samples two at once.
8
+ * One registry pass serves any number of states, so the cross-state eval samples two at once.
9
9
  */
10
10
 
11
11
  import { isPresent } from "@mailwoman/core/objects"
@@ -183,7 +183,7 @@ export async function buildNPPESStateSamples(
183
183
 
184
184
  // Entity-level (site) truth is the same org and the same physical address.
185
185
  // Subparts (NPPES "Is Organization Subpart" plus parent LBN/TIN) collapse to their parent,
186
- // so the matcher is not charged for correctly fusing one org's subpart-NPIs at a site.
186
+ // so the matcher isn't charged for correctly fusing one org's subpart-NPIs at a site.
187
187
  // An NPI's mailing and practice records stay distinct sites.
188
188
  // `orgKey` is the parent identity for a subpart, else the NPI,
189
189
  // so independent orgs sharing an address stay distinct.
@@ -1,7 +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
5
  * @file Pairwise cluster scoring for the NPPES benchmark — precision/recall/F1 and adjusted Rand of recovered clusters
6
6
  * against a truth labeling, plus the over-merge / under-merge shape counts.
7
7
  */
@@ -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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * The comparison-model setting progression the NPPES benchmark walks, where each row turns one
7
- * setting on so its marginal effect is isolated.
5
+ * The comparison-model setting progression the NPPES benchmark walks, where each
6
+ * row turns one setting on so its marginal effect is isolated.
8
7
  */
9
8
 
10
9
  import type { TermFrequencyTable } from "@mailwoman/match"
@@ -1,7 +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
5
  * @file Defines union-find truth labels that group co-located NPIs for one organization.
6
6
  * One label uses address strings. Another uses a haversine radius. The third uses H3 cells.
7
7
  */
@@ -76,7 +76,7 @@ export function collectPrimaryCoordinates(records: readonly SourceRecord[]): Map
76
76
  * at the same address KEY whose primary org names agree.
77
77
  *
78
78
  * The address-string block provides a conservative lower bound.
79
- * `1504 Taub loop` and `1504 Taub LP STE 100` key apart even though they are one building,
79
+ * `1504 Taub loop` and `1504 Taub LP STE 100` key apart even though they're one building,
80
80
  * so a correct merge across them is still charged as an error.
81
81
  * The coordinate grain below is the tighter reading.
82
82
  *
package/tools/shared.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
  * Shared helpers used by two or more probes in the `registry/tools` probe battery.
7
6
  */
8
7
 
@@ -10,6 +9,7 @@ import { makeDirectories, writeLocalFile } from "@mailwoman/core/fs/writers"
10
9
  import { stringifyJSON } from "@mailwoman/core/json"
11
10
  import { isPresent } from "@mailwoman/core/objects"
12
11
  import { makeLcg } from "@mailwoman/core/random"
12
+ import { SourceHeaderSyntax, spdxHeaderText } from "@mailwoman/core/spdx-header"
13
13
  import { block, gbtScore, trainGBT, type GBTOpts, type TermFrequencyTable } from "@mailwoman/match"
14
14
  import { dirname } from "path-ts"
15
15
 
@@ -723,11 +723,8 @@ export async function trainCrossSourceModel(
723
723
  })
724
724
 
725
725
  const moduleSource =
726
+ spdxHeaderText(SourceHeaderSyntax.Slash) +
726
727
  `/**\n` +
727
- ` * @copyright Sister Software\n` +
728
- ` * @license AGPL-3.0\n` +
729
- ` * @author Teffen Ellis, et al.\n` +
730
- ` *\n` +
731
728
  options.moduleDoc +
732
729
  ` */\n\n` +
733
730
  `import type { GBT } from "@mailwoman/match"\n\n` +
@@ -1,23 +1,27 @@
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
+ * Train the cross-source link scorer.
5
6
  *
6
- * Train the cross-source link scorer. The dedup GBT is trained on within-NPPES labels, so its
7
- * strongest feature (`spatial-exact × name-disagree`) rejects the prototypical cross-source pair,
7
+ * The dedup GBT is trained on within-NPPES labels, so its strongest feature
8
+ * (`spatial-exact × name-disagree`) rejects the prototypical cross-source pair,
8
9
  * the same provider under different operational text across registries.
9
- * CMS Open Payments joins NPPES by NPI. That join provides ground-truth positive pairs labeled by a key the matcher never sees.
10
+ * CMS Open Payments joins NPPES by NPI.
11
+ *
12
+ * That join provides ground-truth positive pairs labeled by a key the matcher never sees.
13
+ *
14
+ * The pipeline assembles NPPES and Open Payments TX records for the same NPI population,
15
+ * then the shared `trainCrossSourceModel` geocodes through the standard ingest and blocks the union.
16
+ * It keeps only cross-source candidate pairs.
10
17
  *
11
- * The pipeline assembles NPPES and Open Payments TX records for the same NPI population, then the
12
- * shared `trainCrossSourceModel` geocodes through the standard ingest and blocks the union. It keeps only
13
- * cross-source candidate pairs. It trains the shipped model into
14
- * `registry/models/crosssource-gbt-en-us.ts`.
18
+ * It trains the shipped model into `registry/models/crosssource-gbt-en-us.ts`.
15
19
  *
16
20
  * Sources (both public domain, `.notes/data-sources.md`):
17
21
  *
18
22
  * - `nppes_npi-registry_*.tsv`: the practice-location and primary-name records.
19
- * - `openpayments_covered-recipient-profile_*.csv`: the OP profile supplement (NPI, profile
20
- * first/last, profile practice address).
23
+ * - `openpayments_covered-recipient-profile_*.csv`: the OP profile supplement
24
+ * (NPI, profile first/last, profile practice address).
21
25
  *
22
26
  * Run: `mailwoman registry train-scorer cross-gbt [--state TX] [--npis 2000]
23
27
  * [--precision-bar 0.95] [--wof <admin.db>] [--data-root <dir>]
@@ -1,16 +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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
+ * Trains the production learned-scorer model.
6
+ *
7
+ * `buildNPPESSample` creates the same NPI-keyed records used by the dedup benchmark and clustering A/B.
8
+ * The sample uses the real registry and includes name drift plus address variation.
5
9
  *
6
- * Trains the production learned-scorer model. `buildNPPESSample` creates the same NPI-keyed records used by
7
- * the dedup benchmark and clustering A/B. The sample uses the real registry and includes name drift plus address variation.
8
- * The trainer geocodes records and groups them into candidate pairs. It featurizes each pair with
9
- * `createMatchFeaturizer`. It labels pairs by NPI and fits a gradient-boosted tree model.
10
+ * The trainer geocodes records and groups them into candidate pairs.
11
+ * It featurizes each pair with `createMatchFeaturizer`.
12
+ *
13
+ * It labels pairs by NPI and fits a gradient-boosted tree model.
10
14
  * It writes the model to the committed package module `registry/models/dedup-gbt-en-us.ts`.
11
15
  *
12
- * Unlike the eval, this trains on all sampled NPIs with no held-out split, since the held-out F1
13
- * is the eval's job.
16
+ * Unlike the eval, this trains on all sampled NPIs with no held-out split,
17
+ * since the held-out F1 is the eval's job.
14
18
  *
15
19
  * Run: `mailwoman registry train-scorer gbt [--state TX] [--npis 3000] [--wof <admin.db>]
16
20
  * [--data-root <dir>] [--out registry/models/dedup-gbt-en-us.ts]`
@@ -20,6 +24,7 @@ import { dataRootPath } from "@mailwoman/core/data-root"
20
24
  import { makeDirectories, writeLocalFile } from "@mailwoman/core/fs/writers"
21
25
  import { prettyJSON, stringifyJSON } from "@mailwoman/core/json"
22
26
  import { makeLcg } from "@mailwoman/core/random"
27
+ import { SourceHeaderSyntax, spdxHeaderText } from "@mailwoman/core/spdx-header"
23
28
  import { isoDate } from "@mailwoman/core/utils"
24
29
  import { block, gbtScore, trainGBT } from "@mailwoman/match"
25
30
  import { dirname } from "path-ts"
@@ -235,11 +240,8 @@ export async function trainDedupGBT(
235
240
  }
236
241
 
237
242
  const moduleSource =
243
+ spdxHeaderText(SourceHeaderSyntax.Slash) +
238
244
  `/**\n` +
239
- ` * @copyright Sister Software\n` +
240
- ` * @license AGPL-3.0\n` +
241
- ` * @author Teffen Ellis, et al.\n` +
242
- ` *\n` +
243
245
  ` * GENERATED by \`mailwoman registry train-scorer gbt\` (registry/tools/train-gbt.ts) — DO NOT edit by hand; retrain to update.\n` +
244
246
  ` *\n` +
245
247
  ` * The default learned-scorer model (#603): a gradient-boosted-tree dedup scorer trained on the\n` +
@@ -1,17 +1,23 @@
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
+ * Train the organization-level cross-source link scorer.
6
+ *
7
+ * The practitioner cross-source GBT doesn't transfer to organization records
8
+ * because its person-name features go dark.
9
+ * The organization cross-dataset flows therefore pin the FS baseline.
5
10
  *
6
- * Train the organization-level cross-source link scorer. The practitioner cross-source GBT does
7
- * not transfer to organization records because its person-name features go dark. The organization
8
- * cross-dataset flows therefore pin the FS baseline. CMS Provider of Services joins Care Compare
9
- * by CCN. Each system represents the same facility and maintains its name and address separately.
11
+ * CMS Provider of Services joins Care Compare by CCN.
12
+ * Each system represents the same facility and maintains its name and address separately.
13
+ *
14
+ * The pipeline runs a national CCN join into one record per source per facility,
15
+ * then the shared `trainCrossSourceModel` geocodes the rows and blocks the union.
16
+ * It keeps cross-source pairs.
10
17
  *
11
- * The pipeline runs a national CCN join into one record per source per facility, then the shared
12
- * `trainCrossSourceModel` geocodes the rows and blocks the union. It keeps cross-source pairs.
13
18
  * It featurizes them with the shared featurizer and labels them by CCN.
14
19
  * Calibration uses held-out CCNs.
20
+ *
15
21
  * The function emits `registry/models/org-crosssource-gbt-en-us.ts`.
16
22
  *
17
23
  * Sources (both public domain, direct CSVs):
@@ -1,15 +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
  * Convert the TX hhsc nursing-facilities source into the OaRow jsonl the resolver eval consumes.
7
6
  * The source ships an authoritative `Geo Location` = `lat,lon` per facility, so the geocoder is
8
7
  * graded against the provided coordinates on real facility addresses. `oa-resolver-eval
9
8
  * --address-points` reports a great-circle delta and a tier breakdown.
10
9
  *
11
- * Neutral scope: this measures geocoder accuracy on real public addresses and makes no claim about
12
- * the facilities themselves.
10
+ * Neutral scope: this measures geocoder accuracy on real public addresses
11
+ * and makes no claim about the facilities themselves.
13
12
  *
14
13
  * Run: `mailwoman registry convert tx-hhsc [--src <tsv>] [--out /tmp/txhhsc-oarow.jsonl]`
15
14
  */
@@ -1,11 +1,12 @@
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
  * This module configures the shared browser for Plotly and MapLibre rendering.
6
+ *
7
7
  * SwiftShader supplies WebGL without a hardware GPU.
8
8
  * Each caller owns navigation, readiness checks, and screenshots.
9
+ *
9
10
  * The browser package loads Playwright and stealth plugins when a session starts.
10
11
  */
11
12
 
@@ -1,9 +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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
5
  * Render linked entities from a GeoJSON file in MapLibre, colored by source combination.
6
+ *
7
7
  * `crossAgencyOnly` removes links whose sources belong to one agency.
8
8
  */
9
9
 
@@ -54,7 +54,7 @@ const label = (s: string) => SOURCE_LABELS[s] ?? s
54
54
  * Which agency each source belongs to.
55
55
  *
56
56
  * The two FCC datasets (RHC posted-services + commitments) are one agency.
57
- * So an NPPES↔FCC or FCC↔TX link is cross-agency, but an RHC↔commitments link is not.
57
+ * So an NPPES↔FCC or FCC↔TX link is cross-agency, but an RHC↔commitments link isn't.
58
58
  *
59
59
  * `--cross-agency-only` keeps only the entities whose sources span >1 agency: the harder,
60
60
  * more striking "no shared key across agencies" subset (most of the raw links are FCC-internal).
@@ -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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
+ * Plot string-only and string-plus-distance match probabilities using the
6
+ * record matcher's Fellegi-Sunter weights.
5
7
  *
6
- * Plot string-only and string-plus-distance match probabilities using the record matcher's
7
- * Fellegi-Sunter weights. The supplied prior is illustrative and the output is self-contained html.
8
+ * The supplied prior is illustrative and the output is self-contained html.
8
9
  */
9
10
 
10
11
  import { tempRootPath } from "@mailwoman/core/data-root"
@@ -1,23 +1,22 @@
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
- * Render a {@link toMapHTML} page (MapLibre GL + Protomaps basemap) to a PNG via headless Chromium
7
- * — the shared map renderer behind the `registry viz` map figures (an internal helper rather than a
8
- * command).
5
+ * Render a {@link toMapHTML} page (MapLibre GL + Protomaps basemap) to a PNG
6
+ * via headless Chromium — the shared map renderer behind the `registry viz` map
7
+ * figures (an internal helper rather than a command).
9
8
  *
10
9
  * Two house-stack constraints make this fiddlier than the Plotly/SVG renderers:
11
10
  *
12
- * - MapLibre needs a real WebGL context — the shared harness (`./browser.ts`) provides one through
13
- * SwiftShader.
11
+ * - MapLibre needs a real WebGL context — the shared harness (`./browser.ts`)
12
+ * provides one through SwiftShader.
14
13
  * - The basemap tiles come from `tiles.mailwoman.post`, which cors-restricts to localhost + the docs
15
14
  * domains . Therefore, the page must be served over localhost rather than opened as a file (a file:// page
16
15
  * renders accurate markers on a blank basemap). Serve the output dir first, e.g. `python3 -m
17
16
  * http.server 8899 -d <dir>`, then point this at `http://localhost:8899/<page>.html`.
18
17
  *
19
- * The map paints asynchronously after the network settles. we wait for networkidle, then a fixed
20
- * beat for the basemap tiles + marker layer to finish compositing.
18
+ * The map paints asynchronously after the network settles. we wait for networkidle,
19
+ * then a fixed beat for the basemap tiles + marker layer to finish compositing.
21
20
  */
22
21
 
23
22
  import { withChromiumPage } from "#tools/viz/browser"
@@ -1,15 +1,16 @@
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
+ * Render a self-contained Plotly html to a PNG via headless Chromium — the shared renderer
6
+ * behind the `registry viz` figures (an internal helper rather than a command).
5
7
  *
6
- * Render a self-contained Plotly html to a PNG via headless Chromium — the shared renderer behind
7
- * the `registry viz` figures (an internal helper rather than a command).
8
+ * Plotly 3D (`surface`/`scatter3d`) needs a real WebGL context.
9
+ * The shared harness (`./browser.ts`) provides through SwiftShader. 2D traces
10
+ * (`contour`/`heatmap`) render on the 2D canvas regardless.
8
11
  *
9
- * Plotly 3D (`surface`/`scatter3d`) needs a real WebGL context. The shared harness
10
- * (`./browser.ts`) provides through SwiftShader. 2D traces (`contour`/`heatmap`) render on the 2D
11
- * canvas regardless. We wait for Plotly's `plotly_afterplot` to fire on every graph div rather
12
- * than a fixed sleep, so the screenshot can't race the (async) WebGL paint.
12
+ * We wait for Plotly's `plotly_afterplot` to fire on every graph div rather than a
13
+ * fixed sleep, so the screenshot can't race the (async) WebGL paint.
13
14
  */
14
15
 
15
16
  import { pathToFileURL } from "@mailwoman/core/module/file-url"
@@ -1,10 +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
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
5
  * Sample `address_point.source` rows from a state database and render them by source in MapLibre.
7
- * The output requires an http origin because the tile server does not serve `file:` origins.
6
+ *
7
+ * The output requires an http origin because the tile server doesn't serve `file:` origins.
8
8
  */
9
9
 
10
10
  import { tempRootPath } from "@mailwoman/core/data-root"
@@ -77,7 +77,7 @@ function categorize(source: string): { bucket: string; publisher: string } {
77
77
 
78
78
  // Must stay a type alias. Rows come back from the driver as `Record<string, SQLOutputValue>[]` and
79
79
  // are asserted to `Row[]`; an object type alias includes an implicit index signature that makes that
80
- // assertion legal, an interface does not.
80
+ // assertion legal, an interface doesn't.
81
81
  // oxlint-disable-next-line typescript/consistent-type-definitions -- needs the implicit index signature
82
82
  type Row = { lat: number; lon: number; source: string; number: string | null; street_raw: string | null }
83
83
 
@@ -1,8 +1,5 @@
1
- /**
2
- * @copyright Sister Software
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 { writeLocalTextFile } from "@mailwoman/core/fs/writers"
8
5
  import { escapeHTML } from "@mailwoman/core/strings/escape"