def rand_weighted_headfinal_per_lang(s, lang, i, deptypes): weights = get_weights(lang, i, deptypes, True) return opt_mindep.randlin_from_weights(s, weights, opt_mindep.get_deptype)[-1]
def rand_weighted_per_lang(s, lang, i, deptypes): weights = get_weights(lang, i, deptypes, False) return opt_mindep.randlin_from_weights(s, weights, CONDITIONING)[-1]