summaryrefslogtreecommitdiff
path: root/realtime/rt/decoder.py
diff options
context:
space:
mode:
authorMichael Denkowski <mdenkows@cs.cmu.edu>2014-04-08 13:54:25 -0700
committerMichael Denkowski <mdenkows@cs.cmu.edu>2014-04-08 13:54:25 -0700
commit7242963e683d7b3d4b6c49ac3814ced360ef10c8 (patch)
tree2a29709f5c7cad4acc7b5789f9e1f151257586da /realtime/rt/decoder.py
parentb7d8454761a67f385b8e551fbf4f342e53ad81d8 (diff)
setup for hpyplm being optional, different metrics
Diffstat (limited to 'realtime/rt/decoder.py')
-rw-r--r--realtime/rt/decoder.py6
1 files changed, 3 insertions, 3 deletions
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()