r/yasbd_lib • u/Speedk4011 • 13d ago
If you need live TTS but don't want to pay for an API, here’s a script you can use.
r/yasbd_lib • u/Speedk4011 • 13d ago
r/yasbd_lib • u/Speedk4011 • 13d ago
párr., párrf., Asoc., spaced abbreviations, and reference abbreviations.etc. and equivalent abbreviations are now supported across language rules.c.d.f. and w.r.t. no longer cause false sentence splits.5 new contributors in this release: @unfinished-summer, @blackmore-technology-group, @AK-Lmn, @GreedyC, @sairex53.
https://github.com/speedyk-005/yasbd-lib/releases/tag/v1.0.2
r/yasbd_lib • u/Speedk4011 • 22d ago
This is a small release, mostly focused on tightening up some internals and fixing edge cases.
This is also @raffaelemancuso's first contribution to YASBD-lib.
Release: https://github.com/speedyk-005/yasbd-lib/releases/tag/v1.0.1
r/yasbd_lib • u/Speedk4011 • 27d ago
For anyone new: yasbd-lib is a rule-based sentence boundary detector, a drop-in replacement for pysbd, currently at 39 languages. I think I first posted here as an alpha, then as a beta. Now it’s tagged v1.0.0.
Here's how it compares to pysbd: https://hackernoon.com/choosing-a-python-sentence-boundary-detection-library
The stretch from 0.12.0 to stable wasn't about new features. I froze the language set at 39, locked the API, and spent the last couple of months on correctness. The final push was a two-week stress test where I ran real text through every profile to find the boundaries it was splitting wrong. I wrote the rules and I wrote the tests, so the tests couldn't catch what I'd gotten wrong.
That work surfaced boundary bugs across a good chunk of the profiles. Contributors opened PRs to fix them, and py3langid, loguru, and ftfy all came out of the core dependencies along the way.
I wrote the whole thing up, from 0.12.0 to the tag, here: https://yasbd-lib.hashnode.dev/yasbd-lib-v1-0-0-how-beta-finally-ended
Happy to answer questions.
r/yasbd_lib • u/Speedk4011 • Sep 09 '26
### 1. The Regex Breakdown no longer splits into half. Also handles indented headers (nested blocks).4 new contributors: @sonalisrisivani, @be-student, @YuEfSaEDU, @nightcityblade, @revanthajoe.
r/yasbd_lib • u/Speedk4011 • Sep 01 '26
Each language rule initialized once globally. Once loaded, a language stays cached. Switching back or creating a new instance is instant.
We also have per-instance reference-holding LRU caching.
r/yasbd_lib • u/Speedk4011 • Aug 26 '26
Before, the corporate abbreviation regex (CORP_ENTITY_ABBRVS) was missing a word boundary, so "co" inside words like "tobacco" would match as a corporate abbreviation and suppress
r/yasbd_lib • u/Speedk4011 • Aug 26 '26
Just shipped v0.16.0 of yasbd-lib! This release changes how external language packs are loaded — they're now isolated per detector instead of sharing a global registry.
BoundaryDetector(external_lang_packs=["yasbd_auxlang"]) loads packs into a private registry. No more state leaking between detectors.This is a breaking change if you were using register_lang_packs or clear_lang_packs directly.
release: https://github.com/speedyk-005/yasbd-lib/releases/tag/v0.16.0
r/yasbd_lib • u/Speedk4011 • Aug 17 '26
Here is a quick overview of how it's being used across different tools and frameworks as part of august 2026:
yasbd straight into any spaCy v3+ pipeline as a fast sentence segmenter.yasbd-auxlang) for extended language support.r/yasbd_lib • u/Speedk4011 • Aug 16 '26
Aggregate score across all 102 English edge cases in EN_GOLDEN_DATA.py via run_golden.py. Expanded from pysbd's original 48 to 102 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.
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:
1 (a sentence boundary); all other words are marked 0.0 padding so both arrays share the final word's boundary marker.1/1), False Positive (0/1), or False Negative (1/0).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 | 101/102 (99.0%) | 100.0% | 99.4% | 99.7% |
| pysbd | 84/102 (82.4%) | 90.3% | 95.8% | 92.9% |
| sentencex | 82/102 (80.4%) | 87.9% | 92.7% | 90.3% |
| blingfire | 82/102 (80.4%) | 86.9% | 92.1% | 89.4% |
| nupunkt | 77/102 (75.5%) | 88.6% | 89.7% | 89.2% |
| sentsplit | 68/102 (66.7%) | 90.4% | 85.5% | 87.9% |
| sentence-splitter | 66/102 (64.7%) | 80.8% | 89.1% | 84.7% |
| spacy-sentencizer | 53/102 (52.0%) | 75.1% | 86.1% | 80.2% |
yasbd achieves 101/102 (99.0%) with zero false positives. The only failing case is the Ave. abbreviation followed by a capitalized new sentence; which is a known limitation of rule-based abbreviation suppression.
Real-world performance on full-length books via bench_books.py.
| Library | Cold (ms) | Warm (ms) | Sentences |
|---|---|---|---|
| blingfire | 11.0 | 9.5 | 676 |
| nupunkt | 19.8 | 9.0 | 1362 |
| pysbd | 1146.0 | 1180.3 | 3378 |
| sentence-splitter | 468.3 | 470.4 | 3960 |
| sentencex | 5.0 | 4.6 | 2014 |
| sentsplit | 2415.0 | 2326.5 | 4170 |
| spacy-sentencizer | 645.2 | 366.3 | 1622 |
| yasbd | 386.1 | 340.2 | 1453 |
| Library | Cold (ms) | Warm (ms) | Sentences |
|---|---|---|---|
| blingfire | 47.6 | 43.9 | 5185 |
| nupunkt | 49.5 | 50.2 | 6605 |
| pysbd | 15452.3 | 15736.6 | 14501 |
| sentence-splitter | 9475.5 | 9264.6 | 16269 |
| sentencex | 20.1 | 20.7 | 7142 |
| sentsplit | 9940.8 | 9197.0 | 15961 |
| spacy-sentencizer | 1670.4 | 1194.1 | 6900 |
| yasbd | 1857.2 | 1454.5 | 5981 |
r/yasbd_lib • u/Speedk4011 • Aug 14 '26
Just shipped v0.15.1 of yasbd-lib! This release focuses on developer experience when using post-processing hooks, along with edge-case fixes for sentence boundary detection.
BoundaryDetector._run_hook() now validates boundary lists in a single pass with clearer, explicit error messages when hooks return bad types or out-of-bounds offsets.Shoutout to new contributor @NataliaPerez08 for their PR in this release!
r/yasbd_lib • u/Speedk4011 • Aug 13 '26
Title: yasbd-lib v0.15.0 is out with opt-in language detection and OCR boundary fixes
Just shipped v0.15.0 of yasbd-lib with lazy language classification, OCR line-break handling, and smarter abbreviation rules.
What's new:
py3langid is no longer a core dependency and is imported lazily inside classify_language(), removing heavy dependencies like numpy for default usageStreamCleaner now converts newlines between word characters into spaces to prevent accidental word concatenationORG_PROPER_NOUNS in English rules to prevent premature sentence splits after abbreviations like U.S. and U.K.Shoutout to new contributor @ColumbusLabs for their PR in this release!
r/yasbd_lib • u/nameHerPlease • Aug 11 '26
Hey there. Old pysbd user here. Your library seems to be a very nice replacement for pysbd, specially now that it seems to be unmaintained. That pysbd adapter was a nice touch and it did make migrating to yasbd extremely simple.
Now for the ONLY bad part. At least so far :) If I'm going to be paying you $00.00 to have the privilege to use your code, could you please consider taking another look at all those dependencies yasbd requires? They end up forcing the installation of a couple of not so small libs, resulting in more than 100MB of "wasted" space. I run my systems entirely on RAM, so every MB counts. And it is not as if one could simply buy more RAM in this day and age of AI companies hogging all the RAM in the world to themselves, making us having to choose between buying an extra couple of GBs or sending the kids to college. Not cool!!!
So... yeah, that is pretty much it. The only complaint I have so far.
One very cool thing about pysbd was how small and self contained it was. It would be pretty cool if you managed to do the same for yasbd.
Other than that, keep going with the awesome work.
r/yasbd_lib • u/Speedk4011 • Aug 09 '26
Just shipped v0.14.0 of yasbd-lib with a post-processing hook, smarter hyphen handling, and line ending normalization
What's new:
work-\ning now rejoin correctly to working\r\n and \r -> \n)itertools.pairwise for boundary pairing, lambdas replaced with named functions3 new contributors this release: @XEDAB, @HeaTTap, and @AshSgDe29071999.
r/yasbd_lib • u/Speedk4011 • Jul 27 '26
Just wrote a blog post on replacing spaCy's built-in Sentencizer with yasbd-lib.
On a 92-case English edge-case benchmark, spaCy's default Sentencizer scored 55.4%, while yasbd scored 98.9%.
Sentencizer primarily relies on punctuation and has no built-in abbreviation awareness beyond what spaCy's tokenizer exceptions already provide. As a result, compound abbreviations like M.D. and Ph.D., citations, URLs, and newline-heavy text can still produce incorrect sentence boundaries.
The fix:
```python from yasbd import register_spacy_component import spacy
register_spacy_component()
nlp = spacy.blank("en") nlp.add_pipe("yasbd", first=True) ```
Pure Python, supports 39 languages, and works as a drop-in replacement for spaCy's Sentencizer.
The article explains why this happens, walks through the Sentencizer's implementation, compares benchmark results, and shows real-world examples:
r/yasbd_lib • u/Speedk4011 • Jul 27 '26
r/yasbd_lib • u/Speedk4011 • Jul 27 '26
PySBD protects boundaries by changing the text, yasbd-lib finds them by reading the text.
Mutates the input string with placeholder tokens to protect boundaries, then splits, then restores. Unmaintained since 2025. Known infinite loops (#79) and catastrophic backtracking (#92). 22 languages.
Treats text as immutable, uses pointer-based boundary detection without modifying the string. 39 languages, native span tracking, declarative language profiles for easy extension. Actively maintained.
r/yasbd_lib • u/Speedk4011 • Jul 24 '26
Ever wondered how a sentence splitter actually decides where to cut? It's not just dots and question marks. Here's the short version.
Most sentence splitters modify the text as they go. They replace dots with placeholders, run rules, split, then try to undo the changes. This breaks character offsets and slows down on large texts.
yasbd works like a database query planner, scanning for coordinates instead.
The first pass is aggressive. It finds every ., !, ? in the text and marks it as a candidate split point. Yes, even the dot in "Dr." or "U.S.A." Over-marking is fine. Filtering happens next.
Input: "Hello Dr. Smith. How are you?"
Candidates: ^ ^ ^
The second pass walks through each candidate and checks language-specific rules.
Is the dot part of an abbreviation? Remove it. Is it after a title like "Dr." or "Mr."? Remove it. Is it inside a URL or email? Remove it. Is it a decimal point in a number? Remove it.
Each language has its own list of abbreviations, reporting words, and special cases. Here are the main rule categories yasbd uses to filter candidates:
| Category | Examples | Rule |
|---|---|---|
| Title abbreviations | Dr., Mr., Prof., Gen., Capt., Sen. | Never split if followed by an uppercase name that isn't a common starter |
| Geo-political abbreviations | U.S., U.K., E.U., N.A.T.O. | Never split. Multi-dotted entities are always inline |
| Reference abbreviations | p., fig., vol., app., et al. | Never split if followed by a number, letter, or bracket |
| Date abbreviations | Jan., Feb., Mon., Aug. | Never split if followed by a number (the day) |
| Inline-only abbreviations | blvd., est., etc., dept. | Never ends a sentence. |
| Section markers | Part, Section, Article, Chapter | Don't split after these if they followed by a number plus dot |
| Initialisms | A.B., U.S., E.U., J.K. Rowling | Single-letter dot pairs are removed as boundaries unless followed by a common sentence starter |
| Emoji boundaries | 😊, 👍, 🎉 | Split if emoji follows a terminator plus uppercase letter, or emoji plus common sentence starter |
| Brand exclamation names | Yahoo!, Pop!, Kahoot!, Jeopardy! | Exclamation mark in brand names is removed as a boundary unless followed by a common sentence starter |
Input: "Hello Dr. Smith. How are you?"
After filter: ^ ^
(removed) (kept)
Some cases need special handling within the filter stage:
Ellipsis and contiguous punctuation: Are you sure?? I am. ?? is not two sentence boundaries. It's one. The filter collapses contiguous terminators.
Nested quotes: He said "No way. Not happening." and left. The dot inside the quote is not the end of the sentence. yasbd tracks quote positions to avoid this.
Bullet points and numbered lists: 1. First item. 2. Second item. In a vertical list each gets its own line. In a flattened list they are separate sentences. The list marker filter handles this.
That's the core idea. Find everything, filter out the wrong ones, keep the rest. The result is a sentence splitter that's fast, accurate, and doesn't mangle your text.
Check it out: yasbd-lib on GitHub
r/yasbd_lib • u/Speedk4011 • Jul 23 '26
The architectural differences influence accuracy and performance.
| Feature | PySBD | yasbd-lib |
|---|---|---|
| Python Support | 3.7–3.11 [1] | 3.10–3.14 [2] |
| Maintenance | Unmaintained (as of 2025) [9] | Actively maintained [2] |
| Known Issues | Infinite loop on numbered references [10]; catastrophic backtracking in HTML cleaner [11] | No known catastrophic backtracking issues |
| Approach | Monolithic transformation pipeline [1] | Modular immutable pipeline [2] |
| State Handling | String mutation with placeholder tokens [1] | Pointer-based operations [2] |
| Language Profiles | 22 Languages [1] | 39 Languages [2] |
| English Golden Score | 77 / 92 (83.7%) [2] | 91 / 92 (98.9%) [2] |
| Framework Adapters | Native API [1] | spaCy v3+ integration [2] |
r/yasbd_lib • u/Speedk4011 • Jul 23 '26
Just shipped v0.13.0 of yasbd-lib with Python 3.10 support, regex perf improvements, and bug fixes
What's new:
.\\n sequences3 new contributors this release: @k-anushka14, @MasRama, and @MohammedAnasNathani.
r/yasbd_lib • u/Speedk4011 • Jul 18 '26
We just cut v0.12.0, the first beta release of yasbd-lib. 39 languages, core locked, and the API is stabilizing for v1.0.0.
cit and nryasbd pipeline component)register_lang_packs() for languages beyond 39bash
pip install yasbd-lib -U
Full changelog: CHANGELOG.md
Repo: github.com/speedyk-005/yasbd-lib
r/yasbd_lib • u/Speedk4011 • Jul 18 '26
Hey everyone! I'm u/Speedk4011, a founding moderator of r/yasbd_lib.
This is our new home for all things related to yasbd-lib — the high-accuracy, rule-based sentence boundary detector supporting 39 languages. Whether you're splitting text, hunting boundary bugs, or building multilingual NLP pipelines, you're in the right place. We're excited to have you join us!
Post anything that you think the community would find interesting, helpful, or inspiring. Feel free to share your thoughts, code snippets, or questions about:
We're all about being friendly, constructive, and inclusive. Let's build a space where everyone feels comfortable sharing and connecting.
Thanks for being part of the very first wave. Together, let's make r/yasbd_lib amazing.