I tried all the nltk methods for stemming but it gives me weird results with some words.
Examples
It often cut end of words when it shouldn\'t do it :
In my chatbot project I have used PorterStemmer However LancasterStemmer also serves the purpose. Ultimate objective is to stem the word to its root so that we can search and compare with the search words inputs.
For Example: from nltk.stem import PorterStemmer ps = PorterStemmer()
def SrchpattrnStmmed(self):
KeyWords =[]
SrchpattrnTkn = word_tokenize(self.input)
for token in SrchpattrnTkn:
if token not in stop_words:
KeyWords.append(ps.stem(token))
continue
#print(KeyWords)
return KeyWords
Hope this will help..