Datasets:
Sagnik Ray Choudhury
commited on
Commit
·
c36b48c
1
Parent(s):
e89d7cb
chore: fix loadedr script
Browse files- snli-cf-kaushik.py +3 -3
snli-cf-kaushik.py
CHANGED
|
@@ -85,7 +85,7 @@ class SnliCF(datasets.GeneratorBasedBuilder):
|
|
| 85 |
datasets.SplitGenerator(
|
| 86 |
name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["validation"]}
|
| 87 |
),
|
| 88 |
-
datasets.SplitGenerator(name=datasets.Split.
|
| 89 |
]
|
| 90 |
|
| 91 |
def _generate_examples(self, filepath):
|
|
@@ -93,12 +93,12 @@ class SnliCF(datasets.GeneratorBasedBuilder):
|
|
| 93 |
logger.info("generating examples from = %s", filepath)
|
| 94 |
with open(filepath, encoding="utf-8") as rf:
|
| 95 |
for idx, line in enumerate(rf):
|
| 96 |
-
print(line)
|
| 97 |
if line:
|
| 98 |
_line = json.loads(line)
|
| 99 |
yield idx, {
|
| 100 |
"premise": _line["premise"],
|
| 101 |
"hypothesis": _line["hypothesis"],
|
| 102 |
"idx": _line["idx"],
|
| 103 |
-
"type": _line["type"]
|
|
|
|
| 104 |
}
|
|
|
|
| 85 |
datasets.SplitGenerator(
|
| 86 |
name=datasets.Split.VALIDATION, gen_kwargs={"filepath": downloaded_files["validation"]}
|
| 87 |
),
|
| 88 |
+
datasets.SplitGenerator(name=datasets.Split.TEST, gen_kwargs={"filepath": downloaded_files["test"]}),
|
| 89 |
]
|
| 90 |
|
| 91 |
def _generate_examples(self, filepath):
|
|
|
|
| 93 |
logger.info("generating examples from = %s", filepath)
|
| 94 |
with open(filepath, encoding="utf-8") as rf:
|
| 95 |
for idx, line in enumerate(rf):
|
|
|
|
| 96 |
if line:
|
| 97 |
_line = json.loads(line)
|
| 98 |
yield idx, {
|
| 99 |
"premise": _line["premise"],
|
| 100 |
"hypothesis": _line["hypothesis"],
|
| 101 |
"idx": _line["idx"],
|
| 102 |
+
"type": _line["type"],
|
| 103 |
+
"label": _line["label"]
|
| 104 |
}
|