【发布时间】:2021-06-20 07:57:46
【问题描述】:
我正在使用 spacy,我有一个句子列表,我想从中删除停用词和标点符号。
for i in sentences_list:
for token in docfile:
if token.is_stop or token.is_punct and token.text in i[1]:
i[1] = i[1].replace(token.text, '')
print(sentences_list)
但它也会影响单词,例如单词 I 是停用词,因此单词 big 变为 bg。
【问题讨论】:
-
删除停用词和标点符号对现代 NLP 模型没有帮助,您不必在大多数时间都这样做。