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
diff options
context:
space:
mode:
Diffstat (limited to 'moses/TranslationModel/UG/mm/ug_sampling_bias.cc')
-rw-r--r--moses/TranslationModel/UG/mm/ug_sampling_bias.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/moses/TranslationModel/UG/mm/ug_sampling_bias.cc b/moses/TranslationModel/UG/mm/ug_sampling_bias.cc
index d54305997..f5e660456 100644
--- a/moses/TranslationModel/UG/mm/ug_sampling_bias.cc
+++ b/moses/TranslationModel/UG/mm/ug_sampling_bias.cc
@@ -108,6 +108,21 @@ namespace Moses
// #endif
}
+ DocumentBias
+ ::DocumentBias(std::vector<id_type> const& sid2doc,
+ std::map<std::string,id_type> const& docname2docid,
+ std::map<std::string, float> const& context_weights,
+ std::ostream* log)
+ : m_sid2docid(sid2doc)
+ , m_bias(docname2docid.size(), 0)
+ {
+ init(context_weights, docname2docid);
+ }
+
+ std::map<std::string, float>& SamplingBias::getBiasMap() {
+ return m_bias_map;
+ }
+
void
DocumentBias
::init_from_json
@@ -144,6 +159,7 @@ namespace Moses
<< x.first << " " << x.second << std::endl;
}
}
+ m_bias_map = bias;
init(bias, docname2docid);
// using xmlrpc_parse_json didn't always work (parser errors)