@mailwoman/registry 9.4.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/README.md +10 -10
  2. package/lib/address-key.ts +14 -10
  3. package/lib/geocode-handler.ts +6 -4
  4. package/lib/geojson.ts +13 -17
  5. package/lib/ingest.ts +57 -83
  6. package/lib/learned-scorer.ts +38 -44
  7. package/lib/map-html.ts +24 -70
  8. package/lib/models/crosssource-gbt-en-us.ts +9 -7
  9. package/lib/models/dedup-gbt-en-us.ts +9 -8
  10. package/lib/models/org-crosssource-gbt-en-us.ts +10 -8
  11. package/lib/reconcile.ts +45 -55
  12. package/lib/resolve.ts +180 -124
  13. package/lib/types.ts +18 -12
  14. package/out/address-key.d.ts +14 -10
  15. package/out/address-key.d.ts.map +1 -1
  16. package/out/address-key.js +14 -10
  17. package/out/address-key.js.map +1 -1
  18. package/out/geocode-handler.d.ts +6 -4
  19. package/out/geocode-handler.d.ts.map +1 -1
  20. package/out/geocode-handler.js +6 -4
  21. package/out/geocode-handler.js.map +1 -1
  22. package/out/geojson.d.ts +9 -5
  23. package/out/geojson.d.ts.map +1 -1
  24. package/out/geojson.js +13 -15
  25. package/out/geojson.js.map +1 -1
  26. package/out/ingest.d.ts +46 -75
  27. package/out/ingest.d.ts.map +1 -1
  28. package/out/ingest.js +27 -54
  29. package/out/ingest.js.map +1 -1
  30. package/out/learned-scorer.d.ts +29 -26
  31. package/out/learned-scorer.d.ts.map +1 -1
  32. package/out/learned-scorer.js +31 -39
  33. package/out/learned-scorer.js.map +1 -1
  34. package/out/map-html.d.ts +13 -32
  35. package/out/map-html.d.ts.map +1 -1
  36. package/out/map-html.js +9 -62
  37. package/out/map-html.js.map +1 -1
  38. package/out/models/crosssource-gbt-en-us.d.ts +9 -7
  39. package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
  40. package/out/models/crosssource-gbt-en-us.js +9 -7
  41. package/out/models/crosssource-gbt-en-us.js.map +1 -1
  42. package/out/models/dedup-gbt-en-us.d.ts +9 -8
  43. package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
  44. package/out/models/dedup-gbt-en-us.js +9 -8
  45. package/out/models/dedup-gbt-en-us.js.map +1 -1
  46. package/out/models/org-crosssource-gbt-en-us.d.ts +10 -8
  47. package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
  48. package/out/models/org-crosssource-gbt-en-us.js +10 -8
  49. package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
  50. package/out/reconcile.d.ts +35 -50
  51. package/out/reconcile.d.ts.map +1 -1
  52. package/out/reconcile.js +19 -43
  53. package/out/reconcile.js.map +1 -1
  54. package/out/resolve.d.ts +150 -90
  55. package/out/resolve.d.ts.map +1 -1
  56. package/out/resolve.js +62 -63
  57. package/out/resolve.js.map +1 -1
  58. package/out/tools/coverage-reconciliation.d.ts +23 -23
  59. package/out/tools/coverage-reconciliation.d.ts.map +1 -1
  60. package/out/tools/coverage-reconciliation.js +15 -26
  61. package/out/tools/coverage-reconciliation.js.map +1 -1
  62. package/out/tools/cross/dataset-correlation.d.ts +58 -0
  63. package/out/tools/cross/dataset-correlation.d.ts.map +1 -0
  64. package/out/tools/{cross-dataset-correlation.js → cross/dataset-correlation.js} +10 -62
  65. package/out/tools/cross/dataset-correlation.js.map +1 -0
  66. package/out/tools/cross/source-threshold-sweep.d.ts +60 -0
  67. package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -0
  68. package/out/tools/{cross-source-threshold-sweep.js → cross/source-threshold-sweep.js} +15 -41
  69. package/out/tools/cross/source-threshold-sweep.js.map +1 -0
  70. package/out/tools/dedup-ceiling.d.ts +23 -26
  71. package/out/tools/dedup-ceiling.d.ts.map +1 -1
  72. package/out/tools/dedup-ceiling.js +22 -41
  73. package/out/tools/dedup-ceiling.js.map +1 -1
  74. package/out/tools/eval-geocoder.d.ts +22 -15
  75. package/out/tools/eval-geocoder.d.ts.map +1 -1
  76. package/out/tools/eval-geocoder.js +5 -6
  77. package/out/tools/eval-geocoder.js.map +1 -1
  78. package/out/tools/geocoder/namesake-probe.d.ts +33 -0
  79. package/out/tools/geocoder/namesake-probe.d.ts.map +1 -0
  80. package/out/tools/{geocoder-namesake-probe.js → geocoder/namesake-probe.js} +7 -8
  81. package/out/tools/geocoder/namesake-probe.js.map +1 -0
  82. package/out/tools/geocoder/vs-provided-coords.d.ts +53 -0
  83. package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -0
  84. package/out/tools/{geocoder-vs-provided-coords.js → geocoder/vs-provided-coords.js} +31 -28
  85. package/out/tools/geocoder/vs-provided-coords.js.map +1 -0
  86. package/out/tools/gold-set-sample.d.ts +27 -18
  87. package/out/tools/gold-set-sample.d.ts.map +1 -1
  88. package/out/tools/gold-set-sample.js +18 -22
  89. package/out/tools/gold-set-sample.js.map +1 -1
  90. package/out/tools/learned/scorer/clustering-eval.d.ts +77 -0
  91. package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -0
  92. package/out/tools/{learned-scorer-clustering-eval.js → learned/scorer/clustering-eval.js} +29 -39
  93. package/out/tools/learned/scorer/clustering-eval.js.map +1 -0
  94. package/out/tools/learned/scorer/crossstate-eval.d.ts +65 -0
  95. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -0
  96. package/out/tools/{learned-scorer-crossstate-eval.js → learned/scorer/crossstate-eval.js} +20 -26
  97. package/out/tools/learned/scorer/crossstate-eval.js.map +1 -0
  98. package/out/tools/learned/scorer/eval.d.ts +60 -0
  99. package/out/tools/learned/scorer/eval.d.ts.map +1 -0
  100. package/out/tools/{learned-scorer-eval.js → learned/scorer/eval.js} +12 -72
  101. package/out/tools/learned/scorer/eval.js.map +1 -0
  102. package/out/tools/matcher-scale.d.ts +12 -17
  103. package/out/tools/matcher-scale.d.ts.map +1 -1
  104. package/out/tools/matcher-scale.js +11 -29
  105. package/out/tools/matcher-scale.js.map +1 -1
  106. package/out/tools/nppes/dedup-benchmark.d.ts +81 -0
  107. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -0
  108. package/out/tools/{nppes-dedup-benchmark.js → nppes/dedup-benchmark.js} +21 -67
  109. package/out/tools/nppes/dedup-benchmark.js.map +1 -0
  110. package/out/tools/nppes/org-name.d.ts +5 -4
  111. package/out/tools/nppes/org-name.d.ts.map +1 -1
  112. package/out/tools/nppes/org-name.js +2 -2
  113. package/out/tools/nppes/org-name.js.map +1 -1
  114. package/out/tools/nppes/overmerge-packet.d.ts +15 -11
  115. package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
  116. package/out/tools/nppes/overmerge-packet.js +7 -8
  117. package/out/tools/nppes/overmerge-packet.js.map +1 -1
  118. package/out/tools/nppes/report.d.ts +17 -13
  119. package/out/tools/nppes/report.d.ts.map +1 -1
  120. package/out/tools/nppes/report.js +6 -14
  121. package/out/tools/nppes/report.js.map +1 -1
  122. package/out/tools/nppes/sample.d.ts +28 -17
  123. package/out/tools/nppes/sample.d.ts.map +1 -1
  124. package/out/tools/nppes/sample.js +23 -26
  125. package/out/tools/nppes/sample.js.map +1 -1
  126. package/out/tools/nppes/scoring.d.ts +7 -6
  127. package/out/tools/nppes/scoring.d.ts.map +1 -1
  128. package/out/tools/nppes/scoring.js +6 -5
  129. package/out/tools/nppes/scoring.js.map +1 -1
  130. package/out/tools/nppes/settings.d.ts +10 -7
  131. package/out/tools/nppes/settings.d.ts.map +1 -1
  132. package/out/tools/nppes/settings.js +16 -16
  133. package/out/tools/nppes/settings.js.map +1 -1
  134. package/out/tools/nppes/truth-grains.d.ts +36 -23
  135. package/out/tools/nppes/truth-grains.d.ts.map +1 -1
  136. package/out/tools/nppes/truth-grains.js +36 -20
  137. package/out/tools/nppes/truth-grains.js.map +1 -1
  138. package/out/tools/shared.d.ts +63 -59
  139. package/out/tools/shared.d.ts.map +1 -1
  140. package/out/tools/shared.js +49 -66
  141. package/out/tools/shared.js.map +1 -1
  142. package/out/tools/train/cross-gbt.d.ts +88 -0
  143. package/out/tools/train/cross-gbt.d.ts.map +1 -0
  144. package/out/tools/{train-cross-gbt.js → train/cross-gbt.js} +15 -26
  145. package/out/tools/train/cross-gbt.js.map +1 -0
  146. package/out/tools/train/gbt.d.ts +85 -0
  147. package/out/tools/train/gbt.d.ts.map +1 -0
  148. package/out/tools/{train-gbt.js → train/gbt.js} +28 -32
  149. package/out/tools/train/gbt.js.map +1 -0
  150. package/out/tools/train/org-cross-gbt.d.ts +84 -0
  151. package/out/tools/train/org-cross-gbt.d.ts.map +1 -0
  152. package/out/tools/{train-org-cross-gbt.js → train/org-cross-gbt.js} +19 -23
  153. package/out/tools/train/org-cross-gbt.js.map +1 -0
  154. package/out/tools/txhhsc-to-oarow.d.ts +14 -9
  155. package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
  156. package/out/tools/txhhsc-to-oarow.js +16 -15
  157. package/out/tools/txhhsc-to-oarow.js.map +1 -1
  158. package/out/tools/viz/browser.d.ts +6 -5
  159. package/out/tools/viz/browser.d.ts.map +1 -1
  160. package/out/tools/viz/browser.js +6 -5
  161. package/out/tools/viz/browser.js.map +1 -1
  162. package/out/tools/viz/cross-dataset-map.d.ts +7 -4
  163. package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
  164. package/out/tools/viz/cross-dataset-map.js +9 -6
  165. package/out/tools/viz/cross-dataset-map.js.map +1 -1
  166. package/out/tools/viz/geocode-first-surface.d.ts +10 -5
  167. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  168. package/out/tools/viz/geocode-first-surface.js +16 -11
  169. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  170. package/out/tools/viz/{render-map.d.ts → render/map.d.ts} +6 -6
  171. package/out/tools/viz/render/map.d.ts.map +1 -0
  172. package/out/tools/viz/{render-map.js → render/map.js} +7 -6
  173. package/out/tools/viz/render/map.js.map +1 -0
  174. package/out/tools/viz/render.d.ts +12 -8
  175. package/out/tools/viz/render.d.ts.map +1 -1
  176. package/out/tools/viz/render.js +8 -7
  177. package/out/tools/viz/render.js.map +1 -1
  178. package/out/tools/viz/source-provenance-map.d.ts +19 -7
  179. package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
  180. package/out/tools/viz/source-provenance-map.js +11 -8
  181. package/out/tools/viz/source-provenance-map.js.map +1 -1
  182. package/out/tools/viz/yardstick-figure.d.ts +2 -21
  183. package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
  184. package/out/tools/viz/yardstick-figure.js +3 -39
  185. package/out/tools/viz/yardstick-figure.js.map +1 -1
  186. package/out/types.d.ts +17 -11
  187. package/out/types.d.ts.map +1 -1
  188. package/out/types.js +2 -2
  189. package/out/types.js.map +1 -1
  190. package/package.json +41 -184
  191. package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
  192. package/{lib/tools/cross-dataset-correlation.ts → tools/cross/dataset-correlation.ts} +31 -72
  193. package/{lib/tools/cross-source-threshold-sweep.ts → tools/cross/source-threshold-sweep.ts} +29 -46
  194. package/{lib/tools → tools}/dedup-ceiling.ts +34 -45
  195. package/tools/eval-geocoder.ts +74 -0
  196. package/{lib/tools/geocoder-namesake-probe.ts → tools/geocoder/namesake-probe.ts} +9 -8
  197. package/{lib/tools/geocoder-vs-provided-coords.ts → tools/geocoder/vs-provided-coords.ts} +39 -30
  198. package/{lib/tools → tools}/gold-set-sample.ts +35 -29
  199. package/{lib/tools/learned-scorer-clustering-eval.ts → tools/learned/scorer/clustering-eval.ts} +49 -45
  200. package/{lib/tools/learned-scorer-crossstate-eval.ts → tools/learned/scorer/crossstate-eval.ts} +34 -30
  201. package/{lib/tools/learned-scorer-eval.ts → tools/learned/scorer/eval.ts} +35 -78
  202. package/{lib/tools → tools}/matcher-scale.ts +21 -33
  203. package/{lib/tools/nppes-dedup-benchmark.ts → tools/nppes/dedup-benchmark.ts} +37 -82
  204. package/{lib/tools → tools}/nppes/org-name.ts +5 -4
  205. package/{lib/tools → tools}/nppes/overmerge-packet.ts +17 -13
  206. package/{lib/tools → tools}/nppes/report.ts +32 -25
  207. package/{lib/tools → tools}/nppes/sample.ts +41 -36
  208. package/{lib/tools → tools}/nppes/scoring.ts +7 -6
  209. package/{lib/tools → tools}/nppes/settings.ts +16 -16
  210. package/{lib/tools → tools}/nppes/truth-grains.ts +46 -26
  211. package/{lib/tools → tools}/shared.ts +73 -83
  212. package/{lib/tools/train-cross-gbt.ts → tools/train/cross-gbt.ts} +38 -34
  213. package/{lib/tools/train-gbt.ts → tools/train/gbt.ts} +55 -41
  214. package/{lib/tools/train-org-cross-gbt.ts → tools/train/org-cross-gbt.ts} +39 -30
  215. package/{lib/tools → tools}/txhhsc-to-oarow.ts +24 -18
  216. package/{lib/tools → tools}/viz/browser.ts +6 -5
  217. package/{lib/tools → tools}/viz/cross-dataset-map.ts +15 -9
  218. package/{lib/tools → tools}/viz/geocode-first-surface.ts +28 -17
  219. package/{lib/tools/viz/render-map.ts → tools/viz/render/map.ts} +7 -6
  220. package/{lib/tools → tools}/viz/render.ts +16 -11
  221. package/{lib/tools → tools}/viz/source-provenance-map.ts +30 -15
  222. package/{lib/tools → tools}/viz/yardstick-figure.ts +6 -43
  223. package/lib/tools/eval-geocoder.ts +0 -67
  224. package/lib/tools/index.ts +0 -31
  225. package/out/tools/cross-dataset-correlation.d.ts +0 -65
  226. package/out/tools/cross-dataset-correlation.d.ts.map +0 -1
  227. package/out/tools/cross-dataset-correlation.js.map +0 -1
  228. package/out/tools/cross-source-threshold-sweep.d.ts +0 -66
  229. package/out/tools/cross-source-threshold-sweep.d.ts.map +0 -1
  230. package/out/tools/cross-source-threshold-sweep.js.map +0 -1
  231. package/out/tools/geocoder-namesake-probe.d.ts +0 -32
  232. package/out/tools/geocoder-namesake-probe.d.ts.map +0 -1
  233. package/out/tools/geocoder-namesake-probe.js.map +0 -1
  234. package/out/tools/geocoder-vs-provided-coords.d.ts +0 -50
  235. package/out/tools/geocoder-vs-provided-coords.d.ts.map +0 -1
  236. package/out/tools/geocoder-vs-provided-coords.js.map +0 -1
  237. package/out/tools/index.d.ts +0 -31
  238. package/out/tools/index.d.ts.map +0 -1
  239. package/out/tools/index.js +0 -31
  240. package/out/tools/index.js.map +0 -1
  241. package/out/tools/learned-scorer-clustering-eval.d.ts +0 -74
  242. package/out/tools/learned-scorer-clustering-eval.d.ts.map +0 -1
  243. package/out/tools/learned-scorer-clustering-eval.js.map +0 -1
  244. package/out/tools/learned-scorer-crossstate-eval.d.ts +0 -59
  245. package/out/tools/learned-scorer-crossstate-eval.d.ts.map +0 -1
  246. package/out/tools/learned-scorer-crossstate-eval.js.map +0 -1
  247. package/out/tools/learned-scorer-eval.d.ts +0 -77
  248. package/out/tools/learned-scorer-eval.d.ts.map +0 -1
  249. package/out/tools/learned-scorer-eval.js.map +0 -1
  250. package/out/tools/nppes-dedup-benchmark.d.ts +0 -101
  251. package/out/tools/nppes-dedup-benchmark.d.ts.map +0 -1
  252. package/out/tools/nppes-dedup-benchmark.js.map +0 -1
  253. package/out/tools/train-cross-gbt.d.ts +0 -78
  254. package/out/tools/train-cross-gbt.d.ts.map +0 -1
  255. package/out/tools/train-cross-gbt.js.map +0 -1
  256. package/out/tools/train-gbt.d.ts +0 -69
  257. package/out/tools/train-gbt.d.ts.map +0 -1
  258. package/out/tools/train-gbt.js.map +0 -1
  259. package/out/tools/train-org-cross-gbt.d.ts +0 -71
  260. package/out/tools/train-org-cross-gbt.d.ts.map +0 -1
  261. package/out/tools/train-org-cross-gbt.js.map +0 -1
  262. package/out/tools/viz/render-map.d.ts.map +0 -1
  263. package/out/tools/viz/render-map.js.map +0 -1
@@ -2,15 +2,18 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file The NPPES benchmark's input sample: the variation-rich multi-record set per NPI, plus the corpus-wide
6
- * address-frequency table built in the same pass. One registry pass serves any number of states — the cross-state
7
- * eval samples two at once.
5
+ *
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
9
  */
9
10
  import type { TermFrequencyTable } from "@mailwoman/match";
10
11
  import { type NPIPrimary } from "#tools/nppes/org-name";
11
12
  /**
12
- * One synthetic input row for the matcher; `npi` is the hidden NPI-level truth, `entityID` the site-level entity-level
13
- * truth (subpart-collapsed).
13
+ * One synthetic input row for the matcher.
14
+ *
15
+ * `npi` is the hidden NPI-level truth.
16
+ * `entityID` is the site-level entity-level truth (subpart-collapsed).
14
17
  */
15
18
  export interface MessyRow extends Record<string, string> {
16
19
  npi: string;
@@ -19,18 +22,19 @@ export interface MessyRow extends Record<string, string> {
19
22
  address: string;
20
23
  auth: string;
21
24
  /**
22
- * Whitespace-joined taxonomy-code set (up to 15 slots) — the #625 code-set discriminator.
25
+ * Whitespace-joined taxonomy-code set, up to 15 slots, used as the code-set discriminator.
23
26
  */
24
27
  taxonomy: string;
25
28
  entityID: string;
26
29
  }
27
30
  /**
28
- * One state's slice of the sample pass.
31
+ * One state's share of the sample pass.
29
32
  */
30
33
  export interface NPPESStateSample {
31
34
  rows: MessyRow[];
32
35
  /**
33
- * The sampled NPIs — the true-entity count at the NPI grain.
36
+ * The sampled NPIs.
37
+ * Their count is the true-entity count at the NPI grain.
34
38
  */
35
39
  keptNpis: Set<string>;
36
40
  /**
@@ -43,8 +47,10 @@ export interface NPPESStateSample {
43
47
  */
44
48
  export interface NPPESSample extends NPPESStateSample {
45
49
  /**
46
- * Corpus-wide address-frequency table — the inverse-frequency signal. Counted over EVERY practice address in the
47
- * registry, not just the sample, so the sharing structure is a corpus statistic rather than a slice artifact.
50
+ * Corpus-wide address-frequency table, the inverse-frequency signal.
51
+ *
52
+ * Counted over every practice address in the registry rather than just the sample,
53
+ * so the sharing structure is a corpus statistic rather than a sampling artifact.
48
54
  */
49
55
  addressFrequency: TermFrequencyTable;
50
56
  }
@@ -55,19 +61,22 @@ export interface NPPESSampleOptions {
55
61
  registryPath: string;
56
62
  otherNamesPath: string;
57
63
  /**
58
- * Already upper-cased; compared against the practice-location state column.
64
+ * Already upper-cased.
65
+ * Compared against the practice-location state column.
59
66
  */
60
67
  state: string;
61
68
  maxNpis: number;
62
69
  }
63
70
  /**
64
- * The multi-state shape of {@linkcode NPPESSampleOptions} — one registry pass fills every state's bucket.
71
+ * The multi-state shape of {@linkcode NPPESSampleOptions}, where one registry
72
+ * pass fills every state's bucket.
65
73
  */
66
74
  export interface NPPESMultiSampleOptions {
67
75
  registryPath: string;
68
76
  otherNamesPath: string;
69
77
  /**
70
- * Already upper-cased; compared against the practice-location state column.
78
+ * Already upper-cased.
79
+ * Compared against the practice-location state column.
71
80
  */
72
81
  states: readonly string[];
73
82
  maxNpisPerState: number;
@@ -75,16 +84,18 @@ export interface NPPESMultiSampleOptions {
75
84
  /**
76
85
  * Build the benchmark's input records from the real registry, one bucket per requested state.
77
86
  *
78
- * Two passes over two files, and the SECOND one cannot break early: the address-frequency table needs every registry
79
- * row even after the sample is full, so the per-bucket `keptNpis.size < maxNpisPerState` test bounds only the sample
80
- * branch.
87
+ * Two passes read the two files.
88
+ * The second pass cannot break early because the address-frequency table needs
89
+ * every registry row even after the sample is full.
90
+ *
91
+ * The per-bucket `keptNpis.size < maxNpisPerState` test bounds only the sample branch.
81
92
  */
82
93
  export declare function buildNPPESStateSamples(options: NPPESMultiSampleOptions, report?: (line: string) => void): Promise<{
83
94
  byState: Map<string, NPPESStateSample>;
84
95
  addressFrequency: TermFrequencyTable;
85
96
  }>;
86
97
  /**
87
- * Build one state's benchmark input records — {@linkcode buildNPPESStateSamples} with a single bucket.
98
+ * Build one state's benchmark input records using {@linkcode buildNPPESStateSamples} with a single bucket.
88
99
  */
89
100
  export declare function buildNPPESSample(options: NPPESSampleOptions, report?: (line: string) => void): Promise<NPPESSample>;
90
101
  //# sourceMappingURL=sample.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../../../lib/tools/nppes/sample.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;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MAAM,CAAA;IACtB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;CACf;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACvC,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,MAAM,CAAA;IACtB;;;OAGG;IACH,MAAM,EAAE,SAAS,MAAM,EAAE,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;;GAQG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,uBAAuB,EAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAAC,gBAAgB,EAAE,kBAAkB,CAAA;CAAE,CAAC,CA2H3F;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACrC,OAAO,EAAE,kBAAkB,EAC3B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,WAAW,CAAC,CAYtB"}
@@ -2,9 +2,10 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file The NPPES benchmark's input sample: the variation-rich multi-record set per NPI, plus the corpus-wide
6
- * address-frequency table built in the same pass. One registry pass serves any number of states — the cross-state
7
- * eval samples two at once.
5
+ *
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
9
  */
9
10
  import { isPresent } from "@mailwoman/core/objects";
10
11
  import { addressFrequencyKey, streamRows } from "#index";
@@ -13,13 +14,14 @@ import { addr, MIN_GROUP_SIZE, norm, NPPES_COLUMNS as C } from "#tools/shared";
13
14
  /**
14
15
  * Build the benchmark's input records from the real registry, one bucket per requested state.
15
16
  *
16
- * Two passes over two files, and the SECOND one cannot break early: the address-frequency table needs every registry
17
- * row even after the sample is full, so the per-bucket `keptNpis.size < maxNpisPerState` test bounds only the sample
18
- * branch.
17
+ * Two passes read the two files.
18
+ * The second pass cannot break early because the address-frequency table needs
19
+ * every registry row even after the sample is full.
20
+ *
21
+ * The per-bucket `keptNpis.size < maxNpisPerState` test bounds only the sample branch.
19
22
  */
20
23
  export async function buildNPPESStateSamples(options, report) {
21
24
  const { registryPath, otherNamesPath, states, maxNpisPerState } = options;
22
- // --- Phase A: the variation set — NPIs that carry ≥1 alternate organization name. ---
23
25
  report?.("[A] streaming other-names…");
24
26
  const altNames = new Map();
25
27
  for await (const r of streamRows(otherNamesPath)) {
@@ -35,8 +37,8 @@ export async function buildNPPESStateSamples(options, report) {
35
37
  altNames.set(npi, list);
36
38
  }
37
39
  report?.(` ${altNames.size} NPIs with ≥1 alternate name`);
38
- // --- Phase B: ONE full registry pass — build the GLOBAL address-frequency table (every practice
39
- // address, so the sharing structure is corpus-wide, not sample-biased) AND collect every state's sample. ---
40
+ // One full registry pass builds the global address-frequency table and collects every state's sample.
41
+ // Each row contributes to the corpus-wide sharing structure, independent of the state sample.
40
42
  report?.(`[B] full registry pass: address-frequency table + ${maxNpisPerState} × ${states.join("/")} sample…`);
41
43
  const byState = new Map(states.map((state) => [state, { rows: [], keptNpis: new Set(), npiPrimary: new Map() }]));
42
44
  const addrCounts = new Map();
@@ -48,14 +50,12 @@ export async function buildNPPESStateSamples(options, report) {
48
50
  report?.(` scanned ${scanned / 1e6}M rows, kept ${keptTotal}`);
49
51
  }
50
52
  const practice = addr(r[C.pAddr], r[C.pCity], r[C.pState], r[C.pZip]);
51
- // Global address-frequency: count every practice address (one row ≈ one distinct NPI).
52
53
  if (practice) {
53
54
  const k = addressFrequencyKey(practice);
54
55
  addrCounts.set(k, (addrCounts.get(k) ?? 0) + 1);
55
56
  addrTotal++;
56
57
  }
57
- // Sample: in-state NPIs with ≥1 alternate name, up to maxNpisPerState — NO early break (the table
58
- // needs the full pass).
58
+ // No early break here, since the table needs the full pass.
59
59
  const npi = norm(r[C.npi]);
60
60
  const bucket = byState.get(norm(r[C.pState]).toUpperCase());
61
61
  if (bucket &&
@@ -69,19 +69,19 @@ export async function buildNPPESStateSamples(options, report) {
69
69
  if (primaryName) {
70
70
  const org = isOrg ? norm(r[C.orgLegal]) : "";
71
71
  const auth = `${norm(r[C.authFirst])} ${norm(r[C.authLast])}`.trim();
72
- // the NPI's registrant — shared across its records
73
- // #625: the taxonomy-code set (up to 15 slots), whitespace-joined — identical across the NPI's
74
- // records by construction (it's a per-NPI registry attribute), so it NEVER splits one entity;
75
- // it only separates co-located DISTINCT providers whose sets are disjoint.
72
+ // The taxonomy-code set (up to 15 slots) is whitespace-joined and identical
73
+ // across the NPI's records by construction, so it never splits one entity.
74
+ // It only separates co-located distinct providers whose sets are disjoint.
76
75
  const taxonomy = C.taxonomy
77
76
  .map((col) => norm(r[col]))
78
77
  .filter(isPresent)
79
78
  .join(" ");
80
- // Entity-level (site) truth: same org + same physical address. Subparts (NPPES
81
- // "Is Organization Subpart" + parent LBN/TIN) collapse to their PARENT, so the matcher isn't
82
- // charged for correctly fusing one org's many subpart-NPIs at a site; an NPI's mailing-vs-
83
- // practice records stay DISTINCT sites. orgKey = parent identity for subparts, else the NPI
84
- // (independent orgs sharing an address stay distinct — the conservative choice).
79
+ // Entity-level (site) truth is the same org and the same physical address.
80
+ // Subparts (NPPES "Is Organization Subpart" plus parent LBN/TIN) collapse to their parent,
81
+ // so the matcher is not charged for correctly fusing one org's many subpart-NPIs at a site.
82
+ // An NPI's mailing and practice records stay distinct sites.
83
+ // `orgKey` is the parent identity for a subpart, else the NPI,
84
+ // so independent orgs sharing an address stay distinct.
85
85
  const isSubpart = norm(r[C.isSubpart]).toUpperCase() === "Y";
86
86
  const parentKey = `${norm(r[C.parentLBN])}|${norm(r[C.parentTIN])}`.toLowerCase();
87
87
  const orgKey = isSubpart && parentKey !== "|" ? `p:${parentKey}` : `n:${npi}`;
@@ -92,19 +92,16 @@ export async function buildNPPESStateSamples(options, report) {
92
92
  bucket.keptNpis.add(npi);
93
93
  keptTotal++;
94
94
  bucket.rows.push({ npi, name: primaryName, org, address: practice, auth, taxonomy, entityID: eid(practice) });
95
- // primary
96
95
  for (const alt of altNames.get(npi)) {
97
96
  bucket.rows.push({ npi, name: alt, org: alt, address: practice, auth, taxonomy, entityID: eid(practice) });
98
97
  }
99
- // name drift
100
98
  const mailing = addr(r[C.mAddr], r[C.mCity], r[C.mState], r[C.mZip]);
101
99
  if (mailing && mailing !== practice) {
102
100
  bucket.rows.push({ npi, name: primaryName, org, address: mailing, auth, taxonomy, entityID: eid(mailing) });
103
- } // address variation
101
+ }
104
102
  }
105
103
  }
106
104
  }
107
- // Corpus-wide address-frequency table — the inverse-frequency signal (#617 fix per the DeepSeek consult).
108
105
  const addressFrequency = {
109
106
  total: addrTotal,
110
107
  distinct: addrCounts.size,
@@ -117,7 +114,7 @@ export async function buildNPPESStateSamples(options, report) {
117
114
  return { byState, addressFrequency };
118
115
  }
119
116
  /**
120
- * Build one state's benchmark input records — {@linkcode buildNPPESStateSamples} with a single bucket.
117
+ * Build one state's benchmark input records using {@linkcode buildNPPESStateSamples} with a single bucket.
121
118
  */
122
119
  export async function buildNPPESSample(options, report) {
123
120
  const { byState, addressFrequency } = await buildNPPESStateSamples({
@@ -1 +1 @@
1
- {"version":3,"file":"sample.js","sourceRoot":"","sources":["../../../lib/tools/nppes/sample.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGnD,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AACxD,OAAO,EAAE,SAAS,EAAmB,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,aAAa,IAAI,CAAC,EAAE,MAAM,eAAe,CAAA;AAuE9E;;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E,OAAO,CAAC,OAAO;KAChC,EACD,MAAM,CACN,CAAA;IAED,OAAO,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAE,EAAE,gBAAgB,EAAE,CAAA;AAC5D,CAAC"}
@@ -3,7 +3,7 @@
3
3
  * @license AGPL-3.0
4
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
- * against a truth labelling, plus the over-merge / under-merge shape counts.
6
+ * against a truth labeling, plus the over-merge / under-merge shape counts.
7
7
  */
8
8
  import type { ResolvedEntity, SourceRecord } from "#index";
9
9
  /**
@@ -11,7 +11,7 @@ import type { ResolvedEntity, SourceRecord } from "#index";
11
11
  */
12
12
  export declare const choose2: (n: number) => number;
13
13
  /**
14
- * One clustering scored against one truth labelling.
14
+ * One clustering scored against one truth labeling.
15
15
  */
16
16
  export interface Score {
17
17
  precision: number;
@@ -26,11 +26,12 @@ export interface Score {
26
26
  splitNpis: number;
27
27
  }
28
28
  /**
29
- * Score recovered clusters against a truth labelling.
29
+ * Score recovered clusters against a truth labeling.
30
30
  *
31
- * Pairwise, not set-matching: a true pair is two records carrying the same `labelOf`, a predicted pair is two records
32
- * in the same entity. `totalRecords` is the labelled population and only feeds the adjusted-Rand expectation, so it
33
- * must be the whole record set rather than the clustered subset — a smaller value inflates ARI.
31
+ * Pairwise rather than set-matching: a true pair is two records carrying the same `labelOf`,
32
+ * a predicted pair is two records in the same entity.
33
+ * `totalRecords` is the labeled population and only feeds the adjusted-Rand expectation,
34
+ * so it must be the whole record set rather than the clustered subset — a smaller value inflates ARI.
34
35
  */
35
36
  export declare function scoreEntities(entities: readonly ResolvedEntity[], labelOf: (rec: SourceRecord) => string, totalRecords: number): Score;
36
37
  //# sourceMappingURL=scoring.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../../../lib/tools/nppes/scoring.ts"],"names":[],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AA;IACpB,SAAS,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAC5B,QAAQ,EAAE,SAAS,cAAc,EAAE,EACnC,OAAO,EAAE,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,EACtC,YAAY,EAAE,MAAM,GAClB,KAAK,CAuEP"}
@@ -3,18 +3,19 @@
3
3
  * @license AGPL-3.0
4
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
- * against a truth labelling, plus the over-merge / under-merge shape counts.
6
+ * against a truth labeling, plus the over-merge / under-merge shape counts.
7
7
  */
8
8
  /**
9
9
  * Pairs within a group of `n`.
10
10
  */
11
11
  export const choose2 = (n) => (n * (n - 1)) / 2;
12
12
  /**
13
- * Score recovered clusters against a truth labelling.
13
+ * Score recovered clusters against a truth labeling.
14
14
  *
15
- * Pairwise, not set-matching: a true pair is two records carrying the same `labelOf`, a predicted pair is two records
16
- * in the same entity. `totalRecords` is the labelled population and only feeds the adjusted-Rand expectation, so it
17
- * must be the whole record set rather than the clustered subset — a smaller value inflates ARI.
15
+ * Pairwise rather than set-matching: a true pair is two records carrying the same `labelOf`,
16
+ * a predicted pair is two records in the same entity.
17
+ * `totalRecords` is the labeled population and only feeds the adjusted-Rand expectation,
18
+ * so it must be the whole record set rather than the clustered subset — a smaller value inflates ARI.
18
19
  */
19
20
  export function scoreEntities(entities, labelOf, totalRecords) {
20
21
  const npiTotals = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"scoring.js","sourceRoot":"","sources":["../../../lib/tools/nppes/scoring.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAkB/D;;;;;;GAMG;AAC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,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACnF,MAAM,SAAS,GAAG,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,MAAM,CAAA;IAE5E,OAAO;QACN,SAAS;QACT,MAAM;QACN,EAAE;QACF,GAAG;QACH,QAAQ,EAAE,QAAQ,CAAC,MAAM;QACzB,UAAU;QACV,kBAAkB;QAClB,mBAAmB;QACnB,YAAY;QACZ,SAAS;KACT,CAAA;AACF,CAAC"}
@@ -2,8 +2,9 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file The comparison-model setting progression the NPPES benchmark walks — each row turns one setting on so its marginal
6
- * effect is isolated.
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.
7
8
  */
8
9
  import type { TermFrequencyTable } from "@mailwoman/match";
9
10
  /**
@@ -28,11 +29,13 @@ export interface Setting {
28
29
  /**
29
30
  * Build the progression against a corpus-wide address-frequency table.
30
31
  *
31
- * Every row sets BOTH `collapseSpatial` and `addressFrequency` EXPLICITLY, because the proven settings are default-on
32
- * in `resolveEntities`: leave either implicit and the flipped default silently rides the `+ inverse-address-frequency`
33
- * row, making the A1 delta read as 0. Every row is fed the corpus-wide table — the realistic deployment, where the CLI
34
- * builds it from the full source files — so the zero-config default, whose input-scoped table is intentionally sparse
35
- * on a sub-sample, has to be measured separately.
32
+ * Every row sets both `collapseSpatial` and `addressFrequency` explicitly,
33
+ * because the proven settings are default-on in `resolveEntities`.
34
+ * Leave either implicit and the flipped default silently follows the inverse-address-frequency row.
35
+ * That makes the delta read as 0.
36
+ *
37
+ * Every row is fed the corpus-wide table, the realistic deployment, so the zero-config
38
+ * default with its input-scoped table has to be measured separately.
36
39
  */
37
40
  export declare function buildSettings(addressFrequency: TermFrequencyTable): Setting[];
38
41
  //# sourceMappingURL=settings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../lib/tools/nppes/settings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,gBAAgB,CAAC,EAAE,kBAAkB,GAAG,KAAK,CAAA;IAC7C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC9B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,aAAa,CAAA;CACrB;AAED;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,OAAO,EAAE,CA6D7E"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../tools/nppes/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,gBAAgB,CAAC,EAAE,kBAAkB,GAAG,KAAK,CAAA;IAC7C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC9B,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,aAAa,CAAA;CACrB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,OAAO,EAAE,CA0D7E"}
@@ -2,17 +2,20 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file The comparison-model setting progression the NPPES benchmark walks — each row turns one setting on so its marginal
6
- * effect is isolated.
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.
7
8
  */
8
9
  /**
9
10
  * Build the progression against a corpus-wide address-frequency table.
10
11
  *
11
- * Every row sets BOTH `collapseSpatial` and `addressFrequency` EXPLICITLY, because the proven settings are default-on
12
- * in `resolveEntities`: leave either implicit and the flipped default silently rides the `+ inverse-address-frequency`
13
- * row, making the A1 delta read as 0. Every row is fed the corpus-wide table — the realistic deployment, where the CLI
14
- * builds it from the full source files — so the zero-config default, whose input-scoped table is intentionally sparse
15
- * on a sub-sample, has to be measured separately.
12
+ * Every row sets both `collapseSpatial` and `addressFrequency` explicitly,
13
+ * because the proven settings are default-on in `resolveEntities`.
14
+ * Leave either implicit and the flipped default silently follows the inverse-address-frequency row.
15
+ * That makes the delta read as 0.
16
+ *
17
+ * Every row is fed the corpus-wide table, the realistic deployment, so the zero-config
18
+ * default with its input-scoped table has to be measured separately.
16
19
  */
17
20
  export function buildSettings(addressFrequency) {
18
21
  return [
@@ -26,10 +29,8 @@ export function buildSettings(addressFrequency) {
26
29
  label: "+ authorized-official discriminator (#625)",
27
30
  config: { collapseSpatial: true, addressFrequency, discriminators: ["authorizedOfficial"] },
28
31
  },
29
- // A2–A4 (#625): the built-but-unmeasured over-merge settings. Each builds on the A1 + discriminator
30
- // stack so the marginal effect is isolated. A2 (require name/org corroboration) is the direct
31
- // over-merge precision setting; A3 (phone) is the recall-tail corroborator that should keep A2 from
32
- // killing name-drift links; A4 (average-linkage) splits a component joined only by a weak bridge.
32
+ // The over-merge settings each build on the collapsed-spatial and discriminator stack,
33
+ // so the marginal effect of each is isolated.
33
34
  {
34
35
  label: "+ require name/org corroboration (A2, #625)",
35
36
  config: {
@@ -60,11 +61,10 @@ export function buildSettings(addressFrequency) {
60
61
  linkage: "average",
61
62
  },
62
63
  },
63
- // A5 (#625): the taxonomy code-set discriminator — set-overlap agreement over the NPI's 15 taxonomy
64
- // slots. The named "still-more-distinctive identifier" from the 2026-06-16 report: co-located
65
- // DISTINCT providers usually have disjoint sets (the over-merge separator) while an entity's own
66
- // records always share theirs (never splits). Stacked on the BEST prior classical config (A1 +
67
- // authorized-official; A3 phone + A4 avg-linkage were measured neutral-to-negative and are left off).
64
+ // The taxonomy code-set discriminator uses set-overlap agreement over the NPI's 15 taxonomy slots.
65
+ // Co-located distinct providers usually have disjoint sets, while an entity's
66
+ // own records always share theirs.
67
+ // It is stacked on the best prior classical config.
68
68
  {
69
69
  label: "+ taxonomy code-set discriminator (A5, #625)",
70
70
  config: {
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../lib/tools/nppes/settings.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH;;;;;;;;GAQG;AACH,MAAM,UAAU,aAAa,CAAC,gBAAoC;IACjE,OAAO;QACN;YACC,KAAK,EAAE,yDAAyD;YAChE,MAAM,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE;SAC3D;QACD,EAAE,KAAK,EAAE,iDAAiD,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,gBAAgB,EAAE,EAAE;QAClH,EAAE,KAAK,EAAE,uCAAuC,EAAE,MAAM,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE,EAAE;QACvG;YACC,KAAK,EAAE,4CAA4C;YACnD,MAAM,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC,oBAAoB,CAAC,EAAE;SAC3F;QACD,oGAAoG;QACpG,8FAA8F;QAC9F,oGAAoG;QACpG,kGAAkG;QAClG;YACC,KAAK,EAAE,6CAA6C;YACpD,MAAM,EAAE;gBACP,eAAe,EAAE,IAAI;gBACrB,gBAAgB;gBAChB,cAAc,EAAE,CAAC,oBAAoB,CAAC;gBACtC,oBAAoB,EAAE,IAAI;aAC1B;SACD;QACD;YACC,KAAK,EAAE,+BAA+B;YACtC,MAAM,EAAE;gBACP,eAAe,EAAE,IAAI;gBACrB,gBAAgB;gBAChB,cAAc,EAAE,CAAC,oBAAoB,CAAC;gBACtC,oBAAoB,EAAE,IAAI;gBAC1B,QAAQ,EAAE,IAAI;aACd;SACD;QACD;YACC,KAAK,EAAE,2DAA2D;YAClE,MAAM,EAAE;gBACP,eAAe,EAAE,IAAI;gBACrB,gBAAgB;gBAChB,cAAc,EAAE,CAAC,oBAAoB,CAAC;gBACtC,oBAAoB,EAAE,IAAI;gBAC1B,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,SAAS;aAClB;SACD;QACD,oGAAoG;QACpG,8FAA8F;QAC9F,iGAAiG;QACjG,+FAA+F;QAC/F,sGAAsG;QACtG;YACC,KAAK,EAAE,8CAA8C;YACrD,MAAM,EAAE;gBACP,eAAe,EAAE,IAAI;gBACrB,gBAAgB;gBAChB,cAAc,EAAE,CAAC,oBAAoB,CAAC;gBACtC,mBAAmB,EAAE,CAAC,UAAU,CAAC;aACjC;SACD;KACD,CAAA;AACF,CAAC"}
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../tools/nppes/settings.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAyBH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,gBAAoC;IACjE,OAAO;QACN;YACC,K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AC;gBACtC,mBAAmB,EAAE,CAAC,UAAU,CAAC;aACjC;SACD;KACD,CAAA;AACF,CAAC"}
@@ -2,10 +2,10 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * @file The org-name entity-truth grains: union-find labellings that collapse co-located same-org NPIs, keyed three
6
- * ways — the address string, a haversine co-location radius, and an H3 cell.
5
+ * @file Defines union-find truth labels that group co-located NPIs for one organization.
6
+ * One label uses address strings. Another uses a haversine radius. The third uses H3 cells.
7
7
  */
8
- import { type LatLon } from "@mailwoman/match";
8
+ import type { GeoCoordinate } from "@mailwoman/spatial";
9
9
  import type { SourceRecord } from "#index";
10
10
  import { type NPIPrimary } from "#tools/nppes/org-name";
11
11
  /**
@@ -13,38 +13,51 @@ import { type NPIPrimary } from "#tools/nppes/org-name";
13
13
  */
14
14
  export declare const COLOCATION_KM = 0.05;
15
15
  /**
16
- * A truth labelling: the entity class a record belongs to.
16
+ * A truth labeling: the entity class a record belongs to.
17
17
  */
18
18
  export type TruthLabel = (rec: SourceRecord) => string;
19
19
  /**
20
- * An NPI's primary practice coordinate — the FIRST geocoded record it owns, which is its primary row because the sample
21
- * builder pushes that row before the alternate-name and mailing variants.
20
+ * An NPI's primary practice coordinate.
21
+ *
22
+ * Returns the first geocoded record for the NPI.
23
+ * The sample builder adds this primary row before alternate-name and mailing variants.
22
24
  */
23
- export declare function collectPrimaryCoordinates(records: readonly SourceRecord[]): Map<string, LatLon>;
25
+ export declare function collectPrimaryCoordinates(records: readonly SourceRecord[]): Map<string, GeoCoordinate>;
24
26
  /**
25
- * The string-keyed org-name truth: same NPI ⇒ same entity (so an NPI's records stay together and recall is preserved),
26
- * PLUS union two NPIs at the same address KEY whose primary org names agree.
27
+ * The string-keyed org-name truth: same NPI ⇒ same entity
28
+ * (so an NPI's records stay together and recall is preserved), plus union two NPIs
29
+ * at the same address KEY whose primary org names agree.
30
+ *
31
+ * The address-string block provides a conservative lower bound.
32
+ * `1504 Taub loop` and `1504 Taub LP STE 100` key apart even though they are one building,
33
+ * so a correct merge across them is still charged as an error.
34
+ * The coordinate grain below is the tighter reading.
27
35
  *
28
- * Blocking on the address string is a conservative LOWER bound — `1504 Taub LOOP` and `1504 Taub LP STE 100` key apart
29
- * even though they are one building, so a correct merge across them is still charged as an error. The coordinate grain
30
- * below is the tighter reading. Neither relies on the NPPES subpart flag, which the gold set showed misses 37%.
36
+ * Neither method uses the NPPES subpart flag.
37
+ * The gold set misses 37% of cases when grouped by that flag.
31
38
  */
32
39
  export declare function buildOrgNameGrain(npiPrimary: Map<string, NPIPrimary>): TruthLabel;
33
40
  /**
34
- * The coordinate-keyed org-name truth: union same-org NPIs whose primary practice coordinates fall within
35
- * {@linkcode COLOCATION_KM}. Blocking by the GEOCODED BUILDING catches the same-building pairs the address string keys
36
- * apart, so this F1 is at or above the string grain's; the Jaccard test still blocks distinct co-located orgs.
41
+ * The coordinate-keyed org-name truth: union same-org NPIs whose primary practice
42
+ * coordinates fall within {@linkcode COLOCATION_KM}.
37
43
  *
38
- * Brute-force pairwise over the sampled NPIs — trivial at this scale, and unlike a cell key it has no boundary
39
- * artifact.
44
+ * A geocoded-building block catches same-building pairs that the address string keys apart,
45
+ * so this F1 is at or above the string grain's.
46
+ * The Jaccard test still blocks distinct co-located orgs.
47
+ *
48
+ * Compares every sampled NPI pair.
49
+ * This is small enough for the sample and has no cell-boundary artifact.
40
50
  */
41
- export declare function buildOrgNameCoordGrain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, LatLon>): TruthLabel;
51
+ export declare function buildOrgNameCoordGrain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, GeoCoordinate>): TruthLabel;
42
52
  /**
43
- * The H3-cell org-name truth — the same building grain keyed on a cell instead of a radius, so co-location blocking is
44
- * O(n) rather than O(n²).
53
+ * The H3-cell org-name truth.
54
+ *
55
+ * The same building grain keyed on a cell instead of a radius, so co-location
56
+ * blocking is O(n) rather than O(n²).
45
57
  *
46
- * A robustness check on the coordinate grain, not a replacement: a hard cell boundary can split a same-building pair
47
- * into adjacent cells, so this slightly UNDER-counts relative to the radius. Coarser resolutions absorb more of that.
58
+ * A robustness check on the coordinate grain rather than a replacement: a hard cell boundary can split
59
+ * a same-building pair into adjacent cells, so this slightly under-counts relative to the radius.
60
+ * Coarser resolutions absorb more of that.
48
61
  */
49
- export declare function buildOrgNameH3Grain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, LatLon>, h3Res: number): TruthLabel;
62
+ export declare function buildOrgNameH3Grain(npiPrimary: Map<string, NPIPrimary>, npiCoord: Map<string, GeoCoordinate>, h3Res: number): TruthLabel;
50
63
  //# sourceMappingURL=truth-grains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"truth-grains.d.ts","sourceRoot":"","sources":["../../../lib/tools/nppes/truth-grains.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAwB,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAC1C,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEhE;;GAEG;AACH,eAAO,MAAM,aAAa,OAAO,CAAA;AAEjC;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,YAAY,KAAK,MAAM,CAAA;AAwBtD;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAY/F;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,UAAU,CAoBjF;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,QAAQ,EAAE,GAAG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