@mailwoman/core 5.8.0 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/data/chromium-i18n/ssl-address/AC.json +2 -2
- package/data/chromium-i18n/ssl-address/AD.json +8 -8
- package/data/chromium-i18n/ssl-address/AE.json +8 -8
- package/data/chromium-i18n/ssl-address/AF.json +2 -2
- package/data/chromium-i18n/ssl-address/AG.json +1 -1
- package/data/chromium-i18n/ssl-address/AI.json +2 -2
- package/data/chromium-i18n/ssl-address/AL.json +2 -2
- package/data/chromium-i18n/ssl-address/AM.json +8 -8
- package/data/chromium-i18n/ssl-address/AO.json +1 -1
- package/data/chromium-i18n/ssl-address/AQ.json +1 -1
- package/data/chromium-i18n/ssl-address/AR.json +8 -8
- package/data/chromium-i18n/ssl-address/AS.json +6 -6
- package/data/chromium-i18n/ssl-address/AT.json +3 -3
- package/data/chromium-i18n/ssl-address/AU.json +13 -13
- package/data/chromium-i18n/ssl-address/AW.json +1 -1
- package/data/chromium-i18n/ssl-address/AX.json +4 -4
- package/data/chromium-i18n/ssl-address/AZ.json +3 -3
- package/data/chromium-i18n/ssl-address/BA.json +2 -2
- package/data/chromium-i18n/ssl-address/BB.json +3 -3
- package/data/chromium-i18n/ssl-address/BD.json +3 -3
- package/data/chromium-i18n/ssl-address/BE.json +3 -3
- package/data/chromium-i18n/ssl-address/BF.json +1 -6
- package/data/chromium-i18n/ssl-address/BG.json +3 -3
- package/data/chromium-i18n/ssl-address/BH.json +3 -3
- package/data/chromium-i18n/ssl-address/BI.json +1 -1
- package/data/chromium-i18n/ssl-address/BJ.json +1 -1
- package/data/chromium-i18n/ssl-address/BL.json +4 -4
- package/data/chromium-i18n/ssl-address/BM.json +3 -3
- package/data/chromium-i18n/ssl-address/BN.json +3 -3
- package/data/chromium-i18n/ssl-address/BO.json +1 -1
- package/data/chromium-i18n/ssl-address/BQ.json +1 -1
- package/data/chromium-i18n/ssl-address/BR.json +13 -13
- package/data/chromium-i18n/ssl-address/BS.json +5 -5
- package/data/chromium-i18n/ssl-address/BT.json +3 -3
- package/data/chromium-i18n/ssl-address/BV.json +1 -1
- package/data/chromium-i18n/ssl-address/BW.json +1 -1
- package/data/chromium-i18n/ssl-address/BY.json +4 -4
- package/data/chromium-i18n/ssl-address/BZ.json +1 -1
- package/data/chromium-i18n/ssl-address/CA.json +9 -9
- package/data/chromium-i18n/ssl-address/CC.json +3 -3
- package/data/chromium-i18n/ssl-address/CD.json +1 -1
- package/data/chromium-i18n/ssl-address/CF.json +1 -1
- package/data/chromium-i18n/ssl-address/CG.json +1 -1
- package/data/chromium-i18n/ssl-address/CH.json +5 -5
- package/data/chromium-i18n/ssl-address/CI.json +1 -6
- package/data/chromium-i18n/ssl-address/CK.json +1 -1
- package/data/chromium-i18n/ssl-address/CL.json +9 -9
- package/data/chromium-i18n/ssl-address/CM.json +1 -1
- package/data/chromium-i18n/ssl-address/CN.json +14 -14
- package/data/chromium-i18n/ssl-address/CO.json +8 -4
- package/data/chromium-i18n/ssl-address/CR.json +3 -3
- package/data/chromium-i18n/ssl-address/CU.json +5 -5
- package/data/chromium-i18n/ssl-address/CV.json +6 -6
- package/data/chromium-i18n/ssl-address/CW.json +1 -1
- package/data/chromium-i18n/ssl-address/CX.json +3 -3
- package/data/chromium-i18n/ssl-address/CY.json +2 -2
- package/data/chromium-i18n/ssl-address/CZ.json +3 -3
- package/data/chromium-i18n/ssl-address/DE.json +3 -3
- package/data/chromium-i18n/ssl-address/DJ.json +1 -1
- package/data/chromium-i18n/ssl-address/DK.json +3 -3
- package/data/chromium-i18n/ssl-address/DM.json +1 -1
- package/data/chromium-i18n/ssl-address/DO.json +3 -3
- package/data/chromium-i18n/ssl-address/DZ.json +1 -8
- package/data/chromium-i18n/ssl-address/EC.json +4 -4
- package/data/chromium-i18n/ssl-address/EE.json +5 -4
- package/data/chromium-i18n/ssl-address/EG.json +8 -8
- package/data/chromium-i18n/ssl-address/EH.json +2 -2
- package/data/chromium-i18n/ssl-address/ER.json +1 -1
- package/data/chromium-i18n/ssl-address/ES.json +9 -9
- package/data/chromium-i18n/ssl-address/ET.json +1 -8
- package/data/chromium-i18n/ssl-address/FI.json +4 -4
- package/data/chromium-i18n/ssl-address/FJ.json +1 -1
- package/data/chromium-i18n/ssl-address/FK.json +3 -3
- package/data/chromium-i18n/ssl-address/FM.json +6 -6
- package/data/chromium-i18n/ssl-address/FO.json +4 -4
- package/data/chromium-i18n/ssl-address/FR.json +5 -5
- package/data/chromium-i18n/ssl-address/GA.json +1 -1
- package/data/chromium-i18n/ssl-address/GB.json +5 -5
- package/data/chromium-i18n/ssl-address/GD.json +1 -1
- package/data/chromium-i18n/ssl-address/GE.json +3 -3
- package/data/chromium-i18n/ssl-address/GF.json +4 -4
- package/data/chromium-i18n/ssl-address/GG.json +4 -4
- package/data/chromium-i18n/ssl-address/GH.json +1 -1
- package/data/chromium-i18n/ssl-address/GI.json +2 -2
- package/data/chromium-i18n/ssl-address/GL.json +2 -2
- package/data/chromium-i18n/ssl-address/GM.json +1 -1
- package/data/chromium-i18n/ssl-address/GN.json +1 -8
- package/data/chromium-i18n/ssl-address/GP.json +4 -4
- package/data/chromium-i18n/ssl-address/GQ.json +1 -1
- package/data/chromium-i18n/ssl-address/GR.json +3 -3
- package/data/chromium-i18n/ssl-address/GS.json +3 -3
- package/data/chromium-i18n/ssl-address/GT.json +2 -2
- package/data/chromium-i18n/ssl-address/GU.json +5 -5
- package/data/chromium-i18n/ssl-address/GW.json +2 -2
- package/data/chromium-i18n/ssl-address/GY.json +1 -1
- package/data/chromium-i18n/ssl-address/HK.json +8 -8
- package/data/chromium-i18n/ssl-address/HM.json +3 -3
- package/data/chromium-i18n/ssl-address/HN.json +3 -2
- package/data/chromium-i18n/ssl-address/HR.json +3 -3
- package/data/chromium-i18n/ssl-address/HT.json +3 -3
- package/data/chromium-i18n/ssl-address/HU.json +4 -4
- package/data/chromium-i18n/ssl-address/ID.json +7 -6
- package/data/chromium-i18n/ssl-address/IE.json +9 -9
- package/data/chromium-i18n/ssl-address/IL.json +3 -3
- package/data/chromium-i18n/ssl-address/IM.json +4 -4
- package/data/chromium-i18n/ssl-address/IN.json +11 -11
- package/data/chromium-i18n/ssl-address/IO.json +3 -3
- package/data/chromium-i18n/ssl-address/IQ.json +3 -3
- package/data/chromium-i18n/ssl-address/IR.json +7 -7
- package/data/chromium-i18n/ssl-address/IS.json +3 -3
- package/data/chromium-i18n/ssl-address/IT.json +10 -10
- package/data/chromium-i18n/ssl-address/JE.json +4 -4
- package/data/chromium-i18n/ssl-address/JM.json +6 -6
- package/data/chromium-i18n/ssl-address/JO.json +1 -8
- package/data/chromium-i18n/ssl-address/JP.json +11 -11
- package/data/chromium-i18n/ssl-address/KE.json +1 -8
- package/data/chromium-i18n/ssl-address/KG.json +1 -8
- package/data/chromium-i18n/ssl-address/KH.json +4 -3
- package/data/chromium-i18n/ssl-address/KI.json +2 -2
- package/data/chromium-i18n/ssl-address/KM.json +1 -1
- package/data/chromium-i18n/ssl-address/KN.json +5 -5
- package/data/chromium-i18n/ssl-address/KP.json +6 -6
- package/data/chromium-i18n/ssl-address/KR.json +15 -15
- package/data/chromium-i18n/ssl-address/KW.json +2 -2
- package/data/chromium-i18n/ssl-address/KY.json +7 -7
- package/data/chromium-i18n/ssl-address/KZ.json +2 -2
- package/data/chromium-i18n/ssl-address/LA.json +2 -2
- package/data/chromium-i18n/ssl-address/LB.json +2 -2
- package/data/chromium-i18n/ssl-address/LC.json +1 -1
- package/data/chromium-i18n/ssl-address/LI.json +3 -3
- package/data/chromium-i18n/ssl-address/LK.json +3 -3
- package/data/chromium-i18n/ssl-address/LR.json +1 -8
- package/data/chromium-i18n/ssl-address/LS.json +1 -8
- package/data/chromium-i18n/ssl-address/LT.json +5 -4
- package/data/chromium-i18n/ssl-address/LU.json +3 -3
- package/data/chromium-i18n/ssl-address/LV.json +5 -4
- package/data/chromium-i18n/ssl-address/LY.json +1 -1
- package/data/chromium-i18n/ssl-address/MA.json +2 -2
- package/data/chromium-i18n/ssl-address/MC.json +3 -3
- package/data/chromium-i18n/ssl-address/MD.json +3 -3
- package/data/chromium-i18n/ssl-address/ME.json +2 -2
- package/data/chromium-i18n/ssl-address/MF.json +4 -4
- package/data/chromium-i18n/ssl-address/MG.json +1 -8
- package/data/chromium-i18n/ssl-address/MH.json +6 -6
- package/data/chromium-i18n/ssl-address/MK.json +2 -2
- package/data/chromium-i18n/ssl-address/ML.json +1 -1
- package/data/chromium-i18n/ssl-address/MM.json +1 -8
- package/data/chromium-i18n/ssl-address/MN.json +3 -3
- package/data/chromium-i18n/ssl-address/MO.json +1 -8
- package/data/chromium-i18n/ssl-address/MP.json +6 -6
- package/data/chromium-i18n/ssl-address/MQ.json +4 -4
- package/data/chromium-i18n/ssl-address/MR.json +1 -1
- package/data/chromium-i18n/ssl-address/MS.json +1 -1
- package/data/chromium-i18n/ssl-address/MT.json +4 -4
- package/data/chromium-i18n/ssl-address/MU.json +3 -3
- package/data/chromium-i18n/ssl-address/MV.json +3 -3
- package/data/chromium-i18n/ssl-address/MW.json +1 -1
- package/data/chromium-i18n/ssl-address/MX.json +12 -12
- package/data/chromium-i18n/ssl-address/MY.json +12 -12
- package/data/chromium-i18n/ssl-address/MZ.json +5 -5
- package/data/chromium-i18n/ssl-address/NA.json +8 -1
- package/data/chromium-i18n/ssl-address/NC.json +4 -4
- package/data/chromium-i18n/ssl-address/NE.json +1 -8
- package/data/chromium-i18n/ssl-address/NF.json +3 -3
- package/data/chromium-i18n/ssl-address/NG.json +8 -8
- package/data/chromium-i18n/ssl-address/NI.json +8 -8
- package/data/chromium-i18n/ssl-address/NL.json +4 -4
- package/data/chromium-i18n/ssl-address/NO.json +3 -3
- package/data/chromium-i18n/ssl-address/NP.json +3 -3
- package/data/chromium-i18n/ssl-address/NR.json +5 -5
- package/data/chromium-i18n/ssl-address/NU.json +1 -1
- package/data/chromium-i18n/ssl-address/NZ.json +3 -3
- package/data/chromium-i18n/ssl-address/OM.json +2 -2
- package/data/chromium-i18n/ssl-address/PA.json +1 -7
- package/data/chromium-i18n/ssl-address/PE.json +7 -7
- package/data/chromium-i18n/ssl-address/PF.json +4 -4
- package/data/chromium-i18n/ssl-address/PG.json +2 -2
- package/data/chromium-i18n/ssl-address/PH.json +7 -7
- package/data/chromium-i18n/ssl-address/PK.json +4 -4
- package/data/chromium-i18n/ssl-address/PL.json +3 -3
- package/data/chromium-i18n/ssl-address/PM.json +3 -3
- package/data/chromium-i18n/ssl-address/PN.json +3 -3
- package/data/chromium-i18n/ssl-address/PR.json +6 -6
- package/data/chromium-i18n/ssl-address/PS.json +1 -1
- package/data/chromium-i18n/ssl-address/PT.json +3 -3
- package/data/chromium-i18n/ssl-address/PW.json +6 -6
- package/data/chromium-i18n/ssl-address/PY.json +2 -2
- package/data/chromium-i18n/ssl-address/QA.json +1 -1
- package/data/chromium-i18n/ssl-address/RE.json +4 -4
- package/data/chromium-i18n/ssl-address/RO.json +6 -5
- package/data/chromium-i18n/ssl-address/RS.json +3 -3
- package/data/chromium-i18n/ssl-address/RU.json +12 -12
- package/data/chromium-i18n/ssl-address/RW.json +1 -1
- package/data/chromium-i18n/ssl-address/SA.json +2 -2
- package/data/chromium-i18n/ssl-address/SB.json +1 -1
- package/data/chromium-i18n/ssl-address/SC.json +2 -2
- package/data/chromium-i18n/ssl-address/SD.json +3 -3
- package/data/chromium-i18n/ssl-address/SE.json +5 -5
- package/data/chromium-i18n/ssl-address/SG.json +3 -3
- package/data/chromium-i18n/ssl-address/SH.json +3 -3
- package/data/chromium-i18n/ssl-address/SI.json +3 -3
- package/data/chromium-i18n/ssl-address/SJ.json +3 -3
- package/data/chromium-i18n/ssl-address/SK.json +3 -3
- package/data/chromium-i18n/ssl-address/SL.json +1 -1
- package/data/chromium-i18n/ssl-address/SM.json +3 -3
- package/data/chromium-i18n/ssl-address/SN.json +2 -2
- package/data/chromium-i18n/ssl-address/SO.json +8 -8
- package/data/chromium-i18n/ssl-address/SR.json +4 -4
- package/data/chromium-i18n/ssl-address/SS.json +1 -1
- package/data/chromium-i18n/ssl-address/ST.json +1 -1
- package/data/chromium-i18n/ssl-address/SV.json +9 -9
- package/data/chromium-i18n/ssl-address/SX.json +1 -1
- package/data/chromium-i18n/ssl-address/SY.json +1 -6
- package/data/chromium-i18n/ssl-address/SZ.json +4 -4
- package/data/chromium-i18n/ssl-address/TA.json +2 -2
- package/data/chromium-i18n/ssl-address/TC.json +3 -3
- package/data/chromium-i18n/ssl-address/TD.json +1 -1
- package/data/chromium-i18n/ssl-address/TF.json +1 -1
- package/data/chromium-i18n/ssl-address/TG.json +1 -1
- package/data/chromium-i18n/ssl-address/TH.json +8 -8
- package/data/chromium-i18n/ssl-address/TJ.json +2 -2
- package/data/chromium-i18n/ssl-address/TK.json +1 -1
- package/data/chromium-i18n/ssl-address/TL.json +1 -1
- package/data/chromium-i18n/ssl-address/TM.json +1 -8
- package/data/chromium-i18n/ssl-address/TN.json +3 -3
- package/data/chromium-i18n/ssl-address/TO.json +1 -1
- package/data/chromium-i18n/ssl-address/TR.json +8 -8
- package/data/chromium-i18n/ssl-address/TT.json +1 -1
- package/data/chromium-i18n/ssl-address/TV.json +5 -5
- package/data/chromium-i18n/ssl-address/TW.json +13 -12
- package/data/chromium-i18n/ssl-address/TZ.json +2 -2
- package/data/chromium-i18n/ssl-address/UA.json +11 -11
- package/data/chromium-i18n/ssl-address/UG.json +1 -1
- package/data/chromium-i18n/ssl-address/UM.json +6 -6
- package/data/chromium-i18n/ssl-address/US.json +11 -11
- package/data/chromium-i18n/ssl-address/UY.json +7 -7
- package/data/chromium-i18n/ssl-address/UZ.json +4 -4
- package/data/chromium-i18n/ssl-address/VA.json +1 -8
- package/data/chromium-i18n/ssl-address/VC.json +3 -3
- package/data/chromium-i18n/ssl-address/VE.json +9 -9
- package/data/chromium-i18n/ssl-address/VG.json +2 -2
- package/data/chromium-i18n/ssl-address/VI.json +6 -6
- package/data/chromium-i18n/ssl-address/VN.json +8 -8
- package/data/chromium-i18n/ssl-address/VU.json +1 -1
- package/data/chromium-i18n/ssl-address/WF.json +3 -3
- package/data/chromium-i18n/ssl-address/WS.json +1 -1
- package/data/chromium-i18n/ssl-address/XK.json +1 -8
- package/data/chromium-i18n/ssl-address/YE.json +1 -1
- package/data/chromium-i18n/ssl-address/YT.json +3 -3
- package/data/chromium-i18n/ssl-address/ZA.json +3 -3
- package/data/chromium-i18n/ssl-address/ZM.json +1 -8
- package/data/chromium-i18n/ssl-address/ZW.json +1 -1
- package/out/api/headless.d.ts +7 -3
- package/out/api/headless.d.ts.map +1 -1
- package/out/api/headless.js +3 -4
- package/out/api/headless.js.map +1 -1
- package/out/api/index.d.ts +3 -3
- package/out/classification/Classification.d.ts +3 -3
- package/out/classification/CompositeClassifier.d.ts +3 -3
- package/out/classification/PhraseClassifier.d.ts +1 -1
- package/out/classification/SectionClassifier.d.ts +1 -1
- package/out/classification/WordClassifier.d.ts +1 -1
- package/out/classification/index.d.ts +7 -7
- package/out/classification/scheme.d.ts +1 -1
- package/out/coarse-placer/coarse-placer.d.ts +1 -1
- package/out/coarse-placer/tools/build-dataset.d.ts +18 -3
- package/out/coarse-placer/tools/build-dataset.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-dataset.js +108 -111
- package/out/coarse-placer/tools/build-dataset.js.map +1 -1
- package/out/coarse-placer/tools/build-outlier-exposure.d.ts +18 -3
- package/out/coarse-placer/tools/build-outlier-exposure.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-outlier-exposure.js +46 -52
- package/out/coarse-placer/tools/build-outlier-exposure.js.map +1 -1
- package/out/coarse-placer/tools/build-outlier-latin.d.ts +41 -1
- package/out/coarse-placer/tools/build-outlier-latin.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-outlier-latin.js +74 -82
- package/out/coarse-placer/tools/build-outlier-latin.js.map +1 -1
- package/out/coarse-placer/tools/build-outlier-oa.d.ts +49 -1
- package/out/coarse-placer/tools/build-outlier-oa.d.ts.map +1 -1
- package/out/coarse-placer/tools/build-outlier-oa.js +100 -102
- package/out/coarse-placer/tools/build-outlier-oa.js.map +1 -1
- package/out/coarse-placer/tools/eval-latin-offmap.d.ts +30 -1
- package/out/coarse-placer/tools/eval-latin-offmap.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval-latin-offmap.js +82 -83
- package/out/coarse-placer/tools/eval-latin-offmap.js.map +1 -1
- package/out/coarse-placer/tools/eval-openset.d.ts +23 -2
- package/out/coarse-placer/tools/eval-openset.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval-openset.js +282 -287
- package/out/coarse-placer/tools/eval-openset.js.map +1 -1
- package/out/coarse-placer/tools/eval-quant-compare.d.ts +35 -1
- package/out/coarse-placer/tools/eval-quant-compare.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval-quant-compare.js +87 -91
- package/out/coarse-placer/tools/eval-quant-compare.js.map +1 -1
- package/out/coarse-placer/tools/eval.d.ts +20 -2
- package/out/coarse-placer/tools/eval.d.ts.map +1 -1
- package/out/coarse-placer/tools/eval.js +104 -105
- package/out/coarse-placer/tools/eval.js.map +1 -1
- package/out/coarse-placer/tools/fnv-hash.d.ts +15 -0
- package/out/coarse-placer/tools/fnv-hash.d.ts.map +1 -0
- package/out/coarse-placer/tools/fnv-hash.js +22 -0
- package/out/coarse-placer/tools/fnv-hash.js.map +1 -0
- package/out/coarse-placer/tools/index.d.ts +23 -0
- package/out/coarse-placer/tools/index.d.ts.map +1 -0
- package/out/coarse-placer/tools/index.js +23 -0
- package/out/coarse-placer/tools/index.js.map +1 -0
- package/out/coarse-placer/tools/probe-frontier.d.ts +22 -3
- package/out/coarse-placer/tools/probe-frontier.d.ts.map +1 -1
- package/out/coarse-placer/tools/probe-frontier.js +92 -95
- package/out/coarse-placer/tools/probe-frontier.js.map +1 -1
- package/out/coarse-placer/tools/quantize.d.ts +34 -1
- package/out/coarse-placer/tools/quantize.d.ts.map +1 -1
- package/out/coarse-placer/tools/quantize.js +58 -60
- package/out/coarse-placer/tools/quantize.js.map +1 -1
- package/out/coarse-placer/tools/train.d.ts +25 -4
- package/out/coarse-placer/tools/train.d.ts.map +1 -1
- package/out/coarse-placer/tools/train.js +135 -137
- package/out/coarse-placer/tools/train.js.map +1 -1
- package/out/decoder/arbitrate-tree.d.ts +2 -2
- package/out/decoder/build-tree.d.ts +2 -2
- package/out/decoder/containment.d.ts +2 -2
- package/out/decoder/index.d.ts +12 -12
- package/out/decoder/proposals-to-tree.d.ts +2 -2
- package/out/decoder/resolve-proposal-overlaps.d.ts +1 -1
- package/out/decoder/serialize-json.d.ts +3 -3
- package/out/decoder/serialize-tuples.d.ts +2 -2
- package/out/decoder/serialize-xml.d.ts +1 -1
- package/out/decoder/types.d.ts +1 -1
- package/out/decoder/unknown-spans.d.ts +1 -1
- package/out/decoder/validate-tree.d.ts +2 -2
- package/out/env/index.d.ts +1 -0
- package/out/env/index.d.ts.map +1 -1
- package/out/env/schema.d.ts +1 -0
- package/out/env/schema.d.ts.map +1 -1
- package/out/env/schema.js +3 -2
- package/out/env/schema.js.map +1 -1
- package/out/errors/index.d.ts +1 -1
- package/out/filters/RelationshipFilter.d.ts.map +1 -1
- package/out/filters/RelationshipFilter.js.map +1 -1
- package/out/filters/index.d.ts +4 -4
- package/out/fs/node.d.ts +20 -0
- package/out/fs/node.d.ts.map +1 -0
- package/out/fs/node.js +33 -0
- package/out/fs/node.js.map +1 -0
- package/out/index.d.ts +11 -11
- package/out/kysley/client.d.ts +2 -2
- package/out/kysley/client.d.ts.map +1 -1
- package/out/kysley/client.js +1 -1
- package/out/kysley/client.js.map +1 -1
- package/out/kysley/dialect.d.ts +1 -1
- package/out/kysley/dialect.d.ts.map +1 -1
- package/out/kysley/dialect.js +1 -1
- package/out/kysley/dialect.js.map +1 -1
- package/out/kysley/driver.d.ts +1 -1
- package/out/kysley/driver.d.ts.map +1 -1
- package/out/lifecycle/index.d.ts +3 -3
- package/out/locale/index.d.ts +3 -3
- package/out/locale/locale.d.ts +1 -1
- package/out/locale/profiles/en-us.d.ts +1 -1
- package/out/locale/profiles/fr-fr.d.ts +1 -1
- package/out/locale/profiles/index.d.ts +3 -3
- package/out/locale/profiles/ja-jp.d.ts +1 -1
- package/out/locale/registry.d.ts +1 -1
- package/out/logging/index.d.ts +2 -2
- package/out/logging/shared.d.ts +1 -1
- package/out/logging/shared.js +1 -1
- package/out/parser/AddressParser.d.ts +1 -1
- package/out/parser/index.d.ts +3 -3
- package/out/parser/proposal-pipeline.d.ts +4 -4
- package/out/parser/solution-to-proposals.d.ts +2 -2
- package/out/pipeline/index.d.ts +8 -8
- package/out/pipeline/reconcile-lookups.d.ts +2 -2
- package/out/pipeline/reconcile.d.ts +3 -3
- package/out/pipeline/runtime-pipeline.d.ts +3 -3
- package/out/pipeline/span-logit-aggregation.d.ts +1 -1
- package/out/pipeline/types.d.ts +3 -3
- package/out/policy/defaults.d.ts +1 -1
- package/out/policy/from-config.d.ts +3 -3
- package/out/policy/index.d.ts +5 -5
- package/out/policy/input-shape-router.d.ts +1 -1
- package/out/policy/registry.d.ts +1 -1
- package/out/resolver/index.d.ts +2 -2
- package/out/resolver/index.d.ts.map +1 -1
- package/out/resolver/types.d.ts +52 -1
- package/out/resolver/types.d.ts.map +1 -1
- package/out/resolver/types.js.map +1 -1
- package/out/resources/LocaleIndex.d.ts +2 -2
- package/out/resources/ResourceMapCache.d.ts +1 -1
- package/out/resources/ResourceMapCache.d.ts.map +1 -1
- package/out/resources/ResourceMapCache.js +1 -1
- package/out/resources/ResourceMapCache.js.map +1 -1
- package/out/resources/git.d.ts.map +1 -1
- package/out/resources/git.js +1 -1
- package/out/resources/git.js.map +1 -1
- package/out/resources/index.d.ts +11 -12
- package/out/resources/index.d.ts.map +1 -1
- package/out/resources/index.js +0 -1
- package/out/resources/index.js.map +1 -1
- package/out/resources/languages/index.d.ts +2 -2
- package/out/resources/languages/types.gen.d.ts +1 -1
- package/out/resources/languages/types.gen.js +1 -1
- package/out/resources/libpostal.d.ts +1 -1
- package/out/resources/libpostal.d.ts.map +1 -1
- package/out/resources/libpostal.js +1 -1
- package/out/resources/libpostal.js.map +1 -1
- package/out/resources/whosonfirst/DataSourceCache.d.ts +1 -1
- package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
- package/out/resources/whosonfirst/index.d.ts +4 -4
- package/out/resources/whosonfirst/loader.d.ts +2 -2
- package/out/resources/whosonfirst/placetypes/Placetype.d.ts +1 -1
- package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -1
- package/out/resources/whosonfirst/placetypes/graph.d.ts +2 -2
- package/out/resources/whosonfirst/placetypes/index.d.ts +6 -6
- package/out/resources/whosonfirst/placetypes/mermaid.d.ts +2 -2
- package/out/resources/whosonfirst/placetypes/tree.d.ts +2 -2
- package/out/scripting/index.d.ts +15 -0
- package/out/scripting/index.d.ts.map +1 -0
- package/out/scripting/index.js +34 -0
- package/out/scripting/index.js.map +1 -0
- package/out/{utils/scripting.d.ts → scripting/utils/index.d.ts} +6 -15
- package/out/scripting/utils/index.d.ts.map +1 -0
- package/out/{utils/scripting.js → scripting/utils/index.js} +15 -32
- package/out/scripting/utils/index.js.map +1 -0
- package/out/solver/HashMapSolver.d.ts +2 -2
- package/out/solver/Solution.d.ts +1 -1
- package/out/solver/SolutionMatch.d.ts +1 -1
- package/out/solver/index.d.ts +5 -5
- package/out/solver/mask.d.ts +1 -1
- package/out/solvers/index.d.ts +8 -8
- package/out/tokenization/Graph.d.ts +1 -1
- package/out/tokenization/Span.d.ts +5 -5
- package/out/tokenization/context.d.ts +1 -1
- package/out/tokenization/index.d.ts +5 -5
- package/out/tokenization/permutate.d.ts +1 -1
- package/out/tokenization/split.d.ts +1 -1
- package/out/{data/libpostal/resources-download.d.ts → tools/download-libpostal-resources.d.ts} +10 -5
- package/out/tools/download-libpostal-resources.d.ts.map +1 -0
- package/out/{data/libpostal/resources-download.js → tools/download-libpostal-resources.js} +20 -35
- package/out/tools/download-libpostal-resources.js.map +1 -0
- package/out/{data/chromium-i18n/ssl-address-download.d.ts → tools/download-ssl-address.d.ts} +17 -5
- package/out/tools/download-ssl-address.d.ts.map +1 -0
- package/out/{data/chromium-i18n/ssl-address-download.js → tools/download-ssl-address.js} +15 -29
- package/out/tools/download-ssl-address.js.map +1 -0
- package/out/tools/generate-language-types.d.ts +23 -0
- package/out/tools/generate-language-types.d.ts.map +1 -0
- package/out/tools/generate-language-types.js +137 -0
- package/out/tools/generate-language-types.js.map +1 -0
- package/out/tools/index.d.ts +13 -0
- package/out/tools/index.d.ts.map +1 -0
- package/out/tools/index.js +13 -0
- package/out/tools/index.js.map +1 -0
- package/out/types/classifier.d.ts +2 -2
- package/out/types/index.d.ts +3 -3
- package/out/types/mapping.d.ts +2 -2
- package/out/utils/hash.d.ts +13 -0
- package/out/utils/hash.d.ts.map +1 -0
- package/out/utils/hash.js +23 -0
- package/out/utils/hash.js.map +1 -0
- package/out/utils/index.d.ts +8 -6
- package/out/utils/index.d.ts.map +1 -1
- package/out/utils/index.js +5 -3
- package/out/utils/index.js.map +1 -1
- package/out/utils/jsonl.d.ts +16 -0
- package/out/utils/jsonl.d.ts.map +1 -0
- package/out/utils/jsonl.js +38 -0
- package/out/utils/jsonl.js.map +1 -0
- package/out/utils/stats.d.ts +19 -0
- package/out/utils/stats.d.ts.map +1 -0
- package/out/utils/stats.js +30 -0
- package/out/utils/stats.js.map +1 -0
- package/out/vitest.config.js +3 -3
- package/package.json +309 -42
- package/data/chromium-i18n/ssl-address-download.ts +0 -106
- package/data/libpostal/resources-download.ts +0 -118
- package/out/data/chromium-i18n/ssl-address-download.d.ts.map +0 -1
- package/out/data/chromium-i18n/ssl-address-download.js.map +0 -1
- package/out/data/libpostal/resources-download.d.ts.map +0 -1
- package/out/data/libpostal/resources-download.js.map +0 -1
- package/out/resources/fs.d.ts +0 -12
- package/out/resources/fs.d.ts.map +0 -1
- package/out/resources/fs.js +0 -13
- package/out/resources/fs.js.map +0 -1
- package/out/utils/scripting.d.ts.map +0 -1
- package/out/utils/scripting.js.map +0 -1
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import { appendFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { parseArgs } from "node:util";
|
|
4
|
-
import { DuckDBInstance } from "@duckdb/node-api";
|
|
5
1
|
/**
|
|
6
2
|
* @copyright Sister Software
|
|
7
3
|
* @license AGPL-3.0
|
|
@@ -26,21 +22,17 @@ import { DuckDBInstance } from "@duckdb/node-api";
|
|
|
26
22
|
* "mostly Polish".
|
|
27
23
|
* - Country filter: only OFF-MAP countries (never the 11 in-map); the in-map test.jsonl is untouched.
|
|
28
24
|
*
|
|
29
|
-
* Run AFTER build-dataset
|
|
25
|
+
* Run AFTER build-dataset + the exposure outliers (it APPENDS). Re-runnable: rewrites the
|
|
30
26
|
* dedicated test file and appends fresh OTHER rows — rebuild train/val before re-running.
|
|
31
27
|
*
|
|
32
|
-
*
|
|
33
|
-
* 6000]
|
|
28
|
+
* Run: `mailwoman placer build-dataset --outliers oa --oa-dir <extracted-OA-root> [--per-country
|
|
29
|
+
* 6000]`
|
|
34
30
|
*/
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
data: { type: "string", default: path.resolve(import.meta.dirname, "../../data/coarse-placer") },
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
const PER = Number(args["per-country"]);
|
|
31
|
+
import { appendFileSync, writeFileSync } from "node:fs";
|
|
32
|
+
import * as path from "node:path";
|
|
33
|
+
import { dataRootPath } from "../../utils/data-root.js";
|
|
34
|
+
import { repoRootPath } from "../../utils/repo.js";
|
|
35
|
+
import { hashFNV1a } from "./fnv-hash.js";
|
|
44
36
|
// The 11 IN-MAP countries the coarse-placer routes to — never appear in OTHER. (build-dataset.ts)
|
|
45
37
|
const IN_MAP = new Set(["US", "FR", "GB", "CN", "NL", "IT", "DE", "JP", "ES", "KR", "TW"]);
|
|
46
38
|
// Language/region families for the leave-one-family-out split. Off-map countries OA's europe+asia zips
|
|
@@ -63,15 +55,6 @@ const FAMILIES = {
|
|
|
63
55
|
// Leave-one-language-FAMILY-out probe (DeepSeek): hold out WHOLE families the model never sees a row
|
|
64
56
|
// from — Baltic (Latin, distinct), Oceania (English-Latin, distinct), Middle-East (romanized non-Latin).
|
|
65
57
|
const HELDOUT_FAMILIES = new Set(["baltic", "oceania", "middle_east"]);
|
|
66
|
-
/** FNV-1a → uint32, deterministic ordering/variant choice. */
|
|
67
|
-
function hash(s) {
|
|
68
|
-
let h = 2166136261;
|
|
69
|
-
for (let i = 0; i < s.length; i++) {
|
|
70
|
-
h ^= s.charCodeAt(i);
|
|
71
|
-
h = Math.imul(h, 16777619);
|
|
72
|
-
}
|
|
73
|
-
return h >>> 0;
|
|
74
|
-
}
|
|
75
58
|
/** Assemble a plausible address string from an OA row — SAME shape variants as build-outlier-latin. */
|
|
76
59
|
function assemble(r) {
|
|
77
60
|
const num = (r.number ?? "").toString().trim();
|
|
@@ -85,7 +68,7 @@ function assemble(r) {
|
|
|
85
68
|
if (!street && !/[a-z]/i.test(locality))
|
|
86
69
|
return null;
|
|
87
70
|
const head = [num, street].filter(Boolean).join(" ");
|
|
88
|
-
const h =
|
|
71
|
+
const h = hashFNV1a(`${num}|${street}|${pc}|${locality}`);
|
|
89
72
|
switch (h % 3) {
|
|
90
73
|
case 0:
|
|
91
74
|
return [head, [pc, locality].filter(Boolean).join(" ")].filter(Boolean).join(", ");
|
|
@@ -95,88 +78,103 @@ function assemble(r) {
|
|
|
95
78
|
return [head, [locality, pc].filter(Boolean).join(" ")].filter(Boolean).join(", ");
|
|
96
79
|
}
|
|
97
80
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
//
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
for (const r of res.getRowObjects()) {
|
|
121
|
-
// COLUMNS() preserves source-case keys; normalize to lowercase access.
|
|
122
|
-
const row = {};
|
|
123
|
-
for (const [k, v] of Object.entries(r)) {
|
|
124
|
-
row[k.toLowerCase()] = v;
|
|
81
|
+
/** Coarse-placer OpenAddresses Latin-off-map outlier builder — see the module doc. */
|
|
82
|
+
export async function buildOutlierOA(options = {}, report) {
|
|
83
|
+
const oaDir = options.oaDir || dataRootPath("openaddresses", "extracted");
|
|
84
|
+
const PER = options.perCountry ?? 6000;
|
|
85
|
+
const dataDir = options.data || repoRootPath("data", "coarse-placer");
|
|
86
|
+
// Heavy dep (devDependency — operator tooling), lazy-imported so loading the tools barrel stays cheap.
|
|
87
|
+
const { DuckDBInstance } = await import("@duckdb/node-api");
|
|
88
|
+
const duck = await (await DuckDBInstance.create()).connect();
|
|
89
|
+
/**
|
|
90
|
+
* Read+assemble up to PER deduped rows for a country from its OA CSVs (glob under the per-country dir).
|
|
91
|
+
*/
|
|
92
|
+
async function rowsFor(cc) {
|
|
93
|
+
const lc = cc.toLowerCase();
|
|
94
|
+
// OA collected layout: `<cc>/[<region>/]<source>.csv` (country at root; `summary/` excluded by
|
|
95
|
+
// rooting the glob at <cc>). `**` matches zero-or-more dirs → handles both flat + region-nested.
|
|
96
|
+
const glob = path.join(oaDir, lc, "**", "*.csv");
|
|
97
|
+
let res;
|
|
98
|
+
try {
|
|
99
|
+
res = await duck.runAndReadAll(
|
|
100
|
+
// union_by_name aligns the differing per-source schemas; LOWER the header access so NUMBER /
|
|
101
|
+
// number both resolve. Pull a generous superset, dedup+cap in JS.
|
|
102
|
+
`SELECT COLUMNS('(?i)^(number|street|city|postcode)$') FROM read_csv_auto('${glob}', union_by_name=true, ignore_errors=true, sample_size=-1) LIMIT ${PER * 8}`);
|
|
125
103
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
seen.add(raw);
|
|
130
|
-
out.push(raw);
|
|
131
|
-
if (out.length >= PER)
|
|
132
|
-
break;
|
|
133
|
-
}
|
|
134
|
-
return out.sort((a, b) => hash(a) - hash(b));
|
|
135
|
-
}
|
|
136
|
-
const trainAppend = [];
|
|
137
|
-
const valAppend = [];
|
|
138
|
-
const testRows = []; // {raw, country:"OTHER", group, srcCountry, family}
|
|
139
|
-
let trainCC = 0;
|
|
140
|
-
let heldCC = 0;
|
|
141
|
-
for (const [family, countries] of Object.entries(FAMILIES)) {
|
|
142
|
-
const heldout = HELDOUT_FAMILIES.has(family);
|
|
143
|
-
for (const cc of countries) {
|
|
144
|
-
if (IN_MAP.has(cc))
|
|
145
|
-
continue;
|
|
146
|
-
const rows = await rowsFor(cc);
|
|
147
|
-
if (rows.length === 0)
|
|
148
|
-
continue;
|
|
149
|
-
if (heldout) {
|
|
150
|
-
for (const raw of rows) {
|
|
151
|
-
testRows.push({ raw, country: "OTHER", group: "heldout", srcCountry: cc, family });
|
|
152
|
-
}
|
|
153
|
-
heldCC++;
|
|
154
|
-
console.log(` HELDOUT ${cc} (${family}): ${rows.length} (test-only)`);
|
|
104
|
+
catch (e) {
|
|
105
|
+
report?.(` ${cc}: SKIP (${e.message.split("\n")[0]})`);
|
|
106
|
+
return [];
|
|
155
107
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
108
|
+
const seen = new Set();
|
|
109
|
+
const out = [];
|
|
110
|
+
for (const r of res.getRowObjects()) {
|
|
111
|
+
// COLUMNS() preserves source-case keys; normalize to lowercase access.
|
|
112
|
+
const row = {};
|
|
113
|
+
for (const [k, v] of Object.entries(r)) {
|
|
114
|
+
row[k.toLowerCase()] = v;
|
|
161
115
|
}
|
|
162
|
-
|
|
163
|
-
|
|
116
|
+
const raw = assemble(row);
|
|
117
|
+
if (!raw || raw.length < 6 || seen.has(raw))
|
|
118
|
+
continue;
|
|
119
|
+
seen.add(raw);
|
|
120
|
+
out.push(raw);
|
|
121
|
+
if (out.length >= PER)
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
return out.sort((a, b) => hashFNV1a(a) - hashFNV1a(b));
|
|
125
|
+
}
|
|
126
|
+
const trainAppend = [];
|
|
127
|
+
const valAppend = [];
|
|
128
|
+
const testRows = []; // {raw, country:"OTHER", group, srcCountry, family}
|
|
129
|
+
let trainCC = 0;
|
|
130
|
+
let heldCC = 0;
|
|
131
|
+
for (const [family, countries] of Object.entries(FAMILIES)) {
|
|
132
|
+
const heldout = HELDOUT_FAMILIES.has(family);
|
|
133
|
+
for (const cc of countries) {
|
|
134
|
+
if (IN_MAP.has(cc))
|
|
135
|
+
continue;
|
|
136
|
+
const rows = await rowsFor(cc);
|
|
137
|
+
if (rows.length === 0)
|
|
138
|
+
continue;
|
|
139
|
+
if (heldout) {
|
|
140
|
+
for (const raw of rows) {
|
|
141
|
+
testRows.push({ raw, country: "OTHER", group: "heldout", srcCountry: cc, family });
|
|
142
|
+
}
|
|
143
|
+
heldCC++;
|
|
144
|
+
report?.(` HELDOUT ${cc} (${family}): ${rows.length} (test-only)`);
|
|
164
145
|
}
|
|
165
|
-
|
|
166
|
-
|
|
146
|
+
else {
|
|
147
|
+
const nVal = Math.floor(rows.length * 0.1);
|
|
148
|
+
const nTest = Math.floor(rows.length * 0.1);
|
|
149
|
+
for (const raw of rows.slice(0, nVal)) {
|
|
150
|
+
valAppend.push(raw);
|
|
151
|
+
}
|
|
152
|
+
for (const raw of rows.slice(nVal, nVal + nTest)) {
|
|
153
|
+
testRows.push({ raw, country: "OTHER", group: "indist", srcCountry: cc, family });
|
|
154
|
+
}
|
|
155
|
+
for (const raw of rows.slice(nVal + nTest)) {
|
|
156
|
+
trainAppend.push(raw);
|
|
157
|
+
}
|
|
158
|
+
trainCC++;
|
|
159
|
+
report?.(` TRAIN ${cc} (${family}): ${rows.length}`);
|
|
167
160
|
}
|
|
168
|
-
trainCC++;
|
|
169
|
-
console.log(` TRAIN ${cc} (${family}): ${rows.length}`);
|
|
170
161
|
}
|
|
171
162
|
}
|
|
163
|
+
;
|
|
164
|
+
duck.disconnect?.();
|
|
165
|
+
const wr = (rows) => rows.map((raw) => JSON.stringify({ raw, country: "OTHER" })).join("\n") + "\n";
|
|
166
|
+
appendFileSync(path.join(dataDir, "train.jsonl"), wr(trainAppend));
|
|
167
|
+
appendFileSync(path.join(dataDir, "val.jsonl"), wr(valAppend));
|
|
168
|
+
writeFileSync(path.join(dataDir, "test-latin-offmap.jsonl"), testRows.map((r) => JSON.stringify(r)).join("\n") + "\n");
|
|
169
|
+
report?.(`\nTRAIN countries: ${trainCC} · HELDOUT countries: ${heldCC}`);
|
|
170
|
+
report?.(`appended OTHER → train +${trainAppend.length}, val +${valAppend.length}`);
|
|
171
|
+
report?.(`wrote test-latin-offmap.jsonl: ${testRows.length} (indist ${testRows.filter((r) => r.group === "indist").length} / heldout ${testRows.filter((r) => r.group === "heldout").length})`);
|
|
172
|
+
return {
|
|
173
|
+
train: trainAppend.length,
|
|
174
|
+
val: valAppend.length,
|
|
175
|
+
test: testRows.length,
|
|
176
|
+
trainCountries: trainCC,
|
|
177
|
+
heldoutCountries: heldCC,
|
|
178
|
+
};
|
|
172
179
|
}
|
|
173
|
-
;
|
|
174
|
-
duck.disconnect?.();
|
|
175
|
-
const wr = (rows) => rows.map((raw) => JSON.stringify({ raw, country: "OTHER" })).join("\n") + "\n";
|
|
176
|
-
appendFileSync(path.join(args.data, "train.jsonl"), wr(trainAppend));
|
|
177
|
-
appendFileSync(path.join(args.data, "val.jsonl"), wr(valAppend));
|
|
178
|
-
writeFileSync(path.join(args.data, "test-latin-offmap.jsonl"), testRows.map((r) => JSON.stringify(r)).join("\n") + "\n");
|
|
179
|
-
console.log(`\nTRAIN countries: ${trainCC} · HELDOUT countries: ${heldCC}`);
|
|
180
|
-
console.log(`appended OTHER → train +${trainAppend.length}, val +${valAppend.length}`);
|
|
181
|
-
console.log(`wrote test-latin-offmap.jsonl: ${testRows.length} (indist ${testRows.filter((r) => r.group === "indist").length} / heldout ${testRows.filter((r) => r.group === "heldout").length})`);
|
|
182
180
|
//# sourceMappingURL=build-outlier-oa.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-outlier-oa.js","sourceRoot":"","sources":["../../../coarse-placer/tools/build-outlier-oa.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"build-outlier-oa.js","sourceRoot":"","sources":["../../../coarse-placer/tools/build-outlier-oa.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACvD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AA6BzC,kGAAkG;AAClG,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAA;AAE1F,uGAAuG;AACvG,uGAAuG;AACvG,uFAAuF;AACvF,oGAAoG;AACpG,8FAA8F;AAC9F,MAAM,QAAQ,GAA6B;IAC1C,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACtC,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACnC,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
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Measure the #244 coarse-placer's handling of the Latin-script off-map residual (milestone 3). A
|
|
7
|
+
* Latin off-map address is HANDLED when the model routes it to OTHER or abstains — anything else
|
|
8
|
+
* is a confident mis-placement onto a wrong (trained) country. Reports handled-rate overall, by
|
|
9
|
+
* group (indist = held-out rows of trained-OTHER countries; heldout = countries never trained),
|
|
10
|
+
* and by source country, plus where the misses land. Run baseline (current model) and the M3
|
|
11
|
+
* retrain through this to read the before/after.
|
|
12
|
+
*
|
|
13
|
+
* Run: `mailwoman placer eval latin-offmap --model <dir> [--abstain 0.5]`
|
|
14
|
+
*/
|
|
15
|
+
/** Options for {@linkcode evalLatinOffmap}. */
|
|
16
|
+
export interface EvalLatinOffmapOptions {
|
|
17
|
+
/** Model artifact dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`. */
|
|
18
|
+
model?: string;
|
|
19
|
+
/** Abstention threshold. Default 0.5. */
|
|
20
|
+
abstain?: number;
|
|
21
|
+
/** Dataset dir (`test-latin-offmap.jsonl`). Default `<repo>/data/coarse-placer`. */
|
|
22
|
+
data?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Result of {@linkcode evalLatinOffmap}. */
|
|
25
|
+
export interface EvalLatinOffmapResult {
|
|
26
|
+
n: number;
|
|
27
|
+
handled: number;
|
|
28
|
+
}
|
|
29
|
+
/** Coarse-placer Latin off-map handling eval — see the module doc. Emits the report to stdout. */
|
|
30
|
+
export declare function evalLatinOffmap(options?: EvalLatinOffmapOptions): Promise<EvalLatinOffmapResult>;
|
|
2
31
|
//# sourceMappingURL=eval-latin-offmap.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-latin-offmap.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/eval-latin-offmap.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"eval-latin-offmap.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/eval-latin-offmap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAiBH,+CAA+C;AAC/C,MAAM,WAAW,sBAAsB;IACtC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,yCAAyC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED,6CAA6C;AAC7C,MAAM,WAAW,qBAAqB;IACrC,CAAC,EAAE,MAAM,CAAA;IACT,OAAO,EAAE,MAAM,CAAA;CACf;AAED,kGAAkG;AAClG,wBAAsB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4F1G"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
2
|
-
import * as path from "node:path";
|
|
3
|
-
import { parseArgs } from "node:util";
|
|
4
1
|
/**
|
|
5
2
|
* @copyright Sister Software
|
|
6
3
|
* @license AGPL-3.0
|
|
@@ -13,91 +10,93 @@ import { parseArgs } from "node:util";
|
|
|
13
10
|
* and by source country, plus where the misses land. Run baseline (current model) and the M3
|
|
14
11
|
* retrain through this to read the before/after.
|
|
15
12
|
*
|
|
16
|
-
*
|
|
13
|
+
* Run: `mailwoman placer eval latin-offmap --model <dir> [--abstain 0.5]`
|
|
17
14
|
*/
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
15
|
+
import { readFileSync } from "node:fs";
|
|
16
|
+
import * as path from "node:path";
|
|
17
|
+
import { dataRootPath } from "../../utils/data-root.js";
|
|
18
|
+
import { repoRootPath } from "../../utils/repo.js";
|
|
19
|
+
import { formatPercent } from "../../utils/stats.js";
|
|
20
|
+
import { CoarsePlacer } from "../coarse-placer.js";
|
|
21
|
+
/** Coarse-placer Latin off-map handling eval — see the module doc. Emits the report to stdout. */
|
|
22
|
+
export async function evalLatinOffmap(options = {}) {
|
|
23
|
+
const modelDir = options.model || dataRootPath("coarse-placer", "model");
|
|
24
|
+
const abstain = options.abstain ?? 0.5;
|
|
25
|
+
const dataDir = options.data || repoRootPath("data", "coarse-placer");
|
|
26
|
+
const meta = JSON.parse(readFileSync(path.join(modelDir, "meta.json"), "utf8"));
|
|
27
|
+
const buf = readFileSync(path.join(modelDir, "weights.bin"));
|
|
28
|
+
const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
|
|
29
|
+
let weights;
|
|
30
|
+
if (meta.quantization === "int8-per-row") {
|
|
31
|
+
const int8 = new Int8Array(ab);
|
|
32
|
+
const C = meta.classes.length;
|
|
33
|
+
const dim = meta.featureDim;
|
|
34
|
+
const scales = meta.scales;
|
|
35
|
+
weights = new Float32Array(C * dim);
|
|
36
|
+
for (let c = 0; c < C; c++) {
|
|
37
|
+
const s = scales[c];
|
|
38
|
+
const base = c * dim;
|
|
39
|
+
for (let i = 0; i < dim; i++) {
|
|
40
|
+
weights[base + i] = int8[base + i] * s;
|
|
41
|
+
}
|
|
43
42
|
}
|
|
44
43
|
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
weights = new Float32Array(ab);
|
|
48
|
-
}
|
|
49
|
-
const placer = new CoarsePlacer({ ...meta, weights }, { abstainBelow: Number(args.abstain) });
|
|
50
|
-
const rows = readFileSync(path.join(args.data, "test-latin-offmap.jsonl"), "utf8")
|
|
51
|
-
.trim()
|
|
52
|
-
.split("\n")
|
|
53
|
-
.map((l) => JSON.parse(l));
|
|
54
|
-
const handled = (p) => p.abstained || p.country === "OTHER";
|
|
55
|
-
const by = {}; // key → {n, ok}
|
|
56
|
-
const missTo = {}; // wrong country → count
|
|
57
|
-
const bump = (k) => (by[k] ??= { n: 0, ok: 0 });
|
|
58
|
-
let n = 0;
|
|
59
|
-
let ok = 0;
|
|
60
|
-
const samples = [];
|
|
61
|
-
for (const r of rows) {
|
|
62
|
-
const p = placer.predict(r.raw);
|
|
63
|
-
const h = handled(p);
|
|
64
|
-
n++;
|
|
65
|
-
if (h) {
|
|
66
|
-
ok++;
|
|
67
|
-
}
|
|
68
|
-
bump(`group:${r.group}`).n++;
|
|
69
|
-
bump(`cc:${r.srcCountry}`).n++;
|
|
70
|
-
if (h) {
|
|
71
|
-
bump(`group:${r.group}`).ok++;
|
|
72
|
-
bump(`cc:${r.srcCountry}`).ok++;
|
|
73
|
-
}
|
|
74
44
|
else {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
45
|
+
weights = new Float32Array(ab);
|
|
46
|
+
}
|
|
47
|
+
const placer = new CoarsePlacer({ ...meta, weights }, { abstainBelow: abstain });
|
|
48
|
+
const rows = readFileSync(path.join(dataDir, "test-latin-offmap.jsonl"), "utf8")
|
|
49
|
+
.trim()
|
|
50
|
+
.split("\n")
|
|
51
|
+
.map((l) => JSON.parse(l));
|
|
52
|
+
const handled = (p) => p.abstained || p.country === "OTHER";
|
|
53
|
+
const by = {}; // key → {n, ok}
|
|
54
|
+
const missTo = {}; // wrong country → count
|
|
55
|
+
const bump = (k) => (by[k] ??= { n: 0, ok: 0 });
|
|
56
|
+
let n = 0;
|
|
57
|
+
let ok = 0;
|
|
58
|
+
const samples = [];
|
|
59
|
+
for (const r of rows) {
|
|
60
|
+
const p = placer.predict(r.raw);
|
|
61
|
+
const h = handled(p);
|
|
62
|
+
n++;
|
|
63
|
+
if (h) {
|
|
64
|
+
ok++;
|
|
65
|
+
}
|
|
66
|
+
bump(`group:${r.group}`).n++;
|
|
67
|
+
bump(`cc:${r.srcCountry}`).n++;
|
|
68
|
+
if (h) {
|
|
69
|
+
bump(`group:${r.group}`).ok++;
|
|
70
|
+
bump(`cc:${r.srcCountry}`).ok++;
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
missTo[p.country] = (missTo[p.country] ?? 0) + 1;
|
|
74
|
+
if (samples.length < 8) {
|
|
75
|
+
samples.push(` ${r.srcCountry} → ${p.country} @${p.confidence.toFixed(2)} «${r.raw.slice(0, 38)}»`);
|
|
76
|
+
}
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
console.log(`
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
.
|
|
87
|
-
|
|
88
|
-
console.log(`
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
.
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
|
|
79
|
+
console.log(`Latin off-map handling — model ${path.basename(modelDir)} (abstain ${abstain}, n=${n})`);
|
|
80
|
+
console.log(` OVERALL handled (OTHER-or-abstain): ${ok}/${n} (${formatPercent(ok, n)}) ← want ≥90%`);
|
|
81
|
+
console.log(` by group:`);
|
|
82
|
+
for (const k of Object.keys(by)
|
|
83
|
+
.filter((k) => k.startsWith("group:"))
|
|
84
|
+
.sort()) {
|
|
85
|
+
console.log(` ${k.slice(6).padEnd(8)} ${formatPercent(by[k].ok, by[k].n)} (n=${by[k].n})`);
|
|
86
|
+
}
|
|
87
|
+
console.log(` by source country:`);
|
|
88
|
+
for (const k of Object.keys(by)
|
|
89
|
+
.filter((k) => k.startsWith("cc:"))
|
|
90
|
+
.sort()) {
|
|
91
|
+
console.log(` ${k.slice(3).padEnd(4)} ${formatPercent(by[k].ok, by[k].n)} (n=${by[k].n})`);
|
|
92
|
+
}
|
|
93
|
+
const misses = Object.entries(missTo).sort((a, b) => b[1] - a[1]);
|
|
94
|
+
if (misses.length) {
|
|
95
|
+
console.log(` misses land on: ${misses.map(([c, m]) => `${c}:${m}`).join(", ")}`);
|
|
96
|
+
}
|
|
97
|
+
if (samples.length) {
|
|
98
|
+
console.log(` sample misplacements:\n${samples.join("\n")}`);
|
|
99
|
+
}
|
|
100
|
+
return { n, handled: ok };
|
|
102
101
|
}
|
|
103
102
|
//# sourceMappingURL=eval-latin-offmap.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-latin-offmap.js","sourceRoot":"","sources":["../../../coarse-placer/tools/eval-latin-offmap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"eval-latin-offmap.js","sourceRoot":"","sources":["../../../coarse-placer/tools/eval-latin-offmap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAgD,MAAM,qBAAqB,CAAA;AAyBhG,kGAAkG;AAClG,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,UAAkC,EAAE;IACzE,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,IAAI,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IACxE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,GAAG,CAAA;IACtC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,IAAI,YAAY,CAAC,MAAM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,CAAC,MAAM,EAAE,CAAC;QACpB,OAAO,CAAC,GAAG,CAAC,4BAA4B,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC9D,CAAC;IAED,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAA;AAC1B,CAAC"}
|
|
@@ -27,8 +27,29 @@
|
|
|
27
27
|
* heldout caught = of the never-trained off-map families (baltic/oceania/middle-east), fraction
|
|
28
28
|
* rejected. Both move with the threshold; the Pareto is the whole story.
|
|
29
29
|
*
|
|
30
|
-
*
|
|
31
|
-
* `yarn compile` (imports the compiled featurizer).
|
|
30
|
+
* Run: `mailwoman placer eval openset [--model <dir>] [--out-md <path>]`
|
|
32
31
|
*/
|
|
32
|
+
type ScoreKey = "maxprob" | "p_inmap" | "energy" | "maxlogit" | "maha";
|
|
33
|
+
/** Options for {@linkcode evalOpenSet}. */
|
|
34
|
+
export interface EvalOpenSetOptions {
|
|
35
|
+
/** Model artifact dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`. */
|
|
36
|
+
model?: string;
|
|
37
|
+
/** Dataset dir. Default `<repo>/data/coarse-placer`. */
|
|
38
|
+
data?: string;
|
|
39
|
+
/** Mahalanobis fit rows per class. Default 2000. */
|
|
40
|
+
fitPerClass?: number;
|
|
41
|
+
/** Also write the markdown report here. */
|
|
42
|
+
outMd?: string;
|
|
43
|
+
}
|
|
44
|
+
/** Result of {@linkcode evalOpenSet}. */
|
|
45
|
+
export interface EvalOpenSetResult {
|
|
46
|
+
/** Best score by the honest dev→test balanced min. */
|
|
47
|
+
winner: ScoreKey;
|
|
48
|
+
honestMin: number;
|
|
49
|
+
clears90: boolean;
|
|
50
|
+
markdown: string;
|
|
51
|
+
}
|
|
52
|
+
/** Coarse-placer post-hoc open-set score comparison — see the module doc. Emits the markdown report to stdout. */
|
|
53
|
+
export declare function evalOpenSet(options?: EvalOpenSetOptions, report?: (line: string) => void): Promise<EvalOpenSetResult>;
|
|
33
54
|
export {};
|
|
34
55
|
//# sourceMappingURL=eval-openset.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eval-openset.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/eval-openset.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"eval-openset.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/eval-openset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAUH,KAAK,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;AAqBtE,2CAA2C;AAC3C,MAAM,WAAW,kBAAkB;IAClC,8EAA8E;IAC9E,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,yCAAyC;AACzC,MAAM,WAAW,iBAAiB;IACjC,sDAAsD;IACtD,MAAM,EAAE,QAAQ,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CAChB;AAoED,kHAAkH;AAClH,wBAAsB,WAAW,CAChC,OAAO,GAAE,kBAAuB,EAChC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,iBAAiB,CAAC,CA8W5B"}
|