Created
June 24, 2019 05:55
-
-
Save ayushoriginal/efd4a90fe02e10d795fa2c46ee82786c to your computer and use it in GitHub Desktop.
lemmatizer
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 lemmatize(self): | |
from nltk.stem import WordNetLemmatizer | |
wnl = WordNetLemmatizer() | |
for i, tweet in tqdm(enumerate(self.data),'Lemmatization'): | |
for j, word in enumerate(tweet): | |
self.data[i][j] = wnl.lemmatize(word, pos=self.get_pos(word)) | |
return self.data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment