Last active
June 14, 2018 16:57
-
-
Save mwitiderrick/08769326d6eaae56ceb8d41f22fcb857 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(0, 1000): | |
review = re.sub('[^a-zA-Z]', ' ', df['Review'][i]) | |
review = review.lower() | |
review = review.split() | |
lemmatizer = WordNetLemmatizer() | |
review = [lemmatizer.lemmatize(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