summaryrefslogtreecommitdiff
path: root/gi
diff options
context:
space:
mode:
authorolivia.buzek <olivia.buzek@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-08 21:59:50 +0000
committerolivia.buzek <olivia.buzek@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-08 21:59:50 +0000
commitc12e7241e8908def96943b1a4056e536ea91eded (patch)
treec24b9cf0d2a90239b01eb6432e683292c95bb06f /gi
parenta034f92b1fe0c6368ebb140bc691f0718dd23a23 (diff)
Adding backoff grammar and BackoffRule feature.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@191 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi')
-rwxr-xr-xgi/pipeline/evaluation-pipeline.pl2
-rwxr-xr-xgi/pipeline/local-gi-pipeline.pl8
2 files changed, 6 insertions, 4 deletions
diff --git a/gi/pipeline/evaluation-pipeline.pl b/gi/pipeline/evaluation-pipeline.pl
index 619e2699..e0d13340 100755
--- a/gi/pipeline/evaluation-pipeline.pl
+++ b/gi/pipeline/evaluation-pipeline.pl
@@ -14,6 +14,7 @@ my $feat_map = {
"XFeatures" => [ "XFE","XEF","LabelledEF","LabelledFE"] ,
"LabelledRuleConditionals" => [ "LabelledFE","LabelledEF" ] ,
"LexProb" => [ "LexE2F", "LexF2E" ] ,
+ "BackoffRule" => [ "BackoffRule", "BackoffRule" ] ,
};
my %init_weights = qw(
@@ -27,6 +28,7 @@ my %init_weights = qw(
LogECount -0.129853
LogFCount -0.194037
LogRuleCount 0.256706
+ BackoffRule 0.5
XFE -0.256706
XEF -0.256706
LabelledFE -0.256706
diff --git a/gi/pipeline/local-gi-pipeline.pl b/gi/pipeline/local-gi-pipeline.pl
index c7df2372..99b487db 100755
--- a/gi/pipeline/local-gi-pipeline.pl
+++ b/gi/pipeline/local-gi-pipeline.pl
@@ -69,8 +69,8 @@ safemkdir($OUTPUT) or die "Couldn't create output directory $OUTPUT: $!";
safemkdir($CONTEXT_DIR) or die "Couldn't create output directory $CONTEXT_DIR: $!";
safemkdir($CLUSTER_DIR) or die "Couldn't create output directory $CLUSTER_DIR: $!";
safemkdir($GRAMMAR_DIR) or die "Couldn't create output directory $GRAMMAR_DIR: $!";
-if (-e $TOPICS_CONFIG) {
- copy($TOPICS_CONFIG, $CLUSTER_DIR) or die "Copy failed: $!";
+if(-e $TOPICS_CONFIG) {
+ copy($TOPICS_CONFIG, $CLUSTER_DIR) or die "Copy failed: $!";
}
extract_context();
@@ -199,7 +199,7 @@ sub grammar_extract {
if (-e $OUTGRAMMAR) {
print STDERR "$OUTGRAMMAR exists, reusing...\n";
} else {
- safesystem("$EXTRACTOR -i $LABELED -c $ITEMS_IN_MEMORY -L $BASE_PHRASE_MAX_SIZE | $SORT_KEYS | $REDUCER -p | $GZIP > $OUTGRAMMAR") or die "Couldn't extract grammar";
+ safesystem("$EXTRACTOR -i $LABELED -c $ITEMS_IN_MEMORY -L $BASE_PHRASE_MAX_SIZE -t $NUM_TOPICS -g | $SORT_KEYS | $REDUCER -p | $GZIP > $OUTGRAMMAR") or die "Couldn't extract grammar";
}
return $OUTGRAMMAR;
}
@@ -212,7 +212,7 @@ sub grammar_extract_bidir {
if (-e $OUTGRAMMAR) {
print STDERR "$OUTGRAMMAR exists, reusing...\n";
} else {
- safesystem("$EXTRACTOR -i $LABELED -c $ITEMS_IN_MEMORY -L $BASE_PHRASE_MAX_SIZE -b | $SORT_KEYS | $REDUCER -p -b | $SORT_KEYS | $REDUCER | $GZIP > $OUTGRAMMAR") or die "Couldn't extract grammar";
+ safesystem("$EXTRACTOR -i $LABELED -c $ITEMS_IN_MEMORY -L $BASE_PHRASE_MAX_SIZE -b -t $NUM_TOPICS -g | $SORT_KEYS | $REDUCER -p -b | $SORT_KEYS | $REDUCER | $GZIP > $OUTGRAMMAR") or die "Couldn't extract grammar";
}
return $OUTGRAMMAR;
}