Jonathan Li
commited on
Commit
·
32ca3ad
1
Parent(s):
540732b
Format
Browse files
echr.py
CHANGED
|
@@ -80,25 +80,27 @@ class Echr(datasets.GeneratorBasedBuilder):
|
|
| 80 |
]
|
| 81 |
|
| 82 |
def _info(self):
|
| 83 |
-
features = datasets.Features(
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
|
|
|
|
|
|
| 102 |
|
| 103 |
return datasets.DatasetInfo(
|
| 104 |
features=features,
|
|
@@ -121,7 +123,10 @@ class Echr(datasets.GeneratorBasedBuilder):
|
|
| 121 |
datasets.SplitGenerator(
|
| 122 |
name=datasets.Split.TEST,
|
| 123 |
# These kwargs will be passed to _generate_examples
|
| 124 |
-
gen_kwargs={
|
|
|
|
|
|
|
|
|
|
| 125 |
),
|
| 126 |
datasets.SplitGenerator(
|
| 127 |
name=datasets.Split.VALIDATION,
|
|
@@ -138,6 +143,3 @@ class Echr(datasets.GeneratorBasedBuilder):
|
|
| 138 |
for id_, row in enumerate(f):
|
| 139 |
data = json.loads(row)
|
| 140 |
yield id_, data
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
|
|
|
| 80 |
]
|
| 81 |
|
| 82 |
def _info(self):
|
| 83 |
+
features = datasets.Features(
|
| 84 |
+
{
|
| 85 |
+
"itemid": Value(dtype="string"),
|
| 86 |
+
"languageisocode": Value(dtype="string"),
|
| 87 |
+
"respondent": Value(dtype="string"),
|
| 88 |
+
"branch": Value(dtype="string"),
|
| 89 |
+
"date": Value(dtype="int64"),
|
| 90 |
+
"docname": Value(dtype="string"),
|
| 91 |
+
"importance": Value(dtype="int64"),
|
| 92 |
+
"conclusion": Value(dtype="string"),
|
| 93 |
+
"judges": Value(dtype="string"),
|
| 94 |
+
"text": Sequence(feature=Value(dtype="string")),
|
| 95 |
+
"violated_articles": Sequence(feature=Value(dtype="string")),
|
| 96 |
+
"violated_paragraphs": Sequence(feature=Value(dtype="string")),
|
| 97 |
+
"violated_bulletpoints": Sequence(feature=Value(dtype="string")),
|
| 98 |
+
"non_violated_articles": Sequence(feature=Value(dtype="string")),
|
| 99 |
+
"non_violated_paragraphs": Sequence(feature=Value(dtype="string")),
|
| 100 |
+
"non_violated_bulletpoints": Sequence(feature=Value(dtype="string")),
|
| 101 |
+
"violated": Value(dtype="bool"),
|
| 102 |
+
}
|
| 103 |
+
)
|
| 104 |
|
| 105 |
return datasets.DatasetInfo(
|
| 106 |
features=features,
|
|
|
|
| 123 |
datasets.SplitGenerator(
|
| 124 |
name=datasets.Split.TEST,
|
| 125 |
# These kwargs will be passed to _generate_examples
|
| 126 |
+
gen_kwargs={
|
| 127 |
+
"filepath": os.path.join(data_dir, "test.jsonl"),
|
| 128 |
+
"split": "test",
|
| 129 |
+
},
|
| 130 |
),
|
| 131 |
datasets.SplitGenerator(
|
| 132 |
name=datasets.Split.VALIDATION,
|
|
|
|
| 143 |
for id_, row in enumerate(f):
|
| 144 |
data = json.loads(row)
|
| 145 |
yield id_, data
|
|
|
|
|
|
|
|
|