Datasets:
Update ViHOS.py
Browse files
ViHOS.py
CHANGED
|
@@ -31,6 +31,7 @@ class ViHOS(datasets.GeneratorBasedBuilder):
|
|
| 31 |
|
| 32 |
features=datasets.Features(
|
| 33 |
{
|
|
|
|
| 34 |
"content": datasets.Value("string"),
|
| 35 |
"index_spans": datasets.Value("string")
|
| 36 |
}
|
|
@@ -58,12 +59,14 @@ class ViHOS(datasets.GeneratorBasedBuilder):
|
|
| 58 |
data = pd.read_csv(filepath, header=None, sep=",", on_bad_lines='skip')
|
| 59 |
|
| 60 |
for i in range(len(data)):
|
|
|
|
| 61 |
content = str(data.loc[i, 1])
|
| 62 |
span_ids = str(data.loc[i, 2])
|
| 63 |
if span_ids is None:
|
| 64 |
span_ids = ''
|
| 65 |
|
| 66 |
yield i, {
|
|
|
|
| 67 |
"content": content,
|
| 68 |
"span_ids": span_ids,
|
| 69 |
}
|
|
|
|
| 31 |
|
| 32 |
features=datasets.Features(
|
| 33 |
{
|
| 34 |
+
"id": datasets.Value("string"),
|
| 35 |
"content": datasets.Value("string"),
|
| 36 |
"index_spans": datasets.Value("string")
|
| 37 |
}
|
|
|
|
| 59 |
data = pd.read_csv(filepath, header=None, sep=",", on_bad_lines='skip')
|
| 60 |
|
| 61 |
for i in range(len(data)):
|
| 62 |
+
id_ = str(data.loc[i, 0])
|
| 63 |
content = str(data.loc[i, 1])
|
| 64 |
span_ids = str(data.loc[i, 2])
|
| 65 |
if span_ids is None:
|
| 66 |
span_ids = ''
|
| 67 |
|
| 68 |
yield i, {
|
| 69 |
+
"id": id_,
|
| 70 |
"content": content,
|
| 71 |
"span_ids": span_ids,
|
| 72 |
}
|