diff options
author | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-19 22:51:33 +0000 |
---|---|---|
committer | graehl <graehl@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-19 22:51:33 +0000 |
commit | 904130a611019d3ecb7878e21035f6915b4b5702 (patch) | |
tree | 34d4e44d8cc1edb83f0e5ee4021c5c8e11d2de0f /decoder/ff_bleu.cc | |
parent | a0206fd7c45da0b31501713ac65834f69745b696 (diff) |
shared_ptr for scores. todo: intrusive.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@327 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/ff_bleu.cc')
-rw-r--r-- | decoder/ff_bleu.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/decoder/ff_bleu.cc b/decoder/ff_bleu.cc index f8d62aa2..19564bd0 100644 --- a/decoder/ff_bleu.cc +++ b/decoder/ff_bleu.cc @@ -182,7 +182,8 @@ class BLEUModelImpl { cerr << ")\n"; */ - Score *node_score = smeta.GetDocScorer()[smeta.GetSentenceID()]->ScoreCCandidate(vs); + ScoreP node_score_p = smeta.GetDocScorer()[smeta.GetSentenceID()]->ScoreCCandidate(vs); + Score *node_score=node_score_p.get(); string details; node_score->ScoreDetails(&details); const Score *base_score= &smeta.GetScore(); @@ -194,6 +195,7 @@ class BLEUModelImpl { //how it seems to be done in code //TODO: might need to reverse the -1/+1 of the oracle/neg examples + //TO VLADIMIR: the polarity would be reversed if you switched error (1-BLEU) for BLEU. approx_bleu = ( rule.FWords() * oracledoc_factor ) * node_score->ComputeScore(); //how I thought it was done from the paper //approx_bleu = ( rule.FWords()+ smeta.GetDocLen() ) * node_score->ComputeScore(); @@ -277,7 +279,7 @@ void BLEUModel::TraversalFeaturesImpl(const SentenceMetadata& smeta, const DocScorer *ds = &smeta.GetDocScorer(); */ - cerr<< "Loading sentence " << smeta.GetSentenceID() << endl; +// cerr<< "ff_bleu loading sentence " << smeta.GetSentenceID() << endl; //} features->set_value(fid_, pimpl_->LookupWords(*edge.rule_, ant_states, state, smeta)); //cerr << "FID" << fid_ << " " << DebugStateToString(state) << endl; |