Spacy memo

1
nlp = spacy.load('en_core_web_sm') 
1
nlp = spacy.load('en_core_web_sm', disable=['tagger', 'parser', 'ner']) 

To use lemma of spacy, consider include the pipe tagger because this will influence the effect of lemmatization:

1
2
3
4
nlp = spacy.load('en_core_web_sm') 
doc = nlp("This is my second time.")
for token in doc:
    print(token, token.lemma_) 
1
2
3
4
5
6
1
2
3
4
5
6
This this
is be
my -PRON-
second second
time time
. .
1
2
3
4
nlp = spacy.load('en_core_web_sm', disable=['parser', 'ner']) 
doc = nlp("This is my second time.")
for token in doc:
    print(token, token.lemma_) 
1
2
3
4
5
6
1
2
3
4
5
6
This this
is be
my -PRON-
second second
time time
. .
1
2
3
4
nlp = spacy.load('en_core_web_sm', disable=['tagger', 'parser', 'ner']) 
doc = nlp("This is my second time.")
for token in doc:
    print(token, token.lemma_) 
1
2
3
4
5
6
This This
is be
my my
second 2
time time
. .