-1

All,

What is the base form of battling? Lemmatization results in battling where as I think it should be battle. Is my understanding of lemmatization wrong?

from nltk import download
download('wordnet')
from nltk.stem.wordnet import WordNetLemmatizer

lemmatizer = WordNetLemmatizer()

def get_lemma(word):
    return lemmatizer.lemmatize(word)

get_lemma('battling')

The same is for the word coming

enter image description here

Gopinath Rajee
  • 400
  • 5
  • 20

1 Answers1

1

The default lemmatization pos (Part Of Speech) is noun for the lemmatize method. And it produces the output battling.

If you change the pos to a verb, as is the case here, you get the proper result.

lemmatizer.lemmatize("battling", wordnet.VERB)

will give the base battle

Kris
  • 8,680
  • 4
  • 39
  • 67