🌐
Medium
medium.com › @anoop-singh-dev › understanding-wordnet-lemmatizer-with-nltk-b695458f256a
Understanding WordNet Lemmatizer with NLTK | by Anoop Singh | Medium
January 29, 2025 - For instance, while stemming may ... Toolkit (NLTK) provides a class called WordNetLemmatizer, which is a thin wrapper around the WordNet corpus....
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-lemmatization-with-nltk
Lemmatization with NLTK - GeeksforGeeks
May 28, 2026 - In Python, the NLTK library provides an easy and efficient way to implement lemmatization. First, we need to install the NLTK library and download the necessary datasets like WordNet and the punkt tokenizer.
🌐
NLTK
nltk.org › api › nltk.stem.wordnet.html
NLTK :: nltk.stem.wordnet module
Lemmatize word by picking the shortest of the possible lemmas, using the wordnet corpus reader’s built-in _morphy function.
🌐
NLTK
nltk.org › _modules › nltk › stem › wordnet.html
NLTK :: nltk.stem.wordnet
[docs] class WordNetLemmatizer: """ WordNet Lemmatizer Provides 3 lemmatizer modes: _morphy(), morphy() and lemmatize(). lemmatize() is a permissive wrapper around _morphy(). It returns the shortest lemma found in WordNet, or the input string unchanged if nothing is found.
🌐
Machine Learning Plus
machinelearningplus.com › blog › lemmatization approaches with examples in python
Lemmatization Approaches with Examples in Python
September 10, 2023 - Let’s run lemmatization using the 5 implementations on the following sentence and compare output. ... sentence = """Following mice attacks, caring farmers were marching to Delhi for better living conditions. Delhi police on Tuesday fired water cannons and teargas shells at protesting farmers as they tried to break barricades with their cars, automobiles and tractors.""" # NLTK from nltk.stem import WordNetLemmatizer lemmatizer = WordNetLemmatizer() pprint(" ".join([lemmatizer.lemmatize(w, get_wordnet_pos(w)) for w in nltk.word_tokenize(sentence) if w not in string.punctuation])) # ('Followin
🌐
Holistic SEO
holisticseo.digital › holistic seo › python seo › nltk lemmatization: how to lemmatize words with nltk?
NLTK Lemmatization: How to Lemmatize Words with NLTK? - Holistic SEO
April 20, 2022 - To perform lemmatization with NLTK in an effective way, the “wordnet” and “pos” parameter of the NLTK.WordNetLemmatizer.lemmatize should be used. In the example above, we have specified the part of speech tag value of the lemmatization with NLTK as “wordnet.VERB”. It means that lemmatize the words “love, loving, loved” as a verb.
🌐
DataCamp
datacamp.com › tutorial › stemming-lemmatization-python
Stemming and Lemmatization in Python | DataCamp
June 1, 2026 - For most modern NLP pipelines, lemmatization is preferred when accuracy matters. However, if you're working at scale or building a quick prototype, stemming may be good enough and considerably faster. ... For the Porter Stemmer, no extra downloads are needed beyond installing NLTK itself. For the WordNet Lemmatizer, you'll need to run nltk.download("wordnet") and nltk.download("omw-1.4") once before using it.
Find elsewhere
🌐
Beautiful Soup
tedboy.github.io › nlps › generated › generated › nltk.WordNetLemmatizer.html
nltk.WordNetLemmatizer
>>> from nltk.stem import WordNetLemmatizer >>> wnl = WordNetLemmatizer() >>> print(wnl.lemmatize('dogs')) dog >>> print(wnl.lemmatize('churches')) church >>> print(wnl.lemmatize('aardwolves')) aardwolf >>> print(wnl.lemmatize('abaci')) abacus >>> print(wnl.lemmatize('hardrock')) hardrock
🌐
EDUCBA
educba.com › home › software development › software development tutorials › python tutorial › nltk lemmatizer
NLTK Lemmatizer | How to Use Words NLTK Lemmatizer with Examples?
April 10, 2023 - The below example shows lemmatizing verbs as follows. ... import nltk from nltk.stem import WordNetLemmatizer py_lem = WordNetLemmatizer() py_word = "reputed" py_lemma = py_lem.lemmatize (py_word, 'v') print (py_word, "=>", py_lemma)
Address: Unit no. 202, Jay Antariksh Bldg, Makwana Road, Marol, Andheri (East),, 400059, Mumbai
🌐
Krish Naik
krishnaik.in › ai tutorials › courses › natural language processing › lemmatization
Lemmatization in NLP - WordNetLemmatizer, POS tags and stemming vs lemmatization · Natural Language Processing tutorial
3 weeks ago - It uses the morphy() function of the WordNet corpus reader to find a lemma: a dictionary of words it compares against. lemmatize takes two parameters, the word and its POS tag (part of speech), with the default pos='n', noun.
Top answer
1 of 8
103

First of all, you can use nltk.pos_tag() directly without training it. The function will load a pretrained tagger from a file. You can see the file name with nltk.tag._POS_TAGGER:

nltk.tag._POS_TAGGER
>>> 'taggers/maxent_treebank_pos_tagger/english.pickle' 

As it was trained with the Treebank corpus, it also uses the Treebank tag set.

The following function would map the treebank tags to WordNet part of speech names:

from nltk.corpus import wordnet

def get_wordnet_pos(treebank_tag):

    if treebank_tag.startswith('J'):
        return wordnet.ADJ
    elif treebank_tag.startswith('V'):
        return wordnet.VERB
    elif treebank_tag.startswith('N'):
        return wordnet.NOUN
    elif treebank_tag.startswith('R'):
        return wordnet.ADV
    else:
        return ''

You can then use the return value with the lemmatizer:

from nltk.stem.wordnet import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
lemmatizer.lemmatize('going', wordnet.VERB)
>>> 'go'

Check the return value before passing it to the Lemmatizer because an empty string would give a KeyError.

2 of 8
17

Steps to convert : Document->Sentences->Tokens->POS->Lemmas

import nltk
from nltk.stem import WordNetLemmatizer
from nltk.corpus import wordnet

#example text text = 'What can I say about this place. The staff of these restaurants is nice and the eggplant is not bad'

class Splitter(object):
    """
    split the document into sentences and tokenize each sentence
    """
    def __init__(self):
        self.splitter = nltk.data.load('tokenizers/punkt/english.pickle')
        self.tokenizer = nltk.tokenize.TreebankWordTokenizer()

    def split(self,text):
        """
        out : ['What', 'can', 'I', 'say', 'about', 'this', 'place', '.']
        """
        # split into single sentence
        sentences = self.splitter.tokenize(text)
        # tokenization in each sentences
        tokens = [self.tokenizer.tokenize(sent) for sent in sentences]
        return tokens


class LemmatizationWithPOSTagger(object):
    def __init__(self):
        pass
    def get_wordnet_pos(self,treebank_tag):
        """
        return WORDNET POS compliance to WORDENT lemmatization (a,n,r,v) 
        """
        if treebank_tag.startswith('J'):
            return wordnet.ADJ
        elif treebank_tag.startswith('V'):
            return wordnet.VERB
        elif treebank_tag.startswith('N'):
            return wordnet.NOUN
        elif treebank_tag.startswith('R'):
            return wordnet.ADV
        else:
            # As default pos in lemmatization is Noun
            return wordnet.NOUN

    def pos_tag(self,tokens):
        # find the pos tagginf for each tokens [('What', 'WP'), ('can', 'MD'), ('I', 'PRP') ....
        pos_tokens = [nltk.pos_tag(token) for token in tokens]

        # lemmatization using pos tagg   
        # convert into feature set of [('What', 'What', ['WP']), ('can', 'can', ['MD']), ... ie [original WORD, Lemmatized word, POS tag]
        pos_tokens = [ [(word, lemmatizer.lemmatize(word,self.get_wordnet_pos(pos_tag)), [pos_tag]) for (word,pos_tag) in pos] for pos in pos_tokens]
        return pos_tokens

lemmatizer = WordNetLemmatizer()
splitter = Splitter()
lemmatization_using_pos_tagger = LemmatizationWithPOSTagger()

#step 1 split document into sentence followed by tokenization
tokens = splitter.split(text)

#step 2 lemmatization using pos tagger 
lemma_pos_token = lemmatization_using_pos_tagger.pos_tag(tokens)
print(lemma_pos_token)
🌐
GeeksforGeeks
geeksforgeeks.org › machine learning › python-lemmatization-approaches-with-examples
Python - Lemmatization Approaches with Examples - GeeksforGeeks
July 23, 2025 - By default, WordNet Lemmatizer assumes words to be nouns. For more accurate lemmatization, especially for verbs and adjectives, Part of Speech (POS) tagging is required. POS tagging tells the lemmatizer whether the word is a noun, verb or adjective.
🌐
Medium
medium.com › @yashj302 › lemmatization-f134b3089429
Lemmatization [NLP, Python]. Lemmatization is the process of… | by Yash Jain | Medium
February 23, 2022 - Notice we have mentioned pos=’v’ this means we have gave lemmatizer pos tag manually as verb(‘v’), otherwise it would have taken ’n’ → noun as default pos tag, which in-turn gives us wrong result am are is wa were. So we have to manually give pos tag here. Let’s automate this process and detect pos tag with nltk.pos_tag and give it to wordnetlemmatizer.
🌐
Python Programming
pythonprogramming.net › lemmatizing-nltk-tutorial
Python Programming Tutorials
from nltk.stem import WordNetLemmatizer lemmatizer = WordNetLemmatizer() print(lemmatizer.lemmatize("cats")) print(lemmatizer.lemmatize("cacti")) print(lemmatizer.lemmatize("geese")) print(lemmatizer.lemmatize("rocks")) print(lemmatizer.lemmatize("python")) print(lemmatizer.lemmatize("better", pos="a")) print(lemmatizer.lemmatize("best", pos="a")) print(lemmatizer.lemmatize("run")) print(lemmatizer.lemmatize("run",'v')) Here, we've got a bunch of examples of the lemma for the words that we use.
🌐
Simonhessner
simonhessner.de › lemmatize-whole-sentences-with-python-and-nltks-wordnetlemmatizer
Lemmatize whole sentences with Python and nltk’s WordNetLemmatizer – Simon's blog
June 29, 2018 - To my knowledge, there is no pre-defined function that takes a whole sentence and outputs the lemmatized sentence. Therefore I came up with this code: import nltk from nltk.stem import WordNetLemmatizer from nltk.corpus import wordnet lemmatizer = WordNetLemmatizer() def nltk2wn_tag(nltk_tag): if nltk_tag.startswith('J'): return wordnet.ADJ elif nltk_tag.startswith('V'): return wordnet.VERB elif nltk_tag.startswith('N'): return wordnet.NOUN elif nltk_tag.startswith('R'): return wordnet.ADV else: return None def lemmatize_sentence(sentence): nltk_tagged = nltk.pos_tag(nltk.word_tokenize(sentence)) wn_tagged = map(lambda x: (x[0], nltk2wn_tag(x[1])), nltk_tagged) res_words = [] for word, tag in wn_tagged: if tag is None: res_words.append(word) else: res_words.append(lemmatizer.lemmatize(word, tag)) return " ".join(res_words)
🌐
The Neural Base
theneuralbase.com › home › text preprocessing › intermediate course › wordnet-based lemmatization
WordNet-based Lemmatization | Text Preprocessing Intermediate Course | The Neural Base
The conversion function get_wordnet_pos() correctly maps all six Treebank tag families; edge case: rare tags like 'MD' (modal verb) fall through to NOUN, which is acceptable but document this assumption. Always lowercase before tokenization, not after POS tagging, to avoid tagger confusion on capitalized proper nouns if they appear midsentence. # PRODUCTION ADDITION: Add lemmatization coverage tracking and fallback from nltk.lemmatize import WordNetLemmatizer from nltk.corpus import wordnet lemmatizer = WordNetLemmatizer() out_of_vocabulary_count = 0 total_count = 0 for token, pos in pos_tags: