Skip to content

zomux/gpubleu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Super Fast GPU-based BLEU Computation

  • Smoothed BLEU calculation (BLEU + 1)
  • Return percentage of BLEU
  • Based on Theano
  • Super fast for computing bleus in batch
  • Reference: https://arxiv.org/abs/1704.03169

Usage

bleu = GPUBLEUEvaluator()
# A sentence can be a list of number or string
sents = [
    [1, 2, 3, 4, 5, 3, 4, 1], 
    [2, 2, 2, 5, 7], 
    [1, 2, 3, 3, 4, 5, 1, 5, 6, 7, 4, 3, 3, 6]
]
ref = [[1, 2, 3, 4, 5, 7]]
print (bleu.evaluate(sents, ref))
[[ 0.58739489]
 [ 0.31610978]
 [ 0.23793663]]

About

GPU-based BLEU Computation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages