summaryrefslogtreecommitdiff
path: root/python/pkg/cdec/sa/extract.py
diff options
context:
space:
mode:
authorMichael Denkowski <michael.j.denkowski@gmail.com>2013-01-24 16:55:21 -0500
committerMichael Denkowski <michael.j.denkowski@gmail.com>2013-01-24 16:55:21 -0500
commitab25e1dc737ca49b8ec13a8f48d18ba961d24342 (patch)
tree0139640f93cf660f57b99fad0c910ebf8334bcea /python/pkg/cdec/sa/extract.py
parent567b25a4c6e883a88b3d79d671577425769e1143 (diff)
Scored grammars from online extraction. Don't trust them yet.
Diffstat (limited to 'python/pkg/cdec/sa/extract.py')
-rw-r--r--python/pkg/cdec/sa/extract.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/pkg/cdec/sa/extract.py b/python/pkg/cdec/sa/extract.py
index 9fc37345..20eab9dd 100644
--- a/python/pkg/cdec/sa/extract.py
+++ b/python/pkg/cdec/sa/extract.py
@@ -12,10 +12,10 @@ extractor, prefix = None, None
online = False
def make_extractor(config, grammars, features):
- global extractor, prefix
+ global extractor, prefix, online
signal.signal(signal.SIGINT, signal.SIG_IGN) # Let parent process catch Ctrl+C
load_features(features)
- extractor = cdec.sa.GrammarExtractor(config)
+ extractor = cdec.sa.GrammarExtractor(config, online)
prefix = grammars
def load_features(features):
@@ -53,7 +53,7 @@ def extract(inp):
# Add training instance _after_ extracting grammars
if online:
extractor.add_instance(sentence, reference, alignment)
- extractor.dump_online_stats()
+ #extractor.dump_online_stats()
grammar_file = os.path.abspath(grammar_file)
return '<seg grammar="{0}" id="{1}"> {2} </seg>{3}'.format(grammar_file, i, sentence, suffix)