Skip to content

Commit

Permalink
Update bleu.py
Browse files Browse the repository at this point in the history
Allow a parameter in compute score method to turn off verbose in Bleu_scorer compute_score method
  • Loading branch information
nicolas-lair authored Nov 18, 2020
1 parent 38c2534 commit 6862087
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bleu/bleu.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, n=4):
self._hypo_for_image = {}
self.ref_for_image = {}

def compute_score(self, gts, res):
def compute_score(self, gts, res, verbose=1):

assert(gts.keys() == res.keys())
imgIds = gts.keys()
Expand All @@ -37,7 +37,7 @@ def compute_score(self, gts, res):
bleu_scorer += (hypo[0], ref)

#score, scores = bleu_scorer.compute_score(option='shortest')
score, scores = bleu_scorer.compute_score(option='closest', verbose=1)
score, scores = bleu_scorer.compute_score(option='closest', verbose=verbose)
#score, scores = bleu_scorer.compute_score(option='average', verbose=1)

# return (bleu, bleu_info)
Expand Down

0 comments on commit 6862087

Please sign in to comment.