xxxxxxxxxx
from gensim.parsing.preprocessing import remove_stopwords
text = "Nick likes to play football, however he is not too fond of tennis."
filtered_sentence = remove_stopwords(text)
print(filtered_sentence)
xxxxxxxxxx
from nltk.tokenize import word_tokenize,sent_tokenize # import tokenize
from nltk.corpus import stopwords #import stopwords
sw=stopwords.words("english") # to get stopwords in english
text="hello i need to go For a walk but i don't know where to walk and when to walk to make my walk plesant."
final=[]
for word in word_tokenize(text): #itterate each word in text
if word not in sw:
final.append(word)
final