@mailwoman/registry 9.2.0 → 9.4.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 (227) hide show
  1. package/README.md +1 -1
  2. package/{address-key.ts → lib/address-key.ts} +1 -1
  3. package/{geocode-handler.ts → lib/geocode-handler.ts} +7 -7
  4. package/{geojson.ts → lib/geojson.ts} +9 -4
  5. package/{index.ts → lib/index.ts} +10 -10
  6. package/{ingest.ts → lib/ingest.ts} +75 -68
  7. package/{learned-scorer.ts → lib/learned-scorer.ts} +1 -1
  8. package/{map-html.ts → lib/map-html.ts} +7 -13
  9. package/{reconcile.ts → lib/reconcile.ts} +7 -23
  10. package/{resolve.ts → lib/resolve.ts} +25 -12
  11. package/{tools → lib/tools}/coverage-reconciliation.ts +12 -14
  12. package/{tools → lib/tools}/cross-dataset-correlation.ts +60 -137
  13. package/{tools → lib/tools}/cross-source-threshold-sweep.ts +20 -31
  14. package/{tools → lib/tools}/dedup-ceiling.ts +33 -144
  15. package/{tools → lib/tools}/eval-geocoder.ts +9 -10
  16. package/{tools → lib/tools}/geocoder-namesake-probe.ts +5 -12
  17. package/{tools → lib/tools}/geocoder-vs-provided-coords.ts +9 -10
  18. package/lib/tools/gold-set-sample.ts +141 -0
  19. package/lib/tools/index.ts +31 -0
  20. package/{tools → lib/tools}/learned-scorer-clustering-eval.ts +68 -257
  21. package/{tools → lib/tools}/learned-scorer-crossstate-eval.ts +60 -243
  22. package/{tools → lib/tools}/learned-scorer-eval.ts +63 -257
  23. package/{tools → lib/tools}/matcher-scale.ts +4 -5
  24. package/lib/tools/nppes/org-name.ts +23 -0
  25. package/{tools → lib/tools}/nppes/overmerge-packet.ts +5 -7
  26. package/{tools → lib/tools}/nppes/report.ts +22 -25
  27. package/{tools → lib/tools}/nppes/sample.ts +80 -32
  28. package/{tools/nppes/levers.ts → lib/tools/nppes/settings.ts} +10 -10
  29. package/{tools → lib/tools}/nppes/truth-grains.ts +4 -44
  30. package/{tools → lib/tools}/nppes-dedup-benchmark.ts +42 -38
  31. package/lib/tools/shared.ts +761 -0
  32. package/lib/tools/train-cross-gbt.ts +209 -0
  33. package/{tools → lib/tools}/train-gbt.ts +35 -154
  34. package/lib/tools/train-org-cross-gbt.ts +179 -0
  35. package/{tools → lib/tools}/txhhsc-to-oarow.ts +9 -27
  36. package/lib/tools/viz/browser.ts +50 -0
  37. package/{tools → lib/tools}/viz/cross-dataset-map.ts +7 -8
  38. package/{tools → lib/tools}/viz/geocode-first-surface.ts +10 -8
  39. package/{tools → lib/tools}/viz/render-map.ts +10 -23
  40. package/lib/tools/viz/render.ts +98 -0
  41. package/{tools → lib/tools}/viz/source-provenance-map.ts +8 -10
  42. package/{tools → lib/tools}/viz/yardstick-figure.ts +6 -5
  43. package/out/address-key.d.ts +1 -1
  44. package/out/address-key.d.ts.map +1 -1
  45. package/out/address-key.js.map +1 -1
  46. package/out/geocode-handler.d.ts +6 -6
  47. package/out/geocode-handler.d.ts.map +1 -1
  48. package/out/geocode-handler.js +6 -6
  49. package/out/geocode-handler.js.map +1 -1
  50. package/out/geojson.d.ts +7 -2
  51. package/out/geojson.d.ts.map +1 -1
  52. package/out/geojson.js +5 -3
  53. package/out/geojson.js.map +1 -1
  54. package/out/index.d.ts +10 -10
  55. package/out/index.d.ts.map +1 -1
  56. package/out/index.js +10 -10
  57. package/out/index.js.map +1 -1
  58. package/out/ingest.d.ts +64 -46
  59. package/out/ingest.d.ts.map +1 -1
  60. package/out/ingest.js +31 -45
  61. package/out/ingest.js.map +1 -1
  62. package/out/learned-scorer.d.ts +1 -1
  63. package/out/learned-scorer.d.ts.map +1 -1
  64. package/out/learned-scorer.js.map +1 -1
  65. package/out/map-html.d.ts +3 -3
  66. package/out/map-html.d.ts.map +1 -1
  67. package/out/map-html.js +6 -11
  68. package/out/map-html.js.map +1 -1
  69. package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
  70. package/out/models/crosssource-gbt-en-us.js.map +1 -1
  71. package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
  72. package/out/models/dedup-gbt-en-us.js.map +1 -1
  73. package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
  74. package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
  75. package/out/reconcile.d.ts +6 -1
  76. package/out/reconcile.d.ts.map +1 -1
  77. package/out/reconcile.js +5 -20
  78. package/out/reconcile.js.map +1 -1
  79. package/out/resolve.d.ts +19 -7
  80. package/out/resolve.d.ts.map +1 -1
  81. package/out/resolve.js +16 -5
  82. package/out/resolve.js.map +1 -1
  83. package/out/tools/coverage-reconciliation.d.ts +1 -1
  84. package/out/tools/coverage-reconciliation.d.ts.map +1 -1
  85. package/out/tools/coverage-reconciliation.js +11 -11
  86. package/out/tools/coverage-reconciliation.js.map +1 -1
  87. package/out/tools/cross-dataset-correlation.d.ts +4 -4
  88. package/out/tools/cross-dataset-correlation.d.ts.map +1 -1
  89. package/out/tools/cross-dataset-correlation.js +57 -109
  90. package/out/tools/cross-dataset-correlation.js.map +1 -1
  91. package/out/tools/cross-source-threshold-sweep.d.ts +2 -2
  92. package/out/tools/cross-source-threshold-sweep.d.ts.map +1 -1
  93. package/out/tools/cross-source-threshold-sweep.js +19 -27
  94. package/out/tools/cross-source-threshold-sweep.js.map +1 -1
  95. package/out/tools/dedup-ceiling.d.ts.map +1 -1
  96. package/out/tools/dedup-ceiling.js +36 -117
  97. package/out/tools/dedup-ceiling.js.map +1 -1
  98. package/out/tools/eval-geocoder.d.ts +8 -12
  99. package/out/tools/eval-geocoder.d.ts.map +1 -1
  100. package/out/tools/eval-geocoder.js +2 -2
  101. package/out/tools/eval-geocoder.js.map +1 -1
  102. package/out/tools/geocoder-namesake-probe.d.ts +2 -2
  103. package/out/tools/geocoder-namesake-probe.d.ts.map +1 -1
  104. package/out/tools/geocoder-namesake-probe.js +4 -8
  105. package/out/tools/geocoder-namesake-probe.js.map +1 -1
  106. package/out/tools/geocoder-vs-provided-coords.d.ts +1 -1
  107. package/out/tools/geocoder-vs-provided-coords.d.ts.map +1 -1
  108. package/out/tools/geocoder-vs-provided-coords.js +8 -7
  109. package/out/tools/geocoder-vs-provided-coords.js.map +1 -1
  110. package/out/tools/gold-set-sample.d.ts +5 -5
  111. package/out/tools/gold-set-sample.d.ts.map +1 -1
  112. package/out/tools/gold-set-sample.js +37 -122
  113. package/out/tools/gold-set-sample.js.map +1 -1
  114. package/out/tools/index.d.ts +23 -23
  115. package/out/tools/index.d.ts.map +1 -1
  116. package/out/tools/index.js +23 -23
  117. package/out/tools/index.js.map +1 -1
  118. package/out/tools/learned-scorer-clustering-eval.d.ts +1 -1
  119. package/out/tools/learned-scorer-clustering-eval.d.ts.map +1 -1
  120. package/out/tools/learned-scorer-clustering-eval.js +36 -169
  121. package/out/tools/learned-scorer-clustering-eval.js.map +1 -1
  122. package/out/tools/learned-scorer-crossstate-eval.d.ts +5 -5
  123. package/out/tools/learned-scorer-crossstate-eval.d.ts.map +1 -1
  124. package/out/tools/learned-scorer-crossstate-eval.js +44 -166
  125. package/out/tools/learned-scorer-crossstate-eval.js.map +1 -1
  126. package/out/tools/learned-scorer-eval.d.ts +1 -1
  127. package/out/tools/learned-scorer-eval.d.ts.map +1 -1
  128. package/out/tools/learned-scorer-eval.js +38 -168
  129. package/out/tools/learned-scorer-eval.js.map +1 -1
  130. package/out/tools/matcher-scale.d.ts.map +1 -1
  131. package/out/tools/matcher-scale.js +4 -4
  132. package/out/tools/matcher-scale.js.map +1 -1
  133. package/out/tools/nppes/org-name.d.ts +2 -5
  134. package/out/tools/nppes/org-name.d.ts.map +1 -1
  135. package/out/tools/nppes/org-name.js +1 -30
  136. package/out/tools/nppes/org-name.js.map +1 -1
  137. package/out/tools/nppes/overmerge-packet.d.ts +3 -3
  138. package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
  139. package/out/tools/nppes/overmerge-packet.js +3 -3
  140. package/out/tools/nppes/overmerge-packet.js.map +1 -1
  141. package/out/tools/nppes/report.d.ts +5 -5
  142. package/out/tools/nppes/report.d.ts.map +1 -1
  143. package/out/tools/nppes/report.js +17 -19
  144. package/out/tools/nppes/report.js.map +1 -1
  145. package/out/tools/nppes/sample.d.ts +32 -6
  146. package/out/tools/nppes/sample.d.ts.map +1 -1
  147. package/out/tools/nppes/sample.js +44 -26
  148. package/out/tools/nppes/sample.js.map +1 -1
  149. package/out/tools/nppes/scoring.d.ts.map +1 -1
  150. package/out/tools/nppes/scoring.js.map +1 -1
  151. package/out/tools/nppes/{levers.d.ts → settings.d.ts} +8 -8
  152. package/out/tools/nppes/settings.d.ts.map +1 -0
  153. package/out/tools/nppes/{levers.js → settings.js} +8 -8
  154. package/out/tools/nppes/settings.js.map +1 -0
  155. package/out/tools/nppes/truth-grains.d.ts +2 -2
  156. package/out/tools/nppes/truth-grains.d.ts.map +1 -1
  157. package/out/tools/nppes/truth-grains.js +4 -29
  158. package/out/tools/nppes/truth-grains.js.map +1 -1
  159. package/out/tools/nppes-dedup-benchmark.d.ts +4 -4
  160. package/out/tools/nppes-dedup-benchmark.d.ts.map +1 -1
  161. package/out/tools/nppes-dedup-benchmark.js +40 -34
  162. package/out/tools/nppes-dedup-benchmark.js.map +1 -1
  163. package/out/tools/shared.d.ts +243 -7
  164. package/out/tools/shared.d.ts.map +1 -1
  165. package/out/tools/shared.js +348 -18
  166. package/out/tools/shared.js.map +1 -1
  167. package/out/tools/train-cross-gbt.d.ts +7 -7
  168. package/out/tools/train-cross-gbt.d.ts.map +1 -1
  169. package/out/tools/train-cross-gbt.js +47 -145
  170. package/out/tools/train-cross-gbt.js.map +1 -1
  171. package/out/tools/train-gbt.d.ts +7 -7
  172. package/out/tools/train-gbt.d.ts.map +1 -1
  173. package/out/tools/train-gbt.js +31 -111
  174. package/out/tools/train-gbt.js.map +1 -1
  175. package/out/tools/train-org-cross-gbt.d.ts +7 -5
  176. package/out/tools/train-org-cross-gbt.d.ts.map +1 -1
  177. package/out/tools/train-org-cross-gbt.js +45 -141
  178. package/out/tools/train-org-cross-gbt.js.map +1 -1
  179. package/out/tools/txhhsc-to-oarow.d.ts +2 -2
  180. package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
  181. package/out/tools/txhhsc-to-oarow.js +8 -22
  182. package/out/tools/txhhsc-to-oarow.js.map +1 -1
  183. package/out/tools/viz/browser.d.ts +34 -0
  184. package/out/tools/viz/browser.d.ts.map +1 -0
  185. package/out/tools/viz/browser.js +33 -0
  186. package/out/tools/viz/browser.js.map +1 -0
  187. package/out/tools/viz/cross-dataset-map.d.ts +2 -2
  188. package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
  189. package/out/tools/viz/cross-dataset-map.js +6 -6
  190. package/out/tools/viz/cross-dataset-map.js.map +1 -1
  191. package/out/tools/viz/geocode-first-surface.d.ts +4 -3
  192. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  193. package/out/tools/viz/geocode-first-surface.js +7 -5
  194. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  195. package/out/tools/viz/render-map.d.ts +3 -6
  196. package/out/tools/viz/render-map.d.ts.map +1 -1
  197. package/out/tools/viz/render-map.js +9 -19
  198. package/out/tools/viz/render-map.js.map +1 -1
  199. package/out/tools/viz/render.d.ts +4 -9
  200. package/out/tools/viz/render.d.ts.map +1 -1
  201. package/out/tools/viz/render.js +24 -39
  202. package/out/tools/viz/render.js.map +1 -1
  203. package/out/tools/viz/source-provenance-map.d.ts +2 -2
  204. package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
  205. package/out/tools/viz/source-provenance-map.js +6 -7
  206. package/out/tools/viz/source-provenance-map.js.map +1 -1
  207. package/out/tools/viz/yardstick-figure.d.ts +2 -2
  208. package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
  209. package/out/tools/viz/yardstick-figure.js +5 -4
  210. package/out/tools/viz/yardstick-figure.js.map +1 -1
  211. package/out/types.d.ts.map +1 -1
  212. package/out/types.js.map +1 -1
  213. package/package.json +115 -15
  214. package/out/tools/nppes/levers.d.ts.map +0 -1
  215. package/out/tools/nppes/levers.js.map +0 -1
  216. package/tools/gold-set-sample.ts +0 -254
  217. package/tools/index.ts +0 -31
  218. package/tools/nppes/org-name.ts +0 -56
  219. package/tools/shared.ts +0 -162
  220. package/tools/train-cross-gbt.ts +0 -359
  221. package/tools/train-org-cross-gbt.ts +0 -330
  222. package/tools/viz/render.ts +0 -113
  223. /package/{models → lib/models}/crosssource-gbt-en-us.ts +0 -0
  224. /package/{models → lib/models}/dedup-gbt-en-us.ts +0 -0
  225. /package/{models → lib/models}/org-crosssource-gbt-en-us.ts +0 -0
  226. /package/{tools → lib/tools}/nppes/scoring.ts +0 -0
  227. /package/{types.ts → lib/types.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailwoman/registry",
3
- "version": "9.2.0",
3
+ "version": "9.4.0",
4
4
  "description": "The geocode-first record-matching application: resolve messy contact/organization records into canonical, geocoded entities (block → score → cluster) and export them as GeoJSON for spatial analysis. The clinic-funding use case mailwoman was built for.",
5
5
  "license": "AGPL-3.0-only OR LicenseRef-Commercial",
6
6
  "repository": {
@@ -24,61 +24,110 @@
24
24
  "!test/**"
25
25
  ],
26
26
  "type": "module",
27
+ "sideEffects": false,
27
28
  "imports": {
28
29
  "#index": {
29
30
  "types": "./out/index.d.ts",
31
+ "node": "./out/index.js",
30
32
  "default": "./out/index.js"
31
33
  },
32
- "#tools/nppes/*": {
33
- "types": "./out/tools/nppes/*.d.ts",
34
- "default": "./out/tools/nppes/*.js"
34
+ "#*": {
35
+ "types": "./out/*.d.ts",
36
+ "node": "./out/*.js",
37
+ "default": "./out/*.js"
35
38
  }
36
39
  },
37
40
  "exports": {
38
41
  "./package.json": "./package.json",
39
42
  ".": {
40
43
  "types": "./out/index.d.ts",
44
+ "node": "./out/index.js",
41
45
  "default": "./out/index.js"
42
46
  },
43
47
  "./resolve": {
44
48
  "types": "./out/resolve.d.ts",
49
+ "node": "./out/resolve.js",
45
50
  "default": "./out/resolve.js"
46
51
  },
47
52
  "./geojson": {
48
53
  "types": "./out/geojson.d.ts",
54
+ "node": "./out/geojson.js",
49
55
  "default": "./out/geojson.js"
50
56
  },
51
57
  "./ingest": {
52
58
  "types": "./out/ingest.d.ts",
59
+ "node": "./out/ingest.js",
53
60
  "default": "./out/ingest.js"
54
61
  },
55
62
  "./tools": {
56
63
  "types": "./out/tools/index.d.ts",
64
+ "node": "./out/tools/index.js",
57
65
  "default": "./out/tools/index.js"
58
66
  },
59
67
  "./address-key": {
60
68
  "types": "./out/address-key.d.ts",
69
+ "node": "./out/address-key.js",
61
70
  "default": "./out/address-key.js"
62
71
  },
63
72
  "./types": {
64
73
  "types": "./out/types.d.ts",
74
+ "node": "./out/types.js",
65
75
  "default": "./out/types.js"
66
76
  },
67
77
  "./geocode-handler": {
68
78
  "types": "./out/geocode-handler.d.ts",
79
+ "node": "./out/geocode-handler.js",
69
80
  "default": "./out/geocode-handler.js"
70
81
  },
71
82
  "./learned-scorer": {
72
83
  "types": "./out/learned-scorer.d.ts",
84
+ "node": "./out/learned-scorer.js",
73
85
  "default": "./out/learned-scorer.js"
74
86
  },
75
87
  "./map-html": {
76
88
  "types": "./out/map-html.d.ts",
89
+ "node": "./out/map-html.js",
77
90
  "default": "./out/map-html.js"
78
91
  },
79
92
  "./reconcile": {
80
93
  "types": "./out/reconcile.d.ts",
94
+ "node": "./out/reconcile.js",
81
95
  "default": "./out/reconcile.js"
96
+ },
97
+ "./tools/nppes/org-name": {
98
+ "types": "./out/tools/nppes/org-name.d.ts",
99
+ "node": "./out/tools/nppes/org-name.js",
100
+ "default": "./out/tools/nppes/org-name.js"
101
+ },
102
+ "./tools/nppes/overmerge-packet": {
103
+ "types": "./out/tools/nppes/overmerge-packet.d.ts",
104
+ "node": "./out/tools/nppes/overmerge-packet.js",
105
+ "default": "./out/tools/nppes/overmerge-packet.js"
106
+ },
107
+ "./tools/nppes/report": {
108
+ "types": "./out/tools/nppes/report.d.ts",
109
+ "node": "./out/tools/nppes/report.js",
110
+ "default": "./out/tools/nppes/report.js"
111
+ },
112
+ "./tools/nppes/sample": {
113
+ "types": "./out/tools/nppes/sample.d.ts",
114
+ "node": "./out/tools/nppes/sample.js",
115
+ "default": "./out/tools/nppes/sample.js"
116
+ },
117
+ "./tools/nppes/scoring": {
118
+ "types": "./out/tools/nppes/scoring.d.ts",
119
+ "node": "./out/tools/nppes/scoring.js",
120
+ "default": "./out/tools/nppes/scoring.js"
121
+ },
122
+ "./tools/nppes/settings": {
123
+ "types": "./out/tools/nppes/settings.d.ts",
124
+ "node": "./out/tools/nppes/settings.js",
125
+ "default": "./out/tools/nppes/settings.js"
126
+ },
127
+ "./tools/nppes/truth-grains": {
128
+ "types": "./out/tools/nppes/truth-grains.d.ts",
129
+ "node": "./out/tools/nppes/truth-grains.js",
130
+ "default": "./out/tools/nppes/truth-grains.js"
82
131
  }
83
132
  },
84
133
  "publishConfig": {
@@ -87,72 +136,123 @@
87
136
  "./package.json": "./package.json",
88
137
  ".": {
89
138
  "types": "./out/index.d.ts",
139
+ "node": "./out/index.js",
90
140
  "default": "./out/index.js"
91
141
  },
92
142
  "./resolve": {
93
143
  "types": "./out/resolve.d.ts",
144
+ "node": "./out/resolve.js",
94
145
  "default": "./out/resolve.js"
95
146
  },
96
147
  "./geojson": {
97
148
  "types": "./out/geojson.d.ts",
149
+ "node": "./out/geojson.js",
98
150
  "default": "./out/geojson.js"
99
151
  },
100
152
  "./ingest": {
101
153
  "types": "./out/ingest.d.ts",
154
+ "node": "./out/ingest.js",
102
155
  "default": "./out/ingest.js"
103
156
  },
104
157
  "./tools": {
105
158
  "types": "./out/tools/index.d.ts",
159
+ "node": "./out/tools/index.js",
106
160
  "default": "./out/tools/index.js"
107
161
  },
108
162
  "./address-key": {
109
163
  "types": "./out/address-key.d.ts",
164
+ "node": "./out/address-key.js",
110
165
  "default": "./out/address-key.js"
111
166
  },
112
167
  "./types": {
113
168
  "types": "./out/types.d.ts",
169
+ "node": "./out/types.js",
114
170
  "default": "./out/types.js"
115
171
  },
116
172
  "./geocode-handler": {
117
173
  "types": "./out/geocode-handler.d.ts",
174
+ "node": "./out/geocode-handler.js",
118
175
  "default": "./out/geocode-handler.js"
119
176
  },
120
177
  "./learned-scorer": {
121
178
  "types": "./out/learned-scorer.d.ts",
179
+ "node": "./out/learned-scorer.js",
122
180
  "default": "./out/learned-scorer.js"
123
181
  },
124
182
  "./map-html": {
125
183
  "types": "./out/map-html.d.ts",
184
+ "node": "./out/map-html.js",
126
185
  "default": "./out/map-html.js"
127
186
  },
128
187
  "./reconcile": {
129
188
  "types": "./out/reconcile.d.ts",
189
+ "node": "./out/reconcile.js",
130
190
  "default": "./out/reconcile.js"
191
+ },
192
+ "./tools/nppes/org-name": {
193
+ "types": "./out/tools/nppes/org-name.d.ts",
194
+ "node": "./out/tools/nppes/org-name.js",
195
+ "default": "./out/tools/nppes/org-name.js"
196
+ },
197
+ "./tools/nppes/overmerge-packet": {
198
+ "types": "./out/tools/nppes/overmerge-packet.d.ts",
199
+ "node": "./out/tools/nppes/overmerge-packet.js",
200
+ "default": "./out/tools/nppes/overmerge-packet.js"
201
+ },
202
+ "./tools/nppes/report": {
203
+ "types": "./out/tools/nppes/report.d.ts",
204
+ "node": "./out/tools/nppes/report.js",
205
+ "default": "./out/tools/nppes/report.js"
206
+ },
207
+ "./tools/nppes/sample": {
208
+ "types": "./out/tools/nppes/sample.d.ts",
209
+ "node": "./out/tools/nppes/sample.js",
210
+ "default": "./out/tools/nppes/sample.js"
211
+ },
212
+ "./tools/nppes/scoring": {
213
+ "types": "./out/tools/nppes/scoring.d.ts",
214
+ "node": "./out/tools/nppes/scoring.js",
215
+ "default": "./out/tools/nppes/scoring.js"
216
+ },
217
+ "./tools/nppes/settings": {
218
+ "types": "./out/tools/nppes/settings.d.ts",
219
+ "node": "./out/tools/nppes/settings.js",
220
+ "default": "./out/tools/nppes/settings.js"
221
+ },
222
+ "./tools/nppes/truth-grains": {
223
+ "types": "./out/tools/nppes/truth-grains.d.ts",
224
+ "node": "./out/tools/nppes/truth-grains.js",
225
+ "default": "./out/tools/nppes/truth-grains.js"
131
226
  }
132
227
  },
133
228
  "imports": {
134
229
  "#index": {
135
230
  "types": "./out/index.d.ts",
231
+ "node": "./out/index.js",
136
232
  "default": "./out/index.js"
137
233
  },
138
- "#tools/nppes/*": {
139
- "types": "./out/tools/nppes/*.d.ts",
140
- "default": "./out/tools/nppes/*.js"
234
+ "#*": {
235
+ "types": "./out/*.d.ts",
236
+ "node": "./out/*.js",
237
+ "default": "./out/*.js"
141
238
  }
142
239
  }
143
240
  },
144
241
  "dependencies": {
145
- "@mailwoman/address-id": "9.2.0",
146
- "@mailwoman/core": "9.2.0",
147
- "@mailwoman/match": "9.2.0",
148
- "@mailwoman/record": "9.2.0",
149
- "@mailwoman/spatial": "9.2.0",
242
+ "@mailwoman/address-id": "9.4.0",
243
+ "@mailwoman/core": "9.4.0",
244
+ "@mailwoman/match": "9.4.0",
245
+ "@mailwoman/record": "9.4.0",
246
+ "@mailwoman/resolver-wof-sqlite": "9.4.0",
247
+ "@mailwoman/spatial": "9.4.0",
248
+ "@mailwoman/sqlite": "9.4.0",
150
249
  "@protomaps/basemaps": "^5.7.2",
151
250
  "h3-js": "^4.5.0",
152
- "spliterator": "^6.2.0"
251
+ "spliterator": "^6.4.1"
153
252
  },
154
253
  "devDependencies": {
155
- "@types/node": ">=26.1.2",
156
- "playwright": "^1.62.1"
254
+ "@types/node": "^26.4.1",
255
+ "path-ts": "^2.3.0",
256
+ "playwright": "^1.63.0"
157
257
  }
158
258
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"levers.d.ts","sourceRoot":"","sources":["../../../tools/nppes/levers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAA;AAE1D;;GAEG;AACH,MAAM,WAAW,WAAW;IAC3B,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,KAAK;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,WAAW,CAAA;CACnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,KAAK,EAAE,CA6DzE"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"levers.js","sourceRoot":"","sources":["../../../tools/nppes/levers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAyBH;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,gBAAoC;IAC/D,OAAO;QACN;YACC,KAAK,EAAE,uDAAuD;YAC9D,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,kGAAkG;QAClG,8FAA8F;QAC9F,kGAAkG;QAClG,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,254 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Gold-set P3 (#625) — sample the HARD slice for adjudication. The programmatic entity truth
7
- * (`nppes-dedup-benchmark.ts`) collapses only NPPES-FLAGGED subparts (Is-Subpart + parent
8
- * LBN/TIN); it can't settle the genuinely-ambiguous co-located collisions: distinct NPIs at one
9
- * address with near-identical names that are NOT flagged subparts of the same parent. Those are
10
- * where NPI-truth and any programmatic rule disagree — exactly the pairs a frozen adjudicated
11
- * gold set must cover.
12
- *
13
- * This finds them (over the full TX registry, geocode-free — same machinery as `dedup-ceiling.ts`)
14
- * and writes each as a JSONL row carrying BOTH records' fields (org name, address, authorized
15
- * official, taxonomy, subpart/parent flags) plus the programmatic verdict, so an adjudicator
16
- * (human or LLM-as-judge, flagged as such) can label "same real-world entity? yes/no" and we can
17
- * MEASURE how often the programmatic truth matches judgment.
18
- *
19
- * Run: `mailwoman registry gold-set-sample [--cap 200000] [--state TX] [--tau 0.7] [--n 300]
20
- * [--out-jsonl <path>]`
21
- */
22
-
23
- import { writeFileSync } from "node:fs"
24
-
25
- import { isPresent } from "@mailwoman/core/objects"
26
- import { dataRootPath } from "@mailwoman/core/utils"
27
- import { jaccard } from "@mailwoman/match"
28
-
29
- import { addressFrequencyKey, streamRows } from "#index"
30
-
31
- import { norm } from "./shared.ts"
32
-
33
- /**
34
- * Options for {@linkcode goldSetSample}.
35
- */
36
- export interface GoldSetSampleOptions {
37
- /**
38
- * Record-matcher sources directory. Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
39
- */
40
- sources?: string
41
- /**
42
- * Providers sampled from the registry. Default 200000.
43
- */
44
- cap?: number
45
- /**
46
- * State filter. Default TX.
47
- */
48
- state?: string
49
- /**
50
- * Org-name Jaccard collision threshold. Default 0.7.
51
- */
52
- tau?: number
53
- /**
54
- * Adjudication sample size. Default 300.
55
- */
56
- n?: number
57
- /**
58
- * Write the sampled pairs here as JSONL (otherwise the first 10 print to stdout).
59
- */
60
- outJSONL?: string
61
- }
62
-
63
- const STOP = new Set([
64
- "llc",
65
- "inc",
66
- "incorporated",
67
- "corp",
68
- "corporation",
69
- "co",
70
- "ltd",
71
- "pllc",
72
- "pc",
73
- "pa",
74
- "lp",
75
- "llp",
76
- "the",
77
- "of",
78
- "and",
79
- ])
80
-
81
- function orgTokens(s: string): Set<string> {
82
- return new Set(
83
- s
84
- .toLowerCase()
85
- .replaceAll(/[^a-z0-9 ]/g, " ")
86
- .split(/\s+/)
87
- .filter((t) => t && !STOP.has(t))
88
- )
89
- }
90
-
91
- const C = {
92
- npi: "NPI",
93
- entityType: "Entity Type Code",
94
- org: "Provider Organization Name (Legal Business Name)",
95
- pAddr: "Provider First Line Business Practice Location Address",
96
- pCity: "Provider Business Practice Location Address City Name",
97
- pState: "Provider Business Practice Location Address State Name",
98
- pZip: "Provider Business Practice Location Address Postcode",
99
- authLast: "Authorized Official Last Name",
100
- authFirst: "Authorized Official First Name",
101
- taxonomy: "Healthcare Provider Taxonomy Code_1",
102
- isSubpart: "Is Organization Subpart",
103
- parentLBN: "Parent Organization LBN",
104
- parentTIN: "Parent Organization TIN",
105
- }
106
-
107
- interface Prov {
108
- npi: string
109
- org: string
110
- tokens: Set<string>
111
- address: string
112
- auth: string
113
- taxonomy: string
114
- subpart: boolean
115
- parent: string
116
- }
117
-
118
- /**
119
- * Gold-set P3 (#625) — sample the HARD co-located name-collision slice for adjudication.
120
- */
121
- export async function goldSetSample(
122
- options: GoldSetSampleOptions = {},
123
- report?: (line: string) => void
124
- ): Promise<{ hardPairs: number; sampled: number }> {
125
- const SOURCES = options.sources || dataRootPath("record-matcher", "sources")
126
- const CAP = options.cap ?? 200_000
127
- const STATE = (options.state || "TX").toUpperCase()
128
- const TAU = options.tau ?? 0.7
129
- const N = options.n ?? 300
130
- const OUT = options.outJSONL || ""
131
- const REGISTRY = `${SOURCES}/nppes_npi-registry_20260607.tsv`
132
-
133
- report?.(`[A] streaming ${STATE} org providers (cap ${CAP})…`)
134
- const byAddr = new Map<string, Prov[]>()
135
- let kept = 0
136
-
137
- for await (const r of streamRows(REGISTRY)) {
138
- if (norm(r[C.entityType]) !== "2") continue
139
-
140
- if (norm(r[C.pState]).toUpperCase() !== STATE) continue
141
- const org = norm(r[C.org])
142
- const line1 = norm(r[C.pAddr])
143
-
144
- if (!org || !line1) continue
145
- const address = [line1, norm(r[C.pCity]), STATE, norm(r[C.pZip])].filter(isPresent).join(", ")
146
- const addrKey = addressFrequencyKey(address)
147
-
148
- if (!addrKey) continue
149
-
150
- const p: Prov = {
151
- npi: norm(r[C.npi]),
152
- org,
153
- tokens: orgTokens(org),
154
- address,
155
- auth: `${norm(r[C.authFirst])} ${norm(r[C.authLast])}`.toLowerCase().trim(),
156
- taxonomy: norm(r[C.taxonomy]),
157
- subpart: norm(r[C.isSubpart]).toUpperCase() === "Y",
158
- parent: `${norm(r[C.parentLBN])}|${norm(r[C.parentTIN])}`.toLowerCase(),
159
- }
160
-
161
- if (!byAddr.has(addrKey)) {
162
- byAddr.set(addrKey, [])
163
- }
164
-
165
- byAddr.get(addrKey)!.push(p)
166
-
167
- kept++
168
-
169
- if (kept >= CAP) break
170
- }
171
-
172
- report?.(` ${kept} providers at ${byAddr.size} addresses`)
173
-
174
- // Hard pairs: co-located, name-similar (≥τ), DISTINCT NPIs that programmatic truth can't confidently
175
- // collapse (NOT subparts of the same parent). Tag the programmatic verdict so adjudication can grade it.
176
- interface HardPair {
177
- npiA: string
178
- npiB: string
179
- orgA: string
180
- orgB: string
181
- address: string
182
- nameJaccard: number
183
- sameAuthorizedOfficial: boolean
184
- sameTaxonomy: boolean
185
- bothSubpartSameParent: boolean
186
- programmaticVerdict: "same-entity" | "distinct"
187
- adjudication: null // ← to be filled: "same-entity" | "distinct"
188
- }
189
-
190
- const hard: HardPair[] = []
191
-
192
- for (const provs of byAddr.values()) {
193
- const distinct = new Map<string, Prov>()
194
-
195
- for (const p of provs)
196
- if (!distinct.has(p.npi)) {
197
- distinct.set(p.npi, p)
198
- }
199
-
200
- const list = [...distinct.values()]
201
-
202
- if (list.length < 2) continue
203
-
204
- for (let i = 0; i < list.length; i++) {
205
- for (let j = i + 1; j < list.length; j++) {
206
- const a = list[i]!
207
- const b = list[j]!
208
- const sim = jaccard(a.tokens, b.tokens)
209
-
210
- if (sim < TAU) continue
211
- const sameParent = a.subpart && b.subpart && a.parent === b.parent && a.parent !== "|"
212
-
213
- if (sameParent) continue // programmatic truth already collapses these — not the hard slice
214
- const sameAuth = a.auth !== "" && a.auth === b.auth
215
- const sameTax = a.taxonomy !== "" && a.taxonomy === b.taxonomy
216
-
217
- hard.push({
218
- npiA: a.npi,
219
- npiB: b.npi,
220
- orgA: a.org,
221
- orgB: b.org,
222
- address: a.address,
223
- nameJaccard: Number(sim.toFixed(3)),
224
- sameAuthorizedOfficial: sameAuth,
225
- sameTaxonomy: sameTax,
226
- bothSubpartSameParent: false,
227
- // Programmatic heuristic verdict (what an entity-level rule WOULD say, beyond the flagged
228
- // subparts): same authorized official ⇒ likely one org; different official + different
229
- // specialty ⇒ likely distinct. The whole point is to ADJUDICATE whether this is right.
230
- programmaticVerdict: sameAuth ? "same-entity" : "distinct",
231
- adjudication: null,
232
- })
233
- }
234
- }
235
- }
236
-
237
- report?.(` ${hard.length} hard co-located name-collision pairs (non-flagged-subpart)`)
238
-
239
- // Deterministic spread sample of N (stride, not head — avoid file-order bias, the dedup-ceiling lesson).
240
- const stride = Math.max(1, Math.floor(hard.length / N))
241
- const sample = hard.filter((_, i) => i % stride === 0).slice(0, N)
242
- report?.(` sampling ${sample.length} (stride ${stride}) for adjudication`)
243
-
244
- if (OUT) {
245
- writeFileSync(OUT, sample.map((p) => JSON.stringify(p)).join("\n") + "\n")
246
- report?.(`[written] ${OUT}`)
247
- } else {
248
- for (const p of sample.slice(0, 10)) {
249
- console.log(JSON.stringify(p))
250
- }
251
- }
252
-
253
- return { hardPairs: hard.length, sampled: sample.length }
254
- }
package/tools/index.ts DELETED
@@ -1,31 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Registry operator tool exports.
7
- */
8
-
9
- export * from "./coverage-reconciliation.ts"
10
- export * from "./cross-dataset-correlation.ts"
11
- export * from "./cross-source-threshold-sweep.ts"
12
- export * from "./dedup-ceiling.ts"
13
- export * from "./eval-geocoder.ts"
14
- export * from "./geocoder-namesake-probe.ts"
15
- export * from "./geocoder-vs-provided-coords.ts"
16
- export * from "./gold-set-sample.ts"
17
- export * from "./learned-scorer-clustering-eval.ts"
18
- export * from "./learned-scorer-crossstate-eval.ts"
19
- export * from "./learned-scorer-eval.ts"
20
- export * from "./matcher-scale.ts"
21
- export * from "./nppes-dedup-benchmark.ts"
22
- export * from "./train-cross-gbt.ts"
23
- export * from "./train-gbt.ts"
24
- export * from "./train-org-cross-gbt.ts"
25
- export * from "./txhhsc-to-oarow.ts"
26
- export * from "./viz/cross-dataset-map.ts"
27
- export * from "./viz/geocode-first-surface.ts"
28
- export * from "./viz/render-map.ts"
29
- export * from "./viz/render.ts"
30
- export * from "./viz/source-provenance-map.ts"
31
- export * from "./viz/yardstick-figure.ts"
@@ -1,56 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- * @file Org-name similarity primitives for the NPPES benchmark's org-name entity truth.
6
- */
7
-
8
- /**
9
- * Corporate-form words and articles stripped before two organization names are compared. The gold-set rule is "same
10
- * address + same org name ⇒ same entity", so the domain words carry the distinguishing signal while a legal-form suffix
11
- * would inflate agreement between unrelated co-located companies.
12
- */
13
- const ORG_STOP = new Set([
14
- "llc",
15
- "inc",
16
- "incorporated",
17
- "corp",
18
- "corporation",
19
- "co",
20
- "ltd",
21
- "pllc",
22
- "pc",
23
- "pa",
24
- "lp",
25
- "llp",
26
- "the",
27
- "of",
28
- "and",
29
- ])
30
-
31
- /**
32
- * The comparable token set of an organization name.
33
- */
34
- export const orgTokens = (s: string): Set<string> =>
35
- new Set(
36
- s
37
- .toLowerCase()
38
- .replaceAll(/[^a-z0-9 ]/g, " ")
39
- .split(/\s+/)
40
- .filter((t) => t && !ORG_STOP.has(t))
41
- )
42
-
43
- /**
44
- * Jaccard floor at or above which two {@linkcode orgTokens} sets count as the same organization — the gold-set
45
- * threshold.
46
- */
47
- export const ORG_TAU = 0.7
48
-
49
- /**
50
- * An NPI's primary registry identity: the org-name token set plus the address key of its practice location. Every grain
51
- * of the org-name truth blocks on a location and gates on the tokens.
52
- */
53
- export interface NPIPrimary {
54
- tokens: Set<string>
55
- addrKey: string
56
- }