I was trying to lemmatize a dataframe. In that it converts singular into plural. But I also need to find its root word like Blessing->bless, ran->run, reached -> reach
Below is the sample program I tried.
w_tokenizer = nltk.tokenize.WhitespaceTokenizer()
lemmatizer = nltk.stem.WordNetLemmatizer()
_ return [lemmatizer.lemmatize(w) for w in w_tokenizer.tokenize(text)]_
df = pd.DataFrame([‘this was cheesy’, ‘she likes these books’, ‘wow this is great blessing’], columns=[‘text’])
df[‘text_lemmatized’] = df.text.apply(lemmatize_text)