Basics · Inside 81-Class ModernBERT Unpadded RoPE BIO · aggregation_strategy & Threshold Sweep

Inside Nym: 81-Class BIO Decoding & Threshold Tradeoffs

Explore how onnx-community/nym-pii-multilingual-ONNX (195.27 MB WASM q4, MIT) scores each 256K-vocab SentencePiece token across 81 BIO labels, how aggregation_strategy (none vs simple vs max) changes entity spans and scores, and how sweeping confidence thresholds from 0.30 → 0.90 trades recall against false-positive precision.

1. Model Runtime

2. Live aggregation_strategy Comparison (none vs simple vs max)

Transformers.js 3.7.5 returns raw per-token B-/I-/O predictions via ignore_labels: []. Switch strategies below to see raw token pieces (none), mean-scored BIO spans (simple), or max-token BIO spans (max) recomputed live on the real model logits.

0.50
Active strategysimple
none (raw non-O)–
simple (mean span)–
max (max span)–
Inference ms–
NaN count–

Active Output (simple)

Prepare Nym above to inspect live BIO aggregation.

Raw SentencePiece BIO Stream

Awaiting live inference…
Side-by-side span counts and scores across none, simple, and max aggregation strategies
Strategy Span / Piece Entity Type Score Tokens Merged
Run inspection above to compare aggregation strategies.

3. Threshold Sweep (0.30 → 0.90): Structured IDs vs Person & Address

Structured identifiers (IBAN, Email, Phone, SSN, Passport, ZIP) typically emit near-1.0 confidence logits, while cross-script names (田中太郎) or compound street pieces (Friedrichstraße) can carry lower token probabilities. Sweep the threshold live to inspect the precision/recall curve.

0.50
Threshold–
Overall Recall–
Precision–
Structured IDs Recall–
Person / Address Recall–
Missed (FN) / FP–
Run the threshold sweep to see live gold-benchmark detections.

Threshold sweep 0.30 to 0.90 across structured IDs and person/address spans
Threshold TP / Gold FP Missed (FN) Structured Recall Person/Addr Recall Precision F1
Run the threshold sweep to populate live metrics.

4. 81-Label BIO Taxonomy (40 Entity Types)

5. Inspect Implementation

Show the code — SentencePiece Unicode offset alignment in nym-core.mjs
Show the code — structured vs person/address threshold sweep in nym-core.mjs