Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

What is the function of stemmer in the nltk library of python

$
0
0

@hackers wrote:

hello,

In the below python code what is the function of the stemmer:

from nltk.stem.snowball import SnowballStemmer

stemmer = SnowballStemmer('english')

num_train = df_train.shape[0]

    def str_stemmer(s):
    	return " ".join([stemmer.stem(word) for word in s.lower().split()])

#Finding total common words:
def str_common_word(str1, str2):
	return sum(int(str2.find(word)>=0) for word in str1.split())

Also I could not understand what the function str_stemmer is doing,so can someone please help me with it??

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles