Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
text normalization elmo
# 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