def metricThresholdLabeler(sent_indx, metricScores):

    global thrhold_percent
    hypVal = []
    thrhold_score = max(metricScores) - (thrhold_percent * max(metricScores))

    tot_neg_points = 0
    for met_score in metricScores:
        if met_score >= thrhold_score: hypVal.append(1)
        else:
            hypVal.append(met_score)
            tot_neg_points += 1

    percent_neg_points = tot_neg_points / float( len(hypVal) )
    if (tot_neg_points == 0 or percent_neg_points <= 0.5):
        sys.stderr.write("Metric Threshold Warning: %d ||| %d :: %d ** %g\n" % (sent_indx, len(hypVal), tot_neg_points, percent_neg_points))

    return hypVal
dataset/ETHPy150Open sfu-natlang/Kriya/src/Kriya-Decoder/mert-scripts/PRO.py/metricThresholdLabeler/original