Registry / ai-ml / sentence-splitter

sentence-splitter

JSON →
library1.4pypypi✓ verified 84d ago

Text to sentence splitter using heuristic algorithm by Philipp Koehn and Josh Schroeder. Current version 1.4, release cadence is low (no recent updates).

pip install sentence-splitter
INSTALL
IMPORT
SIG · SENTENCE-SPLITTER
S
sentence-splitter
ai-mlpythonv1.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

split_text_into_sentences
from sentence_splitter import split_text_into_sentences
import sentence_splitter
Direct import of function is the standard pattern.
SentenceSplitter

Basic usage: split text into sentences for English.

from sentence_splitter import split_text_into_sentences text = "This is a sentence. Here is another one. And a third!" sentences = split_text_into_sentences(text=text, language='en') print(sentences)
Debug
Known issues
gotchaThe split_text_into_sentences function requires the 'language' argument; defaults to 'en' but always specify to avoid ambiguity.
fix
Always pass language='en' (or your target language) explicitly.
affects: all
gotchaThe library may not handle abbreviations or edge cases perfectly (e.g., 'Dr.' followed by a name).
fix
Preprocess text to handle known abbreviations or use a more robust library if high accuracy is needed.
affects: all
deprecatedThe package's last release was in 2019; no active development, may not receive updates for Python version compatibility.
fix
Consider alternatives like spaCy or nltk for ongoing support.
affects: 1.4
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'sentence_splitter'
The package is installed as 'sentence-splitter' but imported as 'sentence_splitter'. Misspelling or incorrect import name.
fix
Install with 'pip install sentence-splitter' and import with 'from sentence_splitter import split_text_into_sentences'.
TypeError: split_text_into_sentences() missing 1 required positional argument: 'text'
The 'text' argument is required and must be passed as a keyword argument or positional.
fix
Call the function with text parameter: split_text_into_sentences(text='Your text.', language='en').
Upgrade
Version history
1.4latest on PyPI · released Jan 14, 2019
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
sentence-splitter — pip install sentence-splitter · libregistry