低词频过滤

# fre为词频
fre = 2
            f4 = open("dict.txt", "w", encoding='utf-8')
            for key in t.keys():
                if(t[key] > fre):
                    f4.write(key.lower() + ' ' + str(t[key])+'\n')

你可能感兴趣的:(python学习,词频统计过滤词频)