@frontierrnd/translation-consistency 0.0.0-stage → 2.0.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/CHANGELOG.md +43 -0
- package/LICENSE +21 -0
- package/README.md +98 -2
- package/dist/index.d.ts +197 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +218 -0
- package/dist/index.js.map +1 -0
- package/dist/wasm/fast_iso_wasm.d.ts +78 -0
- package/dist/wasm/fast_iso_wasm.js +771 -0
- package/dist/wasm/fast_iso_wasm_bg.wasm +0 -0
- package/dist/wasm/fast_iso_wasm_bg.wasm.d.ts +27 -0
- package/dist/wasm-loader.d.ts +12 -0
- package/dist/wasm-loader.d.ts.map +1 -0
- package/dist/wasm-loader.js +38 -0
- package/dist/wasm-loader.js.map +1 -0
- package/package.json +49 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@frontierrnd/translation-consistency` will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [2.0.0] - 2026-12-03
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- **`FastIso v2.0` Multi-Lens Consistency & Anomaly Engine** (zero pretrained weights, zero ML training, script-blind, `< 0.6 ms/cand` compiled WASM, `~248 KB` gzipped `.wasm`), now resolved by default via `version: "latest"` (`"2.0.0"`):
|
|
11
|
+
- **Unbalanced Sinkhorn Optimal Transport (`UOTMass`, `UOTOrder`)**: Bidirectional Dirichlet-smoothed diagonal FastAlign (flat-array EM) + 10-iteration Entropic Unbalanced Sinkhorn OT with proportional token striding on long paraphrases (`> 60` tokens), null-sink omission/insertion localization, and continuous order-inversion detection.
|
|
12
|
+
- **Greedy Allosteric Parity Switches (`Parity`)**: Unsupervised discovery of polarity/quantifier allomorph pole pairs via greedy set-level $\phi$-maximization (e.g., negation and quantifier switches) that self-adapts to literal vs dynamic translation styles.
|
|
13
|
+
- **Morphology-Safe Surface, Bleed, Alphabet & Delimiter Integrity (`Surface`)**: SymSpell 1-delete typo index with affix-edit guard (`is_affix_only_edit`), Unicode digit conservation, adaptive punctuation/quote polarity, untranslated source-language word bleed detection, unseen target-alphabet/script-leak guard, and unmatched delimiter / missing terminal-punctuation detection.
|
|
14
|
+
- **Dual-Neighborhood Fluent Hallucination Contrast (`DualAlien`)**: Flags target words fluent in the global corpus but alien to the source's k-NN neighborhood.
|
|
15
|
+
- **Rare-Word-Protected Info-Fluency (`InfoFlu`)**: Softens `fluency_floor` when `source_max_idf >= 5.2` so omitting rare source concepts no longer improves fluency.
|
|
16
|
+
- **3-Bearing Indirect Triangulation (`Triang`)**: Reuses existing TF-IDF similarity vectors for subword-safe reverse back-projection (`T_top5 → S_top5 → covers x`), forward projection (`S_top5 → T_top5 → covers y`), and hubness-free symmetric reciprocal-rank echolocation (`RREcho`).
|
|
17
|
+
- **Strictly In-Language Zipfian Rank Topography & Skip-Gram C-Scores (`ZipfSkip`)**: Independently profiles source vs target Zipfian tail ranks (`p90`) and Bayesian-shrunk `d=1` / `d=2..3` skip-gram C-scores calibrated via project-internal expectations.
|
|
18
|
+
- **Cold-Start-Safe 5D Guide-Star Localized Conformal Calibrator**:
|
|
19
|
+
- Calibrates all 10 lenses locally against Gaussian-weighted out-of-fold guide stars in 5D source-difficulty space (active down to `n = 16`, removing the `v1.2` `< 80`-pair cold-start cliff).
|
|
20
|
+
- Emits calibrated `conformalP` (`(0, 1]`) and 10-element `lensZ` on `ScoreBreakdown`.
|
|
21
|
+
- Soft-saturates one-sided sparse structural alarms (`UOTOrder`, `Parity`, `DualAlien`, `Surface`) while anchoring within-verse `total` additively on `v1.2`'s continuous ranking backbone.
|
|
22
|
+
- **Multi-Scale Passage Context Shunting in `scanPassageDrift`**:
|
|
23
|
+
- Added optional fields on `PassageDriftReport`: `shuntedVerseScores` (`W=1` + `W=3`), `contextBleedScores` (adjacent-neighbor target bleed excess), `localMatrixDivergence` (±2 local `M^S vs M^T` relational divergence), `burstinessDivergence` (±5 sliding-window in-language Zipfian burstiness mismatch), and `boundaryShiftIndices` (disentangling harmless verse-boundary shifts from genuine omissions).
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- **`LATEST_VERSION` promoted from `"1.2.0"` to `"2.0.0"`**:
|
|
27
|
+
- Callers omitting `version` or passing `version: "latest"` now run `FastIso v2.0`.
|
|
28
|
+
- Cached binary blobs serialized with `v1.2.0` will cleanly return `null` from `deserializeScorer(blob, { version: "latest" })` so workers trigger a fresh `v2.0` rebuild.
|
|
29
|
+
- Pin `{ version: "1.2" }` to continue using `FastIso v1.2` with bit-identical Python golden parity (`fixtures/golden_v12.json`).
|
|
30
|
+
- Upgraded `localizeSpans` and `pickBest` under `v2.0` to surface UOT null-sink omissions/insertions, typo tokens, and 10-lens reranking.
|
|
31
|
+
|
|
32
|
+
### Verified Benchmarks (`v1.2` → `v2.0`, Compiled WASM)
|
|
33
|
+
- **Live Aquilla Holdout (24 unseen projects, Rotated 3-Fold, `0.58 ms/cand`):** Balanced `RawAUC 0.618 → 0.674` (`+5.7 pts`), `LenAUC 0.636 → 0.650` (`+1.5 pts`), `HeavyAUC 0.645 → 0.692` (`+4.7 pts`); Cold-Start (`< 100` pairs) `RawAUC 0.529 → 0.625` (`+9.6 pts`), `HeavyAUC 0.543 → 0.652` (`+10.9 pts`).
|
|
34
|
+
- **Live Aquilla Holdout (Strictly Past-Only Temporal Causal, `0.51 ms/cand`):** Balanced `RawAUC 0.633 → 0.653`, `LenAUC 0.611 → 0.632` (`+2.0 pts`), `HeavyAUC 0.676 → 0.686`.
|
|
35
|
+
- **Cross-Script Corruptions (13 archetypes):** Greek→ULB `0.666 → 0.720` (`+5.4 pts`); Greek→T4T `0.614 → 0.658` (`+4.4 pts`, beating `v1.2` on 11/13 archetypes).
|
|
36
|
+
- **8-Attack Goodhart Defense:** ULB `91.1% → 94.0%` (`arg_role_swap +9.6%`); T4T `84.8% → 87.5%` (`arg_role_swap +16.4%`).
|
|
37
|
+
- **Multi-Draft Best-of-8 Reranking:** `Iso+MBR` improved `52.73 → 52.84` (`49.2%` of Oracle-8 headroom).
|
|
38
|
+
- **WMT22 MQM (5-fold doc CV, zero training):** Segment Spearman $\rho$ improved across `en-de` (`0.102 → 0.144`), `en-ru` (`0.082 → 0.131`), and `zh-en` (`0.135 → 0.152`).
|
|
39
|
+
|
|
40
|
+
## [1.2.0] - 2026-11-30
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Initial Rust + WebAssembly release of `@frontierrnd/translation-consistency` (`FastIso v1.2`) with bit-for-bit Python golden parity, `pickBest` (`FastIso + MBR` + CPU glossary swaps + lattice stitching), `extractGlossary`, `localizeSpans`, `scanPassageDrift`, `chrfPP`, and version-stamped `postcard` binary serialization.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Frontier R&D
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,99 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@frontierrnd/translation-consistency`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Sub-millisecond, zero-pretraining, script-blind **translation consistency & anomaly detection** powered by **multi-lens relational geometry (`FastIso v2.0`, with pinned `v1.2` support)**, written in Rust and compiled to WebAssembly.
|
|
4
|
+
|
|
5
|
+
Score draft translations, flag likely human edits with calibrated local `conformalP` p-values, pick the best candidate (`FastIso + MBR` consensus + CPU glossary swaps), localize anomalous spans, and audit passage-level drift in **Browser Web Workers, Node.js, Tauri, or Edge runtimes** — using only the source text and the project's own checked translations.
|
|
6
|
+
|
|
7
|
+
- **Zero pretrained weights & zero GPU:** Works on any language or script (Latin, Syriac, vocalized Arabic, Indic, indigenous languages) via Unicode `L|M|N` tokenization and diacritic-stripped root skeletons.
|
|
8
|
+
- **10 orthogonal zero-training lenses (`v2.0`):** Relational Geometry (`Geo`), Subword IBM1 (`SubIBM`), Unbalanced Sinkhorn Optimal Transport Mass & Order (`UOTMass`, `UOTOrder`), Greedy Allosteric Parity Switches (`Parity`), Dual-Neighborhood Fluent Hallucination Contrast (`DualAlien`), Morphology-Safe Surface/Bleed/Alphabet/Delimiter Integrity (`Surface`), Rare-Word-Protected Info-Fluency (`InfoFlu`), 3-Bearing Indirect Triangulation (`Triang`: back-projection + forward-projection + symmetric reciprocal-rank echolocation), and Strictly In-Language Zipfian Topography & Skip-Gram C-Scores (`ZipfSkip`) — combined via a cold-start-safe 5D Guide-Star Localized Conformal Calibrator.
|
|
9
|
+
- **Multi-scale passage context shunting (`scanPassageDrift`):** Combines `W=1` vs `W=3` shunting, local `M^S vs M^T` relational matrix divergence, adjacent-verse context-bleed detection, sliding-window Zipfian burstiness divergence, and harmless verse-boundary shift disentanglement.
|
|
10
|
+
- **Tiny footprint:** ~250 KB gzipped `.wasm`, `< 0.5–1.0 ms/candidate` production WASM scoring.
|
|
11
|
+
- **Explicit versioning with `"latest"` default:** Omit `version` (or pass `"latest"`) for `FastIso v2.0`, or pin `"1.2"` / `"2.0"` for reproducible evaluations. Every score and serialized binary cache stamps its exact `engineVersion`.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @frontierrnd/translation-consistency
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import {
|
|
25
|
+
createScorer,
|
|
26
|
+
deserializeScorer,
|
|
27
|
+
peekSerializedVersion,
|
|
28
|
+
} from "@frontierrnd/translation-consistency";
|
|
29
|
+
|
|
30
|
+
// 1. Fit once from your project's validated translations (defaults to version: "latest")
|
|
31
|
+
const scorer = await createScorer(validatedPairs, {
|
|
32
|
+
version: "latest", // or pin "1.2"
|
|
33
|
+
indexCap: 1000, // sub-ms sweet spot for echo & LM index
|
|
34
|
+
maxLexicalPairs: 12000,
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// 2. Score a batch of LLM drafts (~0.35–1.0 ms/candidate)
|
|
38
|
+
const scores = scorer.scoreBatch(sourceText, drafts);
|
|
39
|
+
// scores[i] -> { engineVersion: "1.2.0", total, residual, diagnostics, ... }
|
|
40
|
+
|
|
41
|
+
// 3. Pick Best-of-N with Soft FastIso + MBR consensus + zero-LLM CPU glossary swaps
|
|
42
|
+
const winner = scorer.pickBest(sourceText, drafts, {
|
|
43
|
+
isoWeight: 0.45,
|
|
44
|
+
glossarySwap: true,
|
|
45
|
+
stitch: false,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// 4. Cache the compiled index in IndexedDB / disk
|
|
49
|
+
const blob = scorer.serialize();
|
|
50
|
+
const cached = await deserializeScorer(blob, { version: "latest" });
|
|
51
|
+
// Returns `null` if `blob` was built with an older engine version -> trigger clean rebuild!
|
|
52
|
+
|
|
53
|
+
scorer.dispose();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Cloudflare Workers / Custom WASM Loading
|
|
57
|
+
|
|
58
|
+
In browsers (Vite/Webpack/Web Workers) and Node.js, WASM loads automatically. In environments that disallow dynamic `fetch`/`fs` (like Cloudflare Workers), initialize once with the static WASM export:
|
|
59
|
+
|
|
60
|
+
```ts
|
|
61
|
+
import { initWasm, createScorer } from "@frontierrnd/translation-consistency";
|
|
62
|
+
import wasmModule from "@frontierrnd/translation-consistency/wasm";
|
|
63
|
+
|
|
64
|
+
await initWasm(wasmModule);
|
|
65
|
+
const scorer = await createScorer(validatedPairs);
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## API Overview
|
|
71
|
+
|
|
72
|
+
| Export / Method | What it does |
|
|
73
|
+
|---|---|
|
|
74
|
+
| `createScorer(pairs, opts?)` | Fits `FastIso` (`version: "latest"` -> `"2.0.0"`, or pin `"1.2"` / `"2.0"`). |
|
|
75
|
+
| `deserializeScorer(bytes, opts?)` | Restores a serialized index; returns `null` on version mismatch unless `{ strict: true }`. |
|
|
76
|
+
| `peekSerializedVersion(bytes)` | Reads the stamped `engineVersion` header without decoding the index. |
|
|
77
|
+
| `scorer.score(src, cand)` / `scoreBatch(src, cands)` | Returns `ScoreBreakdown` (`total`, localized `residual`, `conformalP`, 10-lens `lensZ`, and plain-English `diagnostics`). |
|
|
78
|
+
| `scorer.pickBest(src, cands, opts?)` | Soft `FastIso + MBR` reranker with optional monotonic CPU glossary swaps and multi-draft lattice stitching. |
|
|
79
|
+
| `scorer.extractGlossary(src, opts?)` | High-confidence project term hints + chapter locks. |
|
|
80
|
+
| `scorer.localizeSpans(src, cand, maxWindow?)` | Batched LOSO span anomaly localization, Doppler-foreign token flags, missing project terms, and `safeMaskedTemplate` (never masks rare correct OOV words). |
|
|
81
|
+
| `scorer.scanPassageDrift(srcs, tgts)` | Contiguous-passage audit: `W=1`/`W=3` context shunting, `contextBleedScores`, `localMatrixDivergence`, `burstinessDivergence`, `boundaryShiftIndices`, `transitionIso`, and intra-passage terminology splits. |
|
|
82
|
+
| `chrfPP(hyp, ref)` | Pure-WASM sentence-level `chrF++` (char 1–6 + word 1–2, `beta = 2.0`). |
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Development
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
npm install
|
|
90
|
+
npm test # Runs Rust unit + Python golden parity tests, builds WASM + TS, runs Node WASM tests
|
|
91
|
+
npm run build # Builds dist/wasm + dist/*.js + dist/*.d.ts
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Repository Layout
|
|
95
|
+
|
|
96
|
+
- `crates/fast-iso-core` — Native Rust crate (usable directly in Tauri or Rust CLIs; verified against `fixtures/golden_v12.json`).
|
|
97
|
+
- `crates/fast-iso-wasm` — `wasm-bindgen` bridge.
|
|
98
|
+
- `js/src` — TypeScript ergonomic wrapper and cross-runtime WASM loader.
|
|
99
|
+
- `fixtures/golden_v12.json` — Golden parity fixture generated directly from Python `fast_iso_v12.py`.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { initWasm, type WasmInitInput } from "./wasm-loader.js";
|
|
2
|
+
import type { WasmFastIso } from "./wasm/fast_iso_wasm.js";
|
|
3
|
+
export { initWasm, type WasmInitInput };
|
|
4
|
+
/** Current default engine version resolved by `"latest"`. */
|
|
5
|
+
export declare const LATEST_VERSION: "2.0.0";
|
|
6
|
+
/** All version selectors accepted by `createScorer` and `deserializeScorer`. */
|
|
7
|
+
export declare const SUPPORTED_VERSIONS: readonly ["latest", "1.2", "1.2.0", "2.0", "2.0.0"];
|
|
8
|
+
export type VersionSelector = (typeof SUPPORTED_VERSIONS)[number] | (string & {});
|
|
9
|
+
export interface ParallelPair {
|
|
10
|
+
source: string;
|
|
11
|
+
target: string;
|
|
12
|
+
}
|
|
13
|
+
export interface FitOptions {
|
|
14
|
+
/** Engine version to use. Defaults to `"latest"` (`"2.0.0"`). Pin e.g. `"1.2"` or `"2.0"` for reproducible evals. */
|
|
15
|
+
version?: VersionSelector;
|
|
16
|
+
/** Run out-of-fold per-project calibration and 5-feature Ridge source-difficulty residualizer. Default: `true`. */
|
|
17
|
+
fitCal?: boolean;
|
|
18
|
+
/** Max held-out rows used for OOF calibration. Default: `120`. */
|
|
19
|
+
maxCal?: number;
|
|
20
|
+
/** Max rows kept in the TF-IDF echo & LM index (sweet spot: `1000`, `< 1.6 ms/cand`). Set `null` to disable cap. */
|
|
21
|
+
indexCap?: number | null;
|
|
22
|
+
/** Max corpus pairs used for full-corpus subword/stem IBM1 alignment. Default: `12000`. */
|
|
23
|
+
maxLexicalPairs?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface DeserializeOptions {
|
|
26
|
+
/** Expected engine version. Defaults to `"latest"`. */
|
|
27
|
+
version?: VersionSelector;
|
|
28
|
+
/**
|
|
29
|
+
* If `false` (default), returns `null` when a cached blob was built by a different engine version
|
|
30
|
+
* so callers can cleanly rebuild in a background worker.
|
|
31
|
+
* If `true`, throws on version mismatch.
|
|
32
|
+
*/
|
|
33
|
+
strict?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ScoreBreakdown {
|
|
36
|
+
engineVersion: string;
|
|
37
|
+
total: number;
|
|
38
|
+
residual: number;
|
|
39
|
+
isoProfile: number;
|
|
40
|
+
bidiEcho: number;
|
|
41
|
+
lexicalCons: number;
|
|
42
|
+
entityGuard: number;
|
|
43
|
+
halfOrder: number;
|
|
44
|
+
infoMass: number;
|
|
45
|
+
fluencyFloor: number;
|
|
46
|
+
clonePenalty: number;
|
|
47
|
+
repPenalty: number;
|
|
48
|
+
sourceMaxIdf: number;
|
|
49
|
+
diagnostics: string[];
|
|
50
|
+
/** Localized conformal p-value in `(0, 1]` (v2.0+ only). Lower = more anomalous. */
|
|
51
|
+
conformalP?: number;
|
|
52
|
+
/** Per-lens guide-star standardized z-scores `[geo, subIbm, uotMass, uotOrder, parity, dualAlien, surface, infoFlu]` (v2.0+ only). */
|
|
53
|
+
lensZ?: number[];
|
|
54
|
+
}
|
|
55
|
+
export interface PickBestOptions {
|
|
56
|
+
/** Weight on FastIso z-score vs. MBR consensus z-score (0..1). Default: `0.45`. */
|
|
57
|
+
isoWeight?: number;
|
|
58
|
+
/** Enable multi-draft CPU lattice span stitching. Default: `false`. */
|
|
59
|
+
stitch?: boolean;
|
|
60
|
+
/** Enable zero-LLM-call monotonic CPU glossary swap for Doppler-foreign tokens. Default: `true`. */
|
|
61
|
+
glossarySwap?: boolean;
|
|
62
|
+
/** Max greedy CPU edits when `stitch` or `glossarySwap` is enabled. Default: `3`. */
|
|
63
|
+
maxEdits?: number;
|
|
64
|
+
/** Minimum donor draft support for lattice span proposals. Default: `2`. */
|
|
65
|
+
minSupport?: number;
|
|
66
|
+
}
|
|
67
|
+
export interface CandidateRank {
|
|
68
|
+
index: number;
|
|
69
|
+
text: string;
|
|
70
|
+
combinedScore: number;
|
|
71
|
+
mbrScore: number;
|
|
72
|
+
breakdown: ScoreBreakdown;
|
|
73
|
+
}
|
|
74
|
+
export interface PickBestResult {
|
|
75
|
+
engineVersion: string;
|
|
76
|
+
bestText: string;
|
|
77
|
+
bestIndex: number;
|
|
78
|
+
editsApplied: number;
|
|
79
|
+
finalBreakdown: ScoreBreakdown;
|
|
80
|
+
ranked: CandidateRank[];
|
|
81
|
+
}
|
|
82
|
+
export interface GlossaryOptions {
|
|
83
|
+
maxTerms?: number;
|
|
84
|
+
minDf?: number;
|
|
85
|
+
minProb?: number;
|
|
86
|
+
passageLocks?: Record<string, string>;
|
|
87
|
+
}
|
|
88
|
+
export interface GlossaryTarget {
|
|
89
|
+
term: string;
|
|
90
|
+
prob: number;
|
|
91
|
+
}
|
|
92
|
+
export interface GlossaryHint {
|
|
93
|
+
sourceTerm: string;
|
|
94
|
+
targets: GlossaryTarget[];
|
|
95
|
+
idf: number;
|
|
96
|
+
locked: boolean;
|
|
97
|
+
}
|
|
98
|
+
export interface TokenFlag {
|
|
99
|
+
tokenIndex: number;
|
|
100
|
+
token: string;
|
|
101
|
+
score: number;
|
|
102
|
+
}
|
|
103
|
+
export interface MissingTerm {
|
|
104
|
+
sourceTerm: string;
|
|
105
|
+
expectedTarget: string;
|
|
106
|
+
}
|
|
107
|
+
export interface SpanAnomalyReport {
|
|
108
|
+
engineVersion: string;
|
|
109
|
+
baseScore: number;
|
|
110
|
+
worstSpanIdx: [number, number] | null;
|
|
111
|
+
worstSpanText: string;
|
|
112
|
+
worstSpanGain: number;
|
|
113
|
+
maskedTemplate: string;
|
|
114
|
+
/** Safe Doppler-only mask template (only masks verified foreign tokens, never rare OOV nouns). */
|
|
115
|
+
safeMaskedTemplate: string | null;
|
|
116
|
+
missingTerms: MissingTerm[];
|
|
117
|
+
foreignTokens: TokenFlag[];
|
|
118
|
+
seamSpikes: TokenFlag[];
|
|
119
|
+
}
|
|
120
|
+
export interface TermSplit {
|
|
121
|
+
sourceWord: string;
|
|
122
|
+
dominantTarget: string;
|
|
123
|
+
formCounts: Record<string, number>;
|
|
124
|
+
verseIndices: number[];
|
|
125
|
+
missingIndices: number[];
|
|
126
|
+
}
|
|
127
|
+
export interface SeamGap {
|
|
128
|
+
leftIndex: number;
|
|
129
|
+
rightIndex: number;
|
|
130
|
+
gap: number;
|
|
131
|
+
}
|
|
132
|
+
export interface PassageDriftReport {
|
|
133
|
+
engineVersion: string;
|
|
134
|
+
meanVerseIso: number;
|
|
135
|
+
meanWin3Iso: number;
|
|
136
|
+
transitionIso: number;
|
|
137
|
+
termConsistencyRate: number;
|
|
138
|
+
termSplits: TermSplit[];
|
|
139
|
+
flaggedVerses: number[];
|
|
140
|
+
verseIsoScores: number[];
|
|
141
|
+
worstSeams: SeamGap[];
|
|
142
|
+
/** Multi-scale `W=1` + `W=3` context-shunted verse scores (v2.0+). */
|
|
143
|
+
shuntedVerseScores?: number[];
|
|
144
|
+
/** Adjacent-neighbor target bleed excess `max(0, sim_T(i, i±1) - sim_S(i, i±1))` (v2.0+). */
|
|
145
|
+
contextBleedScores?: number[];
|
|
146
|
+
/** Local sliding-window (±2) relational matrix divergence `mean |sim_T(i,j) - sim_S(i,j)|` (v2.0+). */
|
|
147
|
+
localMatrixDivergence?: number[];
|
|
148
|
+
/** Sliding-window (±5) local-vs-global in-language Zipfian burstiness divergence (v2.0+). */
|
|
149
|
+
burstinessDivergence?: number[];
|
|
150
|
+
/** Verse indices where isolated `W=1` looks anomalous yet `W=3` snaps back to normal (likely harmless boundary shift). */
|
|
151
|
+
boundaryShiftIndices?: number[];
|
|
152
|
+
}
|
|
153
|
+
export declare class FastIsoScorer {
|
|
154
|
+
#private;
|
|
155
|
+
/** @internal */
|
|
156
|
+
constructor(inner: WasmFastIso);
|
|
157
|
+
/** Concrete semantic version of the engine backing this scorer (e.g. `"1.2.0"`). */
|
|
158
|
+
get engineVersion(): string;
|
|
159
|
+
/** Number of rows indexed in the TF-IDF / LM index (capped by `indexCap`). */
|
|
160
|
+
get corpusSize(): number;
|
|
161
|
+
/** Number of full-corpus rows available to the subword/stem IBM1 aligner. */
|
|
162
|
+
get lexicalSize(): number;
|
|
163
|
+
/** Score a single `(source, candidate)` pair. */
|
|
164
|
+
score(source: string, candidate: string): ScoreBreakdown;
|
|
165
|
+
/** Score a batch of candidate translations against one source string (~1 ms/candidate). */
|
|
166
|
+
scoreBatch(source: string, candidates: string[]): ScoreBreakdown[];
|
|
167
|
+
/**
|
|
168
|
+
* Pick the best candidate from a pool using Soft `FastIso + MBR` consensus,
|
|
169
|
+
* with optional monotonic CPU glossary swaps and multi-draft lattice stitching.
|
|
170
|
+
*/
|
|
171
|
+
pickBest(source: string, candidates: string[], options?: PickBestOptions): PickBestResult;
|
|
172
|
+
/** Extract high-confidence project glossary hints for content words in `source`. */
|
|
173
|
+
extractGlossary(source: string, options?: GlossaryOptions): GlossaryHint[];
|
|
174
|
+
/** Localize anomalous 1–2 token spans, Doppler-foreign words, and missing project terms. */
|
|
175
|
+
localizeSpans(source: string, candidate: string, maxWindow?: number): SpanAnomalyReport;
|
|
176
|
+
/** Audit macro passage-level coherence: 3-verse windows, transition isomorphism, and term splits. */
|
|
177
|
+
scanPassageDrift(sources: string[], targets: string[]): PassageDriftReport;
|
|
178
|
+
/** Serialize the compiled scorer into a compact version-stamped binary blob for IndexedDB/disk caching. */
|
|
179
|
+
serialize(): Uint8Array;
|
|
180
|
+
/** Free the underlying WebAssembly memory immediately. */
|
|
181
|
+
dispose(): void;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Fit a new `FastIsoScorer` from validated parallel project pairs.
|
|
185
|
+
* Defaults to `version: "latest"` (`1.2.0`).
|
|
186
|
+
*/
|
|
187
|
+
export declare function createScorer(pairs: ParallelPair[], options?: FitOptions): Promise<FastIsoScorer>;
|
|
188
|
+
/**
|
|
189
|
+
* Restore a cached `FastIsoScorer` from `serialize()` bytes.
|
|
190
|
+
* Returns `null` (unless `strict: true`) if the blob was built with an older/different engine version.
|
|
191
|
+
*/
|
|
192
|
+
export declare function deserializeScorer(bytes: Uint8Array, options?: DeserializeOptions): Promise<FastIsoScorer | null>;
|
|
193
|
+
/** Read the engine version stamped in a serialized blob without decoding the index. */
|
|
194
|
+
export declare function peekSerializedVersion(bytes: Uint8Array): Promise<string>;
|
|
195
|
+
/** Pure-WASM sentence-level `chrF++` (char 1–6 + word 1–2, beta=2.0), returning 0..100. */
|
|
196
|
+
export declare function chrfPP(hypothesis: string, reference: string): Promise<number>;
|
|
197
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|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IAajB,4FAA4F;IAC5F,aAAa,CACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,SAAS,SAAI,GACZ,iBAAiB;IA2BpB,qGAAqG;IACrG,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,kBAAkB;IA8B1E,2GAA2G;IAC3G,SAAS,IAAI,UAAU;IAIvB,0DAA0D;IAC1D,OAAO,IAAI,IAAI;CAMhB;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,YAAY,EAAE,EACrB,OAAO,GAAE,UAAe,GACvB,OAAO,CAAC,aAAa,CAAC,CAYxB;AAED;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,UAAU,EACjB,OAAO,GAAE,kBAAuB,GAC/B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAa/B;AAED,uFAAuF;AACvF,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,UAAU,GAChB,OAAO,CAAC,MAAM,CAAC,CAGjB;AAED,2FAA2F;AAC3F,wBAAsB,MAAM,CAC1B,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAGjB"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { initWasm } from "./wasm-loader.js";
|
|
2
|
+
export { initWasm };
|
|
3
|
+
/** Current default engine version resolved by `"latest"`. */
|
|
4
|
+
export const LATEST_VERSION = "2.0.0";
|
|
5
|
+
/** All version selectors accepted by `createScorer` and `deserializeScorer`. */
|
|
6
|
+
export const SUPPORTED_VERSIONS = ["latest", "1.2", "1.2.0", "2.0", "2.0.0"];
|
|
7
|
+
function mapBreakdown(raw) {
|
|
8
|
+
return {
|
|
9
|
+
engineVersion: raw.engine_version,
|
|
10
|
+
total: raw.total,
|
|
11
|
+
residual: raw.residual,
|
|
12
|
+
isoProfile: raw.iso_profile,
|
|
13
|
+
bidiEcho: raw.bidi_echo,
|
|
14
|
+
lexicalCons: raw.lexical_cons,
|
|
15
|
+
entityGuard: raw.entity_guard,
|
|
16
|
+
halfOrder: raw.half_order,
|
|
17
|
+
infoMass: raw.info_mass,
|
|
18
|
+
fluencyFloor: raw.fluency_floor,
|
|
19
|
+
clonePenalty: raw.clone_penalty,
|
|
20
|
+
repPenalty: raw.rep_penalty,
|
|
21
|
+
sourceMaxIdf: raw.source_max_idf,
|
|
22
|
+
diagnostics: raw.diagnostics ?? [],
|
|
23
|
+
...(raw.conformal_p !== undefined ? { conformalP: raw.conformal_p } : {}),
|
|
24
|
+
...(raw.lens_z !== undefined ? { lensZ: Array.from(raw.lens_z) } : {}),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function mapToRecord(val) {
|
|
28
|
+
if (val instanceof Map) {
|
|
29
|
+
const out = {};
|
|
30
|
+
for (const [k, v] of val.entries())
|
|
31
|
+
out[String(k)] = Number(v);
|
|
32
|
+
return out;
|
|
33
|
+
}
|
|
34
|
+
return val ?? {};
|
|
35
|
+
}
|
|
36
|
+
export class FastIsoScorer {
|
|
37
|
+
#inner;
|
|
38
|
+
/** @internal */
|
|
39
|
+
constructor(inner) {
|
|
40
|
+
this.#inner = inner;
|
|
41
|
+
}
|
|
42
|
+
#get() {
|
|
43
|
+
if (!this.#inner) {
|
|
44
|
+
throw new Error("FastIsoScorer has been disposed");
|
|
45
|
+
}
|
|
46
|
+
return this.#inner;
|
|
47
|
+
}
|
|
48
|
+
/** Concrete semantic version of the engine backing this scorer (e.g. `"1.2.0"`). */
|
|
49
|
+
get engineVersion() {
|
|
50
|
+
return this.#get().engineVersion;
|
|
51
|
+
}
|
|
52
|
+
/** Number of rows indexed in the TF-IDF / LM index (capped by `indexCap`). */
|
|
53
|
+
get corpusSize() {
|
|
54
|
+
return this.#get().corpusSize;
|
|
55
|
+
}
|
|
56
|
+
/** Number of full-corpus rows available to the subword/stem IBM1 aligner. */
|
|
57
|
+
get lexicalSize() {
|
|
58
|
+
return this.#get().lexicalSize;
|
|
59
|
+
}
|
|
60
|
+
/** Score a single `(source, candidate)` pair. */
|
|
61
|
+
score(source, candidate) {
|
|
62
|
+
return this.scoreBatch(source, [candidate])[0];
|
|
63
|
+
}
|
|
64
|
+
/** Score a batch of candidate translations against one source string (~1 ms/candidate). */
|
|
65
|
+
scoreBatch(source, candidates) {
|
|
66
|
+
const raw = this.#get().scoreBatch(source, candidates);
|
|
67
|
+
return raw.map(mapBreakdown);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Pick the best candidate from a pool using Soft `FastIso + MBR` consensus,
|
|
71
|
+
* with optional monotonic CPU glossary swaps and multi-draft lattice stitching.
|
|
72
|
+
*/
|
|
73
|
+
pickBest(source, candidates, options = {}) {
|
|
74
|
+
const raw = this.#get().pickBest(source, candidates, options);
|
|
75
|
+
return {
|
|
76
|
+
engineVersion: raw.engine_version,
|
|
77
|
+
bestText: raw.best_text,
|
|
78
|
+
bestIndex: raw.best_index,
|
|
79
|
+
editsApplied: raw.edits_applied,
|
|
80
|
+
finalBreakdown: mapBreakdown(raw.final_breakdown),
|
|
81
|
+
ranked: (raw.ranked ?? []).map((r) => ({
|
|
82
|
+
index: r.index,
|
|
83
|
+
text: r.text,
|
|
84
|
+
combinedScore: r.combined_score,
|
|
85
|
+
mbrScore: r.mbr_score,
|
|
86
|
+
breakdown: mapBreakdown(r.breakdown),
|
|
87
|
+
})),
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** Extract high-confidence project glossary hints for content words in `source`. */
|
|
91
|
+
extractGlossary(source, options = {}) {
|
|
92
|
+
const raw = this.#get().extractGlossary(source, options);
|
|
93
|
+
return raw.map((h) => ({
|
|
94
|
+
sourceTerm: h.source_term,
|
|
95
|
+
targets: (h.targets ?? []).map((t) => ({
|
|
96
|
+
term: t.term,
|
|
97
|
+
prob: t.prob,
|
|
98
|
+
})),
|
|
99
|
+
idf: h.idf,
|
|
100
|
+
locked: Boolean(h.locked),
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
/** Localize anomalous 1–2 token spans, Doppler-foreign words, and missing project terms. */
|
|
104
|
+
localizeSpans(source, candidate, maxWindow = 2) {
|
|
105
|
+
const raw = this.#get().localizeSpans(source, candidate, maxWindow);
|
|
106
|
+
return {
|
|
107
|
+
engineVersion: raw.engine_version,
|
|
108
|
+
baseScore: raw.base_score,
|
|
109
|
+
worstSpanIdx: raw.worst_span_idx ?? null,
|
|
110
|
+
worstSpanText: raw.worst_span_text,
|
|
111
|
+
worstSpanGain: raw.worst_span_gain,
|
|
112
|
+
maskedTemplate: raw.masked_template,
|
|
113
|
+
safeMaskedTemplate: raw.safe_masked_template ?? null,
|
|
114
|
+
missingTerms: (raw.missing_terms ?? []).map((m) => ({
|
|
115
|
+
sourceTerm: m.source_term,
|
|
116
|
+
expectedTarget: m.expected_target,
|
|
117
|
+
})),
|
|
118
|
+
foreignTokens: (raw.foreign_tokens ?? []).map((f) => ({
|
|
119
|
+
tokenIndex: f.token_index,
|
|
120
|
+
token: f.token,
|
|
121
|
+
score: f.score,
|
|
122
|
+
})),
|
|
123
|
+
seamSpikes: (raw.seam_spikes ?? []).map((s) => ({
|
|
124
|
+
tokenIndex: s.token_index,
|
|
125
|
+
token: s.token,
|
|
126
|
+
score: s.score,
|
|
127
|
+
})),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/** Audit macro passage-level coherence: 3-verse windows, transition isomorphism, and term splits. */
|
|
131
|
+
scanPassageDrift(sources, targets) {
|
|
132
|
+
const raw = this.#get().scanPassageDrift(sources, targets);
|
|
133
|
+
return {
|
|
134
|
+
engineVersion: raw.engine_version,
|
|
135
|
+
meanVerseIso: raw.mean_verse_iso,
|
|
136
|
+
meanWin3Iso: raw.mean_win3_iso,
|
|
137
|
+
transitionIso: raw.transition_iso,
|
|
138
|
+
termConsistencyRate: raw.term_consistency_rate,
|
|
139
|
+
termSplits: (raw.term_splits ?? []).map((ts) => ({
|
|
140
|
+
sourceWord: ts.source_word,
|
|
141
|
+
dominantTarget: ts.dominant_target,
|
|
142
|
+
formCounts: mapToRecord(ts.form_counts),
|
|
143
|
+
verseIndices: ts.verse_indices ?? [],
|
|
144
|
+
missingIndices: ts.missing_indices ?? [],
|
|
145
|
+
})),
|
|
146
|
+
flaggedVerses: raw.flagged_verses ?? [],
|
|
147
|
+
verseIsoScores: raw.verse_iso_scores ?? [],
|
|
148
|
+
worstSeams: (raw.worst_seams ?? []).map((s) => ({
|
|
149
|
+
leftIndex: s.left_index,
|
|
150
|
+
rightIndex: s.right_index,
|
|
151
|
+
gap: s.gap,
|
|
152
|
+
})),
|
|
153
|
+
...(Array.isArray(raw.shunted_verse_scores) ? { shuntedVerseScores: raw.shunted_verse_scores } : {}),
|
|
154
|
+
...(Array.isArray(raw.context_bleed_scores) ? { contextBleedScores: raw.context_bleed_scores } : {}),
|
|
155
|
+
...(Array.isArray(raw.local_matrix_divergence) ? { localMatrixDivergence: raw.local_matrix_divergence } : {}),
|
|
156
|
+
...(Array.isArray(raw.burstiness_divergence) ? { burstinessDivergence: raw.burstiness_divergence } : {}),
|
|
157
|
+
...(Array.isArray(raw.boundary_shift_indices) ? { boundaryShiftIndices: raw.boundary_shift_indices } : {}),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
/** Serialize the compiled scorer into a compact version-stamped binary blob for IndexedDB/disk caching. */
|
|
161
|
+
serialize() {
|
|
162
|
+
return this.#get().serialize();
|
|
163
|
+
}
|
|
164
|
+
/** Free the underlying WebAssembly memory immediately. */
|
|
165
|
+
dispose() {
|
|
166
|
+
if (this.#inner) {
|
|
167
|
+
this.#inner.free();
|
|
168
|
+
this.#inner = null;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Fit a new `FastIsoScorer` from validated parallel project pairs.
|
|
174
|
+
* Defaults to `version: "latest"` (`1.2.0`).
|
|
175
|
+
*/
|
|
176
|
+
export async function createScorer(pairs, options = {}) {
|
|
177
|
+
const mod = await initWasm();
|
|
178
|
+
const wasmOpts = {
|
|
179
|
+
version: options.version ?? "latest",
|
|
180
|
+
fitCal: options.fitCal,
|
|
181
|
+
maxCal: options.maxCal,
|
|
182
|
+
indexCap: options.indexCap === null ? undefined : options.indexCap,
|
|
183
|
+
disableIndexCap: options.indexCap === null,
|
|
184
|
+
maxLexicalPairs: options.maxLexicalPairs,
|
|
185
|
+
};
|
|
186
|
+
const inner = new mod.WasmFastIso(pairs, wasmOpts);
|
|
187
|
+
return new FastIsoScorer(inner);
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Restore a cached `FastIsoScorer` from `serialize()` bytes.
|
|
191
|
+
* Returns `null` (unless `strict: true`) if the blob was built with an older/different engine version.
|
|
192
|
+
*/
|
|
193
|
+
export async function deserializeScorer(bytes, options = {}) {
|
|
194
|
+
const mod = await initWasm();
|
|
195
|
+
const version = options.version ?? "latest";
|
|
196
|
+
try {
|
|
197
|
+
const inner = mod.WasmFastIso.deserialize(bytes, version);
|
|
198
|
+
return new FastIsoScorer(inner);
|
|
199
|
+
}
|
|
200
|
+
catch (err) {
|
|
201
|
+
const msg = String(err);
|
|
202
|
+
if (!options.strict && msg.includes("version mismatch")) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
throw err;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/** Read the engine version stamped in a serialized blob without decoding the index. */
|
|
209
|
+
export async function peekSerializedVersion(bytes) {
|
|
210
|
+
const mod = await initWasm();
|
|
211
|
+
return mod.peekSerializedVersion(bytes);
|
|
212
|
+
}
|
|
213
|
+
/** Pure-WASM sentence-level `chrF++` (char 1–6 + word 1–2, beta=2.0), returning 0..100. */
|
|
214
|
+
export async function chrfPP(hypothesis, reference) {
|
|
215
|
+
const mod = await initWasm();
|
|
216
|
+
return mod.chrfPP(hypothesis, reference);
|
|
217
|
+
}
|
|
218
|
+
//# sourceMappingURL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