Skip to content

Instantly share code, notes, and snippets.

@shubham-singh-ss
Created May 31, 2019 05:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shubham-singh-ss/3979366a7113a685f8a4ecafa0679a99 to your computer and use it in GitHub Desktop.
Save shubham-singh-ss/3979366a7113a685f8a4ecafa0679a99 to your computer and use it in GitHub Desktop.
corpus = []        
for i in range(0, 8375):         
review = re.sub('[^a-zA-Z]', ' ', df_title['title'][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)            
corpus.append(review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment