Skip to content

Instantly share code, notes, and snippets.

@lisanka93
Created July 13, 2020 16:09
Show Gist options
  • Save lisanka93/73d0dcd3ef1b52cf5b45413611541a40 to your computer and use it in GitHub Desktop.
Save lisanka93/73d0dcd3ef1b52cf5b45413611541a40 to your computer and use it in GitHub Desktop.
lemmatisation and stemming with NLTK
from nltk.stem import WordNetLemmatizer, PorterStemmer, SnowballStemmer
stemmer = PorterStemmer()
lemmatizer = WordNetLemmatizer()
word = "considering"
stemmed_word = stemmer.stem(word)
lemmatised_word = lemmatizer.lemmatize(word)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment