ctr=0.0
i=0
pc=0.0
pi=0.0
nc=0.0
ni=0.0
for line in fileinput.input(['/pro/file1']):
line = line.replace("\n", "")
if (i < len(revs)):
if('pos' in revs[i]):
if(float(line) > 0):
ctr=ctr+1
pc=pc+1
else:
pi=pi+1
elif('neg' in revs[i]):
if(float(line) < 0):
ctr=ctr+1
nc=nc+1
else:
ni=ni+1
i=i+1
precision = pc/(pc+pi)
recall = pc/(ni+pc)
这段代码是关于情绪分析的。当我尝试查找准确性和召回时,我得到ZeroDivisionError:Float 除以零。如何修复它?