Esempio n. 1
0
void MonolingualModel::trainWord(const vector<HuffmanNode>& nodes, int word_pos, int sent_id) {
    if (config.skip_gram) {
        trainWordSkipGram(nodes, word_pos, sent_id);
    } else {
        trainWordCBOW(nodes, word_pos, sent_id);
    }
}
Esempio n. 2
0
void BilingualModel::trainWord(MonolingualModel& src_model, MonolingualModel& trg_model,
                               const vector<HuffmanNode>& src_nodes, const vector<HuffmanNode>& trg_nodes,
                               int src_pos, int trg_pos, float alpha) {

    if (config->skip_gram) {
        return trainWordSkipGram(src_model, trg_model, src_nodes, trg_nodes, src_pos, trg_pos, alpha);
    } else {
        return trainWordCBOW(src_model, trg_model, src_nodes, trg_nodes, src_pos, trg_pos, alpha);
    }
}