Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/moses/FF
diff options
context:
space:
mode:
authorAles Tamchyna <tamchyna@ufal.mff.cuni.cz>2016-03-23 19:37:19 +0300
committerAles Tamchyna <tamchyna@ufal.mff.cuni.cz>2016-03-23 19:37:19 +0300
commit073f9c56565ab9490329f81af1103d38eb720ccf (patch)
treedb518959be3f42ab20288a28ffd98346da08be9b /moses/FF
parentc7a1d21abda7d8b28e200ab7e5ed17697400c01b (diff)
bugfix in context hash
Diffstat (limited to 'moses/FF')
-rw-r--r--moses/FF/VW/VW.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/moses/FF/VW/VW.cpp b/moses/FF/VW/VW.cpp
index 2ea49aae8..112a6ed1c 100644
--- a/moses/FF/VW/VW.cpp
+++ b/moses/FF/VW/VW.cpp
@@ -108,20 +108,21 @@ FFState* VW::EvaluateWhenApplied(
Discriminative::Classifier &classifier = *m_tlsClassifier->GetStored();
// extract target context features
- const Phrase &targetContext = prevVWState.GetPhrase();
+ size_t contextHash = prevVWState.hash();
FeatureVectorMap &contextFeaturesCache = *m_tlsTargetContextFeatures->GetStored();
- FeatureVectorMap::const_iterator contextIt = contextFeaturesCache.find(cacheKey);
+ FeatureVectorMap::const_iterator contextIt = contextFeaturesCache.find(contextHash);
if (contextIt == contextFeaturesCache.end()) {
// we have not extracted features for this context yet
+ const Phrase &targetContext = prevVWState.GetPhrase();
Discriminative::FeatureVector contextVector;
AlignmentInfo alignInfo("");
for(size_t i = 0; i < contextFeatures.size(); ++i)
(*contextFeatures[i])(input, targetContext, alignInfo, classifier, contextVector);
- contextFeaturesCache[cacheKey] = contextVector;
+ contextFeaturesCache[contextHash] = contextVector;
VERBOSE(3, "VW :: context cache miss\n");
} else {
// context already in cache, simply put feature IDs in the classifier object