def read_labels_file(inputfile):
    """ Read a text file containing true and predicted labels """
    labels, preds = [], []
    with open(inputfile) as fin:
        for line in fin:
            line = line.strip()
            if line and not line.startswith('#'):
                y, p = line.split()
                labels.append(int(y))
                preds.append(int(p))
    return labels, preds