use case · basics · BIO transition integrity · 0.50–0.95 sweep · 512 WordPiece check

Inside BIO disease decoding: transitions, thresholds & 512-token bounds

Test how B-DISEASE / I-DISEASE BIO transition repair handles orphan I-DISEASE predictions and ## subwords, sweep confidence from 0.50 to 0.95 for precision vs recall, and observe real >512 WordPiece truncation.

1 · Model runtime

Prepare the model above to run live BIO ablation and threshold sweep probes.

2 · BIO transition integrity & WordPiece / >512-token probe

Standard BIO decoding expects B-DISEASE to start every span and I-DISEASE to continue it. When an uncased WordPiece token emits an orphan I-DISEASE after O (or an inner ## piece flips to O), toggling repair ablation below reveals the live difference between repaired vs strict BIO decoding — plus full totalWordPieces > 512 truncation telemetry.

Total WordPieces–
Truncated (>512)–
B / I / O counts–
Orphan I-DISEASE–
Strict dropped–
Merged spans–

Raw WordPiece BIO tokens (non-O)

Waiting for model…

Decoded disease spans (current BIO rules)

Waiting for model…
Merged BIO disease spans with pattern and subword breakdown
Span BIO Pattern Subwords Score
Run the BIO probe to inspect merged spans.

3 · Precision vs recall confidence threshold sweep (0.50 → 0.95)

Raising the confidence cutoff eliminates borderline false positives at the cost of missed multi-word or rare diseases. Inspect the live 0.50..0.95 precision/recall tradeoff on the 10-entity PubMed case note below.

Threshold–
Precision–
Recall–
F1 Score–
Missed (FN)–
Run the threshold sweep to visualize kept disease spans.

Confidence threshold sweep from 0.50 to 0.95 on annotated PubMed note
Threshold TP / Gold FP FN Precision Recall F1
Run the sweep above to populate live precision vs recall rows.

How it works

Show the code — overlap-based gold span matching for Precision, Recall, and F1
Show the code — sweeping 0.50..0.95 thresholds across cached BIO spans