From 7242963e683d7b3d4b6c49ac3814ced360ef10c8 Mon Sep 17 00:00:00 2001 From: Michael Denkowski Date: Tue, 8 Apr 2014 13:54:25 -0700 Subject: setup for hpyplm being optional, different metrics --- realtime/rt/decoder.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'realtime/rt/decoder.py') diff --git a/realtime/rt/decoder.py b/realtime/rt/decoder.py index ed45c248..5082911d 100644 --- a/realtime/rt/decoder.py +++ b/realtime/rt/decoder.py @@ -38,11 +38,11 @@ class CdecDecoder(Decoder): class MIRADecoder(Decoder): - def __init__(self, config, weights): + def __init__(self, config, weights, metric='bleu'): cdec_root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) mira = os.path.join(cdec_root, 'training', 'mira', 'kbest_cut_mira') - # optimizer=2 step=0.001 best=500, k=500, uniq, stream - mira_cmd = [mira, '-c', config, '-w', weights, '-o', '2', '-C', '0.001', '-b', '500', '-k', '500', '-u', '-t'] + # optimizer=2 step=0.001 best=500, k=500, uniq, stream, metric + mira_cmd = [mira, '-c', config, '-w', weights, '-o', '2', '-C', '0.001', '-b', '500', '-k', '500', '-u', '-t', '-m', metric] logger.info('Executing: {}'.format(' '.join(mira_cmd))) self.decoder = util.popen_io(mira_cmd) self.lock = util.FIFOLock() -- cgit v1.2.3