Update masader.py
Browse files- masader.py +4 -3
masader.py
CHANGED
|
@@ -66,7 +66,7 @@ class Masader(datasets.GeneratorBasedBuilder):
|
|
| 66 |
{
|
| 67 |
'No.': datasets.Value("string"),
|
| 68 |
'Name': datasets.Value("string"),
|
| 69 |
-
'Subsets': datasets.features.Sequence({'Dialect':datasets.Value("string") , 'Volume':datasets.Value("string") , 'Unit':datasets.Value("string")}),
|
| 70 |
'Link': datasets.Value("string"),
|
| 71 |
'License': datasets.Value("string"),
|
| 72 |
'Year': datasets.Value("string"),
|
|
@@ -136,15 +136,16 @@ class Masader(datasets.GeneratorBasedBuilder):
|
|
| 136 |
i+= 1
|
| 137 |
if str(curr_entry[0]) != "nan":
|
| 138 |
entry_list = curr_entry
|
|
|
|
| 139 |
|
| 140 |
if str(next_entry[0]) == "nan":
|
| 141 |
-
subsets
|
| 142 |
continue
|
| 143 |
idx += 1
|
| 144 |
masader_entry = {col:entry_list[j] for j,col in enumerate(df.columns) if j != 2}
|
| 145 |
|
| 146 |
masader_entry['Subsets'] = subsets
|
| 147 |
print(masader_entry)
|
| 148 |
-
|
| 149 |
|
| 150 |
yield idx, masader_entry
|
|
|
|
| 66 |
{
|
| 67 |
'No.': datasets.Value("string"),
|
| 68 |
'Name': datasets.Value("string"),
|
| 69 |
+
'Subsets': datasets.features.Sequence({'Name':datasets.Value("string"), 'Dialect':datasets.Value("string") , 'Volume':datasets.Value("string") , 'Unit':datasets.Value("string")}),
|
| 70 |
'Link': datasets.Value("string"),
|
| 71 |
'License': datasets.Value("string"),
|
| 72 |
'Year': datasets.Value("string"),
|
|
|
|
| 136 |
i+= 1
|
| 137 |
if str(curr_entry[0]) != "nan":
|
| 138 |
entry_list = curr_entry
|
| 139 |
+
subsets = []
|
| 140 |
|
| 141 |
if str(next_entry[0]) == "nan":
|
| 142 |
+
subsets.append({'Dialect':next_entry[7], 'Volume':next_entry[12], 'Unit':next_entry[13]})
|
| 143 |
continue
|
| 144 |
idx += 1
|
| 145 |
masader_entry = {col:entry_list[j] for j,col in enumerate(df.columns) if j != 2}
|
| 146 |
|
| 147 |
masader_entry['Subsets'] = subsets
|
| 148 |
print(masader_entry)
|
| 149 |
+
|
| 150 |
|
| 151 |
yield idx, masader_entry
|