Datasets:
Commit
·
7ced498
1
Parent(s):
335ef69
error fix
Browse files
test.py
CHANGED
|
@@ -145,23 +145,8 @@ class Test(datasets.GeneratorBasedBuilder):
|
|
| 145 |
def _generate_examples(self, filepath):
|
| 146 |
print("**********", filepath)
|
| 147 |
with open(filepath) as f:
|
| 148 |
-
data_df = pd.read_csv(f,sep='
|
| 149 |
-
for index,row in data_df.iterrows():
|
| 150 |
-
print(row)
|
| 151 |
-
print(data_df.head())
|
| 152 |
yield data_df["path"], {
|
| 153 |
"sentence": data_df["sentence"],
|
| 154 |
"path": data_df["path"],
|
| 155 |
-
}
|
| 156 |
-
# with open(filepath, encoding="utf-8") as f:
|
| 157 |
-
# for key, row in enumerate(f):
|
| 158 |
-
# print("---------------------------------")
|
| 159 |
-
# print(key, type(key))
|
| 160 |
-
# print(row, type(row))
|
| 161 |
-
# data = json.loads(row)
|
| 162 |
-
# print(data)
|
| 163 |
-
# yield key, {
|
| 164 |
-
# "sentence": data["sentence"],
|
| 165 |
-
# "path": data["path"],
|
| 166 |
-
# }
|
| 167 |
-
|
|
|
|
| 145 |
def _generate_examples(self, filepath):
|
| 146 |
print("**********", filepath)
|
| 147 |
with open(filepath) as f:
|
| 148 |
+
data_df = pd.read_csv(f,sep=',')
|
|
|
|
|
|
|
|
|
|
| 149 |
yield data_df["path"], {
|
| 150 |
"sentence": data_df["sentence"],
|
| 151 |
"path": data_df["path"],
|
| 152 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|