import jieba import jieba.posseg as pseg quchong = set() jieba.load_userdict("suggest_words.txt") # 导入自己的词表 test = jieba.cut(lines, cut_all=False) # jieba对句子分词 test = pseg.cut(lines) # jieba对句子分词,且为每个句子显示词性 for w in test: if w.flag == ‘v‘ and len(w.word)>1:
import jieba
import jieba.posseg as pseg
quchong = set()
jieba.load_userdict("suggest_words.txt")