Skip to content

Commit

Permalink
fix extra logging
Browse files Browse the repository at this point in the history
  • Loading branch information
redpony committed Mar 5, 2015
1 parent 3d2a607 commit 62b8b8e
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions training/mira/mira.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,9 @@

#scoring function using pycdec scoring
def fast_score(hyps, refs, metric):
#scorer = cdec.score.Scorer(metric)
#logging.info('loaded {0} references for scoring with {1}'.format(
# len(refs), metric))
#if metric=='BLEU':
# logging.warning('BLEU is ambiguous, assuming IBM_BLEU\n')
# metric = 'IBM_BLEU'
#elif metric=='COMBI':
# logging.warning('COMBI metric is no longer supported, switching to '
# 'COMB:TER=-0.5;BLEU=0.5')
# metric = 'COMB:TER=-0.5;BLEU=0.5'
#stats = sum(scorer(r).evaluate(h) for h,r in itertools.izip(hyps,refs))
#logging.info('Score={} ({})'.format(stats.score, stats.detail))
#return stats.score
cmd = ('{0} -r{1} -i {2} -m {3}').format(fast_score_binary, refs, hyps, metric)
proc = subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
o = proc.stdout.readline().strip()
print 'res: ', o
return float(o)

#create new parallel input file in output directory in sgml format
Expand Down

0 comments on commit 62b8b8e

Please sign in to comment.