Lemmatisation
From Wikipedia, the free encyclopedia
In computing, lemmatisation is the process of determining the lemma for a given word. Since the process involves determining the part of speech of a word in a sentence, it requires knowledge of the grammar of a language, and it can therefore be a great deal of work to implement a lemmatiser for a new language.
In many languages, words appear in several inflected forms. For example, in English, the verb 'to walk' may appear as 'walk', 'walked', 'walks', 'walking'. The base form, 'walk', that one might look up in a dictionary, is called the 'lemma' for the word. The combination of the base form with the part of speech is often called the 'lexeme' of the word.
Lemmatisation is closely related to stemming. The difference is that a stemmer operates on a single word without knowledge of the context, and therefore cannot discriminate between words which have different meanings depending on part of speech. However, stemmers are typically easier to implement, run faster, and the reduced accuracy may not matter for some applications.
For instance:
- The word "better" has "good" as its lemma, but this is missed in the stemming.
- The word "walk" is the base form for word "walking", and hence this is matched in both stemming and lemmatization.
Analysers like Lucene Snowball store the base stemmed format of the word without the knowledge of meaning but taking into care to the semantics of the word formation only. The stemmed word itself might not be valid. (see lazi below)
The [quick] brown [fox] jumped [over] the [lazy] dogs
org.apache.lucene.analysis.snowball.SnowballAnalyzer:
quick [brown] fox [jump] over [lazi] dog