liveBook · Manning

Sentence splitting

As explained in Natural Language Processing in Action, Second Edition

Sentence segmentation is the process of dividing text into individual sentence units and identifying their boundaries.

Sentence splitting, or sentence segmentation, divides text into individual sentence units and identifies their boundaries. It isolates coherent packets of meaning, making them useful for extracting facts, selecting dialogue, and training chatbots on longer texts. section 11.2

A practical segmentation pipeline must account for punctuation that does not mark sentence endings:

  • Avoid relying on split('.!?'): periods, question marks, and exclamation points can appear inside quotations, nested dialogue, abbreviations, and technical notation. section 11.2.1
  • Approach the problem with manually programmed regular expressions and pattern matching, or with statistical models trained from data. section 11.2.1
  • Inspect and correct results when needed: even extracted sentences from technical text can contain boundary errors. section 11.2.1

Quoted dialogue and nested punctuation

In “She yelled ‘It’s right here!’ but I kept looking,” the exclamation mark belongs to quoted speech rather than necessarily ending the surrounding sentence. Similar ambiguity appears in questions inside quotations and nested stories. section 11.2.1

How Natural Language Processing in Action, Second Edition covers it

How deep it goes
Explains boundary ambiguity, contrasts regex and statistical methods, and notes manual correction without detailing a complete segmenter.
Examples
Uses quoted dialogue, nested quotations, technical notation, and manually corrected extracted text as boundary examples.
What you can do after
Apply it via regular expressions or statistical models to find sentence boundaries while recognizing punctuation-driven errors.
How it connects
Connects sentence segmentation to information extraction, knowledge graphs, chatbots, regular expressions, pattern matching, and statistical models.

Also explained in

Compare how 2 books explain sentence splitting →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.