53a93d8af5d041f6c5dfdef2fb763f8419e3023d,matchzoo/datasets/snli/load_data.py,,load_data,#Any#Any#Any#,14

Before Change


        label = data_pack.relation["label"].apply(classes.index)
        data_pack.relation["label"] = label
        data_pack.one_hot_encode_label(num_classes=4, inplace=True)
        return data_pack, classes
    else:
        raise ValueError(f"{task} is not a valid task.")

After Change


    data_pack = _read_data(file_path)

    if task == "ranking":
        task = matchzoo.tasks.Ranking()
    if task == "classification":
        task = matchzoo.tasks.Classification()

    if isinstance(task, matchzoo.tasks.Ranking):
        if target_label not in ["entailment", "contradiction", "neutral", "-"]:
            raise ValueError
        binary = (data_pack.relation["label"] == target_label).astype(float)
        data_pack.relation["label"] = binary
        return data_pack
    elif isinstance(task, matchzoo.tasks.Classification):
        classes = ["entailment", "contradiction", "neutral", "-"]
        label = data_pack.relation["label"].apply(classes.index)
        data_pack.relation["label"] = label
        data_pack.one_hot_encode_label(num_classes=4, inplace=True)
        if return_classes:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: NTMC-Community/MatchZoo
Commit Name: 53a93d8af5d041f6c5dfdef2fb763f8419e3023d
Time: 2019-01-19
Author: i@uduse.com
File Name: matchzoo/datasets/snli/load_data.py
Class Name:
Method Name: load_data


Project Name: keras-team/keras
Commit Name: 08014eea360fd8d66b7baab19cdb9335f52c167b
Time: 2016-08-24
Author: francois.chollet@gmail.com
File Name: keras/backend/tensorflow_backend.py
Class Name:
Method Name: repeat


Project Name: GPflow/GPflow
Commit Name: 41fa0902ddf895045b0a109852d9b2f724e1d808
Time: 2016-01-14
Author: james.hensman@gmail.com
File Name: GPflow/kernels.py
Class Name: White
Method Name: K