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
diff options
context:
space:
mode:
authorLane Schwartz <dowobeha@gmail.com>2017-01-02 21:52:01 +0300
committerLane Schwartz <dowobeha@gmail.com>2017-01-02 21:52:01 +0300
commit999d6b6371437862e9309c5bcfe5ccf78a9782ab (patch)
tree2b0cf31fbfb20ca38b65d347357953c16f81712c /moses
parent05006bf1e2c68395a63ebd21a4f7ee56e38f260f (diff)
Added labelled score breakdown to translation options in TranslationRequest.
This will enable a client to get the feature value(s) associated with a particular feature for a particular translation option
Diffstat (limited to 'moses')
-rw-r--r--moses/server/TranslationRequest.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/moses/server/TranslationRequest.cpp b/moses/server/TranslationRequest.cpp
index e1821a265..e2580fe2f 100644
--- a/moses/server/TranslationRequest.cpp
+++ b/moses/server/TranslationRequest.cpp
@@ -214,6 +214,9 @@ insertTranslationOptions(Moses::Manager& manager,
for (size_t j = 0; j < scores.size(); ++j)
scoresXml.push_back(xmlrpc_c::value_double(scores[j]));
toptXml["scores"] = xmlrpc_c::value_array(scoresXml);
+ ostringstream buf;
+ topt->GetScoreBreakdown().OutputAllFeatureScores(buf, true);
+ toptXml["labelledScores"] = PackScores(topt->GetScoreBreakdown());
toptsXml.push_back(xmlrpc_c::value_struct(toptXml));
}
}