File size: 344 Bytes
158b61b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import sacrebleu


h = open("output-translation/flores/test-flores.hi", 'r').readlines()
r = open("input-files/flores/hin.devtest", 'r').readlines()

hyp, ref = [], []

for i in range(len(h)):
    hh = h[i].strip("\n")
    rr = r[i].strip("\n")
    hyp.append(hh)
    ref.append(rr)

bleu = sacrebleu.corpus_bleu(hyp, [ref])

print(bleu.score)