void Decoder1O::get_result(Instance * inst) { int len = inst->size(); inst->predicted_heads.resize(len, -1); if (model_opt.labeled) { inst->predicted_deprelsidx.resize(len, -1); } const LatticeItem * best_item = _lattice_cmp[0][len - 1]; __BUILD_TREE(inst, best_item); }
void Decoder2OCarreras::get_result(Instance * inst) { int len = inst->size(); inst->predicted_heads.resize(len, -1); if (model_opt.labeled) { inst->predicted_deprelsidx.resize(len, -1); } const LatticeItem * best_item = NULL; for (int c = 1; c < len; ++ c) { const LatticeItem * item = _lattice_cmp[0][len - 1][c]; if (!item) { continue; } if (NULL == best_item || best_item->_prob < item->_prob) { best_item = item; } } __BUILD_TREE(inst, best_item); }