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 | 0c4066c71258b8a60b219f015b69634dc564af98 (patch) | |
tree | aa322e24a1e4d70995766b4aecb3ef0242c35929 /rescore | |
parent | bfbe34e123d0087cb855964a7750c5cbdd2cd375 (diff) |
few fixes
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@721 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'rescore')
-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"; } } |