Commit
•
fd15dd8
1
Parent(s):
5e83d21
Update SOTAB.py
Browse files
SOTAB.py
CHANGED
@@ -40,7 +40,7 @@ class WikiTableQuestions(datasets.GeneratorBasedBuilder):
|
|
40 |
def _info(self):
|
41 |
features = datasets.Features(
|
42 |
{
|
43 |
-
|
44 |
"column_index": datasets.Value("int32"),
|
45 |
"label": datasets.Value("string"),
|
46 |
"table": {
|
@@ -50,6 +50,10 @@ class WikiTableQuestions(datasets.GeneratorBasedBuilder):
|
|
50 |
},
|
51 |
}
|
52 |
)
|
|
|
|
|
|
|
|
|
53 |
return datasets.DatasetInfo(
|
54 |
# This is the description that will appear on the datasets page.
|
55 |
description=_DESCRIPTION,
|
@@ -126,10 +130,10 @@ class WikiTableQuestions(datasets.GeneratorBasedBuilder):
|
|
126 |
|
127 |
df = pd.read_csv(main_filepath, encoding="utf8")
|
128 |
for ind in df.index:
|
129 |
-
|
130 |
table_name = df['table_name'][ind]
|
131 |
column_index = df['column_index'][ind]
|
132 |
label = df['label'][ind]
|
133 |
table_content = self._read_table_from_file(table_name, root_dir)
|
134 |
-
yield ind, {"column_index": column_index, "label": label, "table": table_content}
|
135 |
-
|
|
|
40 |
def _info(self):
|
41 |
features = datasets.Features(
|
42 |
{
|
43 |
+
"id": datasets.Value("int32"),
|
44 |
"column_index": datasets.Value("int32"),
|
45 |
"label": datasets.Value("string"),
|
46 |
"table": {
|
|
|
50 |
},
|
51 |
}
|
52 |
)
|
53 |
+
|
54 |
+
# datasets.value -- single value
|
55 |
+
# datasets.features.Sequence -- list
|
56 |
+
|
57 |
return datasets.DatasetInfo(
|
58 |
# This is the description that will appear on the datasets page.
|
59 |
description=_DESCRIPTION,
|
|
|
130 |
|
131 |
df = pd.read_csv(main_filepath, encoding="utf8")
|
132 |
for ind in df.index:
|
133 |
+
example_id = ind
|
134 |
table_name = df['table_name'][ind]
|
135 |
column_index = df['column_index'][ind]
|
136 |
label = df['label'][ind]
|
137 |
table_content = self._read_table_from_file(table_name, root_dir)
|
138 |
+
# yield ind, {"column_index": column_index, "label": label, "table": table_content}
|
139 |
+
yield {"id": example_id, "column_index": column_index, "label": label, "table": table_content}
|