Last active
March 24, 2019 06:16
-
-
Save prateekjoshi565/55481ca27e0e2225881e59a13e6c7f6f to your computer and use it in GitHub Desktop.
text normalization elmo
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
# import spaCy's language model | |
nlp = spacy.load('en', disable=['parser', 'ner']) | |
# function to lemmatize text | |
def lemmatization(texts): | |
output = [] | |
for i in texts: | |
s = [token.lemma_ for token in nlp(i)] | |
output.append(' '.join(s)) | |
return output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment