diff options
author | Michael Denkowski <mdenkows@cs.cmu.edu> | 2013-09-04 12:27:22 -0700 |
---|---|---|
committer | Michael Denkowski <mdenkows@cs.cmu.edu> | 2013-09-04 12:27:22 -0700 |
commit | ed6325760c6cbd7681330bd9591f66ce5efe60ae (patch) | |
tree | c48d9ea649c1bb00d25a228f97dba25cac7d2aed /realtime/rt/decoder.py | |
parent | e636b458b445f781fcc493797dea3576c869f935 (diff) |
Infrastructure for HPYPLM, config file management.
Diffstat (limited to 'realtime/rt/decoder.py')
-rw-r--r-- | realtime/rt/decoder.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/realtime/rt/decoder.py b/realtime/rt/decoder.py index 6bbef6f2..0a202fae 100644 --- a/realtime/rt/decoder.py +++ b/realtime/rt/decoder.py @@ -1,3 +1,4 @@ +import logging import os import subprocess @@ -19,6 +20,7 @@ class CdecDecoder(Decoder): cdec_root = os.path.dirname(os.path.dirname(os.path.dirname(__file__))) decoder = os.path.join(cdec_root, 'decoder', 'cdec') decoder_cmd = [decoder, '-c', config, '-w', weights] + logging.info('Executing: {}'.format(' '.join(decoder_cmd))) self.decoder = util.popen_io(decoder_cmd) class MIRADecoder(Decoder): @@ -28,6 +30,7 @@ class MIRADecoder(Decoder): 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'] + logging.info('Executing: {}'.format(' '.join(mira_cmd))) self.decoder = util.popen_io(mira_cmd) def update(self, sentence, grammar, reference): |