Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CodeT5/evaluator/smooth_bleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import sys, math, re, xml.sax.saxutils
import subprocess
import os
import numpy as np

# Added to bypass NIST-style pre-processing of hyp and ref files -- wade
nonorm = 0
Expand Down Expand Up @@ -194,7 +195,7 @@ def bleuFromMaps(m1, m2):
for key in m1:
if key in m2:
bl = bleu(m1[key], m2[key][0])
score = [score[i] + bl[i] for i in range(0, len(bl))]
score = np.add(bl,score)
num += 1
return [s * 100.0 / num for s in score]

Expand Down