@mailwoman/neural 4.10.0 → 4.12.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/README.md +102 -0
- package/out/anchor-inference.d.ts +1 -1
- package/out/anchor-inference.js +1 -1
- package/out/browser.d.ts +1 -0
- package/out/browser.d.ts.map +1 -1
- package/out/browser.js +5 -0
- package/out/browser.js.map +1 -1
- package/out/case-normalize.d.ts +34 -0
- package/out/case-normalize.d.ts.map +1 -0
- package/out/case-normalize.js +50 -0
- package/out/case-normalize.js.map +1 -0
- package/out/classifier.d.ts +25 -3
- package/out/classifier.d.ts.map +1 -1
- package/out/classifier.js +123 -23
- package/out/classifier.js.map +1 -1
- package/out/index.d.ts +2 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -0
- package/out/index.js.map +1 -1
- package/out/labels.d.ts +1 -1
- package/out/labels.js +1 -1
- package/out/onnx-runner.d.ts +7 -0
- package/out/onnx-runner.d.ts.map +1 -1
- package/out/onnx-runner.js +10 -0
- package/out/onnx-runner.js.map +1 -1
- package/out/postcode-repair.d.ts +17 -0
- package/out/postcode-repair.d.ts.map +1 -1
- package/out/postcode-repair.js +48 -0
- package/out/postcode-repair.js.map +1 -1
- package/out/scorer.d.ts +105 -0
- package/out/scorer.d.ts.map +1 -0
- package/out/scorer.js +286 -0
- package/out/scorer.js.map +1 -0
- package/out/soft-features.d.ts +67 -0
- package/out/soft-features.d.ts.map +1 -0
- package/out/soft-features.js +49 -0
- package/out/soft-features.js.map +1 -0
- package/out/span-bridge.d.ts +4 -4
- package/out/span-bridge.js +4 -4
- package/out/span-proposer-lexicon.d.ts +3 -3
- package/out/span-proposer-lexicon.js +3 -3
- package/out/street-morphology-prior.d.ts +4 -4
- package/out/street-morphology-prior.js +3 -3
- package/out/unit-repair.js +1 -1
- package/out/unit-repair.js.map +1 -1
- package/out/weights.d.ts +109 -0
- package/out/weights.d.ts.map +1 -1
- package/out/weights.js +157 -1
- package/out/weights.js.map +1 -1
- package/out/word-consistency.d.ts +60 -0
- package/out/word-consistency.d.ts.map +1 -0
- package/out/word-consistency.js +140 -0
- package/out/word-consistency.js.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Per-word BIO tag-consistency repair (#727 + the fr.country / admin-token fragmentation class).
|
|
7
|
+
*
|
|
8
|
+
* The model emits per-PIECE BIO labels. On rows where an admin token is adjacent to a non-latin
|
|
9
|
+
* (byte-fallback) locality, carries diacritics, or is all-caps/reordered, the per-piece labels
|
|
10
|
+
* can DISAGREE within a single word — `VERMONT` → `VER`[B-locality] + `MONT`[B-region], `Lozère`
|
|
11
|
+
* → `Loz`[locality] + `ère`[B-region] — and the span decoder reads that as a tag-change
|
|
12
|
+
* mid-token, fracturing the admin component. The model already KNOWS the word's tag (99.7% of
|
|
13
|
+
* normal rows are unanimous); the defect is the lack of a word-level consistency constraint.
|
|
14
|
+
*
|
|
15
|
+
* Fix (DeepSeek-Pro consult `contested-frag`, 2026-06-19): a SentencePiece word — a `▁`-started
|
|
16
|
+
* piece + its non-`▁` continuations — must carry ONE tag. The tag is chosen by a
|
|
17
|
+
* CONFIDENCE-WEIGHTED vote, NOT first-piece-wins: sum each piece's softmax mass per TAG TYPE
|
|
18
|
+
* (B-X
|
|
19
|
+
*
|
|
20
|
+
* - I-X collapsed; `O` included) across the word, argmax the type, and force `B-<type>` then
|
|
21
|
+
* `I-<type>` (or all `O`). The near-certain `ère`→region then pulls the whole word to region,
|
|
22
|
+
* healing both the fragment and the `Loz` bleed. Operates ONLY within a `▁`-delimited word,
|
|
23
|
+
* so cross-word multi-token names ("Saint Paul" → two words) are untouched and the decoder's
|
|
24
|
+
* existing cross-word merge still joins them.
|
|
25
|
+
*
|
|
26
|
+
* Safety: a word whose pieces already agree is left byte-identical (no change). The vote includes
|
|
27
|
+
* `O`, so an all-`O` word stays `O` (no spurious spans).
|
|
28
|
+
*
|
|
29
|
+
* Gate outcome (2026-06-19, fr-admin-split-gate + per-locale-f1, MAILWOMAN_WORD_CONSISTENCY=1): NOT
|
|
30
|
+
* a clean win, so this ships DEFAULT-OFF. It heals clean-latin fragments (`PRUNIÈRES LOZÈRE
|
|
31
|
+
* FRANCE` → region=`LOZÈRE`), but on OOD byte-soup rows where the per-piece confidence is itself
|
|
32
|
+
* unreliable the vote AMPLIFIES that noise — e.g. `VERMONT, ウェストミンスター` lets the region word
|
|
33
|
+
* absorb the adjacent CJK locality — and it net-regressed street −12.6 on the adversarial golden.
|
|
34
|
+
* The confidence-weighted vote out-votes a stray mis-tagged piece only when the surviving pieces
|
|
35
|
+
* are themselves trustworthy; on byte-fallback pieces that premise breaks. A confidence-gated
|
|
36
|
+
* variant (skip the heal when the word's mean p(bestType) is below a floor, or when any piece is
|
|
37
|
+
* a raw byte-fallback piece) is the path to a clean win — tracked on #727.
|
|
38
|
+
*/
|
|
39
|
+
export interface WordConsistencyResult {
|
|
40
|
+
/** A new per-piece label-index array, word-consistent (input is not mutated). */
|
|
41
|
+
labelIndices: number[];
|
|
42
|
+
/** PieceIndex → mean p(chosen type) across the word, for pieces in a word that was HEALED. */
|
|
43
|
+
healedConfidence: Map<number, number>;
|
|
44
|
+
/** Count of words whose labels were rewritten (0 = byte-identical to the input). */
|
|
45
|
+
healedWords: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Rewrite per-piece label indices so every `▁`-delimited word carries one tag, chosen by a
|
|
49
|
+
* confidence-weighted vote over the post-prior `emissions`. See the module docstring.
|
|
50
|
+
*
|
|
51
|
+
* @param pieces SentencePiece pieces (the `▁`-marked surface is the word-boundary signal).
|
|
52
|
+
* @param emissions Per-piece × per-label scores AFTER all priors/masks (the distribution the argmax
|
|
53
|
+
* would see). Softmaxed per piece for the vote so each piece's confidence carries its weight.
|
|
54
|
+
* @param labels The BIO label vocabulary (index ↔ label).
|
|
55
|
+
* @param labelIndices The current per-piece decision (viterbi path or argmax). Not mutated.
|
|
56
|
+
*/
|
|
57
|
+
export declare function enforceWordConsistency(pieces: ReadonlyArray<{
|
|
58
|
+
piece: string;
|
|
59
|
+
}>, emissions: ReadonlyArray<ReadonlyArray<number>>, labels: readonly string[], labelIndices: readonly number[]): WordConsistencyResult;
|
|
60
|
+
//# sourceMappingURL=word-consistency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"word-consistency.d.ts","sourceRoot":"","sources":["../word-consistency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAKH,MAAM,WAAW,qBAAqB;IACrC,iFAAiF;IACjF,YAAY,EAAE,MAAM,EAAE,CAAA;IACtB,8FAA8F;IAC9F,gBAAgB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,oFAAoF;IACpF,WAAW,EAAE,MAAM,CAAA;CACnB;AASD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACrC,MAAM,EAAE,aAAa,CAAC;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,EACxC,SAAS,EAAE,aAAa,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAC/C,MAAM,EAAE,SAAS,MAAM,EAAE,EACzB,YAAY,EAAE,SAAS,MAAM,EAAE,GAC7B,qBAAqB,CA+EvB"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* Per-word BIO tag-consistency repair (#727 + the fr.country / admin-token fragmentation class).
|
|
7
|
+
*
|
|
8
|
+
* The model emits per-PIECE BIO labels. On rows where an admin token is adjacent to a non-latin
|
|
9
|
+
* (byte-fallback) locality, carries diacritics, or is all-caps/reordered, the per-piece labels
|
|
10
|
+
* can DISAGREE within a single word — `VERMONT` → `VER`[B-locality] + `MONT`[B-region], `Lozère`
|
|
11
|
+
* → `Loz`[locality] + `ère`[B-region] — and the span decoder reads that as a tag-change
|
|
12
|
+
* mid-token, fracturing the admin component. The model already KNOWS the word's tag (99.7% of
|
|
13
|
+
* normal rows are unanimous); the defect is the lack of a word-level consistency constraint.
|
|
14
|
+
*
|
|
15
|
+
* Fix (DeepSeek-Pro consult `contested-frag`, 2026-06-19): a SentencePiece word — a `▁`-started
|
|
16
|
+
* piece + its non-`▁` continuations — must carry ONE tag. The tag is chosen by a
|
|
17
|
+
* CONFIDENCE-WEIGHTED vote, NOT first-piece-wins: sum each piece's softmax mass per TAG TYPE
|
|
18
|
+
* (B-X
|
|
19
|
+
*
|
|
20
|
+
* - I-X collapsed; `O` included) across the word, argmax the type, and force `B-<type>` then
|
|
21
|
+
* `I-<type>` (or all `O`). The near-certain `ère`→region then pulls the whole word to region,
|
|
22
|
+
* healing both the fragment and the `Loz` bleed. Operates ONLY within a `▁`-delimited word,
|
|
23
|
+
* so cross-word multi-token names ("Saint Paul" → two words) are untouched and the decoder's
|
|
24
|
+
* existing cross-word merge still joins them.
|
|
25
|
+
*
|
|
26
|
+
* Safety: a word whose pieces already agree is left byte-identical (no change). The vote includes
|
|
27
|
+
* `O`, so an all-`O` word stays `O` (no spurious spans).
|
|
28
|
+
*
|
|
29
|
+
* Gate outcome (2026-06-19, fr-admin-split-gate + per-locale-f1, MAILWOMAN_WORD_CONSISTENCY=1): NOT
|
|
30
|
+
* a clean win, so this ships DEFAULT-OFF. It heals clean-latin fragments (`PRUNIÈRES LOZÈRE
|
|
31
|
+
* FRANCE` → region=`LOZÈRE`), but on OOD byte-soup rows where the per-piece confidence is itself
|
|
32
|
+
* unreliable the vote AMPLIFIES that noise — e.g. `VERMONT, ウェストミンスター` lets the region word
|
|
33
|
+
* absorb the adjacent CJK locality — and it net-regressed street −12.6 on the adversarial golden.
|
|
34
|
+
* The confidence-weighted vote out-votes a stray mis-tagged piece only when the surviving pieces
|
|
35
|
+
* are themselves trustworthy; on byte-fallback pieces that premise breaks. A confidence-gated
|
|
36
|
+
* variant (skip the heal when the word's mean p(bestType) is below a floor, or when any piece is
|
|
37
|
+
* a raw byte-fallback piece) is the path to a clean win — tracked on #727.
|
|
38
|
+
*/
|
|
39
|
+
import { SPACE_SENTINEL } from "./tokenizer.js";
|
|
40
|
+
import { softmax } from "./viterbi.js";
|
|
41
|
+
/** The tag TYPE of a BIO label: `"region"` from `B-region`/`I-region`; `"O"` from `O`. */
|
|
42
|
+
function labelType(label) {
|
|
43
|
+
if (label === "O")
|
|
44
|
+
return "O";
|
|
45
|
+
const dash = label.indexOf("-");
|
|
46
|
+
return dash >= 0 ? label.slice(dash + 1) : label;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Rewrite per-piece label indices so every `▁`-delimited word carries one tag, chosen by a
|
|
50
|
+
* confidence-weighted vote over the post-prior `emissions`. See the module docstring.
|
|
51
|
+
*
|
|
52
|
+
* @param pieces SentencePiece pieces (the `▁`-marked surface is the word-boundary signal).
|
|
53
|
+
* @param emissions Per-piece × per-label scores AFTER all priors/masks (the distribution the argmax
|
|
54
|
+
* would see). Softmaxed per piece for the vote so each piece's confidence carries its weight.
|
|
55
|
+
* @param labels The BIO label vocabulary (index ↔ label).
|
|
56
|
+
* @param labelIndices The current per-piece decision (viterbi path or argmax). Not mutated.
|
|
57
|
+
*/
|
|
58
|
+
export function enforceWordConsistency(pieces, emissions, labels, labelIndices) {
|
|
59
|
+
// Type → {B index, I index}; the standalone O index; per-label-index → type.
|
|
60
|
+
const typeB = new Map();
|
|
61
|
+
const typeI = new Map();
|
|
62
|
+
const idxType = labels.map((l, idx) => {
|
|
63
|
+
const t = labelType(l);
|
|
64
|
+
if (l.startsWith("B-"))
|
|
65
|
+
typeB.set(t, idx);
|
|
66
|
+
else if (l.startsWith("I-"))
|
|
67
|
+
typeI.set(t, idx);
|
|
68
|
+
return t;
|
|
69
|
+
});
|
|
70
|
+
const oIdx = labels.indexOf("O");
|
|
71
|
+
const out = [...labelIndices];
|
|
72
|
+
const healedConfidence = new Map();
|
|
73
|
+
let healedWords = 0;
|
|
74
|
+
// Group pieces into words. A word = a `▁`-started piece + its non-`▁` continuations. A bare `▁`
|
|
75
|
+
// (whitespace-only) piece is a SEPARATOR — it ends the current word and joins no word (its label
|
|
76
|
+
// is left as-is, matching the decoder's "zero-width O is not a boundary" handling).
|
|
77
|
+
const words = [];
|
|
78
|
+
let cur = [];
|
|
79
|
+
const flush = () => {
|
|
80
|
+
if (cur.length)
|
|
81
|
+
words.push(cur);
|
|
82
|
+
cur = [];
|
|
83
|
+
};
|
|
84
|
+
for (let i = 0; i < pieces.length; i++) {
|
|
85
|
+
const pc = pieces[i].piece;
|
|
86
|
+
const isSentinel = pc.startsWith(SPACE_SENTINEL);
|
|
87
|
+
const content = isSentinel ? pc.slice(SPACE_SENTINEL.length) : pc;
|
|
88
|
+
if (content.trim() === "") {
|
|
89
|
+
// Separator (bare `▁` or whitespace) — ends the current word, belongs to none.
|
|
90
|
+
flush();
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (isSentinel) {
|
|
94
|
+
flush();
|
|
95
|
+
cur = [i];
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// Continuation. (An orphan continuation with no started word — shouldn't happen since the
|
|
99
|
+
// input's first piece is `▁`-marked — defensively starts its own word.)
|
|
100
|
+
cur.push(i);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
flush();
|
|
104
|
+
for (const w of words) {
|
|
105
|
+
// Confidence-weighted vote: sum each piece's softmax mass per TYPE (B-X + I-X) across the word.
|
|
106
|
+
const score = new Map();
|
|
107
|
+
for (const pi of w) {
|
|
108
|
+
const probs = softmax([...emissions[pi]]);
|
|
109
|
+
for (let li = 0; li < probs.length; li++) {
|
|
110
|
+
const t = idxType[li];
|
|
111
|
+
score.set(t, (score.get(t) ?? 0) + probs[li]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
let bestType = "O";
|
|
115
|
+
let bestScore = -1;
|
|
116
|
+
for (const [t, s] of score) {
|
|
117
|
+
if (s > bestScore) {
|
|
118
|
+
bestScore = s;
|
|
119
|
+
bestType = t;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Target label index per piece: B-<type> for the first piece, I-<type> for the rest (or O).
|
|
123
|
+
const targets = w.map((_pi, k) => {
|
|
124
|
+
if (bestType === "O")
|
|
125
|
+
return oIdx;
|
|
126
|
+
return k === 0 ? (typeB.get(bestType) ?? oIdx) : (typeI.get(bestType) ?? oIdx);
|
|
127
|
+
});
|
|
128
|
+
const changed = w.some((pi, k) => out[pi] !== targets[k]);
|
|
129
|
+
if (!changed)
|
|
130
|
+
continue; // word already consistent → byte-identical, leave it
|
|
131
|
+
healedWords++;
|
|
132
|
+
const meanConf = bestScore / w.length; // mean p(bestType) — length-invariant (DeepSeek t3)
|
|
133
|
+
w.forEach((pi, k) => {
|
|
134
|
+
out[pi] = targets[k];
|
|
135
|
+
healedConfidence.set(pi, meanConf);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
return { labelIndices: out, healedConfidence, healedWords };
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=word-consistency.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"word-consistency.js","sourceRoot":"","sources":["../word-consistency.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAWtC,0FAA0F;AAC1F,SAAS,SAAS,CAAC,KAAa;IAC/B,IAAI,KAAK,KAAK,GAAG;QAAE,OAAO,GAAG,CAAA;IAC7B,MAAM,IAAI,GAAG,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AgB,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;QACnC,CAAC,CAAC,CAAA;IACH,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,gBAAgB,EAAE,WAAW,EAAE,CAAA;AAC5D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/neural",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.12.0",
|
|
4
4
|
"description": "Mailwoman neural classifier runtime: SentencePiece tokenizer + ONNX inference + decoder wiring.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -14,14 +14,16 @@
|
|
|
14
14
|
".": "./out/index.js",
|
|
15
15
|
"./postcode-anchor": "./out/postcode-anchor.js",
|
|
16
16
|
"./postcode-binary-resolver": "./out/postcode-binary-resolver.js",
|
|
17
|
+
"./soft-features": "./out/soft-features.js",
|
|
18
|
+
"./scorer": "./out/scorer.js",
|
|
17
19
|
"./tokenizer": "./out/tokenizer.js",
|
|
18
20
|
"./onnx-runner": "./out/onnx-runner.js",
|
|
19
21
|
"./weights": "./out/weights.js",
|
|
20
22
|
"./browser": "./out/browser.js"
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
|
-
"@mailwoman/codex": "4.
|
|
24
|
-
"@mailwoman/core": "4.
|
|
25
|
+
"@mailwoman/codex": "4.12.0",
|
|
26
|
+
"@mailwoman/core": "4.12.0",
|
|
25
27
|
"@sctg/sentencepiece-js": "^1.3.3",
|
|
26
28
|
"onnxruntime-node": "^1.26.0"
|
|
27
29
|
},
|