Created
September 8, 2018 13:57
-
-
Save aaronkub/99777e9819342f2c440a91ef810ddd24 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
def get_lemmatized_text(corpus): | |
from nltk.stem import WordNetLemmatizer | |
lemmatizer = WordNetLemmatizer() | |
return [' '.join([lemmatizer.lemmatize(word) for word in review.split()]) for review in corpus] | |
lemmatized_reviews = get_lemmatized_text(reviews_train_clean) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment