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 | 40eac315f63b018eec10da4124b801869cd788f5 (patch) | |
tree | 54ba29aa4b5ed47ee305d8238f8a52a91ecdc521 /realtime/rt/decoder.py | |
parent | 7c583986ab4774480d45ada79a812c9c8853296b (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): |