1.jieba 库 -中文分词库
words = jieba.lcut(str) --->列表,词语
count = {}
for word in words:
if len(word)==1:
continue
else:
count[word] = count.get(word,0)+1
函数
jieba.lcut() 分词,中文
2. 英文分词库
str = "ab sld dd"
str.split()
3.词云统计
import wordcloud
c = wordcloud.WordCloud(max_word = 20)
c.generate(str) 词之间要空格 例如:a b c 中国 美国
c.to_file('aa.png') #得到慈云