Created
April 10, 2020 12:04
-
-
Save abhishek-shrm/6020543d77392b3bdfd3a4d5dc41b0d5 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
# Importing spacy | |
import spacy | |
# Loading model | |
nlp = spacy.load('en_core_web_sm',disable=['parser', 'ner']) | |
# Lemmatization with stopwords removal | |
df['lemmatized']=df['cleaned'].apply(lambda x: ' '.join([token.lemma_ for token in list(nlp(x)) if (token.is_stop==False)])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment