def get_features_line(gold, qid, sub, features):
    """ Produce a string of the following SVM input format:
        3 qid:1 1:1 2:1 3:0 4:0.2 5:0 # 1A
    """
    s = "{} qid:{}".format(gold, qid)
    for idx, feature in enumerate(features):
        s += " {}:{}".format(idx + 1, feature)
    s += " # {}_{}\n".format(qid, sub)
    return s