Python 分词后词频统计

2025-03-14 07:12:16
推荐回答(2个)
回答1:


out_one =  re.compile(r'(.*?)\000',re.S)

out_one_re = re.findall(self.out_one,i)


a={}
for j in out_one_re :
   a[j] = out_one_re .count(j)
  
  
使用字典属性,内容唯一来进行统计。出来的包括内容和次数。

回答2:

百度:jaket5219999 统计词频