Lemmatization and stemmingLemmatisation et racinisation
TRA2600 S5 · in classS5 · en classe
Lemmas and stems
Two normalizations normalizationnormalisation NLPTAL The processing that reduces the variation in a text that is irrelevant to a task, for instance by putting every word in lowercase, removing accents, unifying quotation marks or grouping the forms of a word, so that fewer distinct forms remain to count or to match.Traitement qui réduit la variation d'un texte sans rapport avec la tâche, par exemple en mettant tous les mots en minuscules, en supprimant les accents, en unifiant les guillemets ou en regroupant les formes d'un mot, de sorte qu'il reste moins de formes distinctes à compter ou à apparier. group the inflected forms of a word: lemmatization and stemming.
| Lemmatization | Stemming | |
|---|---|---|
| Result | A dictionary form: va, allons, allait become aller | What is left once the ending is cut, often not a word: chercher, cherches become cherch |
| What it needs | A dictionary or a model of the language, often the word’s tag | A list of endings to cut, for one language |
| Errors | Mostly on forms with two possible lemmas | Many, in both directions (Jurafsky & Martin, 2024) |
Figure 3figure 3 shows both on nine French forms, with the stems the Snowball stemmer for French produces.The stems are the output of the Snowball stemmer for French (snowballstem.org), run on 6 October 2026.
Stemming errors
A stemmer works on letters alone. It has no dictionary and no information about grammatical class, so nothing in its rules can tell that livre and livrer are two words, or that cherchent belongs with chercher. Writing its rules is a balance between two errors (Jurafsky & Martin, 2024):
- Over-stemming: a rule applied too widely merges words that should stay apart, as livre and livrer under livr.
- Under-stemming: a rule applied too narrowly, or left out, splits forms that belong together, as cherchent and chercher.
Applying a rule more widely removes some under-stemming and adds over-stemming, so every rule is a judgement about which does more harm.
Two endings, two decisions
In French, -ent ends the third person plural of the present and -ant the present participle, so removing them would bring more of a verb’s forms together. Both endings also end many other words, and the Snowball stemmer treats the two differently.
| Ending | Rule | What it gains | What it costs |
|---|---|---|---|
| -ent | Never removed on its own | accident, moment, parent, souvent stay whole | cherchent stays apart from chercher: under-stemming |
| -ant | Removed | cherchant joins chercher under cherch | restaurant joins restaurer under restaur, important joins importer under import: over-stemming |
The stemmer’s documentation explains the first decision: removing -ent or -ons would cause “unacceptable overstemming”, as in accident and garçons.Snowball, French stemming algorithm (snowballstem.org), read 6 October 2026; the stems in the table were produced with it the same day. That is also why allons only becomes allon: a later rule deletes the final s, and the -on stays.
Lemmatization and tagging
A form can belong to two lemmas: livre is its own lemma as a noun (un livre) and a form of livrer as a verb (il livre), as saw is a form of see as a verb and its own lemma as a noun (Manning et al., 2008). Figure 4figure 4 shows two such forms.
Tag and lemma are linked in three ways:
- The tag settles livre, which is why many systems run a part-of-speech tagger part-of-speech tagging (POS tagging)étiquetage morphosyntaxique NLPTAL The task of taking a sequence of tokenized words and a tagset, and assigning to each word one tag naming its grammatical class, such as noun or verb.Tâche qui consiste à prendre une suite de mots segmentés et un jeu d'étiquettes, puis à attribuer à chaque mot une étiquette nommant sa classe grammaticale, par exemple nom ou verbe. first and the lemmatizer after it (Müller et al., 2015) (see also the Part-of-speech tagging (including an example of machine learning) chapter) (voir aussi le chapitre L'étiquetage morphosyntaxique (y compris un exemple d'apprentissage automatique)).
- The lemma can help choose the tag, for instance in German, where a plural noun phrase does not show its gender and only the lemma does. Systems that do both tasks together improve on both (Müller et al., 2015; Kondratyuk et al., 2018).
- The tag does not settle fils, a noun either way: the singular fils (son) or the plural of fil (thread, or wire in des fils électriques). Only the rest of the sentence tells them apart, and lemmatizers built with neural networks neural network (NN)réseau de neurones (RNA) machine learningapprentissage automatique A machine-learning model composed of interconnected layers of small computational units.Modèle d'apprentissage automatique composé de couches interconnectées de petites unités de calcul. read that context directly, which helps them most on such ambiguous words (Bergmanis & Goldwater, 2018).
Lemmes et racines
Deux normalisations normalizationnormalisation NLPTAL The processing that reduces the variation in a text that is irrelevant to a task, for instance by putting every word in lowercase, removing accents, unifying quotation marks or grouping the forms of a word, so that fewer distinct forms remain to count or to match.Traitement qui réduit la variation d'un texte sans rapport avec la tâche, par exemple en mettant tous les mots en minuscules, en supprimant les accents, en unifiant les guillemets ou en regroupant les formes d'un mot, de sorte qu'il reste moins de formes distinctes à compter ou à apparier. regroupent les formes fléchies d’un mot : la lemmatisation et la racinisation.
| Lemmatisation | Racinisation | |
|---|---|---|
| Résultat | Une forme de dictionnaire : va, allons, allait deviennent aller | Ce qui reste une fois la terminaison coupée, souvent pas un mot : chercher, cherches deviennent cherch |
| Ce dont elle a besoin | Un dictionnaire ou un modèle de la langue, souvent l’étiquette du mot | Une liste de terminaisons à couper, pour une langue donnée |
| Erreurs | Surtout sur les formes qui ont deux lemmes possibles | Nombreuses, dans les deux sens (Jurafsky & Martin, 2024) |
La Figure 3figure 3 montre les deux sur neuf formes françaises, avec les racines que produit le raciniseur Snowball pour le français.Les racines sont celles que produit le raciniseur Snowball pour le français (snowballstem.org), exécuté le 6 octobre 2026.
Les erreurs de racinisation
Un raciniseur ne travaille que sur les lettres. Il n’a ni dictionnaire ni information sur la classe grammaticale, si bien que rien dans ses règles ne permet de savoir que livre et livrer sont deux mots, ou que cherchent va avec chercher. Écrire ses règles revient à trouver un équilibre entre deux erreurs (Jurafsky & Martin, 2024) :
- La racinisation excessive : une règle appliquée trop largement fusionne des mots qui devraient rester distincts, comme livre et livrer sous livr.
- La racinisation insuffisante : une règle appliquée trop étroitement, ou absente, sépare des formes qui vont ensemble, comme cherchent et chercher.
Appliquer une règle plus largement réduit la racinisation insuffisante et augmente la racinisation excessive : chaque règle repose donc sur un jugement, celui de l’erreur qui fait le plus de tort.
Deux terminaisons, deux décisions
En français, -ent termine la troisième personne du pluriel du présent et -ant le participe présent : les supprimer rapprocherait davantage de formes d’un même verbe. Mais ces deux terminaisons terminent aussi beaucoup d’autres mots, et le raciniseur Snowball les traite différemment.
| Terminaison | Règle | Ce qu’on y gagne | Ce qu’on y perd |
|---|---|---|---|
| -ent | Jamais supprimée seule | accident, moment, parent, souvent restent entiers | cherchent reste séparé de chercher : racinisation insuffisante |
| -ant | Supprimée | cherchant rejoint chercher sous cherch | restaurant rejoint restaurer sous restaur, important rejoint importer sous import : racinisation excessive |
La documentation du raciniseur explique la première décision : supprimer -ent ou -ons entraînerait « unacceptable overstemming » [ma traduction : « une racinisation excessive inacceptable »], comme dans accident et garçons.Snowball, algorithme de racinisation pour le français (snowballstem.org), consulté le 6 octobre 2026 ; les racines du tableau ont été produites avec lui le même jour. C’est aussi pourquoi allons ne devient que allon : une règle appliquée plus tard supprime le s final, et le -on reste.
Lemmatisation et étiquetage
Une forme peut appartenir à deux lemmes : livre est son propre lemme comme nom (un livre) et une forme de livrer comme verbe (il livre), de même que saw est une forme de see comme verbe et son propre lemme comme nom (Manning et al., 2008). La Figure 4figure 4 montre deux formes de ce genre.
L’étiquette et le lemme sont liés de trois façons :
- L’étiquette tranche pour livre, c’est pourquoi beaucoup de systèmes passent d’abord par un étiquetage morphosyntaxique part-of-speech tagging (POS tagging)étiquetage morphosyntaxique NLPTAL The task of taking a sequence of tokenized words and a tagset, and assigning to each word one tag naming its grammatical class, such as noun or verb.Tâche qui consiste à prendre une suite de mots segmentés et un jeu d'étiquettes, puis à attribuer à chaque mot une étiquette nommant sa classe grammaticale, par exemple nom ou verbe. et lemmatisent ensuite (Müller et al., 2015) (see also the Part-of-speech tagging (including an example of machine learning) chapter) (voir aussi le chapitre L'étiquetage morphosyntaxique (y compris un exemple d'apprentissage automatique)).
- Le lemme peut aider à choisir l’étiquette, par exemple en allemand, où un groupe nominal au pluriel ne montre pas son genre, que seul le lemme indique. Les systèmes qui font les deux tâches ensemble améliorent les deux (Müller et al., 2015 ; Kondratyuk et al., 2018).
- L’étiquette ne tranche pas pour fils, un nom dans les deux cas : le singulier fils (l’enfant) ou le pluriel de fil (un fil à coudre, ou électrique dans des fils électriques). Seul le reste de la phrase permet de les distinguer, et les lemmatiseurs construits avec des réseaux de neurones neural network (NN)réseau de neurones (RNA) machine learningapprentissage automatique A machine-learning model composed of interconnected layers of small computational units.Modèle d'apprentissage automatique composé de couches interconnectées de petites unités de calcul. lisent directement ce contexte, ce qui les aide le plus sur ces mots ambigus (Bergmanis & Goldwater, 2018).
Sources
- Bergmanis, T., & Goldwater, S. (2018). Context Sensitive Neural Lemmatization with Lematus. Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), 1391–1400. https://aclanthology.org/N18-1126/
- Jurafsky, D., & Martin, J. H. (2024). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft of 20 August 2024, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/ed3bookaug20_2024.pdf
- Kondratyuk, D., Gavenčiak, T., Straka, M., & Hajič, J. (2018). LemmaTag: Jointly Tagging and Lemmatizing for Morphologically Rich Languages with BRNNs. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, 4921–4928. https://aclanthology.org/D18-1532/
- Manning, C. D., Raghavan, P., & Schütze, H. (2008). Introduction to Information Retrieval. Cambridge University Press. https://nlp.stanford.edu/IR-book/information-retrieval-book.html
- Müller, T., Cotterell, R., Fraser, A., & Schütze, H. (2015). Joint Lemmatization and Morphological Tagging with Lemming. Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, 2268–2274. https://aclanthology.org/D15-1272/
Sources
- Bergmanis, T., & Goldwater, S. (2018). Context Sensitive Neural Lemmatization with Lematus. Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), 1391–1400. https://aclanthology.org/N18-1126/
- Jurafsky, D., & Martin, J. H. (2024). Speech and Language Processing: An Introduction to Natural Language Processing, Computational Linguistics, and Speech Recognition with Language Models. Online draft of 20 août 2024, 3rd edition. https://web.stanford.edu/~jurafsky/slp3/ed3bookaug20_2024.pdf
- Kondratyuk, D., Gavenčiak, T., Straka, M., & Hajič, J. (2018). LemmaTag: Jointly Tagging and Lemmatizing for Morphologically Rich Languages with BRNNs. Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing, 4921–4928. https://aclanthology.org/D18-1532/
- Manning, C. D., Raghavan, P., & Schütze, H. (2008). Introduction to Information Retrieval. Cambridge University Press. https://nlp.stanford.edu/IR-book/information-retrieval-book.html
- Müller, T., Cotterell, R., Fraser, A., & Schütze, H. (2015). Joint Lemmatization and Morphological Tagging with Lemming. Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, 2268–2274. https://aclanthology.org/D15-1272/