Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. sentence = "Welcome to the codersarts tutorials, in this tutorials we will learns about lemmatization and stemming. I hope you can learn it very well and full constrations"
  2.  
  3. # Tokenize: Split the sentence into words
  4. word_list = nltk.word_tokenize(sentence)
  5. print(word_list)
  6.  
  7.  
  8. # Lemmatize list of words and join
  9. lemmatized_output = ' '.join([lemmatizer.lemmatize(w) for w in word_list])
  10.  
  11. print(lemmatized_output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement