@mailwoman/core 5.9.0 → 5.10.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.
- 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/types.d.ts +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,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
/**
|
|
3
2
|
* @copyright Sister Software
|
|
4
3
|
* @license AGPL-3.0
|
|
@@ -17,24 +16,13 @@
|
|
|
17
16
|
* in-set + top1>80% + median prob_1 < 0.9 → UNDER-CONFIDENT, M2 mass-rule fix. in-set + top1<80% →
|
|
18
17
|
* low-quality signal, defer. The probe is a LINEAR model (no ONNX), so it is heat-safe.
|
|
19
18
|
*
|
|
20
|
-
* Run:
|
|
19
|
+
* Run: `mailwoman placer probe-frontier [--model <dir>] [--n 2000] [--out <md>]`
|
|
21
20
|
*/
|
|
22
21
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
const root = new URL("../../", import.meta.url);
|
|
28
|
-
const { CoarsePlacer } = (await import(new URL("core/out/coarse-placer/coarse-placer.js", root).href));
|
|
29
|
-
const { values: args } = parseArgs({
|
|
30
|
-
options: {
|
|
31
|
-
// The DEPLOYED placer is the one bundled in @mailwoman/core (core/data/coarse-placer), NOT the
|
|
32
|
-
// dataRootPath training output — match the runtime.
|
|
33
|
-
model: { type: "string", default: join(String(root).replace("file://", ""), "core/data/coarse-placer") },
|
|
34
|
-
n: { type: "string", default: "2000" },
|
|
35
|
-
out: { type: "string", default: "" },
|
|
36
|
-
},
|
|
37
|
-
});
|
|
22
|
+
import { dataRootPath } from "../../utils/data-root.js";
|
|
23
|
+
import { corePackagePath } from "../../utils/repo.js";
|
|
24
|
+
import { median } from "../../utils/stats.js";
|
|
25
|
+
import { CoarsePlacer } from "../coarse-placer.js";
|
|
38
26
|
const HARD_PLACE_COUNTRY_MIN_CONF = 0.9; // mirrors core/pipeline/runtime-pipeline.ts
|
|
39
27
|
// The placer-recoverable tranche from the 2026-06-26 frontier diagnostic (a country hint resolves them).
|
|
40
28
|
const RECOVERABLE = [
|
|
@@ -75,85 +63,94 @@ const RECOVERABLE = [
|
|
|
75
63
|
"UY",
|
|
76
64
|
"VE",
|
|
77
65
|
];
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
const
|
|
82
|
-
//
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
const s = per.get(cc) ?? { cc, n: 0, inClass: 0, top1Correct: 0, probs: [] };
|
|
105
|
-
s.n++;
|
|
106
|
-
if (classSet.has(cc)) {
|
|
107
|
-
s.inClass++;
|
|
66
|
+
/** Coarse-placer frontier probe (#822) — see the module doc. Emits the report head to stdout. */
|
|
67
|
+
export async function probeFrontier(options = {}, report) {
|
|
68
|
+
const modelDir = options.model || corePackagePath("data", "coarse-placer");
|
|
69
|
+
const maxN = options.n ?? 2000;
|
|
70
|
+
// `@mailwoman/codex` is a devDependency of core (operator tooling) — lazy-imported inside the fn.
|
|
71
|
+
const { ISO2_TO_NAME } = await import("@mailwoman/codex/country");
|
|
72
|
+
const meta = JSON.parse(readFileSync(`${modelDir}/meta.json`, "utf8"));
|
|
73
|
+
// The deployed bundle is int8-per-row quantized — fromArtifactDir dequantizes via meta.scales.
|
|
74
|
+
const placer = await CoarsePlacer.fromArtifactDir(modelDir, { abstainBelow: 0 });
|
|
75
|
+
const classSet = new Set(meta.classes);
|
|
76
|
+
// Build `<City>, <Country>` queries from cities15000 for the recoverable set, shortest first.
|
|
77
|
+
const CITIES = dataRootPath("geonames", "cities15000.txt");
|
|
78
|
+
const want = new Set(RECOVERABLE);
|
|
79
|
+
const all = [];
|
|
80
|
+
for (const line of readFileSync(CITIES, "utf8").split("\n")) {
|
|
81
|
+
if (!line)
|
|
82
|
+
continue;
|
|
83
|
+
const f = line.split("\t");
|
|
84
|
+
const name = f[1];
|
|
85
|
+
const cc = f[8];
|
|
86
|
+
if (!name || !cc || !want.has(cc))
|
|
87
|
+
continue;
|
|
88
|
+
const country = ISO2_TO_NAME.get(cc);
|
|
89
|
+
if (!country)
|
|
90
|
+
continue;
|
|
91
|
+
all.push({ q: `${name}, ${country}`, cc });
|
|
108
92
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
93
|
+
all.sort((a, b) => a.q.length - b.q.length);
|
|
94
|
+
const queries = all.slice(0, maxN);
|
|
95
|
+
const per = new Map();
|
|
96
|
+
for (const { q, cc } of queries) {
|
|
97
|
+
const p = placer.predict(q);
|
|
98
|
+
const s = per.get(cc) ?? { cc, n: 0, inClass: 0, top1Correct: 0, probs: [] };
|
|
99
|
+
s.n++;
|
|
100
|
+
if (classSet.has(cc)) {
|
|
101
|
+
s.inClass++;
|
|
102
|
+
}
|
|
103
|
+
if (p.country === cc) {
|
|
104
|
+
s.top1Correct++;
|
|
105
|
+
s.probs.push(p.confidence);
|
|
106
|
+
}
|
|
107
|
+
per.set(cc, s);
|
|
112
108
|
}
|
|
113
|
-
per.
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
const
|
|
121
|
-
const
|
|
122
|
-
const
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
L.push("
|
|
134
|
-
L.push(
|
|
135
|
-
L.push(`
|
|
136
|
-
L.push(
|
|
137
|
-
L.push(
|
|
138
|
-
L.push(`-
|
|
139
|
-
L.push(`- top1_correct (
|
|
140
|
-
L.push(`-
|
|
141
|
-
L.push(
|
|
142
|
-
L.push(
|
|
143
|
-
L.push(
|
|
144
|
-
L.push("");
|
|
145
|
-
L.push(
|
|
146
|
-
L.push("");
|
|
147
|
-
L.push("|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
console.log(
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
109
|
+
const rows = [...per.values()].sort((a, b) => a.cc.localeCompare(b.cc));
|
|
110
|
+
const N = queries.length;
|
|
111
|
+
const inClass = rows.reduce((t, r) => t + r.inClass, 0);
|
|
112
|
+
const top1 = rows.reduce((t, r) => t + r.top1Correct, 0);
|
|
113
|
+
const inClassCorrectProbs = rows.flatMap((r) => r.probs);
|
|
114
|
+
// NOTE(phase4b): `pct` stays local — core's formatPercent has no Math.max(1, b) zero-denominator
|
|
115
|
+
// guard (it renders "—") and appends its own "%", where this report composes the sign itself.
|
|
116
|
+
const pct = (a, b) => ((100 * a) / Math.max(1, b)).toFixed(1);
|
|
117
|
+
const inClassFalseRate = 1 - inClass / N;
|
|
118
|
+
const top1OfInClass = rows.reduce((t, r) => t + (classSet.has(r.cc) ? r.top1Correct : 0), 0);
|
|
119
|
+
const inClassN = rows.reduce((t, r) => t + r.inClass, 0);
|
|
120
|
+
const branch = inClassFalseRate > 0.05
|
|
121
|
+
? "DATA GAP — class set does not cover the recoverable tranche; defer to a class-set-widening retrain."
|
|
122
|
+
: top1OfInClass / Math.max(1, inClassN) < 0.8
|
|
123
|
+
? "LOW-QUALITY SIGNAL — in-set top1 < 80%; lowering the threshold would hard-filter wrong guesses. Defer."
|
|
124
|
+
: (median(inClassCorrectProbs) ?? 0) < HARD_PLACE_COUNTRY_MIN_CONF
|
|
125
|
+
? "UNDER-CONFIDENT — in-set + top1 ≥ 80% but median prob_1 < 0.9; the M2 mass rule is the CPU fix (default-off)."
|
|
126
|
+
: "NO CHANGE — in-set, confident, correct; the recoverable countries already clear the bar.";
|
|
127
|
+
const L = [];
|
|
128
|
+
L.push("# #822 placer-frontier probe — can the deployed placer emit the recoverable tranche?");
|
|
129
|
+
L.push("");
|
|
130
|
+
L.push(`_Model: \`${modelDir}\` (${meta.classes.length} classes). ${N} \`City, Country\` queries (shortest`);
|
|
131
|
+
L.push(`first) across ${RECOVERABLE.length} placer-recoverable countries. prob_1 vs HARD_PLACE_COUNTRY_MIN_CONF = 0.9._`);
|
|
132
|
+
L.push("");
|
|
133
|
+
L.push(`- in_class_set: **${pct(inClass, N)}%** (${inClass}/${N}) — false rate **${(100 * inClassFalseRate).toFixed(1)}%**`);
|
|
134
|
+
L.push(`- top1_correct (all): **${pct(top1, N)}%** (${top1}/${N})`);
|
|
135
|
+
L.push(`- top1_correct (in-set only): **${pct(top1OfInClass, inClassN)}%** (${top1OfInClass}/${inClassN})`);
|
|
136
|
+
L.push(`- median prob_1 (in-set correct): **${(median(inClassCorrectProbs) ?? 0).toFixed(3)}**`);
|
|
137
|
+
L.push("");
|
|
138
|
+
L.push(`## Branch: ${branch}`);
|
|
139
|
+
L.push("");
|
|
140
|
+
L.push(`Classes (${meta.classes.length}): \`${meta.classes.join(" ")}\``);
|
|
141
|
+
L.push("");
|
|
142
|
+
L.push("| Country | ISO2 | in-class | n | top1-correct | median prob_1 |");
|
|
143
|
+
L.push("| --- | --- | :---: | ---: | ---: | ---: |");
|
|
144
|
+
for (const r of rows) {
|
|
145
|
+
L.push(`| ${ISO2_TO_NAME.get(r.cc) ?? r.cc} | ${r.cc} | ${classSet.has(r.cc) ? "✓" : "—"} | ${r.n} | ${pct(r.top1Correct, r.n)}% | ${(median(r.probs) ?? 0).toFixed(2)} |`);
|
|
146
|
+
}
|
|
147
|
+
const md = L.join("\n");
|
|
148
|
+
console.log(md.split("\n").slice(0, 12).join("\n"));
|
|
149
|
+
console.log("…");
|
|
150
|
+
if (options.out) {
|
|
151
|
+
writeFileSync(options.out, `${md}\n`);
|
|
152
|
+
report?.(`[probe] wrote ${options.out}`);
|
|
153
|
+
}
|
|
154
|
+
return { branch, n: N, markdown: md };
|
|
158
155
|
}
|
|
159
156
|
//# sourceMappingURL=probe-frontier.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"probe-frontier.js","sourceRoot":"","sources":["../../../coarse-placer/tools/probe-frontier.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"probe-frontier.js","sourceRoot":"","sources":["../../../coarse-placer/tools/probe-frontier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAE,YAAY,EAAyB,MAAM,qBAAqB,CAAA;AAuBzE,MAAM,2BAA2B,GAAG,GAAG,CAAA,CAAC,4CAA4C;AAEpF,yGAAyG;AACzG,MAAM,WAAW,GAAG;IACnB,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACJ,CAAA;AAED,iGAAiG;AACjG,MAAM,CAAC,KAAK,UAAU,aAAa,CAClC,UAAgC,EAAE,EAClC,MAA+B;IAE/B,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,IAAI,eAAe,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;IAC1E,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,IAAI,IAAI,CAAA;IAE9B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AM,EAAE,CAAC,iBAAiB,OAAO,CAAC,GAAG,EAAE,CAAC,CAAA;IACzC,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;AACtC,CAAC"}
|
|
@@ -1,2 +1,35 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Int8-quantize the #244 coarse-placer (milestone 3). The placer is a linear classifier, so the
|
|
7
|
+
* only weight is a dense [class][feature] fp32 matrix (12×65536 = 3.0 MB). Per-CLASS symmetric
|
|
8
|
+
* int8 quantization — `scale[c] = max(|W[c]|) / 127`, `q = round(W / scale)` clamped to [-127,
|
|
9
|
+
* 127] — shrinks it to 0.75 MB (4×) while preserving the linear math exactly up to rounding (the
|
|
10
|
+
* logit is `bias[c] + scale[c] * Σ int8`, dequantized on load by `CoarsePlacer.fromArtifactDir`).
|
|
11
|
+
* Per-class scales matter because class weight magnitudes differ (OTHER's outlier-exposure rows
|
|
12
|
+
* push bigger weights than the in-map countries).
|
|
13
|
+
*
|
|
14
|
+
* Verify the accuracy cost with `mailwoman placer eval quant-compare` (target: within ~1pp).
|
|
15
|
+
*
|
|
16
|
+
* Run: `mailwoman placer quantize [--in <fp32 dir>] [--out <int8 dir>]`
|
|
17
|
+
*/
|
|
18
|
+
/** Options for {@linkcode quantizeCoarsePlacer}. */
|
|
19
|
+
export interface QuantizeCoarsePlacerOptions {
|
|
20
|
+
/** Fp32 artifact dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`. */
|
|
21
|
+
in?: string;
|
|
22
|
+
/** Int8 output dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model-int8`. */
|
|
23
|
+
out?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Result of {@linkcode quantizeCoarsePlacer}. */
|
|
26
|
+
export interface QuantizeCoarsePlacerResult {
|
|
27
|
+
outDir: string;
|
|
28
|
+
fp32Bytes: number;
|
|
29
|
+
int8Bytes: number;
|
|
30
|
+
maxAbsErr: number;
|
|
31
|
+
rmse: number;
|
|
32
|
+
}
|
|
33
|
+
/** Coarse-placer int8 quantizer — see the module doc. */
|
|
34
|
+
export declare function quantizeCoarsePlacer(options?: QuantizeCoarsePlacerOptions, report?: (line: string) => void): Promise<QuantizeCoarsePlacerResult>;
|
|
2
35
|
//# sourceMappingURL=quantize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantize.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/quantize.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"quantize.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/quantize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,oDAAoD;AACpD,MAAM,WAAW,2BAA2B;IAC3C,6EAA6E;IAC7E,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,gFAAgF;IAChF,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,kDAAkD;AAClD,MAAM,WAAW,0BAA0B;IAC1C,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACZ;AAED,yDAAyD;AACzD,wBAAsB,oBAAoB,CACzC,OAAO,GAAE,2BAAgC,EACzC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,0BAA0B,CAAC,CAsErC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import { mkdirSync, readFileSync, writeFileSync } 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
|
|
@@ -14,67 +11,68 @@ import { parseArgs } from "node:util";
|
|
|
14
11
|
* Per-class scales matter because class weight magnitudes differ (OTHER's outlier-exposure rows
|
|
15
12
|
* push bigger weights than the in-map countries).
|
|
16
13
|
*
|
|
17
|
-
* Verify the accuracy cost with `
|
|
18
|
-
* ~1pp).
|
|
14
|
+
* Verify the accuracy cost with `mailwoman placer eval quant-compare` (target: within ~1pp).
|
|
19
15
|
*
|
|
20
|
-
*
|
|
16
|
+
* Run: `mailwoman placer quantize [--in <fp32 dir>] [--out <int8 dir>]`
|
|
21
17
|
*/
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const meta = JSON.parse(readFileSync(path.join(
|
|
30
|
-
const buf = readFileSync(path.join(
|
|
31
|
-
const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
|
|
32
|
-
const w = new Float32Array(ab);
|
|
33
|
-
const C = meta.classes.length;
|
|
34
|
-
const dim = meta.featureDim;
|
|
35
|
-
if (w.length !== C * dim)
|
|
36
|
-
|
|
37
|
-
const int8 = new Int8Array(C * dim);
|
|
38
|
-
const scales = [];
|
|
39
|
-
let maxAbsErr = 0;
|
|
40
|
-
let sumSqErr = 0;
|
|
41
|
-
for (let c = 0; c < C; c++) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
const scale = maxAbs / 127 || 1; // all-zero row → scale 1 (q stays 0)
|
|
51
|
-
scales.push(scale);
|
|
52
|
-
for (let i = 0; i < dim; i++) {
|
|
53
|
-
let q = Math.round(w[base + i] / scale);
|
|
54
|
-
if (q > 127) {
|
|
55
|
-
q = 127;
|
|
18
|
+
import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
19
|
+
import * as path from "node:path";
|
|
20
|
+
import { dataRootPath } from "../../utils/data-root.js";
|
|
21
|
+
/** Coarse-placer int8 quantizer — see the module doc. */
|
|
22
|
+
export async function quantizeCoarsePlacer(options = {}, report) {
|
|
23
|
+
const inDir = options.in || dataRootPath("coarse-placer", "model");
|
|
24
|
+
const outDir = options.out || dataRootPath("coarse-placer", "model-int8");
|
|
25
|
+
const meta = JSON.parse(readFileSync(path.join(inDir, "meta.json"), "utf8"));
|
|
26
|
+
const buf = readFileSync(path.join(inDir, "weights.bin"));
|
|
27
|
+
const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
|
|
28
|
+
const w = new Float32Array(ab);
|
|
29
|
+
const C = meta.classes.length;
|
|
30
|
+
const dim = meta.featureDim;
|
|
31
|
+
if (w.length !== C * dim)
|
|
32
|
+
throw new Error(`weights length ${w.length} ≠ classes×dim ${C * dim}`);
|
|
33
|
+
const int8 = new Int8Array(C * dim);
|
|
34
|
+
const scales = [];
|
|
35
|
+
let maxAbsErr = 0;
|
|
36
|
+
let sumSqErr = 0;
|
|
37
|
+
for (let c = 0; c < C; c++) {
|
|
38
|
+
const base = c * dim;
|
|
39
|
+
let maxAbs = 0;
|
|
40
|
+
for (let i = 0; i < dim; i++) {
|
|
41
|
+
const a = Math.abs(w[base + i]);
|
|
42
|
+
if (a > maxAbs) {
|
|
43
|
+
maxAbs = a;
|
|
44
|
+
}
|
|
56
45
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
const scale = maxAbs / 127 || 1; // all-zero row → scale 1 (q stays 0)
|
|
47
|
+
scales.push(scale);
|
|
48
|
+
for (let i = 0; i < dim; i++) {
|
|
49
|
+
let q = Math.round(w[base + i] / scale);
|
|
50
|
+
if (q > 127) {
|
|
51
|
+
q = 127;
|
|
52
|
+
}
|
|
53
|
+
else if (q < -127) {
|
|
54
|
+
q = -127;
|
|
55
|
+
} // symmetric range; avoid -128 so |q|≤127
|
|
56
|
+
int8[base + i] = q;
|
|
57
|
+
const err = Math.abs(q * scale - w[base + i]);
|
|
58
|
+
if (err > maxAbsErr) {
|
|
59
|
+
maxAbsErr = err;
|
|
60
|
+
}
|
|
61
|
+
sumSqErr += err * err;
|
|
64
62
|
}
|
|
65
|
-
sumSqErr += err * err;
|
|
66
63
|
}
|
|
64
|
+
mkdirSync(outDir, { recursive: true });
|
|
65
|
+
writeFileSync(path.join(outDir, "weights.bin"), Buffer.from(int8.buffer));
|
|
66
|
+
writeFileSync(path.join(outDir, "meta.json"), JSON.stringify({ ...meta, quantization: "int8-per-row", scales }, null, 2));
|
|
67
|
+
const fp32Bytes = w.length * 4;
|
|
68
|
+
const int8Bytes = int8.length;
|
|
69
|
+
const rmse = Math.sqrt(sumSqErr / w.length);
|
|
70
|
+
report?.(`coarse-placer int8 quantization`);
|
|
71
|
+
report?.(` in: ${inDir}`);
|
|
72
|
+
report?.(` out: ${outDir}`);
|
|
73
|
+
report?.(` weights: ${(fp32Bytes / 1e6).toFixed(2)} MB fp32 → ${(int8Bytes / 1e6).toFixed(2)} MB int8 (${(fp32Bytes / int8Bytes).toFixed(1)}×)`);
|
|
74
|
+
report?.(` per-class scales: [${scales.map((s) => s.toExponential(2)).join(", ")}]`);
|
|
75
|
+
report?.(` weight reconstruction error: max ${maxAbsErr.toExponential(2)}, rmse ${rmse.toExponential(2)}`);
|
|
76
|
+
return { outDir, fp32Bytes, int8Bytes, maxAbsErr, rmse };
|
|
67
77
|
}
|
|
68
|
-
mkdirSync(args.out, { recursive: true });
|
|
69
|
-
writeFileSync(path.join(args.out, "weights.bin"), Buffer.from(int8.buffer));
|
|
70
|
-
writeFileSync(path.join(args.out, "meta.json"), JSON.stringify({ ...meta, quantization: "int8-per-row", scales }, null, 2));
|
|
71
|
-
const fp32Bytes = w.length * 4;
|
|
72
|
-
const int8Bytes = int8.length;
|
|
73
|
-
const rmse = Math.sqrt(sumSqErr / w.length);
|
|
74
|
-
console.log(`coarse-placer int8 quantization`);
|
|
75
|
-
console.log(` in: ${args.in}`);
|
|
76
|
-
console.log(` out: ${args.out}`);
|
|
77
|
-
console.log(` weights: ${(fp32Bytes / 1e6).toFixed(2)} MB fp32 → ${(int8Bytes / 1e6).toFixed(2)} MB int8 (${(fp32Bytes / int8Bytes).toFixed(1)}×)`);
|
|
78
|
-
console.log(` per-class scales: [${scales.map((s) => s.toExponential(2)).join(", ")}]`);
|
|
79
|
-
console.log(` weight reconstruction error: max ${maxAbsErr.toExponential(2)}, rmse ${rmse.toExponential(2)}`);
|
|
80
78
|
//# sourceMappingURL=quantize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quantize.js","sourceRoot":"","sources":["../../../coarse-placer/tools/quantize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"quantize.js","sourceRoot":"","sources":["../../../coarse-placer/tools/quantize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAChE,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AAEjC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAoBvD,yDAAyD;AACzD,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACzC,UAAuC,EAAE,EACzC,MAA+B;IAE/B,MAAM,KAAK,GAAG,OAAO,CAAC,EAAE,IAAI,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;IAClE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,IAAI,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC,CAAA;IAEzE,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC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AAI,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAC1E,CAAA;IAED,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,GAAG,CAAC,CAAA;IAC9B,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAA;IAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC,MAAM,CAAC,CAAA;IAC3C,MAAM,EAAE,CAAC,iCAAiC,CAAC,CAAA;IAC3C,MAAM,EAAE,CAAC,UAAU,KAAK,EAAE,CAAC,CAAA;IAC3B,MAAM,EAAE,CAAC,UAAU,MAAM,EAAE,CAAC,CAAA;IAC5B,MAAM,EAAE,CACP,cAAc,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CACvI,CAAA;IACD,MAAM,EAAE,CAAC,wBAAwB,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACrF,MAAM,EAAE,CAAC,sCAAsC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAE3G,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;AACzD,CAAC"}
|
|
@@ -8,9 +8,30 @@
|
|
|
8
8
|
* After training, fits a single temperature on val (NLL minimization) for calibrated confidence.
|
|
9
9
|
* Writes a `meta.json` + `weights.bin` (Float32, row-major [class][feature]) artifact.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* $MAILWOMAN_DATA_ROOT/coarse-placer/model]
|
|
13
|
-
* featurizer).
|
|
11
|
+
* Run: `mailwoman placer train [--epochs 12] [--lr 0.1] [--l2 1e-6] [--out
|
|
12
|
+
* $MAILWOMAN_DATA_ROOT/coarse-placer/model]`
|
|
14
13
|
*/
|
|
15
|
-
|
|
14
|
+
/** Options for {@linkcode trainCoarsePlacer}. */
|
|
15
|
+
export interface TrainCoarsePlacerOptions {
|
|
16
|
+
/** SGD epochs. Default 12. */
|
|
17
|
+
epochs?: number;
|
|
18
|
+
/** Initial learning rate (decays per epoch). Default 0.1. */
|
|
19
|
+
lr?: number;
|
|
20
|
+
/** L2 regularization. Default 1e-6. */
|
|
21
|
+
l2?: number;
|
|
22
|
+
/** Artifact output dir. Default `$MAILWOMAN_DATA_ROOT/coarse-placer/model`. */
|
|
23
|
+
out?: string;
|
|
24
|
+
/** Dataset dir (`{train,val}.jsonl`). Default `<repo>/data/coarse-placer`. */
|
|
25
|
+
data?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Result of {@linkcode trainCoarsePlacer}. */
|
|
28
|
+
export interface TrainCoarsePlacerResult {
|
|
29
|
+
outDir: string;
|
|
30
|
+
trainRows: number;
|
|
31
|
+
valRows: number;
|
|
32
|
+
temperature: number;
|
|
33
|
+
valNLL: number;
|
|
34
|
+
}
|
|
35
|
+
/** Coarse-placer SGD trainer — see the module doc. */
|
|
36
|
+
export declare function trainCoarsePlacer(options?: TrainCoarsePlacerOptions, report?: (line: string) => void): Promise<TrainCoarsePlacerResult>;
|
|
16
37
|
//# sourceMappingURL=train.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"train.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/train.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"train.d.ts","sourceRoot":"","sources":["../../../coarse-placer/tools/train.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAcH,iDAAiD;AACjD,MAAM,WAAW,wBAAwB;IACxC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,6DAA6D;IAC7D,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,uCAAuC;IACvC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,+EAA+E;IAC/E,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED,+CAA+C;AAC/C,MAAM,WAAW,uBAAuB;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;CACd;AAED,sDAAsD;AACtD,wBAAsB,iBAAiB,CACtC,OAAO,GAAE,wBAA6B,EACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,uBAAuB,CAAC,CA8LlC"}
|