visualjoyce
commited on
Commit
•
bfd9655
1
Parent(s):
5f01ae7
Add zh, en, xl
Browse files
ipquiz.py
CHANGED
@@ -83,7 +83,12 @@ class IPQuizDataset(datasets.GeneratorBasedBuilder):
|
|
83 |
{
|
84 |
"language": datasets.Value("string"),
|
85 |
"problem": datasets.Value("string"),
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
87 |
"answer": datasets.Value("string")
|
88 |
# These are the features of your dataset like images, labels ...
|
89 |
}
|
@@ -135,6 +140,6 @@ class IPQuizDataset(datasets.GeneratorBasedBuilder):
|
|
135 |
yield key, {
|
136 |
"language": row["language"],
|
137 |
"problem": row["problem"],
|
138 |
-
|
139 |
"answer": row['answer'],
|
140 |
}
|
|
|
83 |
{
|
84 |
"language": datasets.Value("string"),
|
85 |
"problem": datasets.Value("string"),
|
86 |
+
"candidates": datasets.Sequence(
|
87 |
+
{
|
88 |
+
"text": datasets.Value("string"),
|
89 |
+
"option": datasets.Value("string"),
|
90 |
+
}
|
91 |
+
),
|
92 |
"answer": datasets.Value("string")
|
93 |
# These are the features of your dataset like images, labels ...
|
94 |
}
|
|
|
140 |
yield key, {
|
141 |
"language": row["language"],
|
142 |
"problem": row["problem"],
|
143 |
+
"candidates": [{'text': v, 'option': k} for k, v in row["candidates"].items()],
|
144 |
"answer": row['answer'],
|
145 |
}
|