Skip to content

Instantly share code, notes, and snippets.

@Nithilaa
Created June 10, 2021 03:33
Show Gist options
  • Save Nithilaa/dee06e3d6ce728f86d1b72b62a4b1a6d to your computer and use it in GitHub Desktop.
Save Nithilaa/dee06e3d6ce728f86d1b72b62a4b1a6d to your computer and use it in GitHub Desktop.
remove stopwords
from nltk.stem import WordNetLemmatizer
from nltk.corpus import stopwords
stop_words = stopwords.words('english')
%time df2['Review_Processed'] = df2['Review_Processed'].map(lambda x : ' '.join([w for w in x.split() if w not in stop_words]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment