Fix 'path' -> 'filepath'
Browse files- ksponspeech.py +4 -4
ksponspeech.py
CHANGED
@@ -100,17 +100,17 @@ class KsponSpeech(datasets.GeneratorBasedBuilder):
|
|
100 |
) as f2:
|
101 |
data = "\n".join([f1.read().strip(), f2.read().strip()])
|
102 |
for id_, row in enumerate(data.split("\n")):
|
103 |
-
|
104 |
yield id_, {
|
105 |
-
"file": path.join(self.data_dir,
|
106 |
"sentence": sentence,
|
107 |
}
|
108 |
else:
|
109 |
with open(filepath, encoding="utf-8") as f:
|
110 |
data = f.read().strip()
|
111 |
for id_, row in enumerate(data.split("\n")):
|
112 |
-
|
113 |
yield id_, {
|
114 |
-
"file": path.join(self.data_dir,
|
115 |
"sentence": sentence,
|
116 |
}
|
|
|
100 |
) as f2:
|
101 |
data = "\n".join([f1.read().strip(), f2.read().strip()])
|
102 |
for id_, row in enumerate(data.split("\n")):
|
103 |
+
filepath, sentence = tuple(row.split(" :: "))
|
104 |
yield id_, {
|
105 |
+
"file": path.join(self.data_dir, filepath),
|
106 |
"sentence": sentence,
|
107 |
}
|
108 |
else:
|
109 |
with open(filepath, encoding="utf-8") as f:
|
110 |
data = f.read().strip()
|
111 |
for id_, row in enumerate(data.split("\n")):
|
112 |
+
filepath, sentence = tuple(row.split(" :: "))
|
113 |
yield id_, {
|
114 |
+
"file": path.join(self.data_dir, filepath),
|
115 |
"sentence": sentence,
|
116 |
}
|