Articles → NLP → Stemming In NLP

Stemming In NLP






Purpose




  1. playing, played, plays → play
  2. connection, connected, connecting → connect

Types Of Stemmers




  1. Porter Stemmer
  2. Snowball Stemmer
  3. Lancaster Stemmer

Porter Stemmer




  1. connection, connected, connecting → connect
  2. happiness → happi

Snowball Stemmer





Lancaster Stemmer





Example




from nltk.stem import PorterStemmer, LancasterStemmer, SnowballStemmer

porter = PorterStemmer()
lancaster = LancasterStemmer()
snowball = SnowballStemmer("english")

words = ["playing", "played", "happiness", "studies"]

for w in words:
    print(f"{w} -> Porter:{porter.stem(w)}, Lancaster:{lancaster.stem(w)}, Snowball:{snowball.stem(w)}")



Output


Picture showing the output of stemming in nlp



Posted By  -  Karan Gupta
 
Posted On  -  Monday, August 25, 2025

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250