import codecs


def load_data(train_file):
    """
    Return list of dataset given train_file and gs_file
    Value: [(sa:str, sb:str, score:float)]
    """
    with codecs.open(train_file, 'r', encoding='utf8') as f:
        data = []
        for idx, line in enumerate(f):
            line = line.strip().split('\t')
            score = 0.
            if len(line) == 3:
                score = float(line[2])
            sa, sb = line[0], line[1]
            data.append((sa, sb, score))
    return data