Datasets:
Update ViHOS.py
Browse files
ViHOS.py
CHANGED
|
@@ -55,19 +55,19 @@ class ViHOS(datasets.GeneratorBasedBuilder):
|
|
| 55 |
)
|
| 56 |
]
|
| 57 |
def _generate_examples(self, filepath, split):
|
| 58 |
-
colnames=['id', 'Content', 'Span ids']
|
| 59 |
|
| 60 |
-
data = pd.read_csv(filepath,
|
| 61 |
|
| 62 |
for i in range(len(data)):
|
| 63 |
-
|
| 64 |
-
content = str(data.loc[i,
|
| 65 |
-
span_ids = str(data.loc[i,
|
| 66 |
if span_ids is None:
|
| 67 |
span_ids = ''
|
| 68 |
|
| 69 |
yield i, {
|
| 70 |
-
|
| 71 |
"content": content,
|
| 72 |
"span_ids": span_ids,
|
| 73 |
}
|
|
|
|
| 55 |
)
|
| 56 |
]
|
| 57 |
def _generate_examples(self, filepath, split):
|
| 58 |
+
# colnames=['id', 'Content', 'Span ids']
|
| 59 |
|
| 60 |
+
data = pd.read_csv(filepath, header=None, sep=",", on_bad_lines='skip')
|
| 61 |
|
| 62 |
for i in range(len(data)):
|
| 63 |
+
id_ = data.loc[i, 0]
|
| 64 |
+
content = str(data.loc[i, 1])
|
| 65 |
+
span_ids = str(data.loc[i, 2])
|
| 66 |
if span_ids is None:
|
| 67 |
span_ids = ''
|
| 68 |
|
| 69 |
yield i, {
|
| 70 |
+
"id": id_,
|
| 71 |
"content": content,
|
| 72 |
"span_ids": span_ids,
|
| 73 |
}
|