【发布时间】:2019-01-11 23:48:48
【问题描述】:
有一个词未被识别为停用词,尽管在列表中。 我正在使用 spacy 2.0.11、python 3.7、conda env、Debian 9.5
import spacy
from spacy.lang.es.stop_words import STOP_WORDS
nlp = spacy.load('es', disable=['tagger', 'parser', 'ner'])
STOP_WORDS.add('y')
做一些测试:
>>> word = 'y'
>>> word in STOP_WORDS
True
>>> nlp(word)[0].is_stop
False
>>> len(STOP_WORDS)
305
>>> [word for word in STOP_WORDS if not nlp(word)[0].is_stop]
['y']
因此,从 STOP_WORDS 中列出的 305 中,没有一个被标记为这样。我不知道我做错了什么......也许这是一个错误?
【问题讨论】:
标签: python nlp spacy stop-words