@nationaldesignstudio/rampart 0.1.1

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 (62) hide show
  1. package/LICENSE +402 -0
  2. package/MODEL_CARD.md +422 -0
  3. package/README.md +279 -0
  4. package/RELEASE.md +97 -0
  5. package/WHITEPAPER.md +316 -0
  6. package/dist/index.d.ts +23 -0
  7. package/dist/index.d.ts.map +1 -0
  8. package/dist/index.js +35639 -0
  9. package/dist/index.js.map +36 -0
  10. package/dist/src/guard.d.ts +94 -0
  11. package/dist/src/guard.d.ts.map +1 -0
  12. package/dist/src/heuristics.d.ts +14 -0
  13. package/dist/src/heuristics.d.ts.map +1 -0
  14. package/dist/src/ner/classifier.d.ts +92 -0
  15. package/dist/src/ner/classifier.d.ts.map +1 -0
  16. package/dist/src/ner/worker.d.ts +44 -0
  17. package/dist/src/ner/worker.d.ts.map +1 -0
  18. package/dist/src/ner/worker.js +35302 -0
  19. package/dist/src/ner/worker.js.map +30 -0
  20. package/dist/src/pipeline.d.ts +76 -0
  21. package/dist/src/pipeline.d.ts.map +1 -0
  22. package/dist/src/policy.d.ts +27 -0
  23. package/dist/src/policy.d.ts.map +1 -0
  24. package/dist/src/premask.d.ts +48 -0
  25. package/dist/src/premask.d.ts.map +1 -0
  26. package/dist/src/session.d.ts +60 -0
  27. package/dist/src/session.d.ts.map +1 -0
  28. package/dist/src/streaming.d.ts +32 -0
  29. package/dist/src/streaming.d.ts.map +1 -0
  30. package/dist/src/types.d.ts +43 -0
  31. package/dist/src/types.d.ts.map +1 -0
  32. package/dist/src/validators.d.ts +16 -0
  33. package/dist/src/validators.d.ts.map +1 -0
  34. package/eval/bench/README.md +91 -0
  35. package/eval/bench/fetch.ts +152 -0
  36. package/eval/bench/labels.ts +45 -0
  37. package/eval/bench/run.ts +146 -0
  38. package/eval/bench/runs/m06-v3-30k/by_language.json +303 -0
  39. package/eval/bench/runs/m06-v3-30k/summary.json +56 -0
  40. package/eval/bench/runs/sample-900/by_language.json +303 -0
  41. package/eval/bench/runs/sample-900/manifest.json +926 -0
  42. package/eval/bench/runs/sample-900/summary.json +56 -0
  43. package/eval/bench/score.ts +197 -0
  44. package/eval/bench/webgpu/entry.ts +70 -0
  45. package/eval/bench/webgpu/index.html +12 -0
  46. package/eval/bench/webgpu.ts +209 -0
  47. package/eval/public-cases.ts +412 -0
  48. package/eval/run-public-eval.ts +140 -0
  49. package/examples/basic-chat.ts +12 -0
  50. package/examples/pii-worker.ts +3 -0
  51. package/index.ts +47 -0
  52. package/package.json +103 -0
  53. package/src/guard.ts +170 -0
  54. package/src/heuristics.ts +141 -0
  55. package/src/ner/classifier.ts +580 -0
  56. package/src/ner/worker.ts +130 -0
  57. package/src/policy.ts +64 -0
  58. package/src/premask.ts +90 -0
  59. package/src/session.ts +99 -0
  60. package/src/streaming.ts +73 -0
  61. package/src/types.ts +74 -0
  62. package/src/validators.ts +40 -0
@@ -0,0 +1,303 @@
1
+ {
2
+ "de": {
3
+ "rows": 167,
4
+ "private_total": 643,
5
+ "private_recall": 0.9968895800933126,
6
+ "private_recall_wilson95": [
7
+ 0.9887304801600585,
8
+ 0.9991466137065079
9
+ ],
10
+ "private_recall_bootstrap95": [
11
+ 0.9922239502332815,
12
+ 1
13
+ ],
14
+ "leaked": 2,
15
+ "public_total": 401,
16
+ "public_retained": 0.9152119700748129,
17
+ "over_redacted": 34,
18
+ "span_f1": {
19
+ "iou_1.00": {
20
+ "tp": 380,
21
+ "fp": 247,
22
+ "fn": 263,
23
+ "precision": 0.6060606060606061,
24
+ "recall": 0.5909797822706065,
25
+ "f1": 0.5984251968503936
26
+ },
27
+ "iou_0.50": {
28
+ "tp": 467,
29
+ "fp": 160,
30
+ "fn": 176,
31
+ "precision": 0.74481658692185,
32
+ "recall": 0.7262830482115086,
33
+ "f1": 0.7354330708661418
34
+ },
35
+ "iou_0.00": {
36
+ "tp": 496,
37
+ "fp": 131,
38
+ "fn": 147,
39
+ "precision": 0.7910685805422647,
40
+ "recall": 0.7713841368584758,
41
+ "f1": 0.7811023622047243
42
+ }
43
+ }
44
+ },
45
+ "en": {
46
+ "rows": 268,
47
+ "private_total": 1303,
48
+ "private_recall": 0.9984650805832693,
49
+ "private_recall_wilson95": [
50
+ 0.994420601253016,
51
+ 0.9995789775788789
52
+ ],
53
+ "private_recall_bootstrap95": [
54
+ 0.9953952417498081,
55
+ 1
56
+ ],
57
+ "leaked": 2,
58
+ "public_total": 807,
59
+ "public_retained": 0.8004956629491945,
60
+ "over_redacted": 161,
61
+ "span_f1": {
62
+ "iou_1.00": {
63
+ "tp": 771,
64
+ "fp": 500,
65
+ "fn": 532,
66
+ "precision": 0.6066089693154996,
67
+ "recall": 0.5917114351496546,
68
+ "f1": 0.5990675990675991
69
+ },
70
+ "iou_0.50": {
71
+ "tp": 976,
72
+ "fp": 295,
73
+ "fn": 327,
74
+ "precision": 0.7678992918961448,
75
+ "recall": 0.7490406753645433,
76
+ "f1": 0.7583527583527583
77
+ },
78
+ "iou_0.00": {
79
+ "tp": 1032,
80
+ "fp": 239,
81
+ "fn": 271,
82
+ "precision": 0.8119590873328089,
83
+ "recall": 0.7920184190330007,
84
+ "f1": 0.8018648018648018
85
+ }
86
+ }
87
+ },
88
+ "es": {
89
+ "rows": 114,
90
+ "private_total": 505,
91
+ "private_recall": 0.996039603960396,
92
+ "private_recall_wilson95": [
93
+ 0.985676043712077,
94
+ 0.9989132665958852
95
+ ],
96
+ "private_recall_bootstrap95": [
97
+ 0.9900990099009901,
98
+ 1
99
+ ],
100
+ "leaked": 2,
101
+ "public_total": 273,
102
+ "public_retained": 0.8937728937728938,
103
+ "over_redacted": 29,
104
+ "span_f1": {
105
+ "iou_1.00": {
106
+ "tp": 308,
107
+ "fp": 154,
108
+ "fn": 197,
109
+ "precision": 0.6666666666666666,
110
+ "recall": 0.6099009900990099,
111
+ "f1": 0.6370217166494312
112
+ },
113
+ "iou_0.50": {
114
+ "tp": 390,
115
+ "fp": 72,
116
+ "fn": 115,
117
+ "precision": 0.8441558441558441,
118
+ "recall": 0.7722772277227723,
119
+ "f1": 0.8066184074457083
120
+ },
121
+ "iou_0.00": {
122
+ "tp": 408,
123
+ "fp": 54,
124
+ "fn": 97,
125
+ "precision": 0.8831168831168831,
126
+ "recall": 0.807920792079208,
127
+ "f1": 0.8438469493278179
128
+ }
129
+ }
130
+ },
131
+ "fr": {
132
+ "rows": 144,
133
+ "private_total": 608,
134
+ "private_recall": 0.9967105263157895,
135
+ "private_recall_wilson95": [
136
+ 0.9880861483518347,
137
+ 0.999097462569685
138
+ ],
139
+ "private_recall_bootstrap95": [
140
+ 0.9917763157894737,
141
+ 1
142
+ ],
143
+ "leaked": 2,
144
+ "public_total": 370,
145
+ "public_retained": 0.8945945945945946,
146
+ "over_redacted": 39,
147
+ "span_f1": {
148
+ "iou_1.00": {
149
+ "tp": 387,
150
+ "fp": 193,
151
+ "fn": 221,
152
+ "precision": 0.6672413793103448,
153
+ "recall": 0.6365131578947368,
154
+ "f1": 0.6515151515151515
155
+ },
156
+ "iou_0.50": {
157
+ "tp": 480,
158
+ "fp": 100,
159
+ "fn": 128,
160
+ "precision": 0.8275862068965517,
161
+ "recall": 0.7894736842105263,
162
+ "f1": 0.808080808080808
163
+ },
164
+ "iou_0.00": {
165
+ "tp": 496,
166
+ "fp": 84,
167
+ "fn": 112,
168
+ "precision": 0.8551724137931035,
169
+ "recall": 0.8157894736842105,
170
+ "f1": 0.835016835016835
171
+ }
172
+ }
173
+ },
174
+ "it": {
175
+ "rows": 106,
176
+ "private_total": 449,
177
+ "private_recall": 1,
178
+ "private_recall_wilson95": [
179
+ 0.9915166804463195,
180
+ 1
181
+ ],
182
+ "private_recall_bootstrap95": [
183
+ 1,
184
+ 1
185
+ ],
186
+ "leaked": 0,
187
+ "public_total": 279,
188
+ "public_retained": 0.9175627240143369,
189
+ "over_redacted": 23,
190
+ "span_f1": {
191
+ "iou_1.00": {
192
+ "tp": 258,
193
+ "fp": 160,
194
+ "fn": 191,
195
+ "precision": 0.6172248803827751,
196
+ "recall": 0.5746102449888641,
197
+ "f1": 0.5951557093425606
198
+ },
199
+ "iou_0.50": {
200
+ "tp": 321,
201
+ "fp": 97,
202
+ "fn": 128,
203
+ "precision": 0.7679425837320574,
204
+ "recall": 0.7149220489977728,
205
+ "f1": 0.740484429065744
206
+ },
207
+ "iou_0.00": {
208
+ "tp": 342,
209
+ "fp": 76,
210
+ "fn": 107,
211
+ "precision": 0.8181818181818182,
212
+ "recall": 0.7616926503340757,
213
+ "f1": 0.7889273356401384
214
+ }
215
+ }
216
+ },
217
+ "nl": {
218
+ "rows": 47,
219
+ "private_total": 233,
220
+ "private_recall": 1,
221
+ "private_recall_wilson95": [
222
+ 0.9837798765081812,
223
+ 1
224
+ ],
225
+ "private_recall_bootstrap95": [
226
+ 1,
227
+ 1
228
+ ],
229
+ "leaked": 0,
230
+ "public_total": 145,
231
+ "public_retained": 0.9310344827586207,
232
+ "over_redacted": 10,
233
+ "span_f1": {
234
+ "iou_1.00": {
235
+ "tp": 147,
236
+ "fp": 64,
237
+ "fn": 86,
238
+ "precision": 0.6966824644549763,
239
+ "recall": 0.630901287553648,
240
+ "f1": 0.6621621621621621
241
+ },
242
+ "iou_0.50": {
243
+ "tp": 179,
244
+ "fp": 32,
245
+ "fn": 54,
246
+ "precision": 0.8483412322274881,
247
+ "recall": 0.7682403433476395,
248
+ "f1": 0.8063063063063064
249
+ },
250
+ "iou_0.00": {
251
+ "tp": 186,
252
+ "fp": 25,
253
+ "fn": 47,
254
+ "precision": 0.8815165876777251,
255
+ "recall": 0.7982832618025751,
256
+ "f1": 0.8378378378378378
257
+ }
258
+ }
259
+ },
260
+ "pt": {
261
+ "rows": 54,
262
+ "private_total": 250,
263
+ "private_recall": 0.984,
264
+ "private_recall_wilson95": [
265
+ 0.9595895595167768,
266
+ 0.9937608763455877
267
+ ],
268
+ "private_recall_bootstrap95": [
269
+ 0.964,
270
+ 0.996
271
+ ],
272
+ "leaked": 4,
273
+ "public_total": 130,
274
+ "public_retained": 0.9307692307692308,
275
+ "over_redacted": 9,
276
+ "span_f1": {
277
+ "iou_1.00": {
278
+ "tp": 135,
279
+ "fp": 86,
280
+ "fn": 115,
281
+ "precision": 0.6108597285067874,
282
+ "recall": 0.54,
283
+ "f1": 0.5732484076433122
284
+ },
285
+ "iou_0.50": {
286
+ "tp": 170,
287
+ "fp": 51,
288
+ "fn": 80,
289
+ "precision": 0.7692307692307693,
290
+ "recall": 0.68,
291
+ "f1": 0.721868365180467
292
+ },
293
+ "iou_0.00": {
294
+ "tp": 181,
295
+ "fp": 40,
296
+ "fn": 69,
297
+ "precision": 0.8190045248868778,
298
+ "recall": 0.724,
299
+ "f1": 0.7685774946921443
300
+ }
301
+ }
302
+ }
303
+ }