@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