Update DiscEvalMT.py
Browse files- DiscEvalMT.py +4 -3
DiscEvalMT.py
CHANGED
|
@@ -73,7 +73,8 @@ class DiscEvalMT(datasets.GeneratorBasedBuilder):
|
|
| 73 |
def _info(self):
|
| 74 |
return datasets.DatasetInfo(
|
| 75 |
description=_DESCRIPTION,
|
| 76 |
-
features=datasets.Features({
|
|
|
|
| 77 |
"ex_num": datasets.Value("int64"),
|
| 78 |
"type": datasets.Value("string"),
|
| 79 |
"context_src": datasets.Value("string"),
|
|
@@ -99,8 +100,8 @@ class DiscEvalMT(datasets.GeneratorBasedBuilder):
|
|
| 99 |
logger.info("generating examples from = %s", filepath)
|
| 100 |
key = 0
|
| 101 |
with open(filepath, encoding="utf-8") as f:
|
| 102 |
-
for line in f:
|
| 103 |
|
| 104 |
example = json.loads(line)
|
| 105 |
print(example.keys())
|
| 106 |
-
yield
|
|
|
|
| 73 |
def _info(self):
|
| 74 |
return datasets.DatasetInfo(
|
| 75 |
description=_DESCRIPTION,
|
| 76 |
+
features=datasets.Features({
|
| 77 |
+
"split": datasets.Value("string"),
|
| 78 |
"ex_num": datasets.Value("int64"),
|
| 79 |
"type": datasets.Value("string"),
|
| 80 |
"context_src": datasets.Value("string"),
|
|
|
|
| 100 |
logger.info("generating examples from = %s", filepath)
|
| 101 |
key = 0
|
| 102 |
with open(filepath, encoding="utf-8") as f:
|
| 103 |
+
for i, line in enumerate(f):
|
| 104 |
|
| 105 |
example = json.loads(line)
|
| 106 |
print(example.keys())
|
| 107 |
+
yield i, example
|