How to add or remove a stop word in NLP?

1.1K    Asked by EmmaCornish in Data Science , Asked on Nov 9, 2019
Answered by Emma Cornish

To add stop-words into default list of stop words provided by Spacy in Python, we use the following code.


In the above snippet, the word ‘btw’ is added in the stop-words and checked whether is added or not. There are a total of 305 stopwords provided by Spacy but after addition there had been 306 which proves it had been added.

To remove stop-words into default list of stop-words provided by Spacy in Python, we use the following code.


Here the word ‘beyond’ which is not a stop-word is removed just for understanding purpose which is why the total number of stop-words did not get affected. Also we have tested that the word ‘beyond’ does not belong to stopword.


Your Answer

Interviews

Parent Categories