Add/remove custom stop words with spacy

前端 未结 6 2083
悲哀的现实
悲哀的现实 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

    For 2.0 use the following:

    for word in nlp.Defaults.stop_words:
        lex = nlp.vocab[word]
        lex.is_stop = True
    

提交回复
热议问题