Sentence splitting

Sentence Boundary Detection

Finding sentence boundaries in a text from punctuation marks, with rules that prevent wrong splits at abbreviations and decimal numbers.

Traditional algorithm

How it works

The marks . ! ? ؟ ؛ … are candidate sentence ends, then the cases that do not end a sentence are excluded: a period after a known abbreviation (د., Dr.), between two digits (3.14), or after a single Latin letter (J.). Statistical methods such as Punkt learn abbreviations from the text without supervision.

Steps

  1. Find the candidate end marks
  2. Exclude abbreviations and decimal numbers
  3. Attach following quotation marks and brackets to the sentence
  4. Split at a blank line
InputsText
OutputsA list of sentences with their positions
ComplexityO(n)

Example

«قال د. علي إن النسبة 3.5%. ما رأيك؟» → two sentences, with no split after «د.» or inside 3.5

Strengths

  • Simple and fast
  • Good enough for well-edited text

Cons

  • Fails on unpunctuated text (social media)
  • Unknown abbreviations cause wrong splits

Uses

  • Extractive summarization
  • Sentiment analysis per sentence
  • Machine translation

Libraries that implement it

NLTK (Punkt: sent_tokenize)spaCy (sentencizer)Stanza (tokenize)

See Libraries guide For licenses and runtime requirements.

References

  • Kiss, T. & Strunk, J. (2006). Unsupervised Multilingual Sentence Boundary Detection. Computational Linguistics, 32(4), 485–525.