Sentence Stream is a small, pure Python library for splitting text into sentences. It is designed to work efficiently with text streams, such as large files or network streams, by processing text incrementally without loading the entire content into memory. The current version is 1.3.0, and it maintains an active release cadence for improvements and bug fixes.
pip install sentence-streamVerified import paths — ran on the pinned version, not inferred.
Initialize `SentenceStream` with a string or an iterable (like a file-like object). The instance is itself an iterable, yielding sentences one by one.
For complex NLP tasks, consider libraries like spaCy, NLTK, or Hugging Face Transformers, which offer more sophisticated sentence boundary detection algorithms.
For very large texts, provide input as an iterable, such as a file opened in text mode (`open('large_file.txt', 'r', encoding='utf-8')`), or a custom generator that yields text chunks.Review the output for edge cases in your specific text data. For non-English languages or highly specialized texts, consider pre-processing or using language-specific tools.