Segmenting a text into sentencesSegmenter un texte en phrases
TRA2600 S5 · in classS5 · en classe
A task of its own
Cutting a text into sentences is a task of its own, and the full stop is the whole difficulty.
Question marks and exclamation marks almost always end a sentence. A full stop ends a sentence, marks an abbreviation such as Dr. or etc., appears inside a number such as 3.5 and inside an address, and sometimes does two of these at once, as the last full stop of a sentence ending in etc. does (Jurafsky & Martin, 2026). Figure 4figure 4 puts four of them in one sentence.
Rules for sentences
Many sentence splitters first decide, for each full stop, whether it belongs to a word or ends a sentence. The decision is often made by rules and sometimes learned from examples, and a dictionary of abbreviations helps, which can itself be written by hand or learned (Jurafsky & Martin, 2026).
Written as rules, the decision for the full stop alone already nests, each exception settling a case that the line above got wrong:
- Split at a full stop: it ends the sentence.
- except when no space follows: a number or an address, as in 3.5 or umontreal.ca;
- except when the next word starts with a lowercase letter: an abbreviation inside a sentence, as in the lab, etc. and the staff;
- except after a title from a list written out by hand, even when a space and a capital follow: Dr. Tremblay, M. Dupont;
- but after another abbreviation followed by a space and a capital, the full stop does both jobs at once: in etc. The staff stayed., it belongs to etc. and ends the sentence.
The four full stops of Figure 4figure 4 each fall under a different line. Every exception also opens a new gap: a sentence that starts with a lowercase word, such as a brand name like iPhone, is not split from the one before it, and an abbreviation missing from the list is read as the end of a sentence.
Translation tools face the same problem when they cut a document into segments, the units a translator works through one by one, and their segmentation segmentationsegmentation CAT toolsTAO The operation of dividing translatable content into segments, which correspond roughly to sentences, titles and other separate text elements.Opération qui consiste à diviser le contenu à traduire en segments, qui correspondent plus ou moins aux phrases, aux titres et aux autres éléments textuels séparés. rules are lists of exactly this kind (see also the Translation memories chapter, in the CAT tools module) (voir aussi le chapitre Les mémoires de traduction, dans le module Outils de TAO).
Une tâche à part entière
Couper un texte en phrases est une tâche à part entière, et toute la difficulté vient du point.
Les points d’interrogation et d’exclamation terminent presque toujours une phrase. Un point termine une phrase, marque une abréviation comme M. ou etc., apparaît dans un numéro de version comme 2.5 et dans une adresse, et joue parfois deux de ces rôles à la fois, comme le dernier point d’une phrase qui se termine par etc. (Jurafsky & Martin, 2026). La Figure 4figure 4 en réunit quatre dans une même phrase.
Des règles pour les phrases
Beaucoup de segmenteurs de phrases décident d’abord, pour chaque point, s’il appartient à un mot ou s’il termine une phrase. Cette décision est souvent prise par des règles, parfois apprise à partir d’exemples, et un dictionnaire d’abréviations aide, dictionnaire qui peut lui-même être rédigé à la main ou appris (Jurafsky & Martin, 2026).
Écrite sous forme de règles, la décision pour le seul point s’emboîte déjà, chaque exception réglant un cas que la ligne au-dessus traitait mal :
- Couper à un point : il termine la phrase.
- sauf quand aucune espace ne suit : un numéro ou une adresse, comme 2.5 ou umontreal.ca ;
- sauf quand le mot suivant commence par une minuscule : une abréviation au milieu d’une phrase, comme dans au labo, etc. et le personnel ;
- sauf après un titre d’une liste rédigée à la main, même quand une espace et une majuscule suivent : M. Tremblay ;
- mais après une autre abréviation suivie d’une espace et d’une majuscule, le point joue les deux rôles à la fois : dans etc. Le personnel est resté., il appartient à etc. et termine la phrase.
Les quatre points de la Figure 4figure 4 relèvent chacun d’une ligne différente. Chaque exception ouvre aussi une nouvelle brèche : une phrase qui commence par une minuscule, par exemple un nom de marque comme iPhone, n’est pas séparée de la précédente, et une abréviation absente de la liste est lue comme une fin de phrase.
Les outils de traduction rencontrent le même problème quand ils coupent un document en segments, les unités qu’un traducteur traite une à une, et leurs règles de segmentation segmentationsegmentation CAT toolsTAO The operation of dividing translatable content into segments, which correspond roughly to sentences, titles and other separate text elements.Opération qui consiste à diviser le contenu à traduire en segments, qui correspondent plus ou moins aux phrases, aux titres et aux autres éléments textuels séparés. sont des listes exactement de ce genre (see also the Translation memories chapter, in the CAT tools module) (voir aussi le chapitre Les mémoires de traduction, dans le module Outils de TAO).
Sources
- Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/
Sources
- Jurafsky, D., & Martin, J. H. (2026). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/