#include <ug_sampling_bias.h>
Public Member Functions | |
DocumentBias (std::vector< id_type > const &sid2doc, std::map< std::string, id_type > const &docname2docid, std::string const &server_url, std::string const &text, std::ostream *log) | |
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) | |
void | init_from_json (std::string const &json, std::map< std::string, id_type > const &docname2docid, std::ostream *log) |
void | init (std::map< std::string, float > const &biasmap, std::map< std::string, id_type > const &docname2docid) |
float | operator[] (id_type const idx) const |
size_t | size () const |
Definition at line 44 of file ug_sampling_bias.h.
Moses::bitext::DocumentBias::DocumentBias | ( | std::vector< id_type > const & | sid2doc, | |
std::map< std::string, id_type > const & | docname2docid, | |||
std::string const & | server_url, | |||
std::string const & | text, | |||
std::ostream * | log | |||
) |
Definition at line 61 of file ug_sampling_bias.cc.
References init_from_json(), Moses::bitext::SamplingBias::log, NULL, Moses::bitext::query_bias_server(), Moses::Timer::start(), and timer.
Moses::bitext::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 | |||
) |
Definition at line 83 of file ug_sampling_bias.cc.
References init(), and Moses::bitext::SamplingBias::log.
void Moses::bitext::DocumentBias::init | ( | std::map< std::string, float > const & | biasmap, | |
std::map< std::string, id_type > const & | docname2docid | |||
) |
Definition at line 158 of file ug_sampling_bias.cc.
References m.
Referenced by DocumentBias().
void Moses::bitext::DocumentBias::init_from_json | ( | std::string const & | json, | |
std::map< std::string, id_type > const & | docname2docid, | |||
std::ostream * | log | |||
) |
Definition at line 101 of file ug_sampling_bias.cc.
Referenced by DocumentBias().
float Moses::bitext::DocumentBias::operator[] | ( | id_type const | idx | ) | const [virtual] |
Implements Moses::bitext::SamplingBias.
Definition at line 190 of file ug_sampling_bias.cc.
References m, and Moses::bitext::SamplingBias::m_sid2docid.
size_t Moses::bitext::DocumentBias::size | ( | ) | const [virtual] |
Implements Moses::bitext::SamplingBias.
Definition at line 200 of file ug_sampling_bias.cc.
References Moses::bitext::SamplingBias::m_sid2docid.