53a93d8af5d041f6c5dfdef2fb763f8419e3023d,matchzoo/datasets/snli/load_data.py,,load_data,#Any#Any#Any#,14
Before Change
raise ValueError(f"{stage} is not a valid stage."
f"Must be one of `train`, `dev`, and `test`.")
data_root = _download_data()
file_path = data_root.joinpath(f"snli_1.0_{stage}.txt")
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", "-"]
After Change
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)
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: 7278db105dc3ae1d4c1e38b497e54c863a7836e3
Time: 2015-06-19
Author: xavier@whirlscape.com
File Name: keras/layers/recurrent.py
Class Name: SimpleRNN
Method Name: get_output
Project Name: chainer/chainercv
Commit Name: d6c3129f24ea6bea8fa9ab227e399e19fe29cdda
Time: 2017-05-13
Author: yuyuniitani@gmail.com
File Name: chainercv/links/model/faster_rcnn/utils/proposal_creator.py
Class Name: ProposalCreator
Method Name: __call__