def split_golden_set(triples, valid_ratio, test_ratio):
    """Split the data into train/valid/test sets."""
    assert valid_ratio >= 0.0
    assert test_ratio >= 0.0
    num_valid = int(len(triples) * valid_ratio)
    num_test = int(len(triples) * test_ratio)
    valid_set = triples[:num_valid]
    test_set = triples[num_valid:num_valid+num_test]
    train_set = triples[num_valid+num_test:]
    assert len(valid_set) + len(test_set) + len(train_set) == len(triples)

    return train_set, valid_set, test_set
def split_golden_set(triples, valid_ratio, test_ratio):
    """Split the data into train/valid/test sets."""
    assert valid_ratio >= 0.0
    assert test_ratio >= 0.0
    num_valid = int(len(triples) * valid_ratio)
    num_test = int(len(triples) * test_ratio)
    valid_set = triples[:num_valid]
    test_set = triples[num_valid:num_valid+num_test]
    train_set = triples[num_valid+num_test:]
    assert len(valid_set) + len(test_set) + len(train_set) == len(triples)

    return train_set, valid_set, test_set
def split_golden_set ( triples , valid_ratio , test_ratio ) : assert valid_ratio >= 0.0 assert test_ratio >= 0.0 num_valid = int ( len ( triples ) * valid_ratio ) num_test = int ( len ( triples ) * test_ratio ) valid_set = triples [ : num_valid ] test_set = triples [ num_valid : num_valid + num_test ] train_set = triples [ num_valid + num_test : ] assert len ( valid_set ) + len ( test_set ) + len ( train_set ) == len ( triples ) return train_set , valid_set , test_set
Split the data into train/valid/test sets.
Split the data into train / valid / test sets .