Datasets:
Update ViHOS.py
Browse files
ViHOS.py
CHANGED
|
@@ -65,18 +65,18 @@ class ViHOS(datasets.GeneratorBasedBuilder):
|
|
| 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 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
|
| 81 |
# data = pd.read_csv(filepath, colnames=colnames, header = None)
|
| 82 |
# yield data.iloc[:, 0], dataframe.iloc[:, 1], dataframe.iloc[:, 2]
|
|
|
|
| 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)
|
| 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 |
+
|
| 76 |
+
yield 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]
|