Sentence Segmentation
Read “Dr. Smith landed at 5 p.m. She was late.” and you know without thinking where one sentence ends. A program sees four full stops and three candidate boundaries. Sentence segmentation — sentence boundary detection — is the step that decides which piece of punctuation actually closes a sentence and which does not.
Why a full stop is not enough
The hard cases are ordinary rather than exotic:
- Abbreviations and initials — “Dr.”, “Inc.”, “e.g.”, “J. R. R. Tolkien” — end in the same character a sentence does.
- Numbers and identifiers: decimals, version numbers, dates and URLs all carry internal dots.
- Quotations and parentheses place the terminator inside the closing mark, and a great deal of real text — chat messages, transcripts, OCR output — omits punctuation altogether or breaks lines mid-sentence.
How it is done
Rule-based splitters pair punctuation with an abbreviation list: fast, and brittle the moment the domain changes. NLTK’s Punkt learns abbreviations and collocations from unlabelled text in the target language, while spaCy derives boundaries from its dependency parse or from a trained senter component, which copes with missing punctuation far better than any rule list.
Why it matters
The sentence is the unit almost everything downstream consumes: translation and summarisation work sentence by sentence, parsers and role labellers take one sentence at a time, retrieval chunks documents on sentence boundaries, and a transformer’s token limit is wasted by a sentence split in the wrong place. A bad split is silent and compounding — half a sentence handed to a parser produces a confident, wrong analysis, and no later stage can recover the missing half.
Sentence segmentation is the preprocessing step that divides running text into sentences, deciding which punctuation marks are true boundaries and which belong to abbreviations, initials, decimals or URLs. Implementations range from punctuation and abbreviation rules to statistical splitters such as Punkt and parser-based components in spaCy. Translation, summarisation, parsing and retrieval chunking all consume sentences, so an error here propagates silently into every later stage.
Read “Dr. Smith landed at 5 p.m. She was late.” and you know exactly where one sentence stops and the next begins. A computer just sees dots, and most of them are not endings.
Sentence segmentation is the job of cutting a block of text into sentences correctly. It sounds trivial and is not: abbreviations, initials, prices, dates and web addresses all contain full stops, and real text — chat messages, subtitles, scanned documents — is punctuated carelessly or not at all. Almost everything software does with language happens one sentence at a time, so a cut in the wrong place quietly spoils the translation, summary or answer that comes next.