From 0269777fc54bc554c12107bdd5498f743df2a1ce Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Thu, 8 Sep 2011 00:06:52 +0200
Subject: a lot of stuff, fast_sparse_vector, perceptron, removed sofia, sample
[...]
---
dtrain/kbestget.h | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
(limited to 'dtrain/kbestget.h')
diff --git a/dtrain/kbestget.h b/dtrain/kbestget.h
index bb430b85..ae4588c9 100644
--- a/dtrain/kbestget.h
+++ b/dtrain/kbestget.h
@@ -14,7 +14,9 @@ namespace dtrain
struct KBestList {
vector > feats;
vector > sents;
+ vector model_scores;
vector scores;
+ size_t GetSize() { return sents.size(); }
};
@@ -52,9 +54,10 @@ struct KBestGetter : public DecoderObserver
void
KBestUnique( const Hypergraph& forest )
{
- kb.scores.clear();
kb.sents.clear();
kb.feats.clear();
+ kb.model_scores.clear();
+ kb.scores.clear();
KBest::KBestDerivations, ESentenceTraversal, KBest::FilterUnique, prob_t, EdgeProb> kbest( forest, k_ );
for ( size_t i = 0; i < k_; ++i ) {
const KBest::KBestDerivations, ESentenceTraversal, KBest::FilterUnique, prob_t, EdgeProb>::Derivation* d =
@@ -62,16 +65,17 @@ struct KBestGetter : public DecoderObserver
if (!d) break;
kb.sents.push_back( d->yield);
kb.feats.push_back( d->feature_values );
- kb.scores.push_back( d->score );
+ kb.model_scores.push_back( d->score );
}
}
void
KBestNoFilter( const Hypergraph& forest )
{
- kb.scores.clear();
kb.sents.clear();
kb.feats.clear();
+ kb.model_scores.clear();
+ kb.scores.clear();
KBest::KBestDerivations, ESentenceTraversal> kbest( forest, k_ );
for ( size_t i = 0; i < k_; ++i ) {
const KBest::KBestDerivations, ESentenceTraversal>::Derivation* d =
@@ -79,7 +83,7 @@ struct KBestGetter : public DecoderObserver
if (!d) break;
kb.sents.push_back( d->yield);
kb.feats.push_back( d->feature_values );
- kb.scores.push_back( d->score );
+ kb.model_scores.push_back( d->score );
}
}
};
--
cgit v1.2.3