Add/remove custom stop words with spacy

前端 未结 6 2073
悲哀的现实
悲哀的现实 2020-12-07 13:04

What is the best way to add/remove stop words with spacy? I am using token.is_stop function and would like to make some custom changes to the set. I was looking at the docum

6条回答
  •  眼角桃花
    2020-12-07 13:26

    In latest version following would remove the word out of the list:

    spacy_stopwords = spacy.lang.en.stop_words.STOP_WORDS
    spacy_stopwords.remove('not')
    

提交回复
热议问题