def get_flat_labels(filename, multi_label=False, multi_label_sep='|'):
    """ Get flattened list of labels """
    
    labels = []
    with open(filename) as f:
        for line in f:
            for label in line.strip().split():
                if multi_label:
                    for l in label.split(multi_label_sep):
                        labels.append(l)
                else:
                    labels.append(label)
    return labels