jieba分词
import jieba import collections with open('journey_to_the_west.txt', 'r', encoding='utf-8') as f: text = f.read() words = jieba.cut(text) word_counts = collections.Counter(words) top_20_words = word_counts.most_common(20) for word, count in top_20_words: print(word, count)
浙公网安备 33010602011771号