{"id":9947,"library":"minisbd","title":"MiniSBD: Fast Sentence Boundary Detection","description":"MiniSBD is a free and open-source Python library designed for fast and efficient sentence boundary detection (SBD). It provides a lightweight solution for splitting text into sentences, supporting various punctuation and language patterns. The current version is 0.9.5, with releases occurring periodically, often driven by improvements in tokenization or punctuation handling.","status":"active","version":"0.9.5","language":"en","source_language":"en","source_url":"https://github.com/LibreTranslate/MiniSBD","tags":["nlp","sentence-boundary-detection","sbd","text-processing","lightweight"],"install":[{"cmd":"pip install minisbd","lang":"bash","label":"Install stable release"}],"dependencies":[],"imports":[{"note":"While functional, direct import of SBD is idiomatic and often preferred for clarity.","wrong":"import minisbd; sbd = minisbd.SBD()","symbol":"SBD","correct":"from minisbd import SBD"}],"quickstart":{"code":"from minisbd import SBD\n\nsbd = SBD() # Initialize the SBD object once\n\ntext1 = \"Hello world. This is a test. Is it working?\"\nsentences1 = sbd.segment(text1)\nprint(f\"Text 1: {sentences1}\")\n\ntext2 = \"Hello world! This is another test. Is it working now?\"\nsentences2 = sbd.segment(text2)\nprint(f\"Text 2: {sentences2}\")","lang":"python","description":"Initialize the SBD class once, then use its `segment` method to split a string into a list of sentences."},"warnings":[{"fix":"Always initialize `sbd = SBD()` outside of performance-critical loops or functions that will be called repeatedly. Pass the initialized object around if necessary.","message":"Initializing the `SBD` object is an operation that should ideally be done once. Re-initializing it inside a loop will incur unnecessary overhead and degrade performance.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For highly critical applications or non-standard text, evaluate its performance on a representative dataset. Consider pre-processing text or post-processing results if specific patterns cause issues. For deeply linguistic tasks, more complex NLP libraries might be required.","message":"MiniSBD is optimized for speed and general English text. While robust, its accuracy might vary for highly specialized domains, informal text (e.g., social media), or languages with very different sentence boundary rules than common Western languages. It may not handle all edge cases perfectly.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Run `pip install minisbd` to install the library.","cause":"The minisbd package is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'minisbd'"},{"fix":"Change your code from `sbd.segments(text)` to `sbd.segment(text)`.","cause":"You are attempting to call a method named `segments`, but the correct method for sentence segmentation is `segment` (singular).","error":"AttributeError: 'SBD' object has no attribute 'segments'"}]}