Skip to content
Open
Show file tree
Hide file tree
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 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 @@ -186,7 +187,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(score,bl)
num += 1
return [s * 100.0 / num for s in score]

Expand Down
3 changes: 2 additions & 1 deletion experiment/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 @@ -186,7 +187,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(score,bl)
num += 1
return [s * 100.0 / num for s in score]

Expand Down
4 changes: 2 additions & 2 deletions experiment/code-to-text/code/bleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +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 @@ -186,7 +186,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(score,bl)
num += 1
return [s * 100.0 / num for s in score]

Expand Down
3 changes: 2 additions & 1 deletion experiment/code-to-text/evaluator/evaluator.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 @@ -186,7 +187,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(score,bl)
num += 1
return [s * 100.0 / num for s in score]

Expand Down