53a93d8af5d041f6c5dfdef2fb763f8419e3023d,matchzoo/datasets/snli/load_data.py,,load_data,#Any#Any#Any#,14
Before Change
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", "-"]
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:
After Change
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
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 8
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: bashtage/linearmodels
Commit Name: 8698f9b95638a258c880e0ae25cdf8859f26bfa3
Time: 2017-04-05
Author: kevin.k.sheppard@gmail.com
File Name: linearmodels/panel/model.py
Class Name: BetweenOLS
Method Name: _choose_cov
Project Name: etal/cnvkit
Commit Name: 1fe319ef49168c2c7c8d10a7c426c1414521d164
Time: 2016-10-28
Author: eric.talevich@gmail.com
File Name: cnvlib/tabio/genepred.py
Class Name:
Method Name: read_refflat