
正文
结巴分词的stopword.txt
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
1. read the stop words to a list:
stopwords = [line.strip() for line in open('d:/stopword.txt','r').readlines()]
2. Use loop to filter the stop word in word stream.
item_seg = list(jieba.cut(sentences))
outstr = []
for word in item_seg:
if word not in stopwords:
outstr.append(word)
print(outstr)
分词后效果好太多了。







