Basics · Inside Rampart 14.69 MB q4 · Raw B-/I-/O Tokens vs Merged Spans · CC-BY-4.0

Inside Rampart: Raw WordPiece BIO Tags to Merged Entities

Rampart (nationaldesignstudio/rampart, CC-BY-4.0) classifies every WordPiece token into 35 BIO labels (O plus B- and I- across 17 PII entity types). Watch how subwords like ##er or accented European names get scored token-by-token, then merged deterministically into clean character spans.

1. Token-Level BIO Stream vs Merged Spans

Raw WordPieces–
Non-O BIO tokens–
Merged spans (all)–
Passing threshold–
Inference ms–

Step A · Raw B- / I- / O WordPiece Stream

Direct output of pipe(text, { ignore_labels: [] }). Subwords begin with ##.

Awaiting Rampart inference…

Step B · Merged Entity Spans (≥ 0.50)

Contiguous B-TYPE + I-TYPE runs, WordPiece continuations, and structured punctuation bridges collapsed to exact Unicode offsets.

Awaiting Rampart inference…

Per-Token Confidence Breakdown Table

Per-token WordPiece surface, raw BIO tag, confidence bar, and aligned Unicode character offsets
Idx WordPiece Original Slice BIO Tag Score Confidence Bar Offsets
Run inspection above to populate per-token scores.

2. 35-Label BIO Taxonomy Explorer (O + 17 Entity Types)

Every label ID below comes directly from live nationaldesignstudio/rampart/config.json (ID 0 is O; IDs 1–34 are paired B-/I- tags). Cards highlight automatically whenever the active text triggers that entity class.

3. Inspect the Real Implementation

Show the code · rampart-core.mjs — buildNormalizedIndexMap() & alignTokensToText()
Show the code · rampart-core.mjs — mergeBioSpans() (B-/I- + subword + bridge merging)
Show the code · worker.js — ensureLoaded() (epoch-guarded 14.69 MB WASM q4 load)