Stemming, lemmatization and root extraction

Stemming, Lemmatization and Root Extraction

The difference between the stem, the lemma and the root, an explanation of the Porter algorithm for English, and Light10 light stemming, the ISRI algorithm and the Khoja stemmer for Arabic, with evaluation measures (over-stemming and under-stemming).

Lesson 6 of 38Intermediate35 minutes

Lesson objectives

  • Distinguish between the stem, the lemma and the root in Arabic.
  • Trace the steps of Light10 and ISRI on Arabic words.
  • Evaluate a stemmer using the concepts of over-merging and under-merging.
Page contents
  1. Three concepts not to be confused
  2. Stemming in English: the Porter algorithm
  3. Light stemming for Arabic: Light10
  4. Root extraction: ISRI and the Khoja stemmer
  5. Evaluating stemmers
  6. Context-based methods

Three concepts not to be confused

  • Stem: what remains after cutting prefixes and suffixes with rules; it may not be a real word. “والمكتبات” → “مكتب”.
  • Lemma: the form of the dictionary entry. For a verb, the bare third-person past (“كَتَبَ”), and for a noun the singular (“مَكْتَبَة” for “مكتبات”).
  • Root: the bare original letters shared by a derivational family: “ك ت ب” for كتب, كاتب, مكتوب, مكتبة, كتيبة.

In English the stem is usually close to the lemma, but in Arabic the distance between the three is large because of non-concatenative morphology.

Stemming in English: the Porter algorithm

The Porter algorithm (1980) is the best-known English stemmer. It represents a word as [C](VC)^m[V], where C is a run of consonants, V a run of vowels, and m the word's "measure". It then applies five stages of conditional rules, such as:

  • SSES → SS (caresses ← caress)
  • (m>0) ATIONAL → ATE (relational ← relate)
  • (m>1) EMENT → ∅ (replacement ← replac)

The condition on m prevents over-stemming short words.

Light stemming for Arabic: Light10

Larkey and colleagues proposed a family of light stemmers for Arabic information retrieval, the best known being Light10:

  1. Normalization (remove diacritics, unify alef forms, ى → ي, ة → ه).
  2. Remove «و» at the start of the word if 3 or more letters remain.
  3. Remove compound definite-article prefixes if 2 or more letters remain: ال، وال، بال، كال، فال، لل.
  4. Remove suffixes from the left, in order, if 2 or more letters remain: ها، ان، ات، ون، ين، يه، ية، ه، ة، ي.

Example: «والمكتبات» → (remove «وال») «مكتبات» → (remove «ات») «مكتب».

Light10 does not try to reach the root, so it keeps «مكتب» distinct from «كاتب» and «كتيبة». Larkey's experiments showed it outperforms root extraction in information retrieval on the TREC Arabic collection.

Root extraction: ISRI and the Khoja stemmer

The Khoja stemmer (Khoja & Garside, 1999) removes the longest prefix and suffix, matches the remainder against a list of patterns, then checks the resulting root against a root dictionary. Its accuracy is good, but it depends on a dictionary and fails on loanwords and proper names.

The ISRI stemmer (Taghva et al., 2005) works without a root dictionary:

  1. Normalization and diacritic removal.
  2. Remove three-letter then two-letter prefixes (كال، بال، ولل، ال، لل…) and suffixes (كما، كن، هم، هن، ات، ون…).
  3. Remove the initial «و».
  4. Match patterns by word length (4 to 7 letters), e.g. if the word follows the pattern «مفعول» or «فاعل», take the letters corresponding to ف ع ل.
  5. If no pattern matches, the stem is returned after suffix removal, so the output is a "stem", not a root.

NLTK implements this algorithm in nltk.stem.isri.ISRIStemmer, and the lab's implementation matches it on the reference test set.

Evaluating stemmers

A stemmer is evaluated with two opposing measures:

  • Over-stemming: merging words with different meanings into one stem. “كاتب” and “كتيبة” via “كتب”: an error when searching for writers.
  • Under-stemming: failing to merge words from the same origin. “قال” and “يقول” stay separate under light stemming because the verb is hollow.

In information retrieval, the final effect is measured with precision and recall: over-stemming raises recall and lowers precision, and under-stemming does the opposite.

Context-based methods

Rule-based stemming does not see context, so “كتب” may be the plural of “كتاب” (lemma: كِتاب) or a verb (lemma: كَتَبَ). Correct lemmatization needs full morphological analysis with disambiguation, as in MADAMIRA, CAMeL Tools and Farasa, which we will see in the next lesson.

Try it: in the Morphology & Stemming module, type “والمكتبات يكتبون مكتوب استقبال قال” and compare the outputs of Light10 and ISRI, noting where each one got it right and where it over-stemmed or under-stemmed.

Lesson summary

  • The stem is the result of trimming affixes, the lemma is a real dictionary word, and the root is a set of bare original letters.
  • Light stemming is often better than root extraction for Arabic information retrieval.
  • The root gathers distant meanings (كتب: كتاب، مكتب، كتيبة), which causes over-merging.

Check what you understood

Choose an answer for each question to see the correction and the reasoning. Your answers are not sent anywhere.

  1. What is the closest light-stemming (Light10) output for the word «والمكتبات»?

  2. What is meant by over-stemming?

References

  1. Porter, M. F. (1980). An algorithm for suffix stripping. Program 14(3) doi.org/10.1108/eb046814
  2. Larkey, L. S., Ballesteros, L. & Connell, M. E. (2007). Light Stemming for Arabic Information Retrieval. Springer doi.org/10.1007/978-1-4020-6046-5_12
  3. Taghva, K., Elkhoury, R. & Coombs, J. (2005). Arabic Stemming Without a Root Dictionary. ITCC (ISRI stemmer) doi.org/10.1109/ITCC.2005.90
  4. Khoja, S. & Garside, R. (1999). Stemming Arabic Text. Lancaster University technical report