import os
import re
import sys
sys.stdout=open('f1.txt','w')
from collections import Counter
from glob import glob
def removegarbage(text):
    text=re.sub(r'\W+',' ',text)
    text=text.lower()
    return text
folderpath='d:/induvidual-articles'
counter=Counter()
filepaths = glob(os.path.join(folderpath,'*.txt'))
num_files = len(filepaths)
with open('topics.txt','r') as filehandle:
    lines = filehandle.read()
    words = removegarbage(lines).split()
   counter.update(words)
for word, count in counter.most_common():
    probability=count//num_files
    print('{}  {} {}'.format(word,count,probability))
私はゼロ除算エラーを取得しています: 行のゼロによる浮動小数点数除算の確率=カウント//num_files
どうすれば修正できますか?
出力が単語、カウント、確率の形式である必要があります
助けてください!