Removing stopwords from a textblob

2020-07-18 10:16发布

问题:

I'm processing a textblob and one of the steps is stopwords removal. Textblobs are immutable, so I'm turning one into a list to do the job:

blob = tb(tekst)
lista = [word for word in blob.words if word not in stopwords.words('english')]
tekst = ' '.join(lista)
blob = tb(tekst)

Is there a simpler / more elegant solution for the problem?