So you want to know how yasbd stacks up against the competition? Fair enough.
EN Golden benchmark
Aggregate score across all 92 English edge cases in EN_GOLDEN_DATA.py via run_golden.py. Expanded from pysbd's original 48 to 92 cases: we removed biased/wrong expectations (like splitting mid-ellipsis or bad punctuation in dialog) and added cases for abbreviation chains, contiguous terminators, exclamation-safe words, academic citations, and more.
The Passed column is a strict sentence-string equality check. Alongside it, we report boundary-level Precision, Recall, and F1 computed by scorer.py.
Boundary metric methodology
evaluate_segmentation scores against the positions where sentences end, not the sentence strings themselves, so a boundary that is merely shifted (e.g. trailing whitespace) still counts toward accuracy. Implementation:
- Word-level binary arrays. Every sentence is split into words. The final word of each sentence is marked
1(a sentence boundary); all other words are marked0. - Alignment. If the model dropped or added words, the two arrays differ in length. The shorter array is right-justified with
0padding so both arrays share the final word's boundary marker. - Confusion counts. Each aligned word position is a True Positive (
1/1), False Positive (0/1), or False Negative (1/0). - Averages. TP/FP/FN are summed across all 92 cases, then Precision = TP ÷ (TP+FP), Recall = TP ÷ (TP+FN), and F1 = the harmonic mean of the two.
All three are bounded [0, 1]; they fall back to 0.0 when no useful boundary signal exists (e.g. an empty gold).
| Library | Passed | Precision | Recall | F1 |
|---|---|---|---|---|
| yasbd | 91/92 (98.9%) | 100.0% | 99.3% | 99.7% |
| pysbd | 77/92 (83.7%) | 90.5% | 97.3% | 93.8% |
| sentencex | 77/92 (83.7%) | 89.7% | 94.6% | 92.1% |
| blingfire | 75/92 (81.5%) | 86.7% | 93.2% | 89.8% |
| sentsplit | 61/92 (66.3%) | 89.9% | 85.0% | 87.4% |
| sentence-splitter | 60/92 (65.2%) | 80.1% | 90.5% | 85.0% |
| nupunkt | 59/92 (64.1%) | 77.9% | 91.2% | 84.0% |
| spacy-sentencizer | 51/92 (55.4%) | 75.7% | 89.1% | 81.9% |
yasbd achieves 91/92 (98.9%). The only failing case is the Ave. abbreviation followed by a capitalized new sentence — a known limitation of rule-based abbreviation suppression.
Book benchmarks
Real-world performance on full-length books via bench_books.py.
Alice in Wonderland (148,208 chars)
| Library | Cold (ms) | Warm (ms) | Sentences |
|---|---|---|---|
| blingfire | 33.4 | 5.7 | 676 |
| nupunkt | 2583.6 | 24.9 | 1592 |
| pysbd | 730.8 | 740.7 | 3378 |
| sentence-splitter | 221.3 | 221.5 | 3960 |
| sentencex | 5.3 | 2.1 | 2014 |
| sentsplit | 1330.6 | 1034.5 | 4170 |
| spacy-sentencizer | 460.7 | 267.4 | 1622 |
| yasbd | 262.4 | 248.7 | 1620 |
Adventures of Sherlock Holmes (593,911 chars)
| Library | Cold (ms) | Warm (ms) | Sentences |
|---|---|---|---|
| blingfire | 24.4 | 24.4 | 5185 |
| nupunkt | 157.9 | 124.5 | 5092 |
| pysbd | 9148.2 | 9161.5 | 14501 |
| sentence-splitter | 4186.9 | 4102.7 | 16269 |
| sentencex | 10.3 | 7.7 | 7142 |
| sentsplit | 6664.4 | 4687.1 | 15961 |
| spacy-sentencizer | 1572.9 | 863.4 | 6900 |
| yasbd | 1071.3 | 1178.1 | 5962 |
Posted Aug 16, 2026, 10:49 PM UTC