python3统计词频程序

import re
from collections import Counter
txt = open("D:/a1.txt").read()
new_txt = re.split('\W+', txt)
result = Counter(new_txt)
a = result.most_common(10)
print(a)

python3统计词频程序,可用。

你可能感兴趣的:(Python,推荐系统,python)