Skip to content

Instantly share code, notes, and snippets.

@shubham-singh-ss
Created May 31, 2019 05:54
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save shubham-singh-ss/c9c531e711c5452ff1911bcdffadf424 to your computer and use it in GitHub Desktop.
corpus1 = []
for i in range(0, 8375):            
review = re.sub('[^a-zA-Z]', ' ', df_description['description'][i])            
review = review.lower()            
review = review.split()            
ps = PorterStemmer()            
review = [ps.stem(word) for word in review if not word in set(stopwords.words('english'))]            
review = ' '.join(review)            
corpus1.append(review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment