From 0c4066c71258b8a60b219f015b69634dc564af98 Mon Sep 17 00:00:00 2001 From: redpony Date: Sun, 14 Nov 2010 23:27:42 +0000 Subject: few fixes git-svn-id: https://ws10smt.googlecode.com/svn/trunk@721 ec762483-ff6d-05da-a07a-a48fb63a330f --- rescore/rescore_with_cdec_model.pl | 8 +++++--- 1 file 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 "$hyps[$i] ||| $src\n"; } else { - print CDEC_OUT "$src ||| $hyps[$i]\n"; + print CDEC_OUT "$src ||| $hyps[$i]\n"; } my $score = ; 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"; } } -- cgit v1.2.3