diff options
author | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-03-11 20:26:25 +0400 |
---|---|---|
committer | Eva Hasler <ehasler@saxnot.inf.ed.ac.uk> | 2012-03-11 20:26:25 +0400 |
commit | da538961d4694cb7fcd7d3960b9857aafac5b078 (patch) | |
tree | 932da7f1a636d01ff0774a38dd97c30dda2ec1ec /moses-cmd | |
parent | 7ac84d5da9c2bb802ff2b5381677ce4b06995a20 (diff) |
nbest output for sparse features: report non-zero weights instead of scores
Diffstat (limited to 'moses-cmd')
-rw-r--r-- | moses-cmd/src/IOWrapper.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/moses-cmd/src/IOWrapper.cpp b/moses-cmd/src/IOWrapper.cpp index 49ab4063e..5ff86f12d 100644 --- a/moses-cmd/src/IOWrapper.cpp +++ b/moses-cmd/src/IOWrapper.cpp @@ -516,8 +516,11 @@ void OutputFeatureScores( std::ostream& out, const TrellisPath &path, const Feat // report each feature else { for(FVector::FNVmap::const_iterator i = scores.cbegin(); i != scores.cend(); i++) - if (i->second != 0) // do not report zero-valued features - out << " " << i->first << "=" << i->second; + if (i->second != 0) { // do not report zero-valued features + float weight = staticData.GetSparseWeight(i->first); + if (weight != 0) + out << " " << i->first << "=" << weight; + } } } } |