Datasets:
Update ViHOS.py
Browse files
ViHOS.py
CHANGED
|
@@ -63,21 +63,20 @@ class ViHOS(datasets.GeneratorBasedBuilder):
|
|
| 63 |
return data
|
| 64 |
|
| 65 |
def _generate_examples(self, filepath, split):
|
| 66 |
-
colnames=['id', 'Content', 'Span ids']
|
|
|
|
|
|
|
| 67 |
|
| 68 |
-
# with open(filepath, 'r', encoding="utf-8") as f:
|
| 69 |
-
data = pd.read_csv(filepath, names=colnames, header = None, sep=",",on_bad_lines='skip')
|
| 70 |
for i in range(len(data)):
|
| 71 |
id_ = data.loc[i, 'id']
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
yield id_, {
|
| 77 |
"id": id_,
|
| 78 |
-
"content":
|
| 79 |
-
"span_ids":
|
| 80 |
-
|
| 81 |
|
| 82 |
# data = pd.read_csv(filepath, colnames=colnames, header = None)
|
| 83 |
# yield data.iloc[:, 0], dataframe.iloc[:, 1], dataframe.iloc[:, 2]
|
|
|
|
| 63 |
return data
|
| 64 |
|
| 65 |
def _generate_examples(self, filepath, split):
|
| 66 |
+
colnames=['id', 'Content', 'Span ids']
|
| 67 |
+
|
| 68 |
+
data = pd.read_csv(filepath, names=colnames, header=None, sep=",", on_bad_lines='skip')
|
| 69 |
|
|
|
|
|
|
|
| 70 |
for i in range(len(data)):
|
| 71 |
id_ = data.loc[i, 'id']
|
| 72 |
+
content = data.loc[i, 'Content']
|
| 73 |
+
span_ids = data.loc[i, 'Span ids']
|
| 74 |
+
|
|
|
|
| 75 |
yield id_, {
|
| 76 |
"id": id_,
|
| 77 |
+
"content": content,
|
| 78 |
+
"span_ids": span_ids,
|
| 79 |
+
}
|
| 80 |
|
| 81 |
# data = pd.read_csv(filepath, colnames=colnames, header = None)
|
| 82 |
# yield data.iloc[:, 0], dataframe.iloc[:, 1], dataframe.iloc[:, 2]
|