How to detect if word is a stopword after stemming and lemmatization in spaCy?
Assume sentence
s = "something good\nsomethings 2 bad"
In this case something is a stopword. Obviously (to me?) Something and somethings are also stopwords, but it needs to stemmed before. Following script will say that the first is true, but latter isn't.
import spacy
from spacy.tokenizer import Tokenizer
nlp = spacy.load('en')
tokenizer = Tokenizer(nlp.vocab)
s = "something good\nSomething 2 somethings"
tokens = tokenizer(s)
for token in tokens:
print(token.lemma_, token.is_stop)
Returns:
something True
good False
"\n" False
Something False
2 False
somethings False
Is there a way to detect that through spaCy API?