Skip to content

Commit

Permalink
Minor bug fixes in i) creating tuning files kriya.ini and kriya.glue,…
Browse files Browse the repository at this point in the history
… ii) tuning scripts for MERT and PRO to process the new format weights
  • Loading branch information
Baskaran Sankaran committed Jun 25, 2013
1 parent b3fcfb1 commit a9c79ee
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/Kriya-Decoder/mert-scripts/kriya.glue
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
X__1 ||| X__1 ||| 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0
S__1 X__2 ||| S__1 X__2 ||| 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1
X__1 ||| X__1 ||| 0.0
S__1 X__2 ||| S__1 X__2 ||| 1
6 changes: 1 addition & 5 deletions src/Kriya-Decoder/mert-scripts/kriya.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ cbp = 500

# translation model weights
[weight_tm]
1.066893
0.752247
0.589793
0.589793
1.0
1.066893 0.752247 0.589793 0.589793 1.0

# word penalty
[weight_wp]
Expand Down
8 changes: 5 additions & 3 deletions src/Kriya-Decoder/mert-scripts/mert-moses-new-hiero.pl
Original file line number Diff line number Diff line change
Expand Up @@ -918,9 +918,11 @@ sub create_config {
# change parameter, if new values
if (defined($P{$parameter})) {
# write new values
foreach (@{$P{$parameter}}) {
print OUT $_."\n";
}
my $new_wgt_str = join(" ", @{$P{$parameter}});
#foreach (@{$P{$parameter}}) {
#print OUT $_."\n";
#}
print OUT "$new_wgt_str\n";
delete($P{$parameter});
# skip until new parameter, only write comments
while($line = <INI>) {
Expand Down
7 changes: 2 additions & 5 deletions src/Kriya-Decoder/mert-scripts/pro-kriya.pl
Original file line number Diff line number Diff line change
Expand Up @@ -703,11 +703,8 @@ sub create_config {
if (exists $kriyaFeatsHsh{$parameter}) {
$shortname = $kriyaFeatsHsh{$parameter};
if (exists $kriyaWgtsHsh{$shortname}) {
@newweights = split(/\s+/, $kriyaWgtsHsh{$shortname});
foreach my $new_wgt (@newweights) {
print OUT "$new_wgt\n";
$line = <INI>;
}
print OUT "$kriyaWgtsHsh{$shortname}\n";
$line = <INI>;
}
else { die "ERROR: Feature $parameter having shortname $shortname doesn't have corresponding weight(s). Exiting!!\n"; }
next;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ sub create_config {

print INI "# Various feature weights\n";
print INI "# language model weights\n[weight_lm]\n1.0\n\n";
print INI "# translation model weights\n[weight_tm]\n1.066893\n0.752247\n0.589793\n0.589793\n1.0\n\n";
print INI "# translation model weights\n[weight_tm]\n1.066893 0.752247 0.589793 0.589793 1.0\n\n";
print INI "# word penalty\n[weight_wp]\n-2.844814\n\n";
print INI "# glue weight\n[weight_glue]\n1.0\n\n";

Expand Down

0 comments on commit a9c79ee

Please sign in to comment.