#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 |
const std::map< id_type, float > & | GetDocumentBiasMap () const |
Definition at line 42 of file ug_sampling_bias.h.
sapt::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 53 of file ug_sampling_bias.cc.
References init_from_json(), sapt::SamplingBias::log, NULL, sapt::query_bias_server(), Moses::Timer::start(), and timer.
sapt::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 74 of file ug_sampling_bias.cc.
References init(), and sapt::SamplingBias::log.
const std::map< id_type, float > & sapt::DocumentBias::GetDocumentBiasMap | ( | ) | const |
Definition at line 92 of file ug_sampling_bias.cc.
void sapt::DocumentBias::init | ( | std::map< std::string, float > const & | biasmap, | |
std::map< std::string, id_type > const & | docname2docid | |||
) |
Definition at line 126 of file ug_sampling_bias.cc.
References m, and sapt::SamplingBias::m_bias_map.
Referenced by DocumentBias().
void sapt::DocumentBias::init_from_json | ( | std::string const & | json, | |
std::map< std::string, id_type > const & | docname2docid, | |||
std::ostream * | log | |||
) |
Definition at line 99 of file ug_sampling_bias.cc.
Referenced by DocumentBias().
float sapt::DocumentBias::operator[] | ( | id_type const | idx | ) | const [virtual] |
Implements sapt::SamplingBias.
Definition at line 163 of file ug_sampling_bias.cc.
References m, and sapt::SamplingBias::m_sid2docid.
size_t sapt::DocumentBias::size | ( | ) | const [virtual] |
Implements sapt::SamplingBias.
Definition at line 172 of file ug_sampling_bias.cc.
References sapt::SamplingBias::m_sid2docid.