diff options
author | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-11-14 23:27:42 +0000 |
---|---|---|
committer | redpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-11-14 23:27:42 +0000 |
commit | 5c6eb50c78a46a3a0d17b111560b4b42bdee6268 (patch) | |
tree | 496d83901e295cedf1cf65167c60dd65b9583331 | |
parent | 686e0ce22a009f3a79cb49932cacbacace3f2a30 (diff) |
few fixes
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@721 ec762483-ff6d-05da-a07a-a48fb63a330f
-rwxr-xr-x | rescore/rescore_with_cdec_model.pl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rescore/rescore_with_cdec_model.pl b/rescore/rescore_with_cdec_model.pl index ea4252cb..6553fe56 100755 --- a/rescore/rescore_with_cdec_model.pl +++ b/rescore/rescore_with_cdec_model.pl @@ -101,13 +101,15 @@ sub rescore { print STDERR "RESCORING SENTENCE id=$id (# hypotheses=$nhyps)...\n"; for (my $i=0; $i < $nhyps; $i++) { if ($reverse_model) { - print CDEC_OUT "$hyps[$i] ||| $src\n"; + print CDEC_OUT "<seg id=\"$id\">$hyps[$i] ||| $src</seg>\n"; } else { - print CDEC_OUT "$src ||| $hyps[$i]\n"; + print CDEC_OUT "<seg id=\"$id\">$src ||| $hyps[$i]</seg>\n"; } my $score = <CDEC_IN>; chomp $score; - print "$id ||| $hyps[$i] ||| $feats[$i] $feature_name=$score\n"; + my @words = split /\s+/, $hyps[$i]; + my $norm_score = $score / scalar @words; + print "$id ||| $hyps[$i] ||| $feats[$i] $feature_name=$score ${feature_name}_norm=$norm_score\n"; } } |