python之jieba模塊高頻詞統計

import jieba txt = open('gaopin.txt','r').read() words = jieba.lcut(txt) counts = {} for word in words: if len(word) == 1: continue else: counts[word] = counts.get(word,0) + 1
相關文章
相關標籤/搜索