summaryrefslogtreecommitdiff
path: root/realtime/rt
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
commit4627194833a9d50fd218fd3db506685c1d92436d (patch)
treeb68ee5fc562093eddd63fbd8b3c106904e18007a /realtime/rt
parent4b1ae0b11bb9fc4ee4c48b1443f36a824dc92fbe (diff)
setup for hpyplm being optional, different metrics
Diffstat (limited to 'realtime/rt')
-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()